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

How can we add custom text over the node tooltip? #264

Open
Malikx-Alee opened this issue Sep 2, 2020 · 2 comments
Open

How can we add custom text over the node tooltip? #264

Malikx-Alee opened this issue Sep 2, 2020 · 2 comments

Comments

@Malikx-Alee
Copy link
Contributor

Currently the node does not show handleToolTipText like edges.

Below is the code for edges but it does not work for nodes:

edges:[
{
      type: "Dependence",
      source: "Exposition",
      target: "Exposed",
      handleTooltipText:
        "Dependence - Drag and Drop to Another Node to Reconnect",
    }
]
@yatingupta10
Copy link

+1

@ajbogh
Copy link
Contributor

ajbogh commented Mar 5, 2021

You can override node rendering with the renderNode function and return your own SVG component with the tooltip. Overriding the node rendering allows you to do so much more with the nodes that is not possible with the default nodes.

Edges are different. We needed the handleTooltipText (provided by a contributor) because react-digraph has to render the edges itself. We do provide an afterRenderEdge function to help modify those edges, but we don't provide a renderEdge function.

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

3 participants