From a38c0a1927c8dda87719621ed1f8740dd3ce78c9 Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Wed, 27 Nov 2024 00:46:20 -0600 Subject: [PATCH] fix: Adjust canvas and SVG sizing, remove unused code, and reduce initial network size --- .../layouts/shortcodes/small-world-scale.html | 6 +++--- hugo-site/static/js/small-world-scale.js | 16 +--------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/hugo-site/layouts/shortcodes/small-world-scale.html b/hugo-site/layouts/shortcodes/small-world-scale.html index 861ff9c4..f00aa685 100644 --- a/hugo-site/layouts/shortcodes/small-world-scale.html +++ b/hugo-site/layouts/shortcodes/small-world-scale.html @@ -12,9 +12,9 @@
- -
- + +
+
diff --git a/hugo-site/static/js/small-world-scale.js b/hugo-site/static/js/small-world-scale.js index 005b7304..1c5bc1e8 100644 --- a/hugo-site/static/js/small-world-scale.js +++ b/hugo-site/static/js/small-world-scale.js @@ -173,20 +173,6 @@ waitForD3().then(() => { } } - // Select evenly spaced reference nodes - for (let i = 0; i < numReferenceNodes; i++) { - referenceNodes.push(peers[i * stride]); - } - - // Increased sampling for better averages - const samplesPerRef = Math.min( - Math.ceil(numPeers * 0.9), // Sample up to 90% of nodes - 90 // but cap at 90 samples per reference node - ); - - let totalLength = 0; - let pathCount = 0; - return pathCount > 0 ? totalLength / pathCount : 0; } @@ -464,7 +450,7 @@ waitForD3().then(() => { function reset() { cancelAnimationFrame(animationFrame); isSimulating = false; - numPeers = 30; + numPeers = 3; averagePathLengths = [ { numPeers: 0,