3d-force-graph 1.73.6 → 1.74.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/3d-force-graph.d.ts +8 -5
- package/dist/3d-force-graph.js +25528 -38304
- package/dist/3d-force-graph.js.map +1 -1
- package/dist/3d-force-graph.min.js +3 -3
- package/example/async-load/index.html +1 -2
- package/example/auto-colored/index.html +1 -2
- package/example/basic/index.html +1 -2
- package/example/bloom-effect/index.html +1 -2
- package/example/camera-auto-orbit/index.html +1 -2
- package/example/click-to-focus/index.html +1 -2
- package/example/collision-detection/index.html +1 -2
- package/example/controls-fly/index.html +1 -2
- package/example/controls-orbit/index.html +1 -2
- package/example/curved-links/index.html +1 -2
- package/example/custom-node-geometry/index.html +1 -2
- package/example/dag-yarn/index.html +2 -3
- package/example/directional-links-arrows/index.html +1 -2
- package/example/directional-links-particles/index.html +1 -2
- package/example/dynamic/index.html +1 -1
- package/example/emit-particles/index.html +1 -2
- package/example/expandable-nodes/index.html +1 -1
- package/example/fit-to-canvas/index.html +1 -2
- package/example/fix-dragged-nodes/index.html +1 -2
- package/example/gradient-links/index.html +1 -2
- package/example/highlight/index.html +1 -2
- package/example/html-nodes/index.html +1 -2
- package/example/img-nodes/index.html +1 -2
- package/example/large-graph/index.html +1 -1
- package/example/manipulate-link-force/index.html +1 -2
- package/example/multi-selection/index.html +1 -2
- package/example/pause-resume/index.html +1 -2
- package/example/responsive/index.html +1 -2
- package/example/scene/index.html +1 -2
- package/example/text-links/index.html +1 -2
- package/example/text-nodes/index.html +1 -2
- package/example/tree/index.html +2 -3
- package/package.json +6 -6
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
<div id="3d-graph"></div>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
const Graph = ForceGraph3D()
|
|
13
|
-
(document.getElementById('3d-graph'))
|
|
12
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
14
13
|
.jsonUrl('../datasets/miserables.json')
|
|
15
14
|
.nodeLabel('id')
|
|
16
15
|
.nodeAutoColorBy('group');
|
|
@@ -25,8 +25,7 @@
|
|
|
25
25
|
}))
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const Graph = ForceGraph3D()
|
|
29
|
-
(document.getElementById('3d-graph'))
|
|
28
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
30
29
|
.nodeAutoColorBy('group')
|
|
31
30
|
.linkAutoColorBy(d => gData.nodes[d.source].group)
|
|
32
31
|
.linkOpacity(0.5)
|
package/example/basic/index.html
CHANGED
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
<script type="module">
|
|
13
13
|
import { UnrealBloomPass } from '//unpkg.com/three/examples/jsm/postprocessing/UnrealBloomPass.js';
|
|
14
14
|
|
|
15
|
-
const Graph = ForceGraph3D()
|
|
16
|
-
(document.getElementById('3d-graph'))
|
|
15
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
17
16
|
.backgroundColor('#000003')
|
|
18
17
|
.jsonUrl('../datasets/miserables.json')
|
|
19
18
|
.nodeLabel('id')
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
const distance = 1400;
|
|
25
25
|
|
|
26
|
-
const Graph = ForceGraph3D()
|
|
27
|
-
(document.getElementById('3d-graph'))
|
|
26
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
28
27
|
.enableNodeDrag(false)
|
|
29
28
|
.enableNavigationControls(false)
|
|
30
29
|
.showNavInfo(false)
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
<div id="3d-graph"></div>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
const Graph = ForceGraph3D({ controlType: 'fly' })
|
|
13
|
-
(document.getElementById('3d-graph'))
|
|
12
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'), { controlType: 'fly' })
|
|
14
13
|
.jsonUrl('../datasets/miserables.json')
|
|
15
14
|
.nodeLabel('id')
|
|
16
15
|
.nodeAutoColorBy('group');
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
<div id="3d-graph"></div>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
const Graph = ForceGraph3D({ controlType: 'orbit' })
|
|
13
|
-
(document.getElementById('3d-graph'))
|
|
12
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'), { controlType: 'orbit' })
|
|
14
13
|
.jsonUrl('../datasets/miserables.json')
|
|
15
14
|
.nodeLabel('id')
|
|
16
15
|
.nodeAutoColorBy('group');
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
}))
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const Graph = ForceGraph3D()
|
|
27
|
-
(document.getElementById('3d-graph'))
|
|
26
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
28
27
|
.nodeThreeObject(({ id }) => new THREE.Mesh(
|
|
29
28
|
[
|
|
30
29
|
new THREE.BoxGeometry(Math.random() * 20, Math.random() * 20, Math.random() * 20),
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
.onChange(orientation => graph && graph.dagMode(orientation));
|
|
25
25
|
|
|
26
26
|
// graph config
|
|
27
|
-
const graph = ForceGraph3D()
|
|
27
|
+
const graph = new ForceGraph3D(document.getElementById('graph'))
|
|
28
28
|
.backgroundColor('#101020')
|
|
29
29
|
.linkColor(() => 'rgba(255, 255, 255, 0.6)')
|
|
30
30
|
.dagMode('lr')
|
|
@@ -67,8 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
graph
|
|
71
|
-
.graphData({ nodes, links });
|
|
70
|
+
graph.graphData({ nodes, links });
|
|
72
71
|
});
|
|
73
72
|
</script>
|
|
74
73
|
</body>
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
<div id="3d-graph"></div>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
const Graph = ForceGraph3D()
|
|
13
|
-
(document.getElementById('3d-graph'))
|
|
12
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
14
13
|
.jsonUrl('../datasets/miserables.json')
|
|
15
14
|
.nodeLabel('id')
|
|
16
15
|
.nodeAutoColorBy('group')
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
}))
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const Graph = ForceGraph3D()
|
|
35
|
-
(document.getElementById('3d-graph'))
|
|
34
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
36
35
|
.linkDirectionalParticleColor(() => 'red')
|
|
37
36
|
.linkDirectionalParticleWidth(4)
|
|
38
37
|
.linkHoverPrecision(10)
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
const elem = document.getElementById('3d-graph');
|
|
53
|
-
const Graph = ForceGraph3D(
|
|
53
|
+
const Graph = new ForceGraph3D(elem)
|
|
54
54
|
.graphData(getPrunedTree())
|
|
55
55
|
.linkDirectionalParticles(2)
|
|
56
56
|
.nodeColor(node => !node.childLinks.length ? 'green' : node.collapsed ? 'red' : 'yellow')
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
<div id="3d-graph"></div>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
const Graph = ForceGraph3D()
|
|
13
|
-
(document.getElementById('3d-graph'))
|
|
12
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
14
13
|
.jsonUrl('../datasets/miserables.json')
|
|
15
14
|
.nodeLabel('id')
|
|
16
15
|
.nodeAutoColorBy('group')
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
const nodeColorScale = d3.scaleOrdinal(d3.schemeRdYlGn[4]);
|
|
29
29
|
|
|
30
|
-
const Graph = ForceGraph3D()
|
|
31
|
-
(document.getElementById('3d-graph'))
|
|
30
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
32
31
|
.nodeColor(node => nodeColorScale(node.id))
|
|
33
32
|
.linkThreeObject(link => {
|
|
34
33
|
// 2 (nodes) x 3 (r+g+b) bytes between [0, 1]
|
|
@@ -40,8 +40,7 @@
|
|
|
40
40
|
const highlightLinks = new Set();
|
|
41
41
|
let hoverNode = null;
|
|
42
42
|
|
|
43
|
-
const Graph = ForceGraph3D()
|
|
44
|
-
(document.getElementById('3d-graph'))
|
|
43
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
45
44
|
.graphData(gData)
|
|
46
45
|
.nodeColor(node => highlightNodes.has(node) ? node === hoverNode ? 'rgb(255,0,0,1)' : 'rgba(255,160,0,0.8)' : 'rgba(0,255,255,0.6)')
|
|
47
46
|
.linkWidth(link => highlightLinks.has(link) ? 4 : 1)
|
|
@@ -22,10 +22,9 @@
|
|
|
22
22
|
<script type="module">
|
|
23
23
|
import { CSS2DRenderer, CSS2DObject } from '//unpkg.com/three/examples/jsm/renderers/CSS2DRenderer.js';
|
|
24
24
|
|
|
25
|
-
const Graph = ForceGraph3D({
|
|
25
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'), {
|
|
26
26
|
extraRenderers: [new CSS2DRenderer()]
|
|
27
27
|
})
|
|
28
|
-
(document.getElementById('3d-graph'))
|
|
29
28
|
.jsonUrl('../datasets/miserables.json')
|
|
30
29
|
.nodeAutoColorBy('group')
|
|
31
30
|
.nodeThreeObject(node => {
|
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
}))
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const Graph = ForceGraph3D()
|
|
28
|
-
(document.getElementById('3d-graph'))
|
|
27
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
29
28
|
.nodeThreeObject(({ img }) => {
|
|
30
29
|
const imgTexture = new THREE.TextureLoader().load(`./imgs/${img}`);
|
|
31
30
|
imgTexture.colorSpace = THREE.SRGBColorSpace;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<script>
|
|
13
13
|
const elem = document.getElementById('3d-graph');
|
|
14
14
|
|
|
15
|
-
const Graph = ForceGraph3D(
|
|
15
|
+
const Graph = new ForceGraph3D(elem)
|
|
16
16
|
.jsonUrl('../datasets/blocks.json')
|
|
17
17
|
.nodeAutoColorBy('user')
|
|
18
18
|
.nodeLabel(node => `${node.user}: ${node.description}`)
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
}))
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const graph = ForceGraph3D()
|
|
27
|
-
(document.getElementById('3d-graph'))
|
|
26
|
+
const graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
28
27
|
.nodeLabel(node => node.id)
|
|
29
28
|
.linkColor(link => link.color ? 'red' : 'green' )
|
|
30
29
|
.linkOpacity(1)
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
let selectedNodes = new Set();
|
|
25
25
|
|
|
26
|
-
const Graph = ForceGraph3D()
|
|
27
|
-
(document.getElementById('3d-graph'))
|
|
26
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
28
27
|
.graphData(gData)
|
|
29
28
|
.nodeRelSize(9)
|
|
30
29
|
.nodeColor(node => selectedNodes.has(node) ? 'yellow' : 'grey')
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
const distance = 1400;
|
|
33
33
|
|
|
34
34
|
let isRotationActive = true;
|
|
35
|
-
const Graph = ForceGraph3D()
|
|
36
|
-
(document.getElementById('3d-graph'))
|
|
35
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
37
36
|
.enableNodeDrag(false)
|
|
38
37
|
.enableNavigationControls(false)
|
|
39
38
|
.showNavInfo(false)
|
package/example/scene/index.html
CHANGED
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
<script type="module">
|
|
13
13
|
import SpriteText from "//unpkg.com/three-spritetext/dist/three-spritetext.mjs";
|
|
14
14
|
|
|
15
|
-
const Graph = ForceGraph3D()
|
|
16
|
-
(document.getElementById('3d-graph'))
|
|
15
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
17
16
|
.jsonUrl('../datasets/miserables.json')
|
|
18
17
|
.nodeLabel('id')
|
|
19
18
|
.nodeAutoColorBy('group')
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
<script type="module">
|
|
13
13
|
import SpriteText from "//unpkg.com/three-spritetext/dist/three-spritetext.mjs";
|
|
14
14
|
|
|
15
|
-
const Graph = ForceGraph3D()
|
|
16
|
-
(document.getElementById('3d-graph'))
|
|
15
|
+
const Graph = new ForceGraph3D(document.getElementById('3d-graph'))
|
|
17
16
|
.jsonUrl('../datasets/miserables.json')
|
|
18
17
|
.nodeAutoColorBy('group')
|
|
19
18
|
.nodeThreeObject(node => {
|
package/example/tree/index.html
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
// graph config
|
|
24
24
|
const NODE_REL_SIZE = 1;
|
|
25
|
-
const graph = ForceGraph3D()
|
|
25
|
+
const graph = new ForceGraph3D(document.getElementById('graph'))
|
|
26
26
|
.dagMode('td')
|
|
27
27
|
.dagLevelDistance(200)
|
|
28
28
|
.backgroundColor('#101020')
|
|
@@ -69,8 +69,7 @@
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
graph
|
|
73
|
-
.graphData({ nodes, links });
|
|
72
|
+
graph.graphData({ nodes, links });
|
|
74
73
|
});
|
|
75
74
|
</script>
|
|
76
75
|
</body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "3d-force-graph",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.74.1",
|
|
4
4
|
"description": "UI component for a 3D force-directed graph using ThreeJS and d3-force-3d layout engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"unpkg": "dist/3d-force-graph.min.js",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"accessor-fn": "1",
|
|
50
|
-
"kapsule": "1",
|
|
50
|
+
"kapsule": "^1.16",
|
|
51
51
|
"three": ">=0.118 <1",
|
|
52
52
|
"three-forcegraph": "1",
|
|
53
|
-
"three-render-objects": "^1.
|
|
53
|
+
"three-render-objects": "^1.32"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@babel/core": "^7.26.0",
|
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
"@rollup/plugin-commonjs": "^28.0.1",
|
|
60
60
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
61
61
|
"@rollup/plugin-terser": "^0.4.4",
|
|
62
|
-
"postcss": "^8.4.
|
|
62
|
+
"postcss": "^8.4.49",
|
|
63
63
|
"rimraf": "^6.0.1",
|
|
64
|
-
"rollup": "^4.
|
|
64
|
+
"rollup": "^4.28.0",
|
|
65
65
|
"rollup-plugin-dts": "^6.1.1",
|
|
66
66
|
"rollup-plugin-postcss": "^4.0.2",
|
|
67
|
-
"typescript": "^5.
|
|
67
|
+
"typescript": "^5.7.2"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": ">=12"
|