Skip to content

Commit fc5306b

Browse files
authored
Download counts: extend time interval for weekly sparkline and versions chart (#8713)
1 parent 86434c4 commit fc5306b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pkg/web_app/lib/src/widget/downloads_chart/widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void create(HTMLElement element, Map<String, String> options) {
6565
final data = WeeklyVersionDownloadCounts.fromJson((utf8.decoder
6666
.fuse(json.decoder)
6767
.convert(base64Decode(dataPoints)) as Map<String, dynamic>));
68-
final weeksToDisplay = math.min(40, data.totalWeeklyDownloads.length);
68+
final weeksToDisplay = math.min(47, data.totalWeeklyDownloads.length);
6969
final totals =
7070
data.totalWeeklyDownloads.sublist(0, weeksToDisplay).reversed.toList();
7171

pkg/web_app/lib/src/widget/weekly_sparkline/widget.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ void create(HTMLElement element, Map<String, String> options) {
3636
final newestDate = DateTime.fromMillisecondsSinceEpoch(decoded[0] * 1000);
3737
final weeklyDownloads = decoded.sublist(1);
3838
// TODO(https://github.com/dart-lang/pub-dev/issues/8251): Update this to 52.
39-
final dataListLength =
40-
weeklyDownloads.length > 28 ? 28 : weeklyDownloads.length;
39+
final dataListLength = min(47, weeklyDownloads.length);
4140
return List.generate(
4241
weeklyDownloads.length,
4342
(i) => (

0 commit comments

Comments
 (0)