fix: resolve exported SVG appearing blank in Inkscape (#612) #734
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Exported SVGs appearing blank in Inkscape (#612)
This PR finally squashes the bug where our exported SVGs looked fine in Chrome or Firefox but rendered as a completely blank page when opened in Inkscape.
What was happening?
It turns out Inkscape is much stricter than browsers when interpreting SVG specs. The diagrams were technically there, but they were invisible because of a few compounding issues:
viewBoxconfiguration wasn't normalized, throwing off the coordinate system.The Fix
I went through the export logic to clean up the output structure:
viewBoxand size attributes so the canvas dimensions are explicit.Testing
I tested this using small and medium schemas.
Closes #612