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(legend): width with scroll bar #1019

Merged
merged 3 commits into from
Feb 11, 2021

Conversation

nickofthyme
Copy link
Collaborator

Summary

fixes #1011

Checks to see if total legend height on vertical legends, is greater than parent container height. If so adds scrollbar width to total legend width.

Before

image

After

image

Checklist

  • This was checked for cross-browser compatibility
  • Unit tests were updated or added to match the most common scenarios

@nickofthyme nickofthyme added bug Something isn't working :legend Legend related issue labels Feb 5, 2021
@nickofthyme nickofthyme requested a review from markov00 February 5, 2021 21:42
@codecov-io
Copy link

codecov-io commented Feb 5, 2021

Codecov Report

Merging #1019 (6f333cd) into master (e1da4e5) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1019      +/-   ##
==========================================
- Coverage   72.64%   72.62%   -0.03%     
==========================================
  Files         363      379      +16     
  Lines       11188    10807     -381     
  Branches     2437     2210     -227     
==========================================
- Hits         8128     7849     -279     
+ Misses       3046     2855     -191     
- Partials       14      103      +89     
Flag Coverage Δ
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/state/selectors/get_legend_size.ts 93.02% <100.00%> (+0.52%) ⬆️
src/state/selectors/get_legend_items_labels.ts 50.00% <0.00%> (-50.00%) ⬇️
src/utils/dimensions.ts 71.42% <0.00%> (-28.58%) ⬇️
src/components/no_results.tsx 50.00% <0.00%> (-25.00%) ⬇️
src/chart_types/xy_chart/utils/panel_utils.ts 72.72% <0.00%> (-19.59%) ⬇️
src/components/error_boundary/errors.ts 50.00% <0.00%> (-16.67%) ⬇️
src/chart_types/xy_chart/rendering/point_style.ts 87.50% <0.00%> (-12.50%) ⬇️
...t/state/selectors/compute_small_multiple_scales.ts 87.50% <0.00%> (-12.50%) ⬇️
...rt/renderer/dom/annotations/annotation_tooltip.tsx 79.31% <0.00%> (-10.35%) ⬇️
src/utils/data_generators/data_generator.ts 45.45% <0.00%> (-9.10%) ⬇️
... and 208 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 e1da4e5...6f333cd. Read the comment docs.

Copy link
Member

@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.

Looks great, I've just nitpicked about the legend size calculation

src/components/legend/_legend.scss Show resolved Hide resolved
src/components/legend/_legend.scss Show resolved Hide resolved
src/state/selectors/get_legend_size.ts Outdated Show resolved Hide resolved
@nickofthyme nickofthyme enabled auto-merge (squash) February 11, 2021 17:32
@nickofthyme
Copy link
Collaborator Author

jenkins retest this please

@nickofthyme nickofthyme merged commit 45bd0d5 into elastic:master Feb 11, 2021
github-actions bot pushed a commit that referenced this pull request Feb 15, 2021
# [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))
@markov00
Copy link
Member

🎉 This PR is included in version 24.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Feb 15, 2021
@nickofthyme nickofthyme deleted the fix-legend-scroll-sizing branch April 6, 2021 17:39
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
bug Something isn't working :legend Legend related issue released Issue released publicly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Legend sizing does not account for scrollbar width
3 participants