You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see there is a floating points difference. I actually haven't been able to generate the markup with 2 decimal places (if I use devtools I see the same as server code).
I have made a PR to fix my issue but maybe there is another way to fix that?
Steps to reproduce
If you go to the storybook > VictoryArea > Interpolation, and inspect the code of the first chart, you should also see the same.
Expected behavior
No response
Actual behavior
No response
Environment
- Device:
- OS:
- Node:
- npm:
The text was updated successfully, but these errors were encountered:
For context on why this occurs, d3 had a great discussion about it a while ago including test cases of various solutions. The interesting part of the discussion is that each method tends to produce slightly different results depending on the OS architecture, javascript engine, and rounding method.
Based on some initial research I think we should follow d3's approach of rounding to 3 places (browsers round to 1/64 or 1/60 depending on which one), but we are going to have to fix this across the chart stack primitives in multiple places. Roughly anywhere we calculate d, x, y, dx, and dy values for SVG elements, otherwise we lose consistency/alignment when we render.
Is there an existing issue for this?
Code of Conduct
Victory version
37.3.2
Code Sandbox link
No response
Bug report
I'm using VictoryArea in my SSR (remix) app but it's causing hydration issue due to the prop d not matching between the client and server html markup.
Server:
Client:
As you can see there is a floating points difference. I actually haven't been able to generate the markup with 2 decimal places (if I use devtools I see the same as server code).
I have made a PR to fix my issue but maybe there is another way to fix that?
Steps to reproduce
If you go to the storybook > VictoryArea > Interpolation, and inspect the code of the first chart, you should also see the same.
Expected behavior
No response
Actual behavior
No response
Environment
The text was updated successfully, but these errors were encountered: