-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: series identifications throughout library #419
Conversation
start refactor of series Id and tooltip visibility
Codecov Report
@@ Coverage Diff @@
## master #419 +/- ##
==========================================
- Coverage 84.11% 83.72% -0.39%
==========================================
Files 168 169 +1
Lines 4784 4849 +65
Branches 917 970 +53
==========================================
+ Hits 4024 4060 +36
- Misses 744 774 +30
+ Partials 16 15 -1
Continue to review full report at Codecov.
|
…feat/series-identifiers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking this until we fix the fact that different SeriesIdentifiers can possibly have the same Key
@@ -18,7 +19,7 @@ export class DataGenerator { | |||
return dataPoints; | |||
} | |||
generateGroupedSeries(totalPoints = 50, totalGroups = 2, groupPrefix = '') { | |||
const groups = new Array(totalGroups).fill(0).map((group, i) => { | |||
const groups = new Array(totalGroups).fill(0).map((__webpack_hash__, i) => { // eslint-disable-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is __webpack_hash__
? An autogenerated hash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???????? never so that before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you did it :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really???? Idk @rshen91 do you know what this is ☝️?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what it is but I'm sure I accidentally imported it or something 😅.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit 74aa3f5 to remove!
Yaaay!!! 🎉 |
# [15.0.0](v14.2.0...v15.0.0) (2019-12-02) ### Code Refactoring * series identifications throughout library ([#419](#419)) ([66a48ff](66a48ff)) * use redux in favour of mobx ([#281](#281)) ([cd34716](cd34716)) ### BREAKING CHANGES * `GeometryId` is now `SeriesIdentifier`. `customSeriesColors` prop on `SeriesSpec` which used to take a `CustomSeriesColorsMap`, now expects a `CustomSeriesColors` type. `LegendItemListener` now passes the `SeriesIdentifier` type as the first callback argument. * `SpecId`,`AxisId`, `AnnotationId` types are down-casted to a `string` type. The `getSpecId`, `getAxisId` and `getAnnotationId` methods still exist and but return just the same passed string until deprecated in a future version. The spec ids, previously `id`, `axisId`,`annotationId` etc are now aligned to use the same prop name: `id`. The chart rendering status `data-ech-render-complete` and `data-ech-render-count` is no more at the root level of the `echChart` div, but on its child element: `echChartStatus`. The `Spec` has two new private properties called `chartType` and `specType`.
🎉 This PR is included in version 15.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This commit changes the object passed to the event listeners providing either the value of the clicked/hovered element and the SeriesIdentifier object that can uniquely identify a series in elastic-charts. (see #419 for a description on SeriesIdentifiers) BREAKING CHANGE: the `onElementOver` and the `onElementClick` are now called with `Array<[GeometryValue, SeriesIdentifier]>` instead of `Array<GeometryValue>` fix #505
# [17.0.0](v16.2.1...v17.0.0) (2020-01-30) ### Bug Fixes * **brush:** rotate brush on rotated charts ([#528](#528)) ([985ac21](985ac21)), closes [#527](#527) ### Features * text improvements ([#524](#524)) ([6e61700](6e61700)) * **listeners:** add seriesIdentifiers to element listeners ([#525](#525)) ([027d008](027d008)), closes [#419](#419) [#505](#505) ### BREAKING CHANGES * **listeners:** the `onElementOver` and the `onElementClick` are now called with `Array<[GeometryValue, SeriesIdentifier]>` instead of `Array<GeometryValue>` * renames in `Partition` charts— `Layers`: `fillLabel.formatter`->`fillLabel.valueFormatter`; type `FillLabel`-> `FillLabelConfig` Non-breaking changes: * feat: the values in linked labels are rendered, just like they have been in the sectors (formerly, the value could optionally be put in the link label accessor itself) * feat: font styling is possible separately for values: `valueFormatter` configs * test: opacity decrease example; coloring examples * feat: hierarchical data (`parent`, `sortIndex`) is made available to accessors (see stories, helpful with eg. coloring) * refactor: tighter types; other code improvements
# [15.0.0](elastic/elastic-charts@v14.2.0...v15.0.0) (2019-12-02) ### Code Refactoring * series identifications throughout library ([opensearch-project#419](elastic/elastic-charts#419)) ([fc37dd6](elastic/elastic-charts@fc37dd6)) * use redux in favour of mobx ([opensearch-project#281](elastic/elastic-charts#281)) ([50ba58c](elastic/elastic-charts@50ba58c)) ### BREAKING CHANGES * `GeometryId` is now `SeriesIdentifier`. `customSeriesColors` prop on `SeriesSpec` which used to take a `CustomSeriesColorsMap`, now expects a `CustomSeriesColors` type. `LegendItemListener` now passes the `SeriesIdentifier` type as the first callback argument. * `SpecId`,`AxisId`, `AnnotationId` types are down-casted to a `string` type. The `getSpecId`, `getAxisId` and `getAnnotationId` methods still exist and but return just the same passed string until deprecated in a future version. The spec ids, previously `id`, `axisId`,`annotationId` etc are now aligned to use the same prop name: `id`. The chart rendering status `data-ech-render-complete` and `data-ech-render-count` is no more at the root level of the `echChart` div, but on its child element: `echChartStatus`. The `Spec` has two new private properties called `chartType` and `specType`.
# [17.0.0](elastic/elastic-charts@v16.2.1...v17.0.0) (2020-01-30) ### Bug Fixes * **brush:** rotate brush on rotated charts ([opensearch-project#528](elastic/elastic-charts#528)) ([b6c3302](elastic/elastic-charts@b6c3302)), closes [opensearch-project#527](elastic/elastic-charts#527) ### Features * text improvements ([opensearch-project#524](elastic/elastic-charts#524)) ([f7b53c8](elastic/elastic-charts@f7b53c8)) * **listeners:** add seriesIdentifiers to element listeners ([opensearch-project#525](elastic/elastic-charts#525)) ([643ef1b](elastic/elastic-charts@643ef1b)), closes [opensearch-project#419](elastic/elastic-charts#419) [opensearch-project#505](elastic/elastic-charts#505) ### BREAKING CHANGES * **listeners:** the `onElementOver` and the `onElementClick` are now called with `Array<[GeometryValue, SeriesIdentifier]>` instead of `Array<GeometryValue>` * renames in `Partition` charts— `Layers`: `fillLabel.formatter`->`fillLabel.valueFormatter`; type `FillLabel`-> `FillLabelConfig` Non-breaking changes: * feat: the values in linked labels are rendered, just like they have been in the sectors (formerly, the value could optionally be put in the link label accessor itself) * feat: font styling is possible separately for values: `valueFormatter` configs * test: opacity decrease example; coloring examples * feat: hierarchical data (`parent`, `sortIndex`) is made available to accessors (see stories, helpful with eg. coloring) * refactor: tighter types; other code improvements
Summary
BREAKING CHANGE:
GeometryId
is nowSeriesIdentifier
(see below for type)customSeriesColors
prop onSeriesSpec
which used to take aCustomSeriesColorsMap
but now expects aCustomSeriesColors
typeThe
CustomSeriesColors
gives the user flexibility and full insight into what series is being assigned a given color.LegendItemListener
now passes theSeriesIdentifier
type as the first callback argumentFixes: #325
If it involves visual changes include a screenshot or gif.
From now on we should use the more specific
SeriesIdentifier
type below in place ofGeometryId
to identify a particular series. This gives all the information to the consumer of theChart
to change anything for a given series (i.e. name, color, styles, hide/show, etc.)Before
After
As function accessor
As array of colors
The array of colors will chose a color from the array based on the count index. In the example below the first series in the spec with be
'red'
, second'white'
and so on.Internally all series are now identified with the
seriesKey
generated from thegetSeriesKey
method.Change naming for all series to use
SeriesIdentifier
andSeriesIdentifier.key
DataSeriesColorValues
(renamedSeriesCollectionValue
)Closes #325, #179 and #245
Checklist
src/index.ts
(and stories only import from../src
except for test data & storybook)