index.html 733 B

1234567891011121314151617181920212223242526
  1. <head>
  2. <style> body { margin: 0; } </style>
  3. <script src="//unpkg.com/3d-force-graph"></script>
  4. <!-- <script src="../../dist/3d-force-graph.js"></script>-->
  5. </head>
  6. <body>
  7. <div id="3d-graph"></div>
  8. <script type="module">
  9. import { UnrealBloomPass } from '//cdn.skypack.dev/three/examples/jsm/postprocessing/UnrealBloomPass.js';
  10. const Graph = ForceGraph3D()
  11. (document.getElementById('3d-graph'))
  12. .jsonUrl('../datasets/miserables.json')
  13. .nodeLabel('id')
  14. .nodeAutoColorBy('group');
  15. const bloomPass = new UnrealBloomPass();
  16. bloomPass.strength = 3;
  17. bloomPass.radius = 1;
  18. bloomPass.threshold = 0.1;
  19. Graph.postProcessingComposer().addPass(bloomPass);
  20. </script>
  21. </body>