Skip to content

Network graph

import { NetworkChart } from '@arshad-shah/swift-chart';
const chart = new NetworkChart('#chart', { theme: 'midnight' });
chart.setGraph(socialGraph.nodes, socialGraph.links);

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