JavaScript graph visualization libraries

Updated Nov 2026

JavaScript graph visualization libraries draw networks of nodes and the edges that connect them in the browser. A layout step positions each node, often with a force simulation that pulls linked nodes together and pushes other nodes apart. These libraries draw the knowledge graphs, dependency maps, social networks, and fraud-ring views in analysis tools and dashboards.

Popularity

D3 has the most monthly downloads in this comparison, at 125.9M, a count that covers all of its chart and graphics uses.

LibraryMonthly downloadsStarsLast releaseLicense
D3
125.9M
114.0KNov 2026ISC
Cytoscape.js
100.3M
11.3KNov 2026MIT
Apache ECharts
38.3M
67.8KMay 2026Apache-2.0
Highcharts
13.5M
240Sep 2026https://www.highcharts.com/license
force-graph
5.6M
2.2KSep 2026MIT
vis-network
4.2M
3.6KNov 2026MIT
Sigma.js
2.8M
12.2KNov 2026MIT
3d-force-graph
2.6M
6.6KNov 2026MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Combines low-level data, layout, and DOM primitives for custom graph visualizations.

Downloads / mo
125.9M
Stars
114.0K
Last release
7.9.2
License
ISC

Strengths

  • Controls graph rendering directly. Compose SVG or Canvas graphics instead of adopting a fixed graph interface.
  • Computes layouts separately from drawing. Run force simulations over node objects and draw the positions in application code.

Limitations

  • Graph interfaces require composition. Build rendering and interaction from primitives rather than a ready-made graph widget.
  • Force simulation mutates input nodes. Copy node objects when the application must preserve their original values.

Quickstart

From getting-started.md
$ npm install d3


import * as d3 from "https://cdn.jsdelivr.net/npm/d3@7/+esm";

// Declare the chart dimensions and margins.
const width = 640;
const height = 400;
const marginTop = 20;
const marginRight = 20;
const marginBottom = 30;
const marginLeft = 40;

// Declare the x (horizontal position) scale.
const x = d3.scaleUtc()
    .domain([new Date("2023-01-01"), new Date("2024-01-01")])
    .range([marginLeft, width - marginRight]);

// Declare the y (vertical position) scale.
const y = d3.scaleLinear()
    .domain([0, 100])
    .range([height - marginBottom, marginTop]);

// Create the SVG container.
const svg = d3.create("svg")
    .attr("width", width)
    .attr("height", height);

// Add the x-axis.
svg.append("g")
    .attr("transform", `translate(0,${height - marginBottom})`)
    .call(d3.axisBottom(x));

// Add the y-axis.
svg.append("g")
    .attr("transform", `translate(${marginLeft},0)`)
    .call(d3.axisLeft(y));

// Append the SVG element.
container.append(svg.node());

D3 examples

From open-source projects on GitHub

Combines interactive graph visualization, styling, layouts, and graph-analysis operations.

Downloads / mo
100.3M
Stars
11.3K
Last release
3.35.0
License
MIT

Strengths

  • Combines analysis with graph interaction. Run graph-analysis operations alongside an interactive network visualization.
  • Exports the rendered graph. Save the current view or the entire graph as PNG.

Limitations

  • Image export needs rendered graphs. Use a rendered instance; headless analysis cannot produce image exports.
  • Labels increase drawing cost. Show labels selectively to reduce graph rendering work.

Quickstart

From getting-started.md
$ npm install cytoscape
import cytoscape from 'cytoscape';

var cy = cytoscape({
  container: document.getElementById('cy') // container to render in
});

// can use reference to eles later
var eles = cy.add([
  { group: 'nodes', data: { id: 'n0' }, position: { x: 100, y: 100 } },
  { group: 'nodes', data: { id: 'n1' }, position: { x: 200, y: 200 } },
  { group: 'edges', data: { id: 'e0', source: 'n0', target: 'n1' } }
]);

Cytoscape.js examples

From open-source projects on GitHub

Apache ECharts

Draws interactive charts and data visualizations in the browser.

Downloads / mo
38.3M
Stars
67.8K
Last release
6.1.0
License
Apache-2.0

Strengths

  • Includes a graph series. Set the graph series layout to force or circular to arrange nodes and links.

Quickstart

From Get started docs
$ npm install echarts

      // Initialize the echarts instance based on the prepared dom
      var myChart = echarts.init(document.getElementById('main'));

      // Specify the configuration items and data for the chart
      var option = {
        title: {
          text: 'ECharts Getting Started Example'
        },
        tooltip: {},
        legend: {
          data: ['sales']
        },
        xAxis: {
          data: ['Shirts', 'Cardigans', 'Chiffons', 'Pants', 'Heels', 'Socks']
        },
        yAxis: {},
        series: [
          {
            name: 'sales',
            type: 'bar',
            data: [5, 20, 36, 10, 10, 20]
          }
        ]
      };

      // Display the chart using the configuration and the data defined above.
      myChart.setOption(option);

Apache ECharts examples

From open-source projects on GitHub

Highcharts

Adds force-directed network graphs to Highcharts through the networkgraph module.

Downloads / mo
13.5M
Stars
240
Last release
13.1.1
License
https://www.highcharts.com/license

Strengths

  • Takes a list of links. Pass an array of links, each with a start node and an end node.

Limitations

  • Needs an extra module. Load the networkgraph module after the main Highcharts script.

Quickstart

From your-first-chart.md
$ npm install highcharts
    document.addEventListener('DOMContentLoaded', function () {
        const chart = Highcharts.chart('container', {
            chart: {
                type: 'bar'
            },
            title: {
                text: 'Fruit Consumption'
            },
            xAxis: {
                categories: ['Apples', 'Bananas', 'Oranges']
            },
            yAxis: {
                title: {
                    text: 'Fruit eaten'
                }
            },
            series: [{
                name: 'Jane',
                data: [1, 0, 4]
            }, {
                name: 'John',
                data: [5, 7, 3]
            }]
        });
    });

force-graph

Draws a two-dimensional force-directed graph on an HTML5 canvas.

Downloads / mo
5.6M
Stars
2.2K
Last release
1.52.0
License
MIT

Strengths

  • Built-in pointer interactions. Zoom, pan, drag nodes, and handle hover and click events on nodes and links.
  • Has React bindings. Use the react-force-graph package to render the same graph in React.

Quickstart

From index.html
$ npm install force-graph

    // Random tree
    const N = 300;
    const gData = {
      nodes: [...Array(N).keys()].map(i => ({ id: i })),
      links: [...Array(N).keys()]
        .filter(id => id)
        .map(id => ({
          source: id,
          target: Math.round(Math.random() * (id-1))
        }))
    };

    const Graph = new ForceGraph(document.getElementById('graph'))
        .linkDirectionalParticles(2)
        .graphData(gData);

vis-network

Displays interactive node-and-edge networks using Canvas, configurable styles and a physics engine.

Downloads / mo
4.2M
Stars
3.6K
Last release
10.1.5
License
MIT

Strengths

  • Includes physics-based node positioning. Use the physics simulation to arrange nodes and edges.
  • Clusters larger network views. Group nodes into clusters to reduce the visible network.

Limitations

  • Hierarchical layout overrides other settings. Expect its own physics solver and static smooth edges in hierarchical mode.
  • Random layouts vary between runs. Set randomSeed when the initial layout must be repeatable.

Quickstart

From README.md
$ npm install vis-network

    // create an array with nodes
    var nodes = new vis.DataSet([
        {id: 1, label: 'Node 1'},
        {id: 2, label: 'Node 2'},
        {id: 3, label: 'Node 3'},
        {id: 4, label: 'Node 4'},
        {id: 5, label: 'Node 5'}
    ]);

    // create an array with edges
    var edges = new vis.DataSet([
        {from: 1, to: 3},
        {from: 1, to: 2},
        {from: 2, to: 4},
        {from: 2, to: 5}
    ]);

    // create a network
    var container = document.getElementById('mynetwork');

    // provide the data in the vis format
    var data = {
        nodes: nodes,
        edges: edges
    };
    var options = {};

    // initialize your network!
    var network = new vis.Network(container, data, options);

Renders Graphology graph data through WebGL with customizable visual styles and interactive camera controls.

Downloads / mo
2.8M
Stars
12.2K
Last release
4.0.6
License
MIT

Strengths

  • Styles graphs through data attributes. Map graph attributes and state into node appearance rules.
  • Supports mouse and touch gestures. Pan, zoom, and interact with the graph through built-in gestures.

Limitations

  • Missing positions need external layouts. Compute node positions before rendering a graph that lacks coordinates.
  • Image export needs another package. Install the separate export-image companion package for image downloads.

Quickstart

From quickstart.mdx
$ npm install sigma graphology
import Graph from "graphology";
import Sigma from "sigma";

// Create a graph with graphology
const graph = new Graph();

// Add nodes with positions, sizes, colors, and labels
graph.addNode("1", {
  label: "Node 1",
  x: 0,
  y: 0,
  size: 1,
  color: "blue",
});
graph.addNode("2", {
  label: "Node 2",
  x: 5,
  y: 10,
  size: 1,
  color: "red",
});
graph.addNode("3", {
  label: "Node 3",
  x: 10,
  y: 0,
  size: 1,
  color: "green",
});

// Add edges between nodes
graph.addEdge("1", "2", { size: 1 });
graph.addEdge("2", "3", { size: 1 });
graph.addEdge("3", "1", { size: 1 });

// Render the graph in the container
const renderer = new Sigma(graph, document.getElementById("container"));

Sigma.js examples

From open-source projects on GitHub

3d-force-graph

Draws a three-dimensional force-directed graph with ThreeJS and the d3-force-3d layout engine.

Downloads / mo
2.6M
Stars
6.6K
Last release
1.80.2
License
MIT

Strengths

  • Renders with WebGL. ThreeJS draws the graph scene in WebGL.
  • Offers two physics engines. Choose d3-force-3d or ngraph to compute the layout.

Quickstart

From index.html
$ npm install 3d-force-graph

    // Random tree
    const N = 300;
    const gData = {
      nodes: [...Array(N).keys()].map(i => ({ id: i })),
      links: [...Array(N).keys()]
        .filter(id => id)
        .map(id => ({
          source: id,
          target: Math.round(Math.random() * (id-1))
        }))
    };

    const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
        .graphData(gData);

FAQ

Cytoscape.js fits interactive graphs that also need graph-analysis operations. Sigma.js draws large graphs with WebGL, vis-network arranges nodes with a built-in physics engine, and D3 fits fully custom graphics.

Cytoscape.js is a graph theory library for analysis and visualization. It runs graph-analysis operations on the same graph that it renders, styles, and lays out.

A force-directed graph positions nodes by simulating forces, where links pull connected nodes together and other nodes push apart. force-graph, vis-network, and D3 include force layouts.

Sigma.js renders graphs of thousands of nodes and edges with WebGL. It reads graph data from Graphology, a separate package, and needs an external layout when nodes lack positions.

The author of force-graph publishes React bindings as react-force-graph. The canvas version draws two-dimensional graphs, and 3d-force-graph draws them in three dimensions with ThreeJS.

For coding agents

Found your graph visualization library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official