x
 
1
<!DOCTYPE html>
2
<html>
3
  <head>
4
    <meta charset="utf-8">
5
    <style>
6
      body {
7
        background-color: #000000;
8
        margin: 0;
9
        overflow: hidden;
10
      }
11
    </style>
12
  </head>
13
  <body>
14
    <script src="https://unpkg.com/@sdesalas/3d-force-graph@2.0.0/dist/3d-force-graph.min.js"></script>
15
    <script>
16
      
17
      const nodes = [
18
        { id: 1, name: 1 },
19
        { id: 2, name: 2 },
20
        { id: 3, name: 3 }
21
      ];
22
      const links = [
23
        {source: 1, target: 2, weight: 0},
24
        {source: 2, target: 3, weight: 0},
25
        {source: 3, target: 1, weight: 0}
26
      ];
27
28
      new ForceGraph3D(document.body, {
29
        forceEngine: 'ngraph',
30
        linkOpacityField: 'weight', 
31
        graphData: { nodes, links },
32
        nodeRelSize: 5
33
      });
34
35
    </script>
36
  </body>
37
</html>