D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
biovisualize
Full window
Github gist
Network viz, 2d version
<html> <head> <script src="//unpkg.com/force-graph"></script> <style> body { margin: 0; } </style> </head> <body> <div id="graph"></div> <script> function drawGraph(_data) { const elem = document.getElementById('graph') const distance = 800 let highlightNodes = []; const Graph = ForceGraph()(elem) .graphData(_data) .nodeLabel(node => node.id) .backgroundColor("#121212") .enableZoomPanInteraction(false) .zoom(1.2) window.addEventListener("resize", () => Graph.width(window.innerWidth)); } fetch("https://gist.githubusercontent.com/biovisualize/18118a0df56f25136eb6c2440ce4472f/raw/e0a230e0e6942770d52b88064a422ff023850afa/top20b_airports.js") .then(response => response.text()) .then((data) => { drawGraph(JSON.parse(data)) }) </script> </body> </html>
https://unpkg.com/force-graph