@@ -264,8 +264,10 @@ async function fillContent(): Promise<void> {
264264 type ActivityChartData = Record <
265265 number ,
266266 {
267+ restarts : number ;
267268 amount : number ;
268269 time : number ;
270+ maxWpm : number ;
269271 totalWpm : number ;
270272 totalAcc : number ;
271273 totalCon : number ;
@@ -523,20 +525,26 @@ async function fillContent(): Promise<void> {
523525
524526 if ( dataForTimestamp !== undefined ) {
525527 dataForTimestamp . amount ++ ;
528+ dataForTimestamp . restarts += result . restartCount ?? 0 ;
526529 dataForTimestamp . time +=
527530 result . testDuration +
528531 ( result . incompleteTestSeconds ?? 0 ) -
529532 ( result . afkDuration ?? 0 ) ;
533+ if ( result . wpm > dataForTimestamp . maxWpm ) {
534+ dataForTimestamp . maxWpm = result . wpm ;
535+ }
530536 dataForTimestamp . totalWpm += result . wpm ;
531537 dataForTimestamp . totalAcc += result . acc ;
532538 dataForTimestamp . totalCon += result . consistency ?? 0 ;
533539 } else {
534540 activityChartData [ resultTimestamp ] = {
535541 amount : 1 ,
542+ restarts : result . restartCount ?? 0 ,
536543 time :
537544 result . testDuration +
538545 ( result . incompleteTestSeconds ?? 0 ) -
539546 ( result . afkDuration ?? 0 ) ,
547+ maxWpm : result . wpm ,
540548 totalWpm : result . wpm ,
541549 totalAcc : result . acc ,
542550 totalCon : result . consistency ?? 0 ,
@@ -685,6 +693,8 @@ async function fillContent(): Promise<void> {
685693 x : dateInt ,
686694 y : dataPoint . time / 60 ,
687695 amount : dataPoint . amount ,
696+ restarts : dataPoint . restarts ,
697+ maxWpm : Numbers . roundTo2 ( typingSpeedUnit . fromWpm ( dataPoint . maxWpm ) ) ,
688698 avgWpm : Numbers . roundTo2 ( dataPoint . totalWpm / dataPoint . amount ) ,
689699 avgAcc : Numbers . roundTo2 ( dataPoint . totalAcc / dataPoint . amount ) ,
690700 avgCon : Numbers . roundTo2 ( dataPoint . totalCon / dataPoint . amount ) ,
0 commit comments