graphieros / vue-data-ui

An open source user-empowering data visualization Vue 3 components library for eloquent data storytelling
https://vue-data-ui.graphieros.com/
MIT License
1.08k stars 50 forks source link

Fix - onion animations when percentage value is more than 33% #99

Closed cyrilf closed 3 weeks ago

cyrilf commented 3 weeks ago

On the documentation page for vue-ui-onion there is an issue with the animation.

It seems that if a dataset has data with a percentage higher than 33, it will produce a flickering effect where the ring is flipping on the left-side. This PR fixes it.

Before After
before after

Maybe the intention with the ternary and the > 1 / 3 in the code is different than what I understand and the fix is somewhere else?

graphieros commented 3 weeks ago

The fix involved a different approach than relying on just the circumference to create coordinates for the active path.

Your solution did fix the janky animation, but kept incorrect path proportions (an issue that was already there). This issue is visible when setting all values to 50, where the path does draw half of the circle circumference, however the path must cover 270° instead of the full 360°:

Capture d’écran 2024-11-04 à 05 52 52

I pushed the fix in v2.3.69. As for comparison, here is the result with the fix:

Capture d’écran 2024-11-04 à 06 22 20

cyrilf commented 3 weeks ago

Nice, glad to see it fixed! ✨