Added comment to jitter calculation

This commit is contained in:
2025-07-11 10:49:19 +02:00
parent 4448fd2c39
commit 5fa8d1fa3d

View File

@@ -91,6 +91,9 @@ class _GraphViewState extends State<GraphView> {
cumulativeScores[i].length, cumulativeScores[i].length,
(j) => ( (j) => (
j + 1, j + 1,
// Add a small jitter to the cumulative scores to prevent overlapping data points in the graph.
// The jitter is centered around zero by subtracting playerCount ~/ 2 from the player index i.
cumulativeScores[i][j] + (i - playerCount ~/ 2) * jitterStep cumulativeScores[i][j] + (i - playerCount ~/ 2) * jitterStep
), ),
); );