Skip to content

Commit a1f9e94

Browse files
committed
fix position
1 parent 3533aba commit a1f9e94

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

app/containers/Inspect.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ const Inspect = () => {
1313
.onChange(orientation => graph && graph.dagMode(orientation));
1414

1515
// graph config
16-
const NODE_REL_SIZE = 1;
16+
const NODE_REL_SIZE = 3;
1717
const graph = ForceGraph3D()
1818
.dagMode('td')
19-
.dagLevelDistance(200)
19+
.dagLevelDistance(50)
2020
.backgroundColor('#101020')
2121
.linkColor(() => 'rgba(255,255,255,0.2)')
2222
.nodeRelSize(NODE_REL_SIZE)
@@ -98,7 +98,12 @@ const Inspect = () => {
9898
});
9999

100100
graph(document.getElementById('graph'))
101-
.graphData({ nodes, links });
101+
.graphData({ nodes, links })
102+
.onNodeDragEnd(node => {
103+
node.fx = node.x;
104+
node.fy = node.y;
105+
node.fz = node.z;
106+
});
102107
});
103108
}, []);
104109

0 commit comments

Comments
 (0)