Graph starts at round 0 now where all players have 0 points
This commit is contained in:
@@ -88,15 +88,28 @@ class _GraphViewState extends State<GraphView> {
|
|||||||
/// Each series contains data points for each round
|
/// Each series contains data points for each round
|
||||||
return List.generate(playerCount, (i) {
|
return List.generate(playerCount, (i) {
|
||||||
final data = List.generate(
|
final data = List.generate(
|
||||||
|
cumulativeScores[i].length + 1,
|
||||||
|
(j) => (
|
||||||
|
j,
|
||||||
|
j == 0
|
||||||
|
? 0 // 0 Points at at the start of the game
|
||||||
|
|
||||||
|
// Adds 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 - 1] + (i - playerCount ~/ 2) * jitterStep
|
||||||
|
),
|
||||||
|
); /*List.generate(
|
||||||
cumulativeScores[i].length,
|
cumulativeScores[i].length,
|
||||||
(j) => (
|
(j) => (
|
||||||
j + 1,
|
j,
|
||||||
|
j == 0
|
||||||
|
? 0 // In Runde 0 immer 0 Punkte
|
||||||
|
:
|
||||||
// Add a small jitter to the cumulative scores to prevent overlapping data points in the graph.
|
// 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.
|
// 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
|
||||||
),
|
),
|
||||||
);
|
);*/
|
||||||
|
|
||||||
/// Create a LineSeries for the player
|
/// Create a LineSeries for the player
|
||||||
/// The xValueMapper maps the round number, and the yValueMapper maps the cumulative score.
|
/// The xValueMapper maps the round number, and the yValueMapper maps the cumulative score.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: cabo_counter
|
|||||||
description: "Mobile app for the card game Cabo"
|
description: "Mobile app for the card game Cabo"
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.4.3+479
|
version: 0.4.3+481
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|||||||
Reference in New Issue
Block a user