diagrams icon indicating copy to clipboard operation
diagrams copied to clipboard

URL, edgeURL, and labelURL support

Open coryodaniel opened this issue 4 years ago • 4 comments

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

coryodaniel avatar Apr 17 '20 16:04 coryodaniel

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.

mingrammer avatar May 17 '20 10:05 mingrammer

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.

dhirschfeld avatar Jul 07 '20 00:07 dhirschfeld

is there anything preventing this from being rebased and merged?

wolfspyre avatar Nov 25 '20 02:11 wolfspyre

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.

brad-jones avatar Aug 29 '22 07:08 brad-jones