Skip to content

feat: shift click legend items & partition legend hover#648

Merged
nickofthyme merged 4 commits intoelastic:masterfrom
nickofthyme:fix/partiation-legend-hover
Apr 24, 2020
Merged

feat: shift click legend items & partition legend hover#648
nickofthyme merged 4 commits intoelastic:masterfrom
nickofthyme:fix/partiation-legend-hover

Conversation

@nickofthyme
Copy link
Copy Markdown
Collaborator

@nickofthyme nickofthyme commented Apr 23, 2020

Summary

Minor updates to legend styles and functionality

Add negate option to legend toggle deselected series to allow shift + click

Screen Recording 2020-04-23 at 03 12 PM

add legend item prop to prevent clicking in partition charts. Now legend items are only clickable when there is an onClick listener or the series is toggleable. Currently the Partition chart series are not toggleable.

Screen Recording 2020-04-23 at 03 14 PM

Checklist

  • This was checked for cross-browser compatibility, including a check against IE11
  • Proper documentation or storybook story was added for features that require explanation or tutorials
  • Unit tests were updated or added to match the most common scenarios

- add negate option to legend toggle deselected series
- add legendItem prop to prevent clicking in partition charts
@nickofthyme nickofthyme added enhancement New feature or request :legend Legend related issue labels Apr 23, 2020
@nickofthyme nickofthyme requested review from markov00 and rshen91 April 23, 2020 21:32
@nickofthyme nickofthyme changed the title feat: shift click legend items && partiton legend hover feat: shift click legend items & partition legend hover Apr 23, 2020
@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 23, 2020

Codecov Report

Merging #648 into master will increase coverage by 0.77%.
The diff coverage is 84.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #648      +/-   ##
==========================================
+ Coverage   72.02%   72.79%   +0.77%     
==========================================
  Files         246      259      +13     
  Lines        8165     8422     +257     
  Branches     1593     1620      +27     
==========================================
+ Hits         5881     6131     +250     
- Misses       2253     2254       +1     
- Partials       31       37       +6     
Impacted Files Coverage Δ
src/chart_types/xy_chart/legend/legend.ts 85.00% <ø> (ø)
src/chart_types/xy_chart/utils/specs.ts 100.00% <ø> (ø)
src/mocks/series/series_identifiers.ts 100.00% <ø> (ø)
src/state/reducers/interactions.ts 70.96% <45.45%> (-15.99%) ⬇️
src/components/legend/legend_item.tsx 94.36% <96.00%> (-1.35%) ⬇️
src/components/legend/color.tsx 100.00% <100.00%> (ø)
src/components/legend/label.tsx 100.00% <100.00%> (ø)
src/mocks/utils.ts 94.11% <100.00%> (ø)
src/state/actions/legend.ts 92.30% <100.00%> (+0.64%) ⬆️
src/state/chart_state.ts 86.20% <100.00%> (+0.24%) ⬆️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cafcb9c...fa49bfc. Read the comment docs.

Copy link
Copy Markdown
Collaborator

@markov00 markov00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Tested locally on storybook and works great.
Thanks for bringing back this functionality ❤️

@nickofthyme nickofthyme merged commit ed91744 into elastic:master Apr 24, 2020
@nickofthyme nickofthyme deleted the fix/partiation-legend-hover branch April 24, 2020 17:00
markov00 pushed a commit that referenced this pull request Apr 28, 2020
# [19.0.0](v18.4.2...v19.0.0) (2020-04-28)

### Bug Fixes

* tooltip container scroll issue ([#647](#647)) ([f411771](f411771))
* **annotations:** fix alignment at the edges ([#641](#641)) ([43c5a59](43c5a59)), closes [#586](#586)

### Features

* shift click legend items & partition legend hover ([#648](#648)) ([ed91744](ed91744))
* **brush:** add multi axis brushing ([#625](#625)) ([9e49534](9e49534)), closes [#587](#587) [#620](#620)

### BREAKING CHANGES

* **brush:** The type used by the `BrushEndListener` is now in the following form `{ x?: [number, number]; y?: Array<{ groupId: GroupId; values: [number,
number]; }> }` where `x` contains an array of `[min, max]` values, and the  `y` property is an optional array of objects, containing the `GroupId` and the values of the brush for that specific axis.
* **annotations:** In the rectangular annotation, the y0 parameter of the coordinates now refers to the minimum value and the y1 value refers to the maximum value of the y domain.
@markov00
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 19.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Apr 28, 2020
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
# [19.0.0](elastic/elastic-charts@v18.4.2...v19.0.0) (2020-04-28)

### Bug Fixes

* tooltip container scroll issue ([opensearch-project#647](elastic/elastic-charts#647)) ([f0af34b](elastic/elastic-charts@f0af34b))
* **annotations:** fix alignment at the edges ([opensearch-project#641](elastic/elastic-charts#641)) ([c698d08](elastic/elastic-charts@c698d08)), closes [opensearch-project#586](elastic/elastic-charts#586)

### Features

* shift click legend items & partition legend hover ([opensearch-project#648](elastic/elastic-charts#648)) ([cf15ca1](elastic/elastic-charts@cf15ca1))
* **brush:** add multi axis brushing ([opensearch-project#625](elastic/elastic-charts#625)) ([382cb14](elastic/elastic-charts@382cb14)), closes [opensearch-project#587](elastic/elastic-charts#587) [opensearch-project#620](elastic/elastic-charts#620)

### BREAKING CHANGES

* **brush:** The type used by the `BrushEndListener` is now in the following form `{ x?: [number, number]; y?: Array<{ groupId: GroupId; values: [number,
number]; }> }` where `x` contains an array of `[min, max]` values, and the  `y` property is an optional array of objects, containing the `GroupId` and the values of the brush for that specific axis.
* **annotations:** In the rectangular annotation, the y0 parameter of the coordinates now refers to the minimum value and the y1 value refers to the maximum value of the y domain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request :legend Legend related issue released Issue released publicly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants