From d1625e5a818bd143d24522b28c97d1762843facd Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Sat, 30 Nov 2024 11:56:25 -0500 Subject: [PATCH] fix: Move pie and arc generator definitions before usage to resolve initialization error --- .../static/html/eventual_convergence_viz.html | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hugo-site/static/html/eventual_convergence_viz.html b/hugo-site/static/html/eventual_convergence_viz.html index 8373b7fa..9b744160 100644 --- a/hugo-site/static/html/eventual_convergence_viz.html +++ b/hugo-site/static/html/eventual_convergence_viz.html @@ -93,6 +93,13 @@

Freenet Eventual Convergence Simulation

const width = Math.min(window.innerWidth - 40, 1200); const height = Math.min(window.innerHeight - 200, 800); + const arcGenerator = d3.arc().innerRadius(0).outerRadius(10); + const messageArcGenerator = d3.arc().innerRadius(0).outerRadius(5); + const pieGenerator = d3 + .pie() + .value(1) // Each segment has equal weight + .sort(null); // Do not sort, keep original order + let root = d3 .stratify() .id((d) => d.id) @@ -188,14 +195,6 @@

Freenet Eventual Convergence Simulation

initializeVisualization(); } - const arcGenerator = d3.arc().innerRadius(0).outerRadius(10); - - const messageArcGenerator = d3.arc().innerRadius(0).outerRadius(5); - - const pieGenerator = d3 - .pie() - .value(1) // Each segment has equal weight - .sort(null); // Do not sort, keep original order function drawPie(nodeGroup, allColors) { let displayColors;