Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL, edgeURL, and labelURL support #106

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

coryodaniel
Copy link

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

`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`](https://www.graphviz.org/doc/info/attrs.html#a: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.
@mingrammer mingrammer added kind/feature New feature or request status/need-to-review Need to review comp/edge Issue of edge component labels Apr 23, 2020
@mingrammer
Copy link
Owner

mingrammer commented May 17, 2020

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.

@dhirschfeld
Copy link

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.

@wolfspyre
Copy link
Contributor

is there anything preventing this from being rebased and merged?

@brad-jones
Copy link

Keen to see this merged, will be great to combine with #508 which then allows one to click on containers / components & be taken to a git repo or similar for more context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp/edge Issue of edge component kind/feature New feature or request status/need-to-review Need to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

href/link support
5 participants