react-force-graph
react-force-graph copied to clipboard
React Router Link on Node Click
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 💥
Hi @vasturiano! Any updates on this issue? 🤓
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
.