nytimes / svg-crowbar

Extracts an SVG node and accompanying styles from an HTML document and allows you to download it all as an SVG file.
https://nytimes.github.io/svg-crowbar/
MIT License
839 stars 153 forks source link

Downloaded SVG does not keep rects in dagreD3 graphs #21

Open jennyxing opened 9 years ago

jennyxing commented 9 years ago

try SVG Crowbar 2 here: http://cpettitt.github.io/project/dagre-d3/latest/demo/tcp-state-diagram.html

ccblaisdell commented 8 years ago

I'm experiencing the same issue with this chart http://bl.ocks.org/ccblaisdell/fe598e13fc9d263df5bd . You can see a simpler case here http://bl.ocks.org/ccblaisdell/2eb788504f88899342be

For some reason, getComputedStyle is setting the rects' width and height to auto, even if those values are set as attributes on the rect (as in @jennyxing27 's example) or as inherited or inline css styles. I assume that makes this a browser bug, but is it something that can be worked around?