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

Node label as hyperlink instead of plain test #73

Closed
clement911 opened this issue Aug 6, 2014 · 5 comments
Closed

Node label as hyperlink instead of plain test #73

clement911 opened this issue Aug 6, 2014 · 5 comments

Comments

@clement911
Copy link

Is it possible to set the graph nodes to be hyperlink to arbitrary url when clicking on the node?

@cpettitt
Copy link
Collaborator

cpettitt commented Aug 6, 2014

Yes, please see: http://jsbin.com/yiqeya/2. To see the source, look at http://jsbin.com/yiqeya/2/edit.

@cpettitt cpettitt closed this as completed Aug 6, 2014
@clement911
Copy link
Author

Thank you, this worked. However, the link opens in a new window. Is it possible to set up a regular link?
Ideally the best way would be to be able to give arbitrary html to be inserted in the node but I'm not sure how hard that would be...

@laurentpetit
Copy link

Hello, I'm trying to add href attributes to nodes, after the nodes have first been created with graphlibDot.

trying to do so as such:

var g = graphlibDot.read(dotString);
g.nodes().forEach(function (v) {
    var node = g.node(v);
    node.href = 'http://www.google.com';
});

// etc. here goes the rendering code via d3

This does not work. Am I doing something silly?

@laurentpetit
Copy link

Another question: I want to add proper svg links instead of reacting to clicks. This involves wrapping rects inside svg links. Is there a way to hook into the rendering mechanism to do so?

If not, maybe you have some suggestions to do that?

Thanks in advance,

-- Laurent

@flying-sheep
Copy link

I did that in mermaid-js/mermaid#791 but dagre has since changed so it only covers the label area again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants