react-force-graph icon indicating copy to clipboard operation
react-force-graph copied to clipboard

React Router Link on Node Click

Open danielbakas opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. Hi!! We wanted to add a simple react-router Link to each node in the graph, but just couldn't figure it out.

Describe the solution you'd like

import {Link} from 'react-router'
<ForceGraph3D
    nodeLabel={node => `${node.prefix}:${node.fragment}`}
    nodeLink={<Link to={node.path}/>}
/>

Describe alternatives you've considered We tried passing the link as the value for the nodeLabel or the nodeCanvasObject but we know those have different prop types.

Additional context Having the ability to use React Routing in the graph would be dynamite 💥

danielbakas avatar Nov 08 '22 10:11 danielbakas

Hi @vasturiano! Any updates on this issue? 🤓

danielbakas avatar Sep 04 '23 22:09 danielbakas

It's outside of the scope of this module to have integration with any app routing system including direct links. That type of functionality should be performed using onNodeClick.

vasturiano avatar Sep 05 '23 23:09 vasturiano