Skip to content

Commit

Permalink
fix: Modify color propagation to preserve initial colors and limit ma…
Browse files Browse the repository at this point in the history
…x colors
  • Loading branch information
sanity committed Nov 30, 2024
1 parent a6daf40 commit f76b440
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hugo-site/static/html/eventual_convergence_viz.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ <h1 class="title">Freenet Eventual Convergence Simulation</h1>
});

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 {
Expand Down

0 comments on commit f76b440

Please sign in to comment.