Skip to main content
100%

Forced Graph

✓ Published2🌍 Public
VVijay Karchi
Last edited Apr 8, 2023
Created on Apr 7, 2023
Forked from D3 Starter

This example shows a small network of project and feature nodes connected by links, rendered as styled HTML cards within an SVG using D3’s force simulation. The graph uses `d3.forceSimulation` with `forceManyBody`, `forceLink`, and `forceCenter` to position nodes, while each node is a custom `foreignObject` containing a `div` with a left icon area, a title, and a share action. The `tick` event updates link coordinates and translates each node’s container based on simulated positions, and clicking a node triggers an alert with its id. The data comes from an imported `data.js` module defining two nodes and one link.

AI-generated description
MIT Licensed

Similar vizzes