Commit 76ad4cb6 authored by Administrator's avatar Administrator

add 'diagram created' texts to all diagrams except power duration, fix in axes label on lap level

parent 8898c5eb
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.10/","dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.10/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+2/","dependencies":[]},{"name":"shared_preferences_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+8/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"url_launcher_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+5/","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+5/","dependencies":[]},{"name":"url_launcher_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.1+5/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"uni_links","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2020-07-15 22:10:04.014013","version":"1.17.3"}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.10/","dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.10/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+2/","dependencies":[]},{"name":"shared_preferences_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+8/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"url_launcher_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+5/","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+5/","dependencies":[]},{"name":"url_launcher_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.1+5/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"uni_links","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2020-07-16 09:22:52.880139","version":"1.17.3"}
\ No newline at end of file
......@@ -118,6 +118,12 @@ class _AthleteTimeSeriesChartState extends State<AthleteTimeSeriesChart> {
behaviorPosition: BehaviorPosition.bottom,
titleOutsideJustification: OutsideJustification.end,
),
ChartTitle(
'${widget.chartTitleText} Diagram created with Encrateia https://encreteia.informatom.com',
behaviorPosition: BehaviorPosition.top,
titleOutsideJustification: OutsideJustification.endDrawArea,
titleStyleSpec: const TextStyleSpec(fontSize: 10),
)
],
),
),
......
......@@ -58,6 +58,12 @@ class GraphUtils {
behaviorPosition: BehaviorPosition.bottom,
titleOutsideJustification: OutsideJustification.end,
),
ChartTitle(
'$measureTitle diagram created with Encrateia https://encreteia.informatom.com',
titleStyleSpec: const TextStyleSpec(fontSize: 10),
behaviorPosition: BehaviorPosition.top,
titleOutsideJustification: OutsideJustification.endDrawArea,
),
];
}
......
......@@ -8,19 +8,19 @@ import 'package:flutter/foundation.dart';
import 'package:charts_common/common.dart' as common show Series, ChartBehavior;
class MyLineChart extends LineChart {
MyLineChart({
@required List<common.Series<dynamic, dynamic>> data,
@required double maxDomain,
@required List<Lap> laps,
List<PowerZone> powerZones,
List<HeartRateZone> heartRateZones,
@required String domainTitle,
String measureTitle,
NumericTickProviderSpec measureTickProviderSpec,
NumericTickProviderSpec domainTickProviderSpec,
double minimum,
double maximum
}) : super(
MyLineChart(
{@required List<common.Series<dynamic, dynamic>> data,
@required double maxDomain,
@required List<Lap> laps,
List<PowerZone> powerZones,
List<HeartRateZone> heartRateZones,
@required String domainTitle,
String measureTitle,
NumericTickProviderSpec measureTickProviderSpec,
NumericTickProviderSpec domainTickProviderSpec,
double minimum,
double maximum})
: super(
data,
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
......@@ -62,6 +62,12 @@ class MyLineChart extends LineChart {
behaviorPosition: BehaviorPosition.bottom,
titleOutsideJustification: OutsideJustification.end,
),
ChartTitle(
'$domainTitle Diagram created with Encrateia https://encreteia.informatom.com',
behaviorPosition: BehaviorPosition.top,
titleOutsideJustification: OutsideJustification.endDrawArea,
titleStyleSpec: const TextStyleSpec(fontSize: 10),
)
],
);
......@@ -75,20 +81,24 @@ class MyLineChart extends LineChart {
return NumericExtents(
powerZones
.map((PowerZone powerZone) => powerZone.lowerLimit)
.reduce(min) * 0.9,
.reduce(min) *
0.9,
powerZones
.map((PowerZone powerZone) => powerZone.upperLimit)
.reduce(max) * 1.1);
.reduce(max) *
1.1);
else if (heartRateZones != null)
return NumericExtents(
heartRateZones
.map(
(HeartRateZone heartRateZone) => heartRateZone.lowerLimit)
.reduce(min) * 0.9,
.reduce(min) *
0.9,
heartRateZones
.map(
(HeartRateZone heartRateZone) => heartRateZone.upperLimit)
.reduce(max) * 1.1);
.reduce(max) *
1.1);
else if (minimum != null)
return NumericExtents(minimum, maximum);
else
......
import 'package:charts_flutter/flutter.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:encrateia/utils/graph_utils.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/event.dart';
......@@ -21,8 +22,7 @@ class LapEcorChart extends StatelessWidget {
id: 'Ecor',
colorFn: (_, __) => MaterialPalette.black,
domainFn: (Event record, _) => record.distance.round() - offset,
measureFn: (Event record, _) =>
record.power / record.speed / weight,
measureFn: (Event record, _) => record.power / record.speed / weight,
data: records,
)
];
......@@ -41,14 +41,9 @@ class LapEcorChart extends StatelessWidget {
desiredTickCount: 6),
),
animate: false,
behaviors: <ChartTitle>[
ChartTitle(
'Ecor (W s/kg m)',
titleStyleSpec: const TextStyleSpec(fontSize: 13),
behaviorPosition: BehaviorPosition.bottom,
titleOutsideJustification: OutsideJustification.end,
),
],
behaviors: GraphUtils.axis(
measureTitle: 'Ecor (W s/kg m)',
),
),
);
}
......
import 'package:charts_flutter/flutter.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:encrateia/utils/graph_utils.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/event.dart';
import 'package:encrateia/utils/graph_utils.dart';
class LapGroundTimeChart extends StatelessWidget {
const LapGroundTimeChart({
......
......@@ -5,10 +5,7 @@ import 'package:encrateia/utils/my_line_chart.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/event.dart';
import 'package:encrateia/utils/graph_utils.dart';
import 'package:charts_common/common.dart' as common
show
ChartBehavior;
import 'package:charts_common/common.dart' as common show ChartBehavior;
class LapHeartRateChart extends StatelessWidget {
const LapHeartRateChart({
......@@ -51,18 +48,14 @@ class LapHeartRateChart extends StatelessWidget {
),
animate: false,
behaviors: <ChartBehavior<common.ChartBehavior<dynamic>>>[
RangeAnnotation(
GraphUtils.heartRateZoneAnnotations(
heartRateZones: heartRateZones,
RangeAnnotation(
GraphUtils.heartRateZoneAnnotations(
heartRateZones: heartRateZones),
),
] +
GraphUtils.axis(
measureTitle: 'Heart Rate (bpm)',
),
),
ChartTitle(
'Heart Rate (bpm)',
titleStyleSpec: const TextStyleSpec(fontSize: 13),
behaviorPosition: BehaviorPosition.bottom,
titleOutsideJustification: OutsideJustification.end,
),
],
),
);
}
......
......@@ -5,25 +5,31 @@ import 'package:encrateia/models/event.dart';
import 'package:encrateia/utils/graph_utils.dart';
class LapLegSpringStiffnessChart extends StatelessWidget {
const LapLegSpringStiffnessChart({@required this.records});
const LapLegSpringStiffnessChart({
@required this.records,
@required this.minimum,
@required this.maximum,
});
final RecordList<Event> records;
final double minimum;
final double maximum;
@override
Widget build(BuildContext context) {
final int offset = records.first.distance.round();
final List<Series<Event, int>> data = <Series<Event, int>>[
Series<Event, int>(
Series<Event, int>(
id: 'Leg Spring Stiffness',
colorFn: (_, __) => Color.black,
domainFn: (Event record, _) => record.distance.round() - offset,
measureFn: (Event record, _) => record.groundTime,
measureFn: (Event record, _) => record.legSpringStiffness,
data: records,
)
];
return Container(
return Container(
height: 300,
child: LineChart(
data,
......@@ -31,12 +37,13 @@ class LapLegSpringStiffnessChart extends StatelessWidget {
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
),
primaryMeasureAxis: const NumericAxisSpec(
tickProviderSpec: BasicNumericTickProviderSpec(
primaryMeasureAxis: NumericAxisSpec(
tickProviderSpec: const BasicNumericTickProviderSpec(
zeroBound: false,
dataIsInWholeNumbers: false,
desiredTickCount: 5,
),
viewport: NumericExtents(minimum, maximum),
),
behaviors: GraphUtils.axis(
measureTitle: 'Leg Spring Stiffness (kN/m)',
......
import 'package:charts_flutter/flutter.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:encrateia/utils/graph_utils.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/event.dart';
import 'package:charts_common/common.dart' as common show ChartBehavior;
class LapPaceChart extends StatelessWidget {
const LapPaceChart({
......@@ -45,14 +45,9 @@ class LapPaceChart extends StatelessWidget {
viewport: NumericExtents(minimum, maximum),
),
animate: false,
behaviors: <ChartBehavior<common.ChartBehavior<dynamic>>>[
ChartTitle(
'Pace (min/km)',
titleStyleSpec: const TextStyleSpec(fontSize: 13),
behaviorPosition: BehaviorPosition.bottom,
titleOutsideJustification: OutsideJustification.end,
),
],
behaviors: GraphUtils.axis(
measureTitle: 'Pace (min/km)',
),
),
);
}
......
......@@ -48,16 +48,13 @@ class LapPowerChart extends StatelessWidget {
),
animate: false,
behaviors: <ChartBehavior<common.ChartBehavior<dynamic>>>[
RangeAnnotation(
GraphUtils.powerZoneAnnotations(powerZones: powerZones),
),
ChartTitle(
'Power (W)',
titleStyleSpec: const TextStyleSpec(fontSize: 13),
behaviorPosition: BehaviorPosition.bottom,
titleOutsideJustification: OutsideJustification.end,
),
],
RangeAnnotation(
GraphUtils.powerZoneAnnotations(powerZones: powerZones),
),
] +
GraphUtils.axis(
measureTitle: 'Power (W)',
),
),
);
}
......
......@@ -50,6 +50,8 @@ class _LapLegSpringStiffnessWidgetState
children: <Widget>[
LapLegSpringStiffnessChart(
records: RecordList<Event>(legSpringStiffnessRecords),
minimum: widget.lap.avgLegSpringStiffness / 1.25,
maximum: widget.lap.avgLegSpringStiffness * 1.25,
),
const Text('Only records where leg spring stiffness > 0 kN/m '
'are shown.'),
......@@ -58,12 +60,12 @@ class _LapLegSpringStiffnessWidgetState
ListTile(
leading: MyIcon.average,
title: Text(avgLegSpringStiffnessString),
subtitle: const Text('average ground time'),
subtitle: const Text('average leg spring stiffness'),
),
ListTile(
leading: MyIcon.standardDeviation,
title: Text(sdevLegSpringStiffnessString),
subtitle: const Text('standard deviation ground time'),
subtitle: const Text('standard leg spring stiffness'),
),
ListTile(
leading: MyIcon.amount,
......@@ -90,9 +92,9 @@ class _LapLegSpringStiffnessWidgetState
records = RecordList<Event>(await lap.records);
setState(() {
avgLegSpringStiffnessString =
widget.lap.avgLegSpringStiffness.toStringOrDashes(1) + ' ms';
widget.lap.avgLegSpringStiffness.toStringOrDashes(1) + ' cm';
sdevLegSpringStiffnessString =
lap.sdevLegSpringStiffness.toStringOrDashes(2) + ' ms';
lap.sdevLegSpringStiffness.toStringOrDashes(2) + ' cm';
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment