This commit is contained in:
@@ -108,7 +108,7 @@ export class DashboardComponent implements OnInit {
|
||||
readonly topicTreemapMinYear = 1900;
|
||||
readonly topicTreemapMaxYear = new Date().getFullYear();
|
||||
dashboardPeriodMode: DashboardPeriodMode = 'all_time';
|
||||
dashboardFromYear = this.topicTreemapMaxYear - 4;
|
||||
dashboardFromYear = this.topicTreemapMinYear;
|
||||
dashboardToYear = this.topicTreemapMaxYear;
|
||||
selectedTopicTreemapNode?: string;
|
||||
selectedDfgTopicTreemapNode?: string;
|
||||
@@ -406,14 +406,16 @@ export class DashboardComponent implements OnInit {
|
||||
this.dashboardPeriodMode = mode;
|
||||
}
|
||||
this.applyPresetPeriod();
|
||||
this.dashboardFromYear = this.parseDashboardYear(
|
||||
params.get('fromYear'),
|
||||
this.dashboardFromYear,
|
||||
);
|
||||
this.dashboardToYear = this.parseDashboardYear(
|
||||
params.get('toYear'),
|
||||
this.dashboardToYear,
|
||||
);
|
||||
if (this.dashboardPeriodMode !== 'all_time') {
|
||||
this.dashboardFromYear = this.parseDashboardYear(
|
||||
params.get('fromYear'),
|
||||
this.dashboardFromYear,
|
||||
);
|
||||
this.dashboardToYear = this.parseDashboardYear(
|
||||
params.get('toYear'),
|
||||
this.dashboardToYear,
|
||||
);
|
||||
}
|
||||
if (this.dashboardFromYear > this.dashboardToYear) {
|
||||
this.dashboardFromYear = this.dashboardToYear;
|
||||
}
|
||||
@@ -422,7 +424,10 @@ export class DashboardComponent implements OnInit {
|
||||
|
||||
private applyPresetPeriod(): void {
|
||||
const currentYear = this.topicTreemapMaxYear;
|
||||
if (this.dashboardPeriodMode === 'last_10_years') {
|
||||
if (this.dashboardPeriodMode === 'all_time') {
|
||||
this.dashboardFromYear = this.topicTreemapMinYear;
|
||||
this.dashboardToYear = currentYear;
|
||||
} else if (this.dashboardPeriodMode === 'last_10_years') {
|
||||
this.dashboardFromYear = currentYear - 9;
|
||||
this.dashboardToYear = currentYear;
|
||||
} else if (this.dashboardPeriodMode === 'last_5_years') {
|
||||
|
||||
Reference in New Issue
Block a user