diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-25 13:25:35 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-25 13:25:35 +0200 |
| commit | d5de3a6fefbc57bccfb1fe688f9c190ccf87d58d (patch) | |
| tree | 4a368e1331e04348353a9d65b94a07f4e94ee6bf /web/views.go | |
| parent | 87e29e1eb5a113fbb40d452a193219a40780c302 (diff) | |
analytics grouping
Diffstat (limited to 'web/views.go')
| -rw-r--r-- | web/views.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/web/views.go b/web/views.go index 8df860c..b3cab8b 100644 --- a/web/views.go +++ b/web/views.go @@ -38,6 +38,9 @@ type AnalyticsPoint struct { SpeedKmh float64 `json:"speedKmh"` CotacolPer100Km float64 `json:"cotacolPer100Km"` MovingHours float64 `json:"movingHours"` + RideType string `json:"rideType"` + BikeType string `json:"bikeType"` + Year int `json:"year"` } func buildAnalyticsPoints(items []ride.StoredRide) []AnalyticsPoint { @@ -54,6 +57,9 @@ func buildAnalyticsPoints(items []ride.StoredRide) []AnalyticsPoint { SpeedKmh: item.AverageSpeedMps * 3.6, CotacolPer100Km: cotacol * 100 / (item.DistanceM / 1000), MovingHours: float64(item.EffectiveMovingTimeS()) / 3600, + RideType: string(item.RideType), + BikeType: string(item.BikeType), + Year: item.StartDate.Year(), }) } return points |
