Skip to content

Commit

Permalink
fix: Move pie and arc generator definitions before usage to resolve i…
Browse files Browse the repository at this point in the history
…nitialization error
  • Loading branch information
sanity committed Nov 30, 2024
1 parent 03f8518 commit d1625e5
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions hugo-site/static/html/eventual_convergence_viz.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ <h1 class="title">Freenet Eventual Convergence Simulation</h1>
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)
Expand Down Expand Up @@ -188,14 +195,6 @@ <h1 class="title">Freenet Eventual Convergence Simulation</h1>
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;
Expand Down

0 comments on commit d1625e5

Please sign in to comment.