Shopify / polaris-viz

A collection of React and React native components that compose Shopify's data visualization system
https://polaris-viz.shopify.dev
Other
335 stars 26 forks source link

Legend overflow fixes #1693

Closed susiekims closed 4 months ago

susiekims commented 4 months ago

What does this implement/fix?

The legend overflow calculation was using the MINIMUM_LEGEND_ITEM_WITH_VALUE_WIDTH instead of MINIMUM_LEGEND_ITEM_WIDTH when values were hidden. But I also just learned that horizontal legends with values look like this, so we don't even need MINIMUM_LEGEND_ITEM_WITH_VALUE_WIDTH. image

Does this close any currently open issues?

Resolve https://github.com/Shopify/core-issues/issues/73670 One of feedback items we received from CSS here: https://github.com/Shopify/core-issues/issues/72480

What do the changes look like?

Legend items should shorten to 100px before items start being hidden

https://github.com/user-attachments/assets/12c569a3-c3ea-422a-933f-6efb242cfce4

Storybook link

https://6062ad4a2d14cd0021539c1b-abxwzkkvsr.chromatic.com/

Before merging

github-actions[bot] commented 4 months ago

size-limit report πŸ“¦

Path Size Loading time (3g) Running time (snapdragon) Total time
polaris-viz-core-cjs 61.15 KB (+0.01% πŸ”Ί) 1.3 s (+0.01% πŸ”Ί) 1.1 s (+16.22% πŸ”Ί) 2.4 s
polaris-viz-cjs 215.97 KB (+0.01% πŸ”Ί) 4.4 s (+0.01% πŸ”Ί) 2 s (-11.96% πŸ”½) 6.3 s
polaris-viz-esm 176.7 KB (+0.01% πŸ”Ί) 3.6 s (+0.01% πŸ”Ί) 1.4 s (-1.08% πŸ”½) 5 s
polaris-viz-css 4.79 KB (0%) 96 ms (0%) 312 ms (-18.03% πŸ”½) 408 ms
polaris-viz-esnext 182.48 KB (+0.02% πŸ”Ί) 3.7 s (+0.02% πŸ”Ί) 1.7 s (-2.7% πŸ”½) 5.3 s
envex commented 4 months ago

@susiekims Don't forget to update the CHANGELOG