Skip to content

Conversation

@aman-ak-r
Copy link

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:

  • Messy ViewBox: The viewBox configuration wasn't normalized, throwing off the coordinate system.
  • Blocking Layers: There were some background and clipping elements effectively rendering "on top" of the diagram content.
  • Unsupported Transforms: We were using some transform attributes that Inkscape doesn't support (or interprets differently), which pushed elements off the canvas.

The Fix

I went through the export logic to clean up the output structure:

  1. Normalized the Geometry: I standardized the viewBox and size attributes so the canvas dimensions are explicit.
  2. Cleaned up the DOM: Removed unnecessary metadata and background artifacts that were causing the blank rendering.
  3. Flattened Transforms: Instead of relying on complex CSS/SVG transforms, I simplified how we position elements to ensure compatibility across all editors.

Testing

I tested this using small and medium schemas.

  • Browsers: Verified it still looks correct in Chrome and Firefox.
  • Inkscape: Confirmed diagrams now open correctly on both Windows and Linux versions. All tables, connectors, and styling are preserving their scale and position.

Closes #612

@vercel
Copy link

vercel bot commented Nov 25, 2025

@aman-ak-r is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Unable to open the exported SVG in Inkscape

1 participant