Skip to content

Commit

Permalink
Readded App Init over time
Browse files Browse the repository at this point in the history
  • Loading branch information
johc committed Apr 24, 2024
1 parent 00a606b commit 45b0073
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ export class UserSessionComponent implements OnInit {
xField: 'day',
yField: 'count'
});

this.createLineChart(this.chartContainer6, this.groupSessionsByDate(), {
title: 'App Initializations Over Time',
xLabel: 'Date',
yLabel: 'Number of Sessions'
});

}
}

Expand Down Expand Up @@ -234,6 +241,21 @@ export class UserSessionComponent implements OnInit {
}


private groupSessionsByDate() {
const sessionCountsByDate: { [key: string]: Set<string> } = {};

this.userData.forEach(session => {
const dateString = this.extractDateString(session._created_at);
if (dateString) {
const formattedDate = this.formatDate(dateString);
sessionCountsByDate[formattedDate] = sessionCountsByDate[formattedDate] || new Set();
sessionCountsByDate[formattedDate].add(session.fmd_id);
}
});

return this.transformData(sessionCountsByDate);
}

private extractDateString(created_at: any): string | null {
if (created_at && created_at.$date) {
return created_at.$date;
Expand All @@ -257,4 +279,8 @@ export class UserSessionComponent implements OnInit {
}));
}



}


0 comments on commit 45b0073

Please sign in to comment.