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

Stop double formatting in label calculation #1786

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

carysmills
Copy link
Contributor

@carysmills carysmills commented Dec 19, 2024

What does this implement/fix?

Fixes double formatting and inaccurate measuring in the Donut Chart

Does this close any currently open issues?

Should fix https://github.com/Shopify/web/issues/152100 once updated in web

What do the changes look like?

You can see below in the console that the string we were measuring double formatted the label. You can see that as a result, the container was larger than it needed to be.

After, the container is the correct size, and you can see in the console that the string being measured is not double formatted.

Before After
Screenshot 2024-12-20 at 9 25 50 AM Screenshot 2024-12-20 at 9 26 28 AM

Storybook link

I haven't added a story for this, but you can try it out on the existing donut chart stories by console.logging the label that is getting measured here

Before merging

  • Check your changes on a variety of browsers and devices.

  • Update the Changelog's Unreleased section with your changes.

  • Update relevant documentation, tests, and Storybook.

  • Make sure you're exporting any new shared Components, Types and Utilities from the top level index file of the package

@carysmills carysmills self-assigned this Dec 19, 2024
Copy link

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
polaris-viz-core-cjs 61.73 KB (0%) 1.3 s (0%) 1.2 s (+24.55% 🔺) 2.5 s
polaris-viz-cjs 228.93 KB (-0.01% 🔽) 4.6 s (-0.01% 🔽) 1.9 s (-12.72% 🔽) 6.4 s
polaris-viz-esm 185.31 KB (-0.01% 🔽) 3.8 s (-0.01% 🔽) 1.6 s (+0.39% 🔺) 5.3 s
polaris-viz-css 5.72 KB (0%) 115 ms (0%) 340 ms (+7.03% 🔺) 454 ms
polaris-viz-esnext 192.36 KB (-0.01% 🔽) 3.9 s (-0.01% 🔽) 1.6 s (+9.77% 🔺) 5.4 s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant