Skip to content
This repository was archived by the owner on Jun 6, 2025. It is now read-only.

Comments

Stop double formatting in label calculation#1786

Merged
carysmills merged 2 commits intomainfrom
fix-donut-double-format
Jan 6, 2025
Merged

Stop double formatting in label calculation#1786
carysmills merged 2 commits intomainfrom
fix-donut-double-format

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
@github-actions
Copy link

github-actions bot commented Dec 19, 2024

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%) 992 ms (+21.55% 🔺) 2.3 s
polaris-viz-cjs 228.93 KB (-0.01% 🔽) 4.6 s (-0.01% 🔽) 2.1 s (+26.12% 🔺) 6.7 s
polaris-viz-esm 185.31 KB (-0.01% 🔽) 3.8 s (-0.01% 🔽) 1.9 s (+22.06% 🔺) 5.6 s
polaris-viz-css 5.72 KB (0%) 115 ms (0%) 333 ms (+23.09% 🔺) 447 ms
polaris-viz-esnext 192.36 KB (-0.01% 🔽) 3.9 s (-0.01% 🔽) 1.5 s (-15.41% 🔽) 5.3 s

@carysmills carysmills requested a review from envex January 6, 2025 13:13
@carysmills carysmills merged commit 8cf0484 into main Jan 6, 2025
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants