Network graph
import { NetworkChart } from '@arshad-shah/swift-chart';
const chart = new NetworkChart('#chart', { theme: 'midnight' });chart.setGraph(socialGraph.nodes, socialGraph.links);import { Network } from '@arshad-shah/swift-chart/react';
<Network nodes={nodes} links={links} theme="midnight" height={380} />Tuning the simulation
Control the springs and repulsion via the chart config — the underlying solver is exposed as a standalone helper too.
new NetworkChart('#chart', { iterations: 300, linkStrength: 0.08, chargeStrength: 400,});Reference
- Class:
NetworkChart - React component:
Network - Solver helper:
simulateForce