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

Make link in label clickable #10

Closed
cryzed opened this issue May 21, 2018 · 7 comments · Fixed by #12
Closed

Make link in label clickable #10

cryzed opened this issue May 21, 2018 · 7 comments · Fixed by #12
Assignees
Labels
enhancement New feature or request

Comments

@cryzed
Copy link

cryzed commented May 21, 2018

It would be nice if there was some way to keep a node's label displayed in such a way that linked elements within it could be clicked.

@boludo00
Copy link
Collaborator

By label do you mean the text under the node or the text rendered from on hover?

@cryzed
Copy link
Author

cryzed commented May 23, 2018

Ideally both, however if the text under the node was interpreted as HTML (and elements clickable) that would suffice. The current issue with the hover display is that I can't click on elements within it, because it disappears.

@boludo00
Copy link
Collaborator

Yeah I see what you mean. The VisJS library supports HTML and CSS in the title attribute of nodes (which is the hover metadata) but the label is plain text. Ill have to investigate with the developers and see if there is a way to keep the hover data static so it does not disappear when the mouse is moved.

@boludo00
Copy link
Collaborator

boludo00 commented May 24, 2018

I have played with the HTML and JS template to recreate the following:
image

It looks clunky, but it works. I am going to work on integrating this soon.

@boludo00 boludo00 self-assigned this May 24, 2018
@boludo00 boludo00 added the enhancement New feature or request label May 24, 2018
@paritoshk
Copy link

How can I use this functionality? I want users to click on the node (or hypertext Label) and get redirected to another tab within my streamlit app. Thanks!

@jasotamame
Copy link

Hi! I would also be interested in knowing how to use this functionality. Thanks!!!

@jasotamame
Copy link

jasotamame commented Apr 8, 2022

Hey paritoshk, I managed to do it following this

#12

"How it works: currently there is a check done before rendering the HTML page that checks if there is an href anywhere in the title attribute of any node. The template is then modified if this is the case.
g.add_node("I am a node with a link", title=<a href='http://www.google.com\'>google"
This will not work within a jupyter notebook session by the way..."

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

Successfully merging a pull request may close this issue.

4 participants