📍 NodeComponent
NodeComponent
Is an optional prop that allows customizing the display of nodes in the graph.
📌 Example Usage
const CustomNode = ({ node }) => (
<div className="custom-node">
<strong>{node.label}</strong>
</div>
);
const graphData = {
nodes: [{ id: 1, label: "A" }, { id: 2, label: "B" }],
links: [{ source: 0, target: 1 }],
};
const MyGraph = () => (
<Graph graph={graphData} NodeComponent={CustomNode} />
);