From b9c3e1dd4e70ba142569637b23f76b78867acc19 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 12 Jul 2025 21:03:27 +0200 Subject: [PATCH 01/10] Graph starts at round 0 now where all players have 0 points --- lib/presentation/views/graph_view.dart | 25 +++++++++++++++++++------ pubspec.yaml | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/presentation/views/graph_view.dart b/lib/presentation/views/graph_view.dart index e9ed4d1..4c03dd4 100644 --- a/lib/presentation/views/graph_view.dart +++ b/lib/presentation/views/graph_view.dart @@ -88,15 +88,28 @@ class _GraphViewState extends State { /// Each series contains data points for each round return List.generate(playerCount, (i) { 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, (j) => ( - 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 + 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. + // The jitter is centered around zero by subtracting playerCount ~/ 2 from the player index i. + cumulativeScores[i][j] + (i - playerCount ~/ 2) * jitterStep ), - ); + );*/ /// Create a LineSeries for the player /// The xValueMapper maps the round number, and the yValueMapper maps the cumulative score. diff --git a/pubspec.yaml b/pubspec.yaml index 2f82cdf..1440d14 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cabo_counter description: "Mobile app for the card game Cabo" publish_to: 'none' -version: 0.4.3+479 +version: 0.4.3+481 environment: sdk: ^3.5.4 From 5780155954c386d11ff81ab411b8fd5290a4b574 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 12 Jul 2025 21:03:51 +0200 Subject: [PATCH 02/10] Adjusted jitterStep --- lib/presentation/views/graph_view.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/presentation/views/graph_view.dart b/lib/presentation/views/graph_view.dart index 4c03dd4..9fa4e0a 100644 --- a/lib/presentation/views/graph_view.dart +++ b/lib/presentation/views/graph_view.dart @@ -82,7 +82,7 @@ class _GraphViewState extends State { } } - const double jitterStep = 0.15; + const double jitterStep = 0.05; /// Create a list of LineSeries for each player /// Each series contains data points for each round From 97da4cadffa6efa410cf41a034529ccc14acd038 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 13 Jul 2025 00:21:37 +0200 Subject: [PATCH 03/10] Removed dead code --- lib/presentation/views/graph_view.dart | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/presentation/views/graph_view.dart b/lib/presentation/views/graph_view.dart index 9fa4e0a..a6e6042 100644 --- a/lib/presentation/views/graph_view.dart +++ b/lib/presentation/views/graph_view.dart @@ -98,18 +98,7 @@ class _GraphViewState extends State { // 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, - (j) => ( - 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. - // The jitter is centered around zero by subtracting playerCount ~/ 2 from the player index i. - cumulativeScores[i][j] + (i - playerCount ~/ 2) * jitterStep - ), - );*/ + ); /// Create a LineSeries for the player /// The xValueMapper maps the round number, and the yValueMapper maps the cumulative score. From 0b1b71e227f7785a00a41e1dfd383ab72ae5dd62 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 13 Jul 2025 00:37:16 +0200 Subject: [PATCH 04/10] Updated Y-Axis and removed values under y = 0 --- lib/presentation/views/graph_view.dart | 11 +++++++---- pubspec.yaml | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/presentation/views/graph_view.dart b/lib/presentation/views/graph_view.dart index a6e6042..21f37d8 100644 --- a/lib/presentation/views/graph_view.dart +++ b/lib/presentation/views/graph_view.dart @@ -40,7 +40,10 @@ class _GraphViewState extends State { interval: 1, decimalPlaces: 0, ), - primaryYAxis: const NumericAxis(), + primaryYAxis: const NumericAxis( + interval: 1, + decimalPlaces: 0, + ), series: getCumulativeScores(), ), ) @@ -82,7 +85,7 @@ class _GraphViewState extends State { } } - const double jitterStep = 0.05; + const double jitterStep = 0.03; /// Create a list of LineSeries for each player /// Each series contains data points for each round @@ -91,8 +94,8 @@ class _GraphViewState extends State { cumulativeScores[i].length + 1, (j) => ( j, - j == 0 - ? 0 // 0 Points at at the start of the game + j == 0 || cumulativeScores[i][j - 1] == 0 + ? 0 // 0 Points at at the start of the game OR value is 0 (dont subtract jitter step) // 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. diff --git a/pubspec.yaml b/pubspec.yaml index 1440d14..c793316 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cabo_counter description: "Mobile app for the card game Cabo" publish_to: 'none' -version: 0.4.3+481 +version: 0.4.3+483 environment: sdk: ^3.5.4 From af630539dbf31edd8d6298f6ba20106c8cfe0d21 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 13 Jul 2025 00:46:32 +0200 Subject: [PATCH 05/10] Changed overflow mode --- lib/presentation/views/graph_view.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/presentation/views/graph_view.dart b/lib/presentation/views/graph_view.dart index 21f37d8..09aba16 100644 --- a/lib/presentation/views/graph_view.dart +++ b/lib/presentation/views/graph_view.dart @@ -35,7 +35,9 @@ class _GraphViewState extends State { padding: const EdgeInsets.fromLTRB(0, 100, 0, 0), child: SfCartesianChart( legend: const Legend( - isVisible: true, position: LegendPosition.bottom), + overflowMode: LegendItemOverflowMode.wrap, + isVisible: true, + position: LegendPosition.bottom), primaryXAxis: const NumericAxis( interval: 1, decimalPlaces: 0, From 7733d3bd5c8ba7f4c8f11dd4b3dca22ad52fac65 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 13 Jul 2025 00:55:28 +0200 Subject: [PATCH 06/10] Replaced string & if statement with visibility widget --- lib/presentation/views/active_game_view.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/presentation/views/active_game_view.dart b/lib/presentation/views/active_game_view.dart index 9ecae1b..704952a 100644 --- a/lib/presentation/views/active_game_view.dart +++ b/lib/presentation/views/active_game_view.dart @@ -121,7 +121,7 @@ class _ActiveGameViewState extends State { children: [ CupertinoListTile( title: Text( - AppLocalizations.of(context).statistics, + AppLocalizations.of(context).game_process, ), backgroundColorActivated: CustomTheme.backgroundColor, @@ -131,8 +131,9 @@ class _ActiveGameViewState extends State { builder: (_) => GraphView( gameSession: gameSession, )))), - if (!gameSession.isPointsLimitEnabled) - CupertinoListTile( + Visibility( + visible: !gameSession.isPointsLimitEnabled, + child: CupertinoListTile( title: Text( AppLocalizations.of(context).end_game, style: gameSession.roundNumber > 1 && @@ -148,6 +149,7 @@ class _ActiveGameViewState extends State { _showEndGameDialog(); } }), + ), CupertinoListTile( title: Text( AppLocalizations.of(context).delete_game, From fee6cc3a339f45c503255627f3c8bd01b5a77716 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 13 Jul 2025 00:56:32 +0200 Subject: [PATCH 07/10] updated accessability of graph view --- lib/presentation/views/graph_view.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/presentation/views/graph_view.dart b/lib/presentation/views/graph_view.dart index 09aba16..fe36de9 100644 --- a/lib/presentation/views/graph_view.dart +++ b/lib/presentation/views/graph_view.dart @@ -30,7 +30,7 @@ class _GraphViewState extends State { middle: Text(AppLocalizations.of(context).game_process), previousPageTitle: AppLocalizations.of(context).back, ), - child: widget.gameSession.roundNumber > 2 + child: widget.gameSession.roundNumber > 1 ? Padding( padding: const EdgeInsets.fromLTRB(0, 100, 0, 0), child: SfCartesianChart( From ee5319533a9e6f16b755e1469169bfb8617e5a90 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 13 Jul 2025 00:57:08 +0200 Subject: [PATCH 08/10] Changed string for GraphView title --- lib/l10n/arb/app_de.arb | 3 +-- lib/l10n/arb/app_en.arb | 4 +--- lib/l10n/generated/app_localizations.dart | 2 +- lib/l10n/generated/app_localizations_de.dart | 2 +- lib/l10n/generated/app_localizations_en.dart | 2 +- pubspec.yaml | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/l10n/arb/app_de.arb b/lib/l10n/arb/app_de.arb index 4b55a8d..b072d63 100644 --- a/lib/l10n/arb/app_de.arb +++ b/lib/l10n/arb/app_de.arb @@ -74,7 +74,6 @@ "done": "Fertig", "next_round": "Nächste Runde", - "statistics": "Statistiken", "end_game": "Spiel beenden", "delete_game": "Spiel löschen", "new_game_same_settings": "Neues Spiel mit gleichen Einstellungen", @@ -85,7 +84,7 @@ "end_game_message": "Möchtest du das Spiel beenden? Das Spiel wird als beendet markiert und kann nicht fortgeführt werden.", "game_process": "Spielverlauf", - "empty_graph_text": "Du musst mindestens zwei Runden spielen, damit der Graph des Spielverlaufes angezeigt werden kann.", + "empty_graph_text": "Du musst mindestens eine Runde spielen, damit der Graph des Spielverlaufes angezeigt werden kann.", "settings": "Einstellungen", "cabo_penalty": "Cabo-Strafe", diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index 782008a..a649362 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -74,8 +74,6 @@ "done": "Done", "next_round": "Next Round", - - "statistics": "Statistics", "end_game": "End Game", "delete_game": "Delete Game", "new_game_same_settings": "New Game with same Settings", @@ -86,7 +84,7 @@ "end_game_message": "Do you want to end the game? The game gets marked as finished and cannot be continued.", "game_process": "Scoring History", - "empty_graph_text": "You must play at least two rounds for the game progress graph to be displayed.", + "empty_graph_text": "You must play at least one round for the game progress graph to be displayed.", "settings": "Settings", "cabo_penalty": "Cabo Penalty", diff --git a/lib/l10n/generated/app_localizations.dart b/lib/l10n/generated/app_localizations.dart index d805b45..c54cca0 100644 --- a/lib/l10n/generated/app_localizations.dart +++ b/lib/l10n/generated/app_localizations.dart @@ -479,7 +479,7 @@ abstract class AppLocalizations { /// No description provided for @empty_graph_text. /// /// In de, this message translates to: - /// **'Du musst mindestens zwei Runden spielen, damit der Graph des Spielverlaufes angezeigt werden kann.'** + /// **'Du musst mindestens eine Runde spielen, damit der Graph des Spielverlaufes angezeigt werden kann.'** String get empty_graph_text; /// No description provided for @settings. diff --git a/lib/l10n/generated/app_localizations_de.dart b/lib/l10n/generated/app_localizations_de.dart index 4acdb1c..7bd7af0 100644 --- a/lib/l10n/generated/app_localizations_de.dart +++ b/lib/l10n/generated/app_localizations_de.dart @@ -212,7 +212,7 @@ class AppLocalizationsDe extends AppLocalizations { @override String get empty_graph_text => - 'Du musst mindestens zwei Runden spielen, damit der Graph des Spielverlaufes angezeigt werden kann.'; + 'Du musst mindestens eine Runde spielen, damit der Graph des Spielverlaufes angezeigt werden kann.'; @override String get settings => 'Einstellungen'; diff --git a/lib/l10n/generated/app_localizations_en.dart b/lib/l10n/generated/app_localizations_en.dart index 138c633..5403a95 100644 --- a/lib/l10n/generated/app_localizations_en.dart +++ b/lib/l10n/generated/app_localizations_en.dart @@ -209,7 +209,7 @@ class AppLocalizationsEn extends AppLocalizations { @override String get empty_graph_text => - 'You must play at least two rounds for the game progress graph to be displayed.'; + 'You must play at least one round for the game progress graph to be displayed.'; @override String get settings => 'Settings'; diff --git a/pubspec.yaml b/pubspec.yaml index c793316..8241466 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cabo_counter description: "Mobile app for the card game Cabo" publish_to: 'none' -version: 0.4.3+483 +version: 0.4.4+484 environment: sdk: ^3.5.4 From 1157ab70ec41a30e93500c1a7143ff57c1b7b27a Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 13 Jul 2025 11:49:47 +0200 Subject: [PATCH 09/10] Updated comment Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- lib/presentation/views/graph_view.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/presentation/views/graph_view.dart b/lib/presentation/views/graph_view.dart index fe36de9..d322bd0 100644 --- a/lib/presentation/views/graph_view.dart +++ b/lib/presentation/views/graph_view.dart @@ -97,7 +97,7 @@ class _GraphViewState extends State { (j) => ( j, j == 0 || cumulativeScores[i][j - 1] == 0 - ? 0 // 0 Points at at the start of the game OR value is 0 (dont subtract jitter step) + ? 0 // 0 points at the start of the game or when the value is 0 (don't subtract jitter step) // 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. From 75568a1a4bf3657bdd8bdf6ddfece0339dfcb85e Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 13 Jul 2025 11:55:46 +0200 Subject: [PATCH 10/10] Updated generated files --- lib/l10n/generated/app_localizations.dart | 6 ------ lib/l10n/generated/app_localizations_de.dart | 3 --- lib/l10n/generated/app_localizations_en.dart | 3 --- pubspec.yaml | 2 +- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/l10n/generated/app_localizations.dart b/lib/l10n/generated/app_localizations.dart index c54cca0..2059f1b 100644 --- a/lib/l10n/generated/app_localizations.dart +++ b/lib/l10n/generated/app_localizations.dart @@ -416,12 +416,6 @@ abstract class AppLocalizations { /// **'Nächste Runde'** String get next_round; - /// No description provided for @statistics. - /// - /// In de, this message translates to: - /// **'Statistiken'** - String get statistics; - /// No description provided for @end_game. /// /// In de, this message translates to: diff --git a/lib/l10n/generated/app_localizations_de.dart b/lib/l10n/generated/app_localizations_de.dart index 7bd7af0..068711f 100644 --- a/lib/l10n/generated/app_localizations_de.dart +++ b/lib/l10n/generated/app_localizations_de.dart @@ -178,9 +178,6 @@ class AppLocalizationsDe extends AppLocalizations { @override String get next_round => 'Nächste Runde'; - @override - String get statistics => 'Statistiken'; - @override String get end_game => 'Spiel beenden'; diff --git a/lib/l10n/generated/app_localizations_en.dart b/lib/l10n/generated/app_localizations_en.dart index 5403a95..06b5c03 100644 --- a/lib/l10n/generated/app_localizations_en.dart +++ b/lib/l10n/generated/app_localizations_en.dart @@ -175,9 +175,6 @@ class AppLocalizationsEn extends AppLocalizations { @override String get next_round => 'Next Round'; - @override - String get statistics => 'Statistics'; - @override String get end_game => 'End Game'; diff --git a/pubspec.yaml b/pubspec.yaml index 8241466..da2c087 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cabo_counter description: "Mobile app for the card game Cabo" publish_to: 'none' -version: 0.4.4+484 +version: 0.4.4+485 environment: sdk: ^3.5.4