Skip to content
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

fix(partition): consider legendMaxDepth on legend size #654

Merged
merged 7 commits into from
May 26, 2020

Conversation

markov00
Copy link
Member

@markov00 markov00 commented Apr 28, 2020

Summary

This PR fix the legend size computation for Partition charts taking in consideration the legendMaxDepth value if present.

fix #639

Checklist

Delete any items that are not applicable to this PR.

  • 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

On partition chart we should compute the legend size only for the elements actually rendered, so
everything below the legendMaxDepth if used

fix elastic#639
@markov00 markov00 added :legend Legend related issue :partition Partition/PieChart/Donut/Sunburst/Treemap chart related wip work in progress enhancement New feature or request labels Apr 28, 2020
@codecov-commenter
Copy link

codecov-commenter commented May 21, 2020

Codecov Report

Merging #654 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #654      +/-   ##
==========================================
+ Coverage   72.60%   72.63%   +0.02%     
==========================================
  Files         266      266              
  Lines        8678     8686       +8     
  Branches     1710     1696      -14     
==========================================
+ Hits         6301     6309       +8     
  Misses       2338     2338              
  Partials       39       39              
Impacted Files Coverage Δ
src/chart_types/xy_chart/utils/specs.ts 100.00% <ø> (ø)
src/components/chart.tsx 73.23% <ø> (ø)
src/scales/scale_band.ts 98.07% <ø> (ø)
src/scales/scale_continuous.ts 97.87% <ø> (ø)
src/specs/settings.tsx 90.90% <ø> (ø)
src/utils/accessor.ts 81.81% <ø> (ø)
src/utils/commons.ts 97.00% <ø> (ø)
src/chart_types/goal_chart/specs/index.ts 100.00% <100.00%> (ø)
...n_chart/state/selectors/get_legend_items_labels.ts 94.59% <100.00%> (+1.49%) ⬆️
src/chart_types/xy_chart/specs/rect_annotation.tsx 100.00% <100.00%> (ø)
... and 2 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 8856878...cee4b63. Read the comment docs.

@markov00 markov00 removed the wip work in progress label May 25, 2020
@markov00 markov00 marked this pull request as ready for review May 25, 2020 08:16
Copy link
Contributor

@monfera monfera left a comment

Choose a reason for hiding this comment

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

LGTM, nice improvement!

Copy link
Collaborator

@nickofthyme nickofthyme 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 legend in multiple partition stories, issue fixed.

@markov00 markov00 merged commit 9429dcf into elastic:master May 26, 2020
@markov00 markov00 deleted the 2020_28_04-fix-partition-legend branch May 26, 2020 17:39
markov00 pushed a commit that referenced this pull request May 28, 2020
# [19.4.0](v19.3.0...v19.4.0) (2020-05-28)

### Bug Fixes

* **partition:** consider legendMaxDepth on legend size ([#654](#654)) ([9429dcf](9429dcf)), closes [#639](#639)

### Features

* **partition:** enable grooves in all group layers ([#666](#666)) ([f5b4767](f5b4767))
* **partition:** linked text overflow avoidance ([#670](#670)) ([b6e5911](b6e5911)), closes [#633](#633)
* **partition:** monotonic font size scaling ([#681](#681)) ([ea2489b](ea2489b)), closes [#661](#661)
* **tooltip:** improve positioning with popperjs ([#651](#651)) ([6512950](6512950)), closes [#596](#596)
@markov00
Copy link
Member Author

🎉 This PR is included in version 19.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label May 28, 2020
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
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 :partition Partition/PieChart/Donut/Sunburst/Treemap chart related released Issue released publicly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Partition legend width is not considering legendMaxDepth
4 participants