Open dearlordylord opened 1 year ago
Describe the bug having the structure
const graphData = { nodes: [{ id: '1', }, { id: '2', }, { id: '2', }], links: [{ source: '1', target: '2', }] };
calling the component as
<ForceGraph3D graphData={graphData} linkDirectionalArrowLength={3.5} linkDirectionalArrowRelPos={1} linkCurvature={0.25} />
I experience it creating an extra node for id: 2 and not linking it to the node of id: 1, instead linking only the first node with id: 2
Expected behavior
Ideally, I'd expect it to handle duplicated IDs and ignoring the extra nodes
Ideally ideally, I'd expect it to handle duplicated IDs, throwing an error
Ideally ideally ideally, I'd expect it to make duplicated IDs unrepresentable accepting the structure
const graphData = { nodes: {'1': {/*...*/}, '2': {/*...*/}} links: [{ source: '1', target: '2', }] };
which seems to be more reasonable than an array
@Firfi thanks for reaching out.
This module really adopted the convention that came from d3-force forceLink.
Overall, it's better if you sanitize your data before you pass it on to react-force-graph.
react-force-graph
Describe the bug having the structure
calling the component as
I experience it creating an extra node for id: 2 and not linking it to the node of id: 1, instead linking only the first node with id: 2
Expected behavior
Ideally, I'd expect it to handle duplicated IDs and ignoring the extra nodes
Ideally ideally, I'd expect it to handle duplicated IDs, throwing an error
Ideally ideally ideally, I'd expect it to make duplicated IDs unrepresentable accepting the structure
which seems to be more reasonable than an array