Skip to main content

📊 Graph

graph Contains nodes and links arrays to represent the graph structure.


📌 Example Usage

const graphData = {
  nodes: [{ id: 1 }, { id: 2 }, { id: 3 }],
  links: [
    { source: 0, target: 1 },
    { source: 1, target: 2 },
  ],
};

const MyGraph = () => (
  <Graph
    graph={graphData}
    zoomScale={[0.5, 8]}
    linkForce={{ strength: 1, length: 100 }}
    gravityForce={{ strength: 0.1, center_x: 0, center_y: 0 }}
    chargeForce={{ strength: -30 }}
  />
);

🎮 Playground

Node

Zoom Scale

Link Force