Merge branch 'dev' into 1511-occupancy-heat-map-tooltip

This commit is contained in:
Faris Armoush
2025-05-14 12:05:34 +03:00
committed by GitHub
9 changed files with 64 additions and 49 deletions

View File

@ -15,8 +15,9 @@ class OccupancyHeatMap extends StatelessWidget {
static const _cellSize = 16.0;
static const _totalWeeks = 53;
int get _maxValue =>
heatMapData.isNotEmpty ? heatMapData.values.reduce(math.max) : 0;
int get _maxValue => heatMapData.isNotEmpty
? heatMapData.keys.map((key) => heatMapData[key] ?? 0).reduce(math.max)
: 0;
DateTime _getStartingDate() {
final jan1 = DateTime(DateTime.now().year, 1, 1);

View File

@ -68,7 +68,10 @@ class OccupancyHeatMapBox extends StatelessWidget {
Expanded(
child: OccupancyHeatMap(
heatMapData: state.heatMapData.asMap().map(
(_, value) => MapEntry(value.date, value.occupancy),
(_, value) => MapEntry(
value.eventDate,
value.countTotalPresenceDetected,
),
),
),
),