Using SVG symbols to make diagrams, then convert them back in SVG

2,294 views
Skip to first unread message

NPL

unread,
Oct 3, 2016, 5:29:10 AM10/3/16
to draw.io
Hello,

We'd like to use Draw.io to make process diagrams. Then to export the diagrams in SVG files in order to embed them into a web application.
We created a bunch of symbols in SVG, with attributes (id, class,...) that are needed to be rendered in a special way in our application.

I noticed that:
- when importing a SVG file into draw.io, none of the SVG tags are kept, but a long string of letter and figures instead. And therefore the attributes (id, class,...) are not imported.
- when exporting to a SVG file, the original SVG is not recovered and we lost the tags and attributes. We still have the long string instead.

Furthermore:
- when creating a shape directly into Draw.io, and giving it some attributes (which I could call "id" or "class"), these attributes are not preserved when exporting to an SVG file.

Are we doing something wrong ?
To resume, is it possible to:
1- make a Draw library from SVG symbols, with attributes ("id", "class") and connectors
2- Use Draw to make diagrams using these symbols
3- Export the diagrams in proper SVG format, which preserves SVG tags and attributes

I thank you in advance for your help

Best regards,

Nicolas

Gaudenz Alder

unread,
Oct 3, 2016, 5:35:21 AM10/3/16
to draw.io
Can you attach one of the SVG symbols used?

NPL

unread,
Oct 3, 2016, 8:03:38 AM10/3/16
to draw.io
Of course, here it is.
The <text></text> has an "id" and a "class" that we want to preserve in the SVG export of the diagram.
But if I import this SVG shape into Draw.io, then Export in a SVG file I get the "test.svg" file attached.
CHV_elec.svg
test.svg

Gaudenz Alder

unread,
Oct 3, 2016, 8:08:25 AM10/3/16
to draw.io
The SVG is included in the output as an base 64 encoded SVG image, the tags and attributes are all there.

Nicolas Piquemal

unread,
Oct 6, 2016, 3:48:39 AM10/6/16
to Gaudenz Alder, draw.io
Hello,

I thank you for this answer, I did not know about this possibility to encode in base 64.
However, is it possible to change the encoder ?
How to get a classic SVG file as an output to Draw.io ?
Our CSS and scripts catch our attributes to change the content and the formating of several elements in our SVG diagram.

Best regards,

On 3 October 2016 at 14:08, Gaudenz Alder <ald...@gmail.com> wrote:
The SVG is included in the output as an base 64 encoded SVG image, the tags and attributes are all there.

--
You received this message because you are subscribed to a topic in the Google Groups "draw.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/drawio/TGTz6UqbFas/unsubscribe.
To unsubscribe from this group and all its topics, send an email to drawio+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/drawio/592e1605-3657-4bcf-a486-14630d1526ef%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Gaudenz Alder

unread,
Oct 6, 2016, 5:54:45 AM10/6/16
to draw.io, ald...@gmail.com
Currently, that's not supported. Please create a feature request at https://draw.uservoice.com/forums/266072-feature-requests for this.

GERARD Nicolas

unread,
Nov 9, 2017, 11:42:57 AM11/9/17
to draw.io
I am in the same context. I would like to create a custom library of svg components, create a diagram, export it in SVG  and retrieve my components in pure svg format (not encoded in based 64). 
I was searching the feature request but I can't find it.
Do I need to create it ?
If yes, where ? in Trello or in Uservoice.

Thanks
Nico

David Benson

unread,
Feb 15, 2018, 4:06:17 AM2/15/18
to draw.io
Trello
Reply all
Reply to author
Forward
0 new messages