diagrams
diagrams copied to clipboard
URL, edgeURL, and labelURL support
edgeURL
and labelURL
are technically already supported via the **attrs
Dict in Edge
's initializer.
I added a named parameter to Node
to accept URL
.
SVG output natively supports links in the diagram. Links can also be added to jpg and png using cmapx
which I added to the output types.
To use cmapx you will need to run the diagram generation twice. Once for the png and once for the cmapx file.
I had originally detected if a url was added to a node, edge, or label and autogenerated the cmapx file. I can add that back in if interested, but it seemed to break the paradigm of generating one file from a diagram.
Closes #97
I think SVG native support would be enough. With cmapx, a user should create an HTML file containing the map filename and image filename. But it would be a bad experience in my thought as long as there are no ways to support link in PNG itself natively.
I think there is a lot of value in just having the working SVG support.
If others want PNG support that can perhaps be looked at in another PR - perfect is the enemy of shipped and all.
is there anything preventing this from being rebased and merged?
Keen to see this merged, will be great to combine with https://github.com/mingrammer/diagrams/pull/508 which then allows one to click on containers / components & be taken to a git repo or similar for more context.