Last active
October 23, 2025 13:36
-
-
Save vasturiano/02affe306ce445e423f992faeea13521 to your computer and use it in GitHub Desktop.
Revisions
-
vasturiano revised this gist
Jun 26, 2019 . 2 changed files with 4 additions and 8 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 @@ -13,7 +13,7 @@ function getGraphDataSets() { // const loadBlocks = function(Graph) { fetch('.blocks.json').then(r => r.json()).then(data => { data.nodes.forEach(node => { node.name = `${node.user?node.user+': ':''}${node.description || node.id}` }); Graph @@ -29,12 +29,9 @@ function getGraphDataSets() { // const loadD3Dependencies = function(Graph) { fetch('.d3.csv').then(r => r.text()).then(d3.csvParse).then(data => { const nodes = [], links = []; data.forEach(({ size, path }) => { const levels = path.split('/'), module = levels.length > 1 ? levels[1] : null, leaf = levels.pop(), 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,7 +1,6 @@ <head> <script src="//unpkg.com/3d-force-graph@1"></script> <script src="//unpkg.com/d3-dsv"></script> <script src="data-set-loader.js"></script> -
vasturiano revised this gist
Mar 18, 2018 . 1 changed file with 2 additions 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 @@ -9,11 +9,12 @@ </head> <body> <div id="3d-graph"></div> <div class="graph-data"> <span id="graph-data-description"></span> <button class="toggle-data-btn" onClick="toggleData()">Show me something else</button> </div> <script src="index.js"></script> </body> -
vasturiano revised this gist
Jan 5, 2018 . 1 changed file with 3 additions and 3 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 @@ -4,7 +4,7 @@ function getGraphDataSets() { Graph .cooldownTicks(200) .nodeLabel('id') .nodeAutoColorBy('group') .forceEngine('ngraph') .jsonUrl('.miserables.json'); }; @@ -19,7 +19,7 @@ function getGraphDataSets() { Graph .cooldownTicks(300) .cooldownTime(20000) .nodeAutoColorBy('user') .forceEngine('ngraph') .graphData(data); }); @@ -58,7 +58,7 @@ function getGraphDataSets() { .nodeId('path') .nodeVal('size') .nodeLabel('path') .nodeAutoColorBy('module') .forceEngine('ngraph') .graphData({ nodes: nodes, links: links }); }); -
vasturiano revised this gist
Jan 2, 2018 . 2 changed files with 5 additions and 5 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 @@ -3,7 +3,7 @@ function getGraphDataSets() { const loadMiserables = function(Graph) { Graph .cooldownTicks(200) .nodeLabel('id') .autoColorBy('group') .forceEngine('ngraph') .jsonUrl('.miserables.json'); @@ -55,9 +55,9 @@ function getGraphDataSets() { Graph .cooldownTicks(300) .nodeRelSize(0.5) .nodeId('path') .nodeVal('size') .nodeLabel('path') .autoColorBy('module') .forceEngine('ngraph') .graphData({ nodes: nodes, links: links }); 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,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@1"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Sep 19, 2017 . 1 changed file 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 @@ -1,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@1/dist/3d-force-graph.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Jul 4, 2017 . 1 changed file 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 @@ -1,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@1.5/dist/3d-force-graph.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Jul 4, 2017 . 1 changed file 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 @@ -1,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@1.4/dist/3d-force-graph.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Jun 28, 2017 . 1 changed file with 1 addition and 3 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 @@ -2,6 +2,4 @@ Cycle through various topological data sets using the button on the top-right. See also the [VR version](https://bl.ocks.org/vasturiano/972ca4f3e8e074dacf14d7071aad8ef9). -
vasturiano revised this gist
Jun 21, 2017 . 1 changed file 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 @@ -1,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@1.3/dist/3d-force-graph.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Jun 21, 2017 . 4 changed files with 3 additions and 3 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes.File renamed without changes.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 @@ -6,14 +6,14 @@ function getGraphDataSets() { .nameField('id') .autoColorBy('group') .forceEngine('ngraph') .jsonUrl('.miserables.json'); }; loadMiserables.description = "<em>Les Miserables</em> data (<a href='https://bl.ocks.org/mbostock/4062045'>4062045</a>)"; // const loadBlocks = function(Graph) { qwest.get('.blocks.json').then((_, data) => { data.nodes.forEach(node => { node.name = `${node.user?node.user+': ':''}${node.description || node.id}` }); Graph @@ -29,7 +29,7 @@ function getGraphDataSets() { // const loadD3Dependencies = function(Graph) { qwest.get('.d3.csv').then((_, csvData) => { const { data: [, ...data] } = Papa.parse(csvData); // Parse csv data.pop(); // Remove last empty row -
vasturiano revised this gist
May 10, 2017 . 1 changed file 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 @@ -1,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@1.3/dist/3d-force-graph.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
May 1, 2017 . 1 changed file 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 @@ -1,4 +1,4 @@ 3-dimensional representation of a force-directed iterative layout, using [3d-force-graph](https://github.com/vasturiano/3d-force-graph). This component uses [ThreeJS](https://github.com/mrdoob/three.js/)/WebGL for rendering and either [d3-force-3d](https://github.com/vasturiano/d3-force-3d) or [ngraph](https://github.com/anvaka/ngraph.forcelayout3d) for the 3D physics engine. Cycle through various topological data sets using the button on the top-right. -
vasturiano revised this gist
May 1, 2017 . 2 changed files with 5 additions 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 @@ -5,6 +5,7 @@ function getGraphDataSets() { .cooldownTicks(200) .nameField('id') .autoColorBy('group') .forceEngine('ngraph') .jsonUrl('miserables.json'); }; loadMiserables.description = "<em>Les Miserables</em> data (<a href='https://bl.ocks.org/mbostock/4062045'>4062045</a>)"; @@ -19,6 +20,7 @@ function getGraphDataSets() { .cooldownTicks(300) .cooldownTime(20000) .autoColorBy('user') .forceEngine('ngraph') .graphData(data); }); }; @@ -57,6 +59,7 @@ function getGraphDataSets() { .valField('size') .nameField('path') .autoColorBy('module') .forceEngine('ngraph') .graphData({ nodes: nodes, links: links }); }); }; @@ -86,6 +89,7 @@ function getGraphDataSets() { Graph .cooldownTicks(300) .forceEngine('ngraph') .graphData({ nodes: nodes, links: links }); }; tunnel.description = "fabric data for a cylindrical tunnel shape"; 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,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@1.2/dist/3d-force-graph.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Apr 30, 2017 . 1 changed file 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 @@ -1,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@1.1/dist/3d-force-graph.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Apr 29, 2017 . 2 changed files with 7 additions and 15 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,16 +1,11 @@ function getGraphDataSets() { const loadMiserables = function(Graph) { Graph .cooldownTicks(200) .nameField('id') .autoColorBy('group') .jsonUrl('miserables.json'); }; loadMiserables.description = "<em>Les Miserables</em> data (<a href='https://bl.ocks.org/mbostock/4062045'>4062045</a>)"; @@ -24,10 +19,7 @@ function getGraphDataSets() { .cooldownTicks(300) .cooldownTime(20000) .autoColorBy('user') .graphData(data); }); }; loadBlocks.description = "<em>Blocks</em> data (<a href='https://bl.ocks.org/mbostock/afecf1ce04644ad9036ca146d2084895'>afecf1ce04644ad9036ca146d2084895</a>)"; 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,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@1.0/dist/3d-force-graph.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Apr 28, 2017 . 1 changed file with 30 additions and 48 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,20 +1,14 @@ function getGraphDataSets() { const loadMiserables = function(Graph) { qwest.get('miserables.json').then((_, data) => { Graph .cooldownTicks(200) .nameField('id') .autoColorBy('group') .graphData({ nodes: data.nodes, links: data.links }); }); }; @@ -24,21 +18,15 @@ function getGraphDataSets() { const loadBlocks = function(Graph) { qwest.get('blocks.json').then((_, data) => { data.nodes.forEach(node => { node.name = `${node.user?node.user+': ':''}${node.description || node.id}` }); Graph .cooldownTicks(300) .cooldownTime(20000) .autoColorBy('user') .graphData({ nodes: data.nodes, links: data.links }); }); }; @@ -51,70 +39,64 @@ function getGraphDataSets() { const { data: [, ...data] } = Papa.parse(csvData); // Parse csv data.pop(); // Remove last empty row const nodes = [], links = []; data.forEach(([size, path]) => { const levels = path.split('/'), module = levels.length > 1 ? levels[1] : null, leaf = levels.pop(), parent = levels.join('/'); nodes.push({ path, leaf, module, size: +size || 1 }); if (parent) { links.push({ source: parent, target: path}); } }); Graph .cooldownTicks(300) .nodeRelSize(0.5) .idField('path') .valField('size') .nameField('path') .autoColorBy('module') .graphData({ nodes: nodes, links: links }); }); }; loadD3Dependencies.description = "<em>D3 dependencies</em> data (<a href='https://bl.ocks.org/mbostock/9a8124ccde3a4e9625bc413b48f14b30'>9a8124ccde3a4e9625bc413b48f14b30</a>)"; const tunnel = function(Graph) { const perimeter = 12, length = 30; const getId = (col, row) => `${col},${row}`; let nodes = [], links = []; for (let colIdx=0; colIdx<perimeter; colIdx++) { for (let rowIdx=0; rowIdx<length; rowIdx++) { const id = getId(colIdx, rowIdx); nodes.push({id}); // Link vertically if (rowIdx>0) { links.push({ source: getId(colIdx, rowIdx-1), target: id }); } // Link horizontally links.push({ source: getId((colIdx || perimeter) - 1, rowIdx), target: id }); } } Graph .cooldownTicks(300) .graphData({ nodes: nodes, links: links }); }; tunnel.description = "fabric data for a cylindrical tunnel shape"; // -
vasturiano revised this gist
Apr 21, 2017 . 2 changed files with 3 additions and 4 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 @@ -9,7 +9,6 @@ function getGraphDataSets() { data.nodes.forEach(node => { nodes[node.id] = node }); // Index by ID Graph .coolDownTicks(200) .nameAccessor(node => node.id) .colorAccessor(node => parseInt(colors[node.group%colors.length].slice(1),16)) @@ -34,7 +33,6 @@ function getGraphDataSets() { data.nodes.forEach(node => { nodes[node.id] = node }); // Index by ID Graph .coolDownTicks(600) .nameAccessor(node => `${node.user?node.user+': ':''}${node.description || node.id}`) .colorAccessor(node => parseInt(userColors[node.user || null].slice(1), 16)) @@ -80,7 +78,6 @@ function getGraphDataSets() { }); Graph .coolDownTicks(300) .nodeRelSize(0.5) .valAccessor(node => node.size) @@ -113,7 +110,7 @@ function getGraphDataSets() { } } Graph .coolDownTicks(300) .graphData({ nodes: nodes, links: links }); }; 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 @@ -9,6 +9,8 @@ let toggleData; curDataSetIdx = curDataSetIdx === undefined ? 0 : (curDataSetIdx+1)%dataSets.length; const dataSet = dataSets[curDataSetIdx]; Graph.resetProps(); // Wipe current state dataSet(Graph); // Load data set document.getElementById('graph-data-description').innerHTML = dataSet.description ? `Viewing ${dataSet.description}` : ''; })(); // IIFE init -
vasturiano revised this gist
Apr 21, 2017 . 2 changed files with 5 additions and 5 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 @@ -9,7 +9,7 @@ function getGraphDataSets() { data.nodes.forEach(node => { nodes[node.id] = node }); // Index by ID Graph .resetProps() .coolDownTicks(200) .nameAccessor(node => node.id) .colorAccessor(node => parseInt(colors[node.group%colors.length].slice(1),16)) @@ -34,7 +34,7 @@ function getGraphDataSets() { data.nodes.forEach(node => { nodes[node.id] = node }); // Index by ID Graph .resetProps() .coolDownTicks(600) .nameAccessor(node => `${node.user?node.user+': ':''}${node.description || node.id}`) .colorAccessor(node => parseInt(userColors[node.user || null].slice(1), 16)) @@ -80,7 +80,7 @@ function getGraphDataSets() { }); Graph .resetProps() .coolDownTicks(300) .nodeRelSize(0.5) .valAccessor(node => node.size) @@ -113,7 +113,7 @@ function getGraphDataSets() { } } Graph.resetProps() .coolDownTicks(300) .graphData({ nodes: nodes, links: links }); }; 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,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@0.5/dist/3d-force-graph.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Apr 20, 2017 . 1 changed file with 3 additions 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 @@ -2,4 +2,6 @@ Cycle through various topological data sets using the button on the top-right. See also [this version](https://bl.ocks.org/vasturiano/f59675656258d3f490e9faa40828c0e7) for 3D simulation using D3-force. And the [VR version](https://bl.ocks.org/vasturiano/972ca4f3e8e074dacf14d7071aad8ef9). -
vasturiano revised this gist
Apr 13, 2017 . 1 changed file 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 @@ -1,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@0.4/dist/3d-force-graph.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Mar 30, 2017 . 2 changed files with 5 additions 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 @@ -10,6 +10,7 @@ function getGraphDataSets() { Graph .resetState() .coolDownTicks(200) .nameAccessor(node => node.id) .colorAccessor(node => parseInt(colors[node.group%colors.length].slice(1),16)) .graphData({ @@ -34,6 +35,7 @@ function getGraphDataSets() { Graph .resetState() .coolDownTicks(600) .nameAccessor(node => `${node.user?node.user+': ':''}${node.description || node.id}`) .colorAccessor(node => parseInt(userColors[node.user || null].slice(1), 16)) .graphData({ @@ -79,6 +81,7 @@ function getGraphDataSets() { Graph .resetState() .coolDownTicks(300) .nodeRelSize(0.5) .valAccessor(node => node.size) .nameAccessor(node => node.path) @@ -111,6 +114,7 @@ function getGraphDataSets() { } Graph.resetState() .coolDownTicks(300) .graphData({ nodes: nodes, links: links }); }; tunnel.description = "fabric data for a cyllindrical tunnel shape"; 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,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@0.3/dist/3d-force-graph.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Mar 30, 2017 . 1 changed file 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 @@ -1,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@0.2/dist/3d-force-graph.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Mar 27, 2017 . 1 changed file with 3 additions 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 @@ -1,3 +1,5 @@ 3-dimensional representation of a force-directed iterative layout, using [3d-force-graph](https://github.com/vasturiano/3d-force-graph). This component uses [ThreeJS](https://github.com/mrdoob/three.js/)/WebGL for rendering and [ngraph](https://github.com/anvaka/ngraph.forcelayout3d) for the 3D physics engine. Cycle through various topological data sets using the button on the top-right. See also [this version](https://bl.ocks.org/vasturiano/f59675656258d3f490e9faa40828c0e7) for 3D simulation using D3-force. -
vasturiano revised this gist
Mar 27, 2017 . 1 changed file 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 @@ -1,5 +1,5 @@ <head> <script src="//unpkg.com/3d-force-graph@0.1.0/dist/3d-force-graph.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> -
vasturiano revised this gist
Mar 27, 2017 . 1 changed file 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 @@ -1,3 +1,3 @@ 3-dimensional representation of a force-directed iterative layout, using [3d-force-graph](https://github.com/vasturiano/3d-force-graph). This component uses [ThreeJS](https://github.com/mrdoob/three.js/)/WebGL for rendering and [ngraph](https://github.com/anvaka/ngraph.forcelayout3d) for the 3D physics engine. Cycle through various topological data sets using the button on the top-right. -
vasturiano revised this gist
Mar 26, 2017 . 4 changed files with 1 addition and 280 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,15 +0,0 @@ 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,258 +0,0 @@ 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,14 +1,10 @@ <head> <script src="//unpkg.com/[email protected]/dist/3d-force-graph.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/qwest/4.4.5/qwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.4/papaparse.min.js"></script> <script src="data-set-loader.js"></script> <link rel="stylesheet" href="style.css"> </head> 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,5 +1,3 @@ const Graph = ForceGraph3D() (document.getElementById("3d-graph")); -
vasturiano revised this gist
Mar 26, 2017 . 1 changed file with 2 additions 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 @@ -205,7 +205,8 @@ function ForceGraph3D() { ]; line.geometry.verticesNeedUpdate = true; line.geometry.computeBoundingSphere(); }); } } -
vasturiano revised this gist
Mar 7, 2017 . 1 changed file with 2 additions and 2 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 @@ -90,13 +90,13 @@ function getGraphDataSets() { const tunnel = function(Graph) { const perimeter = 15, length = 50; const getId = (col, row) => `${col},${row}`; let nodes = {}, links = []; for (let colIdx=0; colIdx<perimeter; colIdx++) { for (let rowIdx=0; rowIdx<length; rowIdx++) { const id = getId(colIdx, rowIdx); nodes[id] = {}; -
vasturiano revised this gist
Mar 7, 2017 . 1 changed file 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 @@ -113,7 +113,7 @@ function getGraphDataSets() { Graph.resetState() .graphData({ nodes: nodes, links: links }); }; tunnel.description = "fabric data for a cyllindrical tunnel shape"; // -
vasturiano revised this gist
Mar 7, 2017 . 1 changed file with 28 additions and 2 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 @@ -46,7 +46,7 @@ function getGraphDataSets() { // const loadD3Dependencies = function(Graph) { qwest.get('d3.csv').then((_, csvData) => { const { data: [, ...data] } = Papa.parse(csvData); // Parse csv data.pop(); // Remove last empty row @@ -88,8 +88,34 @@ function getGraphDataSets() { }; loadD3Dependencies.description = "<em>D3 dependencies</em> data (<a href='https://bl.ocks.org/mbostock/9a8124ccde3a4e9625bc413b48f14b30'>9a8124ccde3a4e9625bc413b48f14b30</a>)"; const tunnel = function(Graph) { const perimeter = 15, height = 50; const getId = (col, row) => `${col},${row}`; let nodes = {}, links = []; for (let colIdx=0; colIdx<perimeter; colIdx++) { for (let rowIdx=0; rowIdx<height; rowIdx++) { const id = getId(colIdx, rowIdx); nodes[id] = {}; // Link vertically if (rowIdx>0) { links.push([getId(colIdx, rowIdx-1), id]); } // Link horizontally links.push([getId((colIdx || perimeter) - 1, rowIdx), id]); } } Graph.resetState() .graphData({ nodes: nodes, links: links }); }; tunnel.description = "texture data for a cyllindrical tunnel shape"; // return [loadMiserables, loadBlocks, loadD3Dependencies, tunnel]; }
NewerOlder