I am trying to create SVG file from dot with one of the nodes having URL which links to another SVG file.
All SVGs are locally generated and there is no web link for them.
I created node with something like this:
NODE1 [label = "My Node", URL = "file:///../images/diagram2.svg"];
Of course, the paths have to be relative so that when I take generated SVGs with root level folder structure to the other machines, it should be able navigate.
I cannot find a way to insert relative local files paths. The absolute paths work just fine but I cannot use it.
Is the purpose of the URL to link to a different page (replace the current SVG graph with the new SVG file), or do you want to include the new SVG file as an image in the current node?
For Windows, this is how to do the latter:
graph E {
s[image="images/Face-smile.svg" label=""]
}
Output generated from diagram2.dot with dot -Tsvg -o ..\images\diagram2.svg diagram2.gv
and from diagram1.dot with dot -Tsvg -o diagram1.svg diagram1.gv
Now, when I open diagram1.svg the browser shows the link correctly mapped to the address bar like below: file:///C:/Shares/graphviz/diagram1.svg
However when I click on the My Node it tries to load the diagram2.svg by taking below path: file:///images/diagram2.svg
and throws ERR_FILE_NOT_FOUND error.