fix(export): prevent vis-network stack overflow crash on HTML render

Resolves the `BarnesHutSolver.js` maximum call stack size exceeded 
error. By explicitly initializing node X/Y coordinates using a 
sunflower spiral (Fermat's spiral) formula, nodes no longer spawn 
stacked on top of each other. This prevents `avoidOverlap` physics 
forces from dividing by zero and exploding into infinite values 
on the very first frame.
This commit is contained in:
Sanjaiyan Parthipan authored and GitHub committed 2026-09-20 22:01:24 +05:30
1 parent b9cd957072
commit a20b3593bd
1 file changed
+2
+2
View File
@@ -151,6 +151,8 @@ function esc(s) {{
const nodesDS = new vis.DataSet(RAW_NODES.map(n => ({{
id: n.id, label: n.label, color: n.color, size: n.size,
font: n.font, title: n.title,
x: 30 * Math.sqrt(i) * Math.cos(i * 2.4),
y: 30 * Math.sqrt(i) * Math.sin(i * 2.4),
_community: n.community, _community_name: n.community_name,
_source_file: n.source_file, _file_type: n.file_type, _degree: n.degree,
}})));