napari / napari-svg

A plugin for writing svg files from napari
BSD 3-Clause "New" or "Revised" License
4 stars 12 forks source link

Export should take layer transforms into account #26

Closed jni closed 2 months ago

jni commented 2 years ago

I discovered while playing around with a new napari logo that the svg export doesn't include the transforms on the layer. I think the coordinates should be transformed by all layer transforms and line thicknesses should be multiplied by the layer scale, to match what napari is displaying.

See original issue:

https://github.com/jni/new-napari-logo/issues/1

andy-sweet commented 3 months ago

Not sure if this is out of scope, but I also expect all the content of the SVG to be visible. In https://github.com/jni/new-napari-logo/issues/1 , some of the strokes are clipped.

jni commented 3 months ago

I wonder if that's an issue of whatever software I was opening the svg with rather than the output. I must say I know very little about the svg format. 😅

jni commented 3 months ago

wow, this is cool: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform

so I don't need to hardcode the transforms into the coordinates, I can just grab them directly from the metadata.