diff --git a/hugo-site/static/js/small-world-comparison.js b/hugo-site/static/js/small-world-comparison.js index 44a49a1b..0f9f0ed7 100644 --- a/hugo-site/static/js/small-world-comparison.js +++ b/hugo-site/static/js/small-world-comparison.js @@ -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; @@ -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();