Obtaining dot commands from SVG

Hi All,
I have a graph available in .drawio format which I have downloaded as a SVG format.
I want this SVG to be converted as a dot file and obtain the dot commands, so that I can add these dot commands in my Doxygen documentation. The main reason to obtain the dot syntax is to add in the source code without adding as a file.
Any idea how I can achieve this?

Thanks a lot

If I understand your request, you want to convert an SVG file (created by the draw.io program) to a dot (input) file.
Sorry, while it sounds cool, I’m unaware of any “Google translate” to do this. There is a very tiny chance it could be done manually, but it would require very detailed knowledge of both SVG and dot.
If you really need a dot input file, I suggest learning the Graphviz (dot) language and recreate your graph strictly with dot.

1 Like

Hi steveroush,
Thanks for the reply. I’ll try with GraphViz language and recreate the dot.

Thanks!

I suggest looking at this document: https://www.graphviz.org/pdf/dotguide.pdf
and this web page: Attribute Types | Graphviz

Could we do the opposite? Include the source code in SVG output? I know you run into problems if you try to use XML comments because “–” is disallowed in comments, but I found a workaround where I manually add the dot source code using CDATA and defs just before the closing svg tag so a graph might appear like this:

 <defs>
 <![CDATA[
   graph g { a -- b -- c }
 ]]>
 </defs>
 </svg>