-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embed SVG images #107
Comments
That's exactly what I need! I have a complicated SVG image and I would like to turn it into an element to be manipulated in the diagram. Basically, I would like to use SVG as input (not only output) for diagrams. I guess that should be a feature in svg-builder, no? I found svg-tree but I don't think I can use it, right? Maybe if both had a general XML representation behind or provided a way to convert from/to it (like svg-tree seems to have) then it would open more possibilities for reuse/interoperability, no? What do you suggest I do? Should I turn the SVG into a PNG? |
Right, implementing this would probably require adding some features to |
Thank you so much! I've been using that. It's exactly what I needed. Thank you. |
Right now it is possible to embed raster images (PNG, JPG, ...) but not other SVG images, although the SVG format itself supports embedded SVGs perfectly well, either via a nested
<svg>
tag or via an<image ... xlink:href="...">
tag (corresponding to the existing embedded/external distinction in diagrams).While researching the best way to support this I'm realizing that diagrams' whole system of support for images is very much biased towards raster images. The SVG backend has an instance for
DImage Embedded
which definitely represents a raster image; it also has a specialloadImageSVG
which goes viaImageNative
, but it also only supports PNG or JPEG, and ends up embedding them in a base64-encoded data URI. I think trying to shoehorn embedded SVG into this is going to be annoying.Instead, I think the simplest approach is to simply add a new kind of embedded SVG primitive, specific to the SVG backend. It would be easiest to have it work via the
xlink
approach but inlining the contents of another SVG should be possible too.The text was updated successfully, but these errors were encountered: