-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(Mermaid) add pan and zoom via svg-pan-zoom #14967
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle ReportChanges will increase total bundle size by 398.94kB (1.74%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-client-array-pushAssets Changed:
Files in
view changes for bundle: sentry-docs-server-cjsAssets Changed:
Files in
App Routes Affected:
|
| maxZoom: 10, | ||
| zoomScaleSensitivity: 0.2, | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: SVG Initialization Fails on Hidden Elements
The svg-pan-zoom library initializes on all Mermaid SVG elements, including the one currently hidden by CSS for theme switching. Hidden SVGs have zero dimensions, which can cause svg-pan-zoom to initialize incorrectly, leading to broken pan/zoom functionality or conflicting controls when the theme changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! The only downside I see with this approach is that we have different zoom states for light/dark but I thinks thats not a big issue. Thanks for taking care of this!
Some say bug, others say feature 😅 |

Closes #13749
Example: https://develop-docs-7b5gl6fix.sentry.dev/self-hosted/data-flow/