Skip to content

Commit

Permalink
fix: Move dimensions definition to top-level scope to resolve referen…
Browse files Browse the repository at this point in the history
…ce error
  • Loading branch information
sanity committed Nov 27, 2024
1 parent e361824 commit 80e8fa0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hugo-site/static/js/small-world-comparison.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ waitForD3().then(() => {
});
}

// Define dimensions first - moved to top level
const margin = {top: 30, right: 60, bottom: 40, left: 60};
const svgWidth = 245;
const svgHeight = 245;
const width = svgWidth - margin.left - margin.right;
const height = svgHeight - margin.top - margin.bottom;

// Keep SVG reference
let statsSvg;

Expand Down Expand Up @@ -258,13 +265,6 @@ waitForD3().then(() => {
}
statsSvg.selectAll('*').remove();

// Define dimensions first
const margin = {top: 30, right: 60, bottom: 40, left: 60};
const svgWidth = 245;
const svgHeight = 245;
const width = svgWidth - margin.left - margin.right;
const height = svgHeight - margin.top - margin.bottom;

// Clear previous content
if (statsSvg) {
statsSvg.selectAll('*').remove();
Expand Down

0 comments on commit 80e8fa0

Please sign in to comment.