d2 icon indicating copy to clipboard operation
d2 copied to clipboard

renderer: no css svg

Open alixander opened this issue 2 years ago • 1 comments

D2 output SVGs can't be imported into SVG renderers like Figma and Inkscape currently because we style with CSS.

Might be doable to map all the CSS fields to SVG attributes.

alixander avatar Nov 08 '23 23:11 alixander

it is possible that this not related to CSS. If you look at a d2 svg file in inkscape, it is evident that there are many svg elements that are not related to the actual graph. Using the simple x->y example one gets the following

image

it is unclear why rect1 is needed, and if is needed, why is it in front of all other objects?

The other problem is that the coordinate system seems wrong. Resizing the page to the graph dimensions results in this

image

I don't speak svg, but hope this helps

uliw avatar Nov 27 '23 14:11 uliw