feat(axis): small multiples axis improvements#1004
feat(axis): small multiples axis improvements#1004nickofthyme merged 20 commits intoelastic:masterfrom
Conversation
- Add panel axis for sm chart with own style - Add title prop to GroupBy for formatting sm titles by panel - DRY up repeated types - Simplify title dimensioning logic - Fix check for sm with single bucket - Fix bug with sm value of zero
- Add options to grid story - Hide title when non is defined or empty string
50410cd to
8bdeb19
Compare
Codecov Report
@@ Coverage Diff @@
## master #1004 +/- ##
==========================================
- Coverage 72.48% 72.11% -0.38%
==========================================
Files 353 371 +18
Lines 11063 10776 -287
Branches 2419 2221 -198
==========================================
- Hits 8019 7771 -248
+ Misses 3029 2904 -125
- Partials 15 101 +86
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Good additions and improvements here!
It refers to a single text label only, ie. not a full axis, so no line, ticks and tick values, correct? Though I guess the per row category labels can be seen as tick values of the outside axis Related: it'd be neat to have a knob for toggling the |
Not sure if I fully understand your question but I think yes. It treats the
Great idea! I forgot to add some vrt for this. I'll do that now. |
monfera
left a comment
There was a problem hiding this comment.
Looks great! A couple of smaller optional changes linked to rows
markov00
left a comment
There was a problem hiding this comment.
Left few comments, in particular I'd like to discuss the title prop
src/specs/group_by.ts
Outdated
| * If both axis title and this value are set, the axis title will be | ||
| * treated as the primary title and this as the secondary. | ||
| */ | ||
| title?: GroupByTitleFormatter; |
There was a problem hiding this comment.
The GroupBy component is a general component and it can be reused for much more than just creating small multiples.
The title prop implies that some text will be rendered somewhere.
I prefer something like lookup or format that describes an action we are doing to each of the aggregated keys.
Also we should be carefully describe when this formatting take place: before the sorting or after that, because it can really change the way sorting works.
| <Axis id="time" title="metric" position={Position.Bottom} gridLine={{ visible: false }} /> | ||
| <Axis id="y" title="Day of week" position={Position.Left} gridLine={{ visible: false }} /> | ||
| <Axis id="time" position={Position.Bottom} gridLine={{ visible: false }} /> | ||
| <Axis id="y" title="Day of week" position={Position.Right} gridLine={{ visible: false }} /> |
There was a problem hiding this comment.
can we go back to the Left position? bar charts should always have a baseline
# [24.6.0](v24.5.1...v24.6.0) (2021-02-15) ### Bug Fixes * **legend:** width with scroll bar ([#1019](#1019)) ([45bd0d5](45bd0d5)) ### Features * sort values in actions by closest to cursor ([#1023](#1023)) ([e1da4e5](e1da4e5)) * **axis:** small multiples axis improvements ([#1004](#1004)) ([514466f](514466f)) * **partition:** drilldown ([#995](#995)) ([20bbdae](20bbdae))
|
🎉 This PR is included in version 24.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [24.6.0](elastic/elastic-charts@v24.5.1...v24.6.0) (2021-02-15) ### Bug Fixes * **legend:** width with scroll bar ([opensearch-project#1019](elastic/elastic-charts#1019)) ([3f9c858](elastic/elastic-charts@3f9c858)) ### Features * sort values in actions by closest to cursor ([opensearch-project#1023](elastic/elastic-charts#1023)) ([4f99c63](elastic/elastic-charts@4f99c63)) * **axis:** small multiples axis improvements ([opensearch-project#1004](elastic/elastic-charts#1004)) ([5896cfa](elastic/elastic-charts@5896cfa)) * **partition:** drilldown ([opensearch-project#995](elastic/elastic-charts#995)) ([de0cba6](elastic/elastic-charts@de0cba6))

Summary
fixes #985, fixes #986
Related to #891
This PR adds functionality around the axis for small multiples including the following...
Axis.titleAxisPanelTitlesecondary) axessmVorsmHvalue would not render the series correctly.Demo
Checklist
src/index.ts(and stories only import from../srcexcept for test data & storybook)