Last active
April 22, 2021 23:29
-
-
Save vasturiano/bcfc5baa9e7998fb97b3091d2499fe16 to your computer and use it in GitHub Desktop.
Revisions
-
vasturiano revised this gist
Apr 22, 2021 . 2 changed files with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ <script src="//unpkg.com/3d-force-graph@1"></script> <script src="//unpkg.com/d3-octree"></script> <script src="//unpkg.com/d3-force-3d"></script> </head> <body> LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed. -
vasturiano revised this gist
Mar 12, 2018 . 2 changed files with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,7 @@ .d3Force('collide', d3.forceCollide(16)) .nodeRelSize(8) .nodeColor(d => d.type === 'a' ? 'brown' : 'steelblue') .enableNodeDrag(false) .graphData({ nodes, links: [] }) (document.getElementById('3d-graph')); </script> LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed. -
vasturiano revised this gist
Jan 9, 2018 . 1 changed file with 1 addition and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,5 @@ <head> <style> body { margin: 0; } </style> <script src="//unpkg.com/3d-force-graph@1"></script> -
vasturiano revised this gist
Jan 7, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ 3D version of [mbostock](https://bl.ocks.org/mbostock)'s [Radial Force](https://bl.ocks.org/mbostock/cd98bf52e9067e26945edd95e8cf6ef9). The two classes of nodes are attracted to a sphere's surface with configured radius of 300px (red) and 600px (blue). Uses [3d-force-graph](https://github.com/vasturiano/3d-force-graph) for the ThreeJS/WebGL rendering and [d3-force-3d](https://github.com/vasturiano/d3-force-3d) for the 3D versions of the radial and collision forces. -
vasturiano revised this gist
Jan 7, 2018 . 2 changed files with 0 additions and 0 deletions.There are no files selected for viewing
LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed.LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed. -
vasturiano created this gist
Jan 7, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ <head> <style> body { margin: 0; font-family: Sans-serif; } </style> <script src="//unpkg.com/3d-force-graph@1"></script> <script src="//unpkg.com/d3-octree"></script> <script src="//unpkg.com/d3-force-3d@1"></script> </head> <body> <div id="3d-graph"></div> <script> const N = 700; const nodes = [...Array(N*4).keys()].map((n) => ({ type: n > N ? 'b' : 'a' })); ForceGraph3D() .d3AlphaDecay(0.01) .d3VelocityDecay(0.1) .d3Force('charge', null) // Deactivate existing charge .d3Force('radial', d3.forceRadial(d => d.type === 'a' ? 300 : 600)) .d3Force('collide', d3.forceCollide(16)) .nodeRelSize(8) .nodeColor(d => d.type === 'a' ? 'brown' : 'steelblue') .graphData({ nodes, links: [] }) (document.getElementById('3d-graph')); </script> </body>