GithubHelp home page GithubHelp logo

Make link in label clickable about pyvis HOT 7 CLOSED

westhealth avatar westhealth commented on July 26, 2024
Make link in label clickable

from pyvis.

Comments (7)

boludo00 avatar boludo00 commented on July 26, 2024 2

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.

from pyvis.

boludo00 avatar boludo00 commented on July 26, 2024

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

from pyvis.

cryzed avatar cryzed commented on July 26, 2024

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.

from pyvis.

boludo00 avatar boludo00 commented on July 26, 2024

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.

from pyvis.

paritoshk avatar paritoshk commented on July 26, 2024

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!

from pyvis.

jasotamame avatar jasotamame commented on July 26, 2024

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

from pyvis.

jasotamame avatar jasotamame commented on July 26, 2024

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..."

from pyvis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.