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

SSR Hydration attribute mismatch on transform attribute #2264

Open
Jannchie opened this issue Dec 31, 2024 · 1 comment
Open

SSR Hydration attribute mismatch on transform attribute #2264

Jannchie opened this issue Dec 31, 2024 · 1 comment
Labels
bug Something isn’t working

Comments

@Jannchie
Copy link

Hello,

I’m currently working on a Vue application using this project and am building SSR charts with Nuxt. Most things are functioning well, but I’ve encountered an issue with the transform attribute, where there is often a 0.5-pixel mismatch.

  - rendered on server: transform="translate(-9,6.5)"
  - expected on client: transform="translate(-8.5,7)"

I’m not sure why this is happening, but I did notice that the official documentation seems to have the same issue. For example, the following page reports a similar error: https://observablehq.com/plot/features/marks.

I’m not certain if the maintainers are aware of this issue. I hope it can be addressed and resolved. Thank you for your attention to this matter.

@Jannchie Jannchie added the bug Something isn’t working label Dec 31, 2024
@Fil
Copy link
Contributor

Fil commented Jan 3, 2025

I believe this is due to this offset

export const offset = (typeof window !== "undefined" ? window.devicePixelRatio > 1 : typeof it === "undefined") ? 0 : 0.5; // prettier-ignore

We should probably align its value to the most common use case (which is possibly the high rather than low DPI at this point?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

No branches or pull requests

2 participants