fix styles
This commit is contained in:
@@ -108,6 +108,7 @@
|
||||
<p class="statistics-error">Die Kennzahlen konnten nicht geladen werden.</p>
|
||||
}
|
||||
|
||||
@if (topicHeatmapLoading || topicHeatmapError || hasTopicHeatmapData()) {
|
||||
<section class="topic-heatmap-section">
|
||||
<header class="topic-heatmap-header">
|
||||
<div>
|
||||
@@ -166,7 +167,9 @@
|
||||
[loading]="topicHeatmapLoading"></app-topic-heatmap>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (topAuthorsLoading || topAuthorsError || hasTopAuthorData()) {
|
||||
<section class="top-authors-section">
|
||||
<header class="top-authors-header">
|
||||
<div>
|
||||
@@ -195,7 +198,7 @@
|
||||
</p>
|
||||
} @else {
|
||||
<div class="top-authors-grid" [class.loading]="topAuthorsLoading">
|
||||
@for (dataset of topAuthorDatasets(); track dataset.title) {
|
||||
@for (dataset of visibleTopAuthorDatasets(); track dataset.title) {
|
||||
<article class="top-authors-chart">
|
||||
<h3>
|
||||
<mat-icon>{{ dataset.icon }}</mat-icon
|
||||
@@ -245,5 +248,6 @@
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
@@ -19,16 +19,15 @@ type DashboardStatisticKey =
|
||||
| 'eu_projects'
|
||||
| 'bmbf_projects'
|
||||
| 'dfg_projects';
|
||||
type TopicTreemapPeriod = 'last_5_years' | 'last_10_years' | 'all_time' | 'custom';
|
||||
type TopicTreemapPeriod =
|
||||
| 'last_5_years'
|
||||
| 'last_10_years'
|
||||
| 'all_time'
|
||||
| 'custom';
|
||||
|
||||
@Component({
|
||||
selector: 'dashboard',
|
||||
imports: [
|
||||
DecimalPipe,
|
||||
MatIconModule,
|
||||
RouterLink,
|
||||
TopicHeatmapComponent,
|
||||
],
|
||||
imports: [DecimalPipe, MatIconModule, RouterLink, TopicHeatmapComponent],
|
||||
templateUrl: './dashboard.component.html',
|
||||
styleUrl: './dashboard.component.scss',
|
||||
})
|
||||
@@ -77,12 +76,18 @@ export class DashboardComponent implements OnInit {
|
||||
this.statisticsService.getPublicationCount(),
|
||||
);
|
||||
this.loadStatistic('persons', this.statisticsService.getPersonCount());
|
||||
this.loadStatistic('eu_projects', this.statisticsService.getEuProjectCount());
|
||||
this.loadStatistic(
|
||||
'eu_projects',
|
||||
this.statisticsService.getEuProjectCount(),
|
||||
);
|
||||
this.loadStatistic(
|
||||
'bmbf_projects',
|
||||
this.statisticsService.getBmbfProjectCount(),
|
||||
);
|
||||
this.loadStatistic('dfg_projects', this.statisticsService.getDfgProjectCount());
|
||||
this.loadStatistic(
|
||||
'dfg_projects',
|
||||
this.statisticsService.getDfgProjectCount(),
|
||||
);
|
||||
}
|
||||
|
||||
isStatisticLoading(key: DashboardStatisticKey): boolean {
|
||||
@@ -96,19 +101,48 @@ export class DashboardComponent implements OnInit {
|
||||
}> {
|
||||
return [
|
||||
{
|
||||
title:
|
||||
this.topAuthorsWorksPeriod === 'last_5_years'
|
||||
? 'Works letzte 5 Jahre'
|
||||
: 'Works alle Zeiten',
|
||||
title: 'Publikationen',
|
||||
icon: 'menu_book',
|
||||
entries: this.topAuthors?.works ?? [],
|
||||
},
|
||||
{ title: 'Projekte', icon: 'work', entries: this.topAuthors?.projects ?? [] },
|
||||
{ title: 'Patente', icon: 'description', entries: this.topAuthors?.patents ?? [] },
|
||||
{
|
||||
title: 'Projekte',
|
||||
icon: 'work',
|
||||
entries: this.topAuthors?.projects ?? [],
|
||||
},
|
||||
{
|
||||
title: 'Patente',
|
||||
icon: 'description',
|
||||
entries: this.topAuthors?.patents ?? [],
|
||||
},
|
||||
{ title: 'News', icon: 'article', entries: this.topAuthors?.news ?? [] },
|
||||
];
|
||||
}
|
||||
|
||||
visibleTopAuthorDatasets(): Array<{
|
||||
title: string;
|
||||
icon: string;
|
||||
entries: TopAuthor[];
|
||||
}> {
|
||||
const datasets = this.topAuthorDatasets();
|
||||
return this.topAuthorsLoading
|
||||
? datasets
|
||||
: datasets.filter((dataset) => dataset.entries.length > 0);
|
||||
}
|
||||
|
||||
hasTopAuthorData(): boolean {
|
||||
return this.topAuthorDatasets().some(
|
||||
(dataset) => dataset.entries.length > 0,
|
||||
);
|
||||
}
|
||||
|
||||
hasTopicHeatmapData(): boolean {
|
||||
return (this.topicHeatmap?.fields ?? []).some(
|
||||
(field) =>
|
||||
field.total > 0 || field.values.some((value) => value.count > 0),
|
||||
);
|
||||
}
|
||||
|
||||
setTopAuthorsWorksPeriod(period: TopAuthorsWorksPeriod): void {
|
||||
if (period === this.topAuthorsWorksPeriod) return;
|
||||
this.topAuthorsWorksPeriod = period;
|
||||
@@ -150,10 +184,7 @@ export class DashboardComponent implements OnInit {
|
||||
this.loadTopicHeatmap();
|
||||
}
|
||||
|
||||
onTopicTreemapYearChange(
|
||||
field: 'from' | 'to',
|
||||
value: string,
|
||||
): void {
|
||||
onTopicTreemapYearChange(field: 'from' | 'to', value: string): void {
|
||||
const year = Number(value);
|
||||
if (!Number.isInteger(year)) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user