Adding docs for elastic-charts#2209
Conversation
|
Thanks @cchaos for this, it looks awesome. I have some small comments on the code, but I think I can go through them and fix them directly, like some code strings instead of the I think we should also include an example to hide the markers on the line if the line contains many points (100 or more). My last remark: the font size seems very small for all the labels on the chart, don't you think? Compared to the basic font size (14px)? |
|
Thanks @markov00. Yeah I went through a pass to clean up those extra objects but must have missed some.
Do you think this should just be a part of elastic-charts? Something it does automatically so that the marker only exists on hover?
Agreed. I originally set it that small to sort of get them out of the way because charts should just be a quick glance of noticing trends and differences and then the user should rely on the tooltips for actual values. The current problem right now is that elastic-charts doesn't allow for good spacing between the tick labels causing a jam up of text. So reducing the font size helped to keep the user from getting distracted by these values. I do realize, however, that the font size is too small for categorical charts where reading the category names are important for that glance. And there still needs to be better vertical spacing.
The base font size for charts has never been as large as 14px. But I'm thinking a good compromise is increasing both ticks and labels by just a couple pixels. |
There was a problem hiding this comment.
It's hard to test this without the theming system being released. I've done some review with @cchaos in zoom's and my general comments were as follows:
- Label sizing was likely a tad too small
- We will need some sort of guidance around chart sizing. AKA, what makes a good panel view chart and what should and should not be dropping in those sorts of views. Then, what makes a good sparkline / tiny chart. Those three usages are going to be the most common.
- Possibly some more instruction on the palette services (chroma) being used. Just something that says... to build charts that look like this. Import this theme, use this service, and then use this chart configuration. Some of that is lost in the doc examples at the moment.
My comments are more toward the charting system in general. Right now it seems it doesn't do well scaling detail down based upon the containers it sits within. I think that's something we need to focus on in general since it's blocking our ability to deliver reliable, adaptive solutions to folks.
I think that outside of the theme service this content is all just documentation so we should be a little more open with just merging this and seeing how it helps, it's something that we can iterate on over time.
Do we want to hardcode that max number of markers on a specific size or do we want to add that to the theme itself? I think the last should provide all a better configurability of the chart For the axis labels: we have a ticket to fix too many labels specifying the number of ticks for each axis. |
|
This PR is now ready for review 🎉 |
I was thinking that since the chart is already doing all that math and plotting of points that it should be able to determine a minimum distance between points and if that minimum is not met, it would turn off the points. Of course this could be a boolean style prop or setting that just turns the logic on or off but is on by default. I'm not sure any other good way to do it through the theme (at least with the current configurations that are available now). |
This is currently not the final way I'd like to be able to support more color schemes/palettes. We can either provide a better service with our own functions (pulling the chroma one out of docs) on top of our named palettes. Or Elastic-charts needs to create a color service for creating palettes. Either way, there's no good way to describe the way I'm creating these extra palettes at the moment. My biggest goal right now is to get the base EUI chart themes into Kibana so that all the charts can start to look a bit better. I don't think many are using custom color schemes, or if they are they're already providing these hex values directly. |
|
Yes. I agree. It should be handled on the ECharts side. |
|
The panels and configuration toggles with built-in best practices is a very cool and very helpful way to do this. |
138782e to
a2a9269
Compare
snide
left a comment
There was a problem hiding this comment.
Lots of small docs changes. Mostly to change to active voice / fix typos (which coming from me you might want to double check). Kind of a big question about the delivery of the themes, but I think the resolution should be pretty simple. We should check with the engineers.
Overall. This is fantastic and what we should strive to do when providing usage documentation for our design work. Nice work. 🥇
| <Fragment> | ||
| <EuiTitle size="xxs"> | ||
| <h3> | ||
| Number of GitHub issues per visualization type |
There was a problem hiding this comment.
There is no "aggregation" value on the legend to be applied.
We for sure have to remove the value when not on hover (it's used on tsvb to show the last bucket but for time series, for ordinal values is not useful).
|
PR adding the chart themes to |
src-docs/src/routes.js
Outdated
| ].map(example => createExample(example)), | ||
| }, | ||
| { | ||
| name: 'Elastic-Charts', |
There was a problem hiding this comment.
Is it ok to use Elastic Charts (no hyphen) in the TOC? Also, suggest this organization:
Elastic Charts
- Creating charts
- Theming via EUI
- Coloring charts
- Sizing charts
- Time series charts
- Categorical charts
- Sparklines
There was a problem hiding this comment.
I kept Sparklines with sizing but moved it to the second item just below Creating charts
|
Just stopping by to say that I pulled this down and it is awesome. Really great work @cchaos ! |
d00792c to
0aa4b73
Compare
Started creating EUI specific light theme
|
Thanks @markov00, for reference, I've addressed most of your bullet points.
I converted the theme to TS, not too worried about the C/P code at the moment for TS users. Hopefully they'll get their own warnings in order to fix that and the imports.
Fixed
I only found one instance that wasn't using an enum which was for a
I saw in your Storybook that you're just using straight strings for id's. You may want to then look into your documentation around that.
Fixed
I didn't realize there was a particular chart type for that use case. I'll agree it would be good to have a documentation example solely for that. I think it's out of scope right now, but created a github issue to follow up on. #2254 |
|
Jenkins, test this |
|
Looking back, I don't think a single CI run has succeeded. Before the lint errors were resolved, CI was failing before it even got to eslint.
|
Removes the need for `mergeWithDefaultTheme`
|
@chandlerprall Does the CI include devDeps when it installs? |
|
@cchaos pushed fix for the duplicate react versions, however elastic-charts is entering an infinite loop in IE11, both in these docs and in their published storyboard at elastic.github.com/elastic-charts , looks like the loop is caused by the resize observer /cc @markov00 @nickofthyme |
|
Thanks @chandlerprall I'll take a look |
|
Thanks @chandlerprall ! |
|
@cchaos I've updated the @elastic/elastic-charts dependency to latest version and made a change that I expect will let CI run against this branch. |
|
Thank you to all who made this possible 🥇 |

This PR will add docs pages for 4 main topics surrounding elastic-charts (and charts in general).
The sections will show the ideal version of the specified chart type. They talk more about how to represent your data correctly than how elastic-charts works. That's what their docs are for. However, it does also provide code to produce the resulting chart so it's easy for consumers to copy/paste these ideal charts.
1. Using elastic-charts and EUI together
Main topic is how to use the EUI produced themes that work with elastic-charts and then a broader topic on best uses for color when creating charts.
2. Time series charts
This is probably the most used chart type in Kibana and will then probably be the most consumed version of elastic-charts.
3. Categorical charts
This is a type of chart that usually gets misrepresented because consumers don't adjust their data properly.
4. Sizing/Sparklines
There isn't always room to show all the details of a chart depending on the size of the chart itself. The sizing section showcases some examples.
Most of the issues that stem around the creation of sparklines is forgetting to remove interactions and extraneous markings.
Checklist
[ ] Props have proper autodocs[ ] Added or updated jest tests[ ] Checked for breaking changes and labeled appropriately