From f76b440355b133c737e6dcd669cd403e0a5eb4d3 Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Sat, 30 Nov 2024 10:59:48 -0500 Subject: [PATCH] fix: Modify color propagation to preserve initial colors and limit max colors --- hugo-site/static/html/eventual_convergence_viz.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hugo-site/static/html/eventual_convergence_viz.html b/hugo-site/static/html/eventual_convergence_viz.html index 0c3dbea4..02a40e1c 100644 --- a/hugo-site/static/html/eventual_convergence_viz.html +++ b/hugo-site/static/html/eventual_convergence_viz.html @@ -211,10 +211,10 @@

Freenet Eventual Convergence Simulation

}); if (colorsAdded) { - // Ensure we only keep the MAX_COLORS most recent colors - target.data.receivedColors = target.data.receivedColors - .filter(c => globalColors.includes(c)) - .slice(-MAX_COLORS); + // Only trim to MAX_COLORS if we exceed it + if (target.data.receivedColors.length > MAX_COLORS) { + target.data.receivedColors = target.data.receivedColors.slice(-MAX_COLORS); + } updateNodeColors(target); } } finally {