elastic / elastic-charts Goto Github PK
View Code? Open in Web Editor NEW:bar_chart: Elastic Charts library
Home Page: https://elastic.github.io/elastic-charts/storybook
License: Other
:bar_chart: Elastic Charts library
Home Page: https://elastic.github.io/elastic-charts/storybook
License: Other
Add a story with a high density chart (with points or bars smaller than 1 or 2 px) to see how it works on that case.
Is your feature request related to a problem? Please describe.
Add click interaction on legend items.
Ideally used to hide/show a series.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
Kibana Cross Issues
elastic/kibana#21084
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentStack monitoring team will use the new charts.
They use mainly multi-line charts with few line series (~4 to 5 series max from a first check).
Feature parity:
Kibana Cross Issues
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentThe version numbers in this issue reflect version numbers of Kibana releases, at which we're planning to have the functionality implemented in Elastic charts. They are not reflecting actual Elastic Chart version numbers.
DONE
Preparation for TSVB timeseries chart replacement #64
IN PROGRESS
Replacement of TSVB timeseries chart (EPAM) #108moved to 7.3
DONE
Series specific styling (line width, opacity) #138 PR #170DONE
Handle band area charts (used on percentile band mode) #144 PR #157DONE
Add last bucket value on the legend #143 PR #155DONE
Fix for time scales in different time zones #130 PR#151DONE
Handle/Test negative values in stacked area charts #135 PR #149DONE
Add annotation line #81 PR #126DONE
hide in legend (hide that series from the legend) #137 PR #147DONE
Add a separated name props on each series #136 PR #142DONE
Display orphan data points on line/area series #63 PR #114DONE
Add external custom colour from spec props #39 PR #95DONE
Crosshair and vertical/horizontal cursors #80 #58 PR #96DONE
Scale data to specific domain #86 PR #98DONE
Add filter in/out series only action to listeners) PR #51DONE
Add hide/show series chart internals) PR #51DONE
Add hover/click event for each legend series PR #51DONE
Add color picker for each legend series #23 PR #51DONE
Value labels option for charts without hovering #67 PR #182moved to 7.3
moved to 7.3
IN PROGRESS
Replacement of Discovery chart #191moved to 7.4
IN PROGRESS
Replacement of TSVB timeseries chart (EPAM) #108moved to 7.4
IN PROGRESS
Pie chart #84moved to 7.4
moved to 7.4
moved to 7.4
moved to 7.4
moved to 7.4
moved to 7.4
DONE
Replacement of Discovery chartmoved to 7.5
UNDER REVIEW
Replacement of TSVB timeseries chart (EPAM) #108 moved to 7.5
DONE
Preparation for Stack Monitoring chart replacement #65
DONE
Sync crosshair/vertical cursor across charts #83IN PROGRESS
Pie chartmoved to 7.5
ON HOLD
moved to 7.5
IN PROGRESS
Add configuration validation #85moved to 7.5
moved to 7.5
moved to 7.5
DONE
Avoid clipping tooltip markers on edges #20DONE
Replacement of TSVB timeseries chart (EPAM) #108DONE
Replacement of Discovery chart #191DONE
Visual regression tests #77IN PROGRESS
Pie chart #84moved to 7.6
moved to backlog
moved to 7.6
moved to 7.6
moved to backlog
DONE
Pie chart #84DONE
Basic export as PNG function #82DONE
Moving from MobX to Redux #281PAUSED
Add configuration validation #85moved to 7.9
DONE
add pie chart events listeners (#578)DONE
add pie chart tooltip (#544)DONE
add percentage in piechart/treemap (#558)DONE
Gauge(/ษกฤj/)/Goal chart type (#520)DONE
add pie chart legendIN PROGRESS
vislib replacement (features: #502)IN PROGRESS
vislib replacement (features: #502)Bar Chart - clustered multi series
is a duplicated story. We can remove it
Find a way to fully display tooltip markers near the edges.
Kibana Cross Issues:
The existing story Bar Chart - with log y axis
doesn't currently work.
Seems that the Log Y axis is not correctly handled when rendering the geometries:
<BarSeries
id={getSpecId('bars')}
xScaleType={ScaleType.Linear}
yScaleType={ScaleType.Log}
xAccessor="x"
yAccessors={['y']}
data={[{ x: 1, y: 2 }, { x: 2, y: 7 }, { x: 4, y: 3 }, { x: 9, y: 6 }]}
yScaleToDataExtent={true}
/>
Kibana Cross Issues:
๐ฆ Meta issue for Vislib replacement project
AnnotationLine.style.line
#687AreaSeries
#678Bounds margin
on y domain #706stackAsPercentage
on LineSeriesSpec
xAccessor
as a function #551groupIdAccessor
#537Kibana Cross Issues
This will help when trying to align multiple charts on the same dashboard/app.
The axes dimensions are currently computed automatically based on the labels and possible label overflows.
This will disable that process and strictly use the size provided, causing labels to overflow or be truncated.
Is your feature request related to a problem? Please describe.
Multiple charts can share the same vertical cursor when they have the same x axis.
Describe the solution you'd like
We need to add two props like the following to the chart:
onExternalCursorChange
that is populated with the value from an external cursoronCursorChange
that accept a listener and is called when the cursor change it's positionDescribe alternatives you've considered
n/a
Additional context
n/a
Kibana Cross Issues
Add any Kibana related issues/feature requests here.
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentIs your feature request related to a problem? Please describe.
It's required to draw piechart and donut chart, with one or multiple levels.
Describe the solution you'd like
Chart
structure but different specs for chart PieChartSeries
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Rendering a piechart is not so difficult, we can just use d3-arcs
to compute the paths.
import { arc, pie } from 'd3-shape';
const pieSpec = {
data: [[10],[20], [30]],
accessor: 0,
}
const paths = pie().value((d: any) => {
return d[pieSpec.accessor];
})(pieSpec.data);
// that is the space allowed to render the pie chart we should take in consideration the
// how much space a direct labelling on the chart take
const { width, height } = chartDimensions;
const outerRadius = width < height ? width / 2 : height / 2;
const innerRadius = pieSpec.donut ? outerRadius / 2 : 0;
const arcGenerator = arc();
const arcs = paths.map((path) => {
const arc = arcGenerator({
...path,
innerRadius: innerRadius,
outerRadius: outerRadius,
});
return {
arc: arc === null ? '' : arc,
color: 'red',
transform: {
x: width / 2,
y: height / 2,
},
geometryId: {
specId: pieSpec.id,
seriesKey: [],
},
seriesArcStyle: settings.theme.arcSeriesStyle.arc,
};
});
The difficult part is the label positioning, place labels to avoid overlaps and overflows.
The pre-computing label dimensions will came in handy, but we need a good alghoritm to place them without overlapping them together.
We have to take in consideration also the style of the slices, specially when we will have many small slices.
Consider also label rotations as described here: https://www.amcharts.com/docs/v4/tutorials/labels-inside-pie-chart-slices/
Other interesting references:
Features:
Kibana Cross Issues
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentCurrently, the x-axis labels for timestamp shows full dates for more than 24 hours, it will be helpful to allow more formatting, examples:
When looking at a month show only the day (1-30)
When trying to compare weeks, the timestamp will be able to be in the context of weeks, show the day of the week instead of the full date (Sunday-Sutarday)
With these options, users will be able to switch the format based on what they are analyzing,
When multiple datapoints of a line or area chart have the same x and y value, the tooltip is displayed only for the series that reside on the top-most z-index.
The idea is to get all the possible values and display a tooltip with all the matching values
Kibana Cross Issues
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentOften raised by users, users use dashboard/visualization in kiosk node displaying it on monitor, they can't tell the value of the chart without hovering on the area of the chart, this issue often also raised in the context of reporting, when you export a report isn't possible to hover and know the value of the chart.
It will be helpful if we had an option to display the chart with the values labels (similar to pie)
Is your feature request related to a problem? Please describe.
I want to be able to save the chart as PNG image. This can be used to simplify client side export in Kibana.
Describe the solution you'd like
Add the possibility to export the chart as a PNG via a function call to the chart.
Konva has the possibility to get the DataURL from the Stage
object (see https://konvajs.org/docs/data_and_serialization/Stage_Data_URL.html)
const dataURL = stage.toDataURL();
This, btw, will only save the chart into a PNG, not the whole chart with the legend.
A possibility for that is illustrated on https://github.com/tsayen/dom-to-image#how-it-works
but is basically the following:
foreignObject
with the cloned DOM elementDescribe alternatives you've considered
The legend can be rendered in canvas, but it's quite difficult and we need to move the whole action logic to a canvas element.
Another option is to render subsequentially a static legend on the chart canvas with only colors and texts of the existing legend.
Additional context
n/a
Kibana Cross Issues
Add any Kibana related issues/feature requests here.
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentAdd on hover interaction on each legend item and highlight series on chart
Is your feature request related to a problem? Please describe.
Add a color picker to choose a new series color when clicking on the legend item.
Describe the solution you'd like
Will use EUIColorPicker
Describe alternatives you've considered
Additional context
Kibana Cross Issues
elastic/kibana#28618
elastic/kibana#19341
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentIs your feature request related to a problem? Please describe.
Add visual regression tests with image snapshot comparisons.
This can be applied to:
Describe the solution you'd like
Evaluate the following:
Requirements:
canvas === svg ? ok : fail
References:
Is your feature request related to a problem? Please describe.
Our current computeChart
function is massive and produces many side effects, which makes it hard to write tests for. Further, any time computeChart
is called, all computations are run again even if certain values have remained the same and may not need to be re-computed.
Describe the solution you'd like
We can consider reducing the side effects produced by this function and reduce the size of the function (moving logic and computations into additional functions which can be themselves tested). We can also consider ways to address partial (and not full) re-computing (memoization, transducers to chain transformations, etc.).
Describe alternatives you've considered
Additional context
n/a
Kibana Cross Issues
Add any Kibana related issues/feature requests here.
n/a
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentIf you use a dataset with more than 10 x values, seems that the we don't correctly computed the bottom axis label width.
Can be reproduced using the following to generate a simple dataset:
import { DataGenerator } from '../utils/data_generators/data_generator';
const dg = new DataGenerator();
const data = dg.generateSimpleSeries();
...
<AreaSeries
id={getSpecId('area')}
xScaleType={ScaleType.Linear}
yScaleType={ScaleType.Linear}
xAccessor="x"
yAccessors={['y']}
data={data}
/>
The axis values are correct, but seems to be cutted off:
0, 5, 1, 1, 2, 2, 3, 3, 4, 4
instead of
0, 5, 10, 15, 20, 25, 30, 35, 40, 45
Describe the bug
On published storybook the Story
addon panel is empty
To Reproduce
Steps to reproduce the behavior:
Story
addon panel on the right panelExpected behavior
The Story
panel should shows the JSX code of the example
Version
The axis grid lines should be moved on the background, behind chart elements to clean up the chart a bit.
We can make that grid appear maybe decreasing the opacity of the elements but I think it's better to move the grid behind elements.
Add test coverage for the mergeWithDefaultTheme
function
Add a first basic issue template to keep track of kibana cross issues:
The template can have a checklist like the following:
<!--
GitHub is reserved for bug reports and feature requests. The best place
to ask a general question is at the Elastic Discourse forums at
https://discuss.elastic.co. If you are in fact posting a bug report or
a feature request, please include one and only one of the below blocks
in your new issue.
-->
<!--
If you are filing a bug report, please remove the below feature
request block and provide responses for all of the below items.
-->
**Elastic Chart version**:
**Browser version**:
**Browser OS version**:
**Description of the problem including expected versus actual behavior**:
**Steps to reproduce**:
1.
2.
3.
**Errors in browser console (if relevant)**:
**Kibana Cross Issues**:
**Checklist**
[] every related Kibana issue is listed under `Kibana Cross Issues:` list
[] `kibana cross issue` tag is associated to the issue if any kibana cross issue is present
The below is a list of near term items planned for the first release on February 2019.
3 workstreams are planned for the roadmap toward 7.1.
The priority order of each task is the following:
reporting
roadmap for 7.2)The reporting
team will start client-side export of ES chart in 7.2. We have to prepare the field with some basic functionalities to export PNG from charts.
With this PR: elastic/kibana#29896 the icon to collapse the legend is now always on the same place (bottom left) and disappear when moving the mouse focus out of the chart panel.
We need to align the current implementation with that style
This issue keeps track of the tasks required to replace completely the Kibana TSVB charts with the elastic-charts
:
Feature parity
DONE
Series specific styling (line width, opacity) #138 PR #170DONE
Handle band area charts (used on percentile band mode) #144 PR #157DONE
Add last bucket value on the legend #143 PR #155DONE
Fix for time scales in different time zones #130 PR#151DONE
Handle/Test negative values in stacked area charts #135 PR #149DONE
Add annotation line #81 PR #126DONE
hide in legend (hide that series from the legend) #137 PR #147DONE
Add a separated name props on each series #136 PR #142DONE
Display orphan data points on line/area series #63 PR #114DONE
Add external custom colour from spec props #39 PR #95DONE
Crosshair and vertical/horizontal cursors #80 #58 PR #96DONE
Scale data to specific domain #86 PR #98DONE
Add filter in/out series only action to listeners) PR #51DONE
Add hide/show series chart internals) PR #51DONE
Add hover/click event for each legend series PR #51DONE
Add color picker for each legend series #23 PR #51Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentCurrently on stack chart when hovering on an area it only shows the values of the what the mouse is hovering on, it requires the users to be more accurate with their mouse hovering, which in busy charts can be challenging, also it is harder to compare values since you can only get a single value at each time. It will be more helpful if in stack chart you can see the values of all the stacked lines/bar/areas once hovering, either in the legend or in the tooltip (preferred)
current (you can't tell how much exactly the blue bar is):
multiple values in tooltip:
Is your feature request related to a problem? Please describe.
Interactions with elements in the charts currently may have effects internal to the chart as well as effects controlled externally by the parent application. An example of this is interactions on hover with the legend items. On hover of a legend item, there is a chart internal effect of highlighting the series elements within the chart and also the values for identifying the series are passed along to a listener which the parent application can define. This issue is for addressing that the developer user may also want to control the chart internal effects in some way.
Describe the solution you'd like
There are a few ways to approach this:
Describe alternatives you've considered
I wonder if we should think about a way to generalize interactions to reduce some of the boilerplate that is replicated everytime we add an interaction. For example, currently, when implementing an interaction, one must:
Whichever path we take with the defaults, this will add additional things that will need to be done when adding any interactions, so I'm wondering if we also want to think about tackling this generalizations issue.
Additional context
Originally brought up here from this comment in PR #31.
Kibana Cross Issues
n/a
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentIs your feature request related to a problem? Please describe.
Some series may have orphan data points, points that are between two null datums like:
[
...,
{x: 1, y: null},
{x: 2, y: 10},
{x: 3, y: null},
...,
]
When a series has orphan data points like the example above, we need to find a way to display the single point value.
Fitting functions (#55) can fill the gaps with specific values (like adding zeros or an average value), but the developer or user can decide to keep null
values.
Describe the solution you'd like
If the style of the line/area already shows single circles as data points we don't need to add anything to that rendering.
If the style configuration hides the data points we need to force displaying these points when orphans.
We also have to configure the line/area path generation defined
function to correctly specify when a line/area is not defined: https://github.com/d3/d3-shape#line_defined https://github.com/d3/d3-shape#area_defined
Kibana Cross Issues
Add any Kibana related issues/feature requests here.
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentAs reported in elastic/kibana#31244, it would be great to have the possibility to serialize the configuration and enable exporting a chart as js script.
First draft of To Dos:
Kibana Cross Issues
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentIs your feature request related to a problem? Please describe.
Ensure a correct chart configuration for the developer
Describe the solution you'd like
Add a warning message on console if the chart doesn't respect a set of basic rules like:
xAccessor={'foo'}
when the data has no foo
fields)Prevent chart from not showing when config is bad, such as...
import React from 'react';
import { Chart, LineSeries, ScaleType, Position, Settings, Axis } from '../src';
import { SeededDataGenerator } from '../src/mocks/utils';
export class Playground extends React.Component<{}, { isSunburstShown: boolean }> {
render() {
const dg = new SeededDataGenerator();
const data = dg.generateGroupedSeries(10, 2).map((item) => ({
...item,
y1: item.y + 100,
}));
return (
<>
<div className="chart">
<Chart>
<Settings showLegend />
<Axis id="y1" groupId="g1" position={Position.Left} title={'y1'} />
<Axis id="y2" groupId="g2" position={Position.Left} title={'y2'} />
<Axis id="x" position={Position.Bottom} title={'x'} />
<LineSeries
id={'aaa'}
xScaleType={ScaleType.Linear}
xAccessor={'x'}
yAccessors={['y', 'y1']}
splitSeriesAccessors={['g']}
data={data}
/>
</Chart>
</div>
</>
);
}
}
Describe alternatives you've considered
n/a
Additional context
n/a
Kibana Cross Issues
n/a
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentDescribe the bug
The tooltip label the x value as X Value
if not title on horizontal axis is available.
If multiple horizontal axis are available and only one axis title configured, the tooltip will shows X Value
also if we have titles on it.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Always display at least one title independently of the status of the axis titles.
We also have to include the possibility to add an hidden title on an axis so we can have the label on the tooltip but no axis title displayed on the chart
Version (please complete the following information):
Additional context
n/a
Errors in browser console
n/a
Kibana Cross Issues
n/a
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentCurrently chart.margins
will be applied to spacing between margins with the same position, but there should be a separate prop which controls axes spacing.
Specify a color for each data series on the chart specs
Is your feature request related to a problem? Please describe.
See discussions from other issues/PRs:
#25 (comment)
#51
Describe the solution you'd like
Would like to settle on what the UI for the legend items interactions should be. This would cover:
Describe alternatives you've considered
See the links in the first section for some options discussed and current implementation.
Additional context
Kibana Cross Issues
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentIs your feature request related to a problem? Please describe.
We need to add a license checker that blocks PRs when a incompatible license is found in our dependencies.
Describe the solution you'd like
We can use a similar solution to the one used by Kibana, using license-checker
and a small script to execute it in a new GitHub action.
Describe alternatives you've considered
I didn't find any github app or service that does this check. Only FOSSA but it has only business plans.
Prepare a story or a global knob to switch EUI darkmode on/off
Currently the CanvasBBoxCalculator canvas is attached and then destroyed as soon as computations are done, but is not actually offscreen.
Is your feature request related to a problem? Please describe.
Limit the chart to a specific data domain on each axis.
It's typically used on y axis to cut the max value out or to start the chart at a min value.
It's used on x axis when you want to display a larger domain than the one used on the dataset.
Describe the solution you'd like
Add a prop at chart or series spec level to limit the domain of the chart to that min and max.
Describe alternatives you've considered
n/a
Additional context
n/a
Kibana Cross Issues
Add any Kibana related issues/feature requests here.
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentIs your feature request related to a problem? Please describe.
We need to display annotations on charts like the current time marker, partial-data areas or other general annotations.
Describe the solution you'd like
Add the possibility to include vertical or horizontal lines or rectangles on the chart, specifying the base x or y value where the line will lie.
This can be split into 3 different tasks:
Describe alternatives you've considered
n/a
Additional context
n/a
Kibana Cross Issues
Add any Kibana related issues/feature requests here.
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentIs your feature request related to a problem? Please describe.
Add the possibility to switch between simple element tooltip to multi/element tooltips like vertical or horizontal cursors or crosshair.
Describe the solution you'd like
The user/developer can select the type of tooltip that's better conforms for the chart use to enable the following possibilities:
Describe alternatives you've considered
Various solutions can be applied:
design note: the tooltip could be crowded specially with multiple splitted series.
extra: this can solve the following issue: #58
Additional context
TVSB, charts used by Stack Monitor and any other chart that use react-vis in kibana currently has the possibility to include a vertical cursor on the chart instead of the tooltip.
Kibana Cross Issues
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.