Merge remote-tracking branch 'origin/dev' into ts-career-stage-backend
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
2026-06-19 14:08:32 +02:00
98 changed files with 6978 additions and 1268 deletions
@@ -0,0 +1,39 @@
<div class="dashboard-wrapper">
<header class="dashboard-header">
<h2>University Performance Dashboard</h2>
<div class="controls">
<select (change)="onTopicChange($any($event.target).value)">
@for (t of topics; track t) {
<option [value]="t">{{ t }}</option>
}
</select>
<div class="toggle-group">
<button
[class.active]="metric === 'publications'"
(click)="setMetric('publications')">
Publications
</button>
<button
[class.active]="metric === 'citations'"
(click)="setMetric('citations')">
Citations
</button>
</div>
</div>
</header>
<div class="content-grid">
<section class="chart-section">
<app-university-line-chart
[data]="rawDataSource"
[metric]="metric"></app-university-line-chart>
</section>
<aside class="table-section">
<app-university-ranking-table
[rankings]="computedRankings"
[loading]="isLoading"></app-university-ranking-table>
</aside>
</div>
</div>
@@ -0,0 +1,95 @@
// src/app/modules/university-ranking/dashboard.component.scss
.dashboard-wrapper {
padding: 2rem;
font-family: 'Inter', sans-serif;
color: #333;
.dashboard-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
border-bottom: 1px solid #eee;
padding-bottom: 1rem;
}
.content-grid {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 2rem;
@media (max-width: 1024px) {
grid-template-columns: 1fr;
}
}
.controls {
display: flex;
gap: 1rem;
select {
padding: 0.5rem;
border-radius: 4px;
border: 1px solid #ccc;
}
.toggle-group {
button {
padding: 0.5rem 1rem;
border: 1px solid #0056b3;
background: white;
color: #0056b3;
cursor: pointer;
&:first-child {
border-radius: 4px 0 0 4px;
}
&:last-child {
border-radius: 0 4px 4px 0;
}
&.active {
background: #0056b3;
color: white;
}
}
}
}
}
// Table styling
.ranking-table {
width: 100%;
border-collapse: collapse;
font-size: 0.9rem;
th,
td {
padding: 0.75rem;
text-align: left;
border-bottom: 1px solid #f0f0f0;
}
.top-tier {
background-color: #f8fbff;
font-weight: 600;
}
.positive {
color: #28a745;
}
.negative {
color: #dc3545;
}
.mover-badge {
margin-left: 4px;
font-size: 0.8rem;
}
.trend-col {
font-weight: bold;
&[data-trend='up'] {
color: #28a745;
}
&[data-trend='down'] {
color: #dc3545;
}
}
}
@@ -1,10 +1,62 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { UniversityRankingService } from '../university-ranking/services/uni-ranking-service';
import { UniversityLineChartComponent } from '../university-ranking/uni-line-chart/uni-line-chart.component';
import { UniversityRankingTableComponent } from '../university-ranking/uni-ranking-table/uni-ranking-table.component';
import { UniversityTopicData, UniversityRanking } from '../../api';
export type ResearchTopic =
| 'Artificial Intelligence'
| 'Quantum Computing'
| 'Renewable Energy'
| 'Biotechnology';
export type DashboardMetric = 'publications' | 'citations';
@Component({
selector: 'app-dashboard',
imports: [],
selector: 'dashboard',
imports: [UniversityLineChartComponent, UniversityRankingTableComponent],
templateUrl: './dashboard.component.html',
styleUrl: './dashboard.component.scss',
standalone: true,
})
export class DashboardComponent {}
export class DashboardComponent implements OnInit {
topics: ResearchTopic[] = [
'Artificial Intelligence',
'Quantum Computing',
'Renewable Energy',
'Biotechnology',
];
selectedTopic: ResearchTopic = 'Artificial Intelligence';
metric: DashboardMetric = 'publications';
rawDataSource: UniversityTopicData[] = [];
computedRankings: UniversityRanking[] = [];
isLoading = false;
constructor(private dataService: UniversityRankingService) {}
ngOnInit() {
this.loadData();
}
onTopicChange(topic: ResearchTopic) {
this.selectedTopic = topic;
this.loadData(); // Re-fetch as rankings depend on the topic
}
setMetric(metric: DashboardMetric) {
this.metric = metric;
this.loadData(); // Re-fetch as ranking order changes based on metric
}
private loadData() {
this.isLoading = true;
this.dataService
.getRankingData(this.selectedTopic, this.metric)
.subscribe((response) => {
// Map backend snake_case properties to frontend camelCase if necessary,
// though OpenAPI Generator usually handles this.
console.log(response);
this.rawDataSource = (response.timeseries as any) || [];
this.computedRankings = (response.rankings as any) || [];
this.isLoading = false;
});
}
}
@@ -51,7 +51,7 @@
</mat-card-header>
<mat-card-content>
<app-institution-projects-funding-graph
[fundings]="[bundProjectsFunding()]" />
[fundings]="[bundProjectsFunding(), cordisEuProjectsFunding()]" />
</mat-card-content>
</mat-card>
@@ -71,13 +71,14 @@
<app-person-network-info-card
[description]="'Gesamte Förderung durch die Europäische Union'"
[value]="
(123456789 | currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ??
(euTotalFunding() | currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ??
undefined
" />
<app-person-network-info-card
[description]="'Durchschnittliche jährliche Förderung durch die Europäische Union'"
[value]="
(12345 | currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined
(euAverageAnnualFunding()
| currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined
" />
</div>
</div>
@@ -90,6 +91,6 @@
<ng-template #fundingEndTmp let-row>
{{ row.funding_end | date: 'dd.MM.yyyy' }}
</ng-template>
<ng-template #grantAmountTmp let-row>
{{ row.grant_amount | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }}
<ng-template #fundingAmountTmp let-row>
{{ row.funding_amount | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }}
</ng-template>
@@ -12,8 +12,8 @@ import { ActivatedRoute, Router } from '@angular/router';
import {
BundProject,
BundProjectPage,
EuProject,
EuProjectPage,
CordisEuProject,
CordisEuProjectPage,
InstitutionFunderSummary,
} from '../../api';
import { MatCardModule } from '@angular/material/card';
@@ -39,7 +39,7 @@ type BundProjectRow = {
topic: string;
funding_start: Date;
funding_end: Date;
grant_amount: number;
funding_amount: number;
department: string;
};
@@ -47,7 +47,7 @@ type EuProjectRow = {
topic: string;
funding_start: Date;
funding_end: Date;
grant_amount: number;
funding_amount: number;
};
@Component({
@@ -74,9 +74,9 @@ type EuProjectRow = {
export class InstitutionProjectsComponent implements OnInit {
fundingStartTmp = viewChild.required<TemplateRef<any>>('fundingStartTmp');
fundingEndTmp = viewChild.required<TemplateRef<any>>('fundingEndTmp');
grantAmountTmp = viewChild.required<TemplateRef<any>>('grantAmountTmp');
fundingAmountTmp = viewChild.required<TemplateRef<any>>('fundingAmountTmp');
euProjectPage = input.required<EuProjectPage>();
cordisEuProjectPage = input.required<CordisEuProjectPage>();
euProjectColumns: GenericColumn<EuProjectRow>[] = [];
euProjectData: EuProjectRow[] = [];
@@ -85,19 +85,29 @@ export class InstitutionProjectsComponent implements OnInit {
bundProjectData: BundProjectRow[] = [];
bundProjectsFunding = input.required<InstitutionFunderSummary>();
bundTotalFunding = computed(() => {
const funding = this.bundProjectsFunding();
return Object.values(
funding.funding_per_year as Record<string, number>,
).reduce((sum, yearFunding) => sum + yearFunding, 0);
});
bundAverageAnnualFunding = computed(() => {
const funding = this.bundProjectsFunding();
return funding.annual_average_over_period ?? 0;
});
cordisEuProjectsFunding = input.required<InstitutionFunderSummary>();
euTotalFunding = computed(() => {
const funding = this.cordisEuProjectsFunding();
return Object.values(
funding.funding_per_year as Record<string, number>,
).reduce((sum, yearFunding) => sum + yearFunding, 0);
});
euAverageAnnualFunding = computed(() => {
const funding = this.cordisEuProjectsFunding();
return funding.annual_average_over_period ?? 0;
});
urlSortKey = signal<string>('');
urlSortDirection = signal<SortDirection>('');
urlSearchTerm = signal<string>('');
@@ -117,7 +127,7 @@ export class InstitutionProjectsComponent implements OnInit {
});
effect(() => {
const euPage = this.euProjectPage();
const euPage = this.cordisEuProjectPage();
if (euPage) {
this.euProjectData = euPage.elements
? euPage.elements.map(this.transformEuRow.bind(this))
@@ -164,7 +174,7 @@ export class InstitutionProjectsComponent implements OnInit {
readonly selectedPage = computed(() => {
if (this.displayedProjects() === 'eu') {
return this.euProjectPage();
return this.cordisEuProjectPage();
} else {
return this.bundProjectPage();
}
@@ -185,8 +195,8 @@ export class InstitutionProjectsComponent implements OnInit {
ngOnInit(): void {
this.euProjectColumns = [
{
id: 'topic',
header: 'Thema',
id: 'title',
header: 'Titel',
type: 'accessor',
accessorKey: 'topic',
},
@@ -205,17 +215,17 @@ export class InstitutionProjectsComponent implements OnInit {
cellTemplate: this.fundingEndTmp(),
},
{
id: 'grant_amount',
id: 'funding_amount',
header: 'Fördersumme',
type: 'accessor',
accessorKey: 'grant_amount',
cellTemplate: this.grantAmountTmp(),
accessorKey: 'funding_amount',
cellTemplate: this.fundingAmountTmp(),
},
];
this.bundProjectColumns = [
{
id: 'topic',
header: 'Thema',
header: 'Titel',
type: 'accessor',
accessorKey: 'topic',
},
@@ -234,29 +244,23 @@ export class InstitutionProjectsComponent implements OnInit {
cellTemplate: this.fundingEndTmp(),
},
{
id: 'grant_amount',
id: 'funding_amount',
header: 'Fördersumme',
type: 'accessor',
accessorKey: 'grant_amount',
cellTemplate: this.grantAmountTmp(),
},
{
id: 'department',
header: 'Abteilung',
type: 'accessor',
accessorKey: 'department',
accessorKey: 'funding_amount',
cellTemplate: this.fundingAmountTmp(),
},
];
}
transformEuRow(project: EuProject): EuProjectRow {
transformEuRow(project: CordisEuProject): EuProjectRow {
return {
topic: project.title || '',
funding_start: project.start_date
? new Date(project.start_date)
funding_start: project.startDate
? new Date(project.startDate)
: new Date(0),
funding_end: project.end_date ? new Date(project.end_date) : new Date(0),
grant_amount: Number(project.total_cost) || 0,
funding_end: project.endDate ? new Date(project.endDate) : new Date(0),
funding_amount: Number(project.totalCost) || 0,
};
}
@@ -269,7 +273,7 @@ export class InstitutionProjectsComponent implements OnInit {
funding_end: project.funding_end
? new Date(project.funding_end)
: new Date(0),
grant_amount: project.grant_amount || 0,
funding_amount: project.grant_amount || 0,
department: project.department_fullname || '',
};
}
@@ -288,7 +292,7 @@ export class InstitutionProjectsComponent implements OnInit {
selectedTabChange(event: MatTabChangeEvent): void {
const tab = ['eu', 'bund'][event.index];
this.router.navigate([], {
queryParams: { project_tab: tab, page: 1, size: 10 },
queryParams: { project_tab: tab, page: 0, size: 10 },
queryParamsHandling: 'merge',
});
}
@@ -36,7 +36,7 @@ export class InstitutionComponent implements OnInit {
page: 0,
size: 10,
search: '',
sort_by: 'topic',
sort_by: 'title',
sort_direction: 'asc',
},
},
@@ -25,7 +25,7 @@
{{ person.display_name ?? '' }}
</h2>
<p [skText]="loading" class="person-id">
{{ getDistinguishingId(person) ?? '' }}
{{ getDistinguishingId(person) }}
</p>
<p [skText]="loading" class="stats">
{{ getStatsString() }}
@@ -40,24 +40,30 @@
<div class="main-layout">
<section class="graph-column">
@if (graphOptions) {
<section class="graph-card">
<div class="graph-toolbar">
<button
type="button"
class="related-toggle"
[class.active]="showRelatedPersons"
[attr.aria-pressed]="showRelatedPersons"
(click)="toggleRelatedPersons()">
<span class="toggle-switch">
<span class="toggle-knob"></span>
</span>
<span class="toggle-text">
Weitere Registerpersonen anzeigen
</span>
</button>
</div>
<mat-card appearance="outlined" class="graph-card">
<div class="graph-stage">
<button
mat-icon-button
type="button"
class="graph-related-persons-button"
#relatedPersonsTooltip="matTooltip"
(click)="toggleRelatedPersons(relatedPersonsTooltip)"
[matTooltip]="
showRelatedPersons
? 'Weitere Registerpersonen ausblenden'
: 'Weitere Registerpersonen anzeigen'
"
matTooltipPosition="left"
[attr.aria-label]="
showRelatedPersons
? 'Weitere Registerpersonen ausblenden'
: 'Weitere Registerpersonen anzeigen'
">
<mat-icon class="graph-related-persons-icon">
{{ showRelatedPersons ? 'no_accounts' : 'account_circle' }}
</mat-icon>
</button>
<div
class="graph"
echarts
@@ -86,7 +92,7 @@
Liste ist rechts sichtbar.
</p>
}
</section>
</mat-card>
}
<p class="disclaimer">
@@ -95,7 +101,7 @@
</section>
<section class="list-column">
<div class="connection-list">
<mat-card appearance="outlined" class="connection-list">
<div class="list-header">
<span>Unternehmen</span>
<span>Rolle</span>
@@ -109,6 +115,7 @@
<div class="connection-item">
<div
#connectionRow
class="connection-row"
[attr.data-company-key]="companyKey"
[class.selected]="companyKey === selectedCompanyKey"
@@ -186,20 +193,22 @@
relatedOfficers.length
}})
</span>
<span>
<mat-icon>
{{
isCompanyOfficersExpanded(connection) ? '▲' : '▼'
isCompanyOfficersExpanded(connection)
? 'expand_less'
: 'expand_more'
}}
</span>
</mat-icon>
</button>
@if (isCompanyOfficersExpanded(connection)) {
<ul class="related-officers">
<div class="related-officers">
@for (
relatedOfficer of relatedOfficers;
track relatedOfficer.name
) {
<li class="related-officer">
<div class="related-officer">
<span
class="officer-name"
[title]="relatedOfficer.name || ''">
@@ -243,9 +252,9 @@
} @else {
<span class="officer-open-placeholder"></span>
}
</li>
</div>
}
</ul>
</div>
}
}
</div>
@@ -253,7 +262,7 @@
</div>
}
</div>
</div>
</mat-card>
</section>
</div>
</section>
@@ -1,10 +1,8 @@
$author-color: #5470c6;
$marked-color: #5470c6;
$related-person-color: #4f8df5;
$timeline-purple: #7255d9;
$timeline-purple-bg: #f6f0ff;
$timeline-green-bg: #effaf3;
$timeline-green-border: #bdebcf;
$timeline-orange-bg: #fff7e8;
$timeline-orange-border: #ffd796;
$timeline-orange-text: #c67500;
@@ -107,7 +105,6 @@ $text-muted: #64718f;
.graph-card,
.connection-list {
border: 1px solid $card-border;
border-radius: 16px;
background: #ffffff;
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
@@ -121,70 +118,45 @@ $text-muted: #64718f;
flex-direction: column;
}
.graph-toolbar {
flex: 0 0 auto;
padding: 12px 18px 8px;
border-bottom: 1px solid #edf2fb;
}
.related-toggle {
display: inline-flex;
align-items: center;
gap: 10px;
max-width: 100%;
padding: 0;
border: 0;
background: transparent;
color: $text-main;
cursor: pointer;
}
.toggle-switch {
position: relative;
flex: 0 0 auto;
width: 44px;
height: 24px;
border-radius: 999px;
background: #dbe5f6;
transition: background 160ms ease;
}
.toggle-knob {
position: absolute;
top: 3px;
left: 3px;
width: 18px;
height: 18px;
border-radius: 999px;
background: #ffffff;
box-shadow: 0 1px 4px rgba(15, 23, 42, 0.24);
transition: transform 160ms ease;
}
.related-toggle.active .toggle-switch {
background: #e95590;
}
.related-toggle.active .toggle-knob {
transform: translateX(20px);
}
.toggle-text {
min-width: 0;
color: $text-main;
font-size: 13px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.graph-stage {
position: relative;
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
.graph-related-persons-button {
position: absolute;
top: 12px;
right: 12px;
z-index: 2;
width: 50px;
height: 50px;
padding: 0;
background: transparent;
color: $related-person-color;
box-shadow: none;
}
.graph-related-persons-button:hover {
background: rgba(84, 112, 198, 0.08);
}
.graph-related-persons-icon {
width: 51px;
height: 51px;
font-size: 51px;
line-height: 51px;
font-variation-settings:
'FILL' 1,
'wght' 400,
'GRAD' 0,
'opsz' 48;
}
.graph {
width: 100%;
height: 100%;
@@ -288,14 +260,6 @@ $text-muted: #64718f;
.list-header span,
.connection-row span {
min-width: 0;
}
.list-header span {
white-space: normal;
}
.list-header span,
.connection-row span {
justify-self: start;
text-align: left;
}
@@ -322,7 +286,7 @@ $text-muted: #64718f;
&.selected {
background: #f0f6ff;
box-shadow: inset 3px 0 0 $author-color;
box-shadow: inset 3px 0 0 $marked-color;
}
&.removed {
@@ -343,34 +307,10 @@ $text-muted: #64718f;
white-space: nowrap;
}
.company-name {
min-width: 0;
}
.company-name {
font-weight: 700;
}
.detail-value.detail-status {
display: block;
margin: 0;
padding: 0;
border: 0;
border-radius: 0;
background: transparent;
font-size: 13px;
font-weight: 700;
line-height: 1.35;
}
.detail-value.detail-status--active {
color: #218354;
}
.detail-value.detail-status--removed {
color: #6b7280;
}
.role-value {
width: auto;
padding-left: 8px;
@@ -422,6 +362,26 @@ $text-muted: #64718f;
line-height: 1.35;
}
.detail-value.detail-status {
display: block;
margin: 0;
padding: 0;
border: 0;
border-radius: 0;
background: transparent;
font-size: 13px;
font-weight: 700;
line-height: 1.35;
}
.detail-value.detail-status--active {
color: #218354;
}
.detail-value.detail-status--removed {
color: #6b7280;
}
.officers-toggle {
display: flex;
justify-content: space-between;
@@ -441,21 +401,23 @@ $text-muted: #64718f;
cursor: pointer;
}
.officers-toggle mat-icon {
color: $text-muted;
}
.related-officers {
display: flex;
flex-direction: column;
gap: 6px;
margin: 8px 0 0;
padding: 0;
list-style: none;
}
.related-officer {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr) 28px;
grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr) 40px;
gap: 12px;
align-items: center;
padding-right: 34px;
color: $text-main;
font-size: 13px;
}
@@ -466,49 +428,21 @@ $text-muted: #64718f;
}
.officer-role {
display: block;
max-width: 100%;
min-width: 0;
padding-left: 10px;
border-left: 4px solid #8a95b3;
color: $text-main;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.officer-open-link {
--mdc-icon-button-state-layer-size: 28px;
--mat-icon-button-state-layer-size: 28px;
justify-self: center;
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0;
border-radius: 6px;
color: $author-color;
line-height: 1;
}
.officer-open-link:hover {
background: rgba(47, 76, 190, 0.08);
}
.officer-open-link .mat-icon {
width: 20px;
height: 20px;
font-size: 20px;
line-height: 20px;
color: $marked-color;
}
.officer-open-placeholder {
display: block;
width: 28px;
height: 28px;
width: 40px;
height: 40px;
}
@media (max-width: 1450px) {
@@ -553,9 +487,8 @@ $text-muted: #64718f;
}
.related-officer {
grid-template-columns: minmax(0, 1fr) 28px;
grid-template-columns: minmax(0, 1fr) 40px;
gap: 6px 10px;
padding-right: 0;
}
.officer-role {
@@ -1,7 +1,16 @@
import { CommonModule, LocationStrategy } from '@angular/common';
import { Component, ElementRef, OnInit, inject } from '@angular/core';
import {
Component,
ElementRef,
OnInit,
QueryList,
ViewChildren,
inject,
} from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import { EChartsOption } from 'echarts';
@@ -26,7 +35,10 @@ interface RoleLegendItem {
MatProgressSpinnerModule,
NgxEchartsDirective,
MatButtonModule,
MatCardModule,
MatIconModule,
MatTooltipModule,
MatTooltip,
RouterModule,
],
templateUrl: './person-company-connections.component.html',
@@ -36,11 +48,9 @@ export class PersonCompanyConnectionsComponent implements OnInit {
private readonly route = inject(ActivatedRoute);
private readonly router = inject(Router);
private readonly locationStrategy = inject(LocationStrategy);
private readonly host = inject(ElementRef<HTMLElement>);
private readonly companyConnectionsApi = inject(CompanyConnectionsService);
private readonly graphCompanyLimit = 10;
private readonly searchInstitutionName = 'University of Duisburg-Essen';
private readonly personCategoryIndex = 0;
private readonly activeCompanyCategoryIndex = 1;
@@ -58,6 +68,22 @@ export class PersonCompanyConnectionsComponent implements OnInit {
private readonly relatedPersonColor = '#4f8df5';
private readonly fallbackRoleColor = '#8a95b3';
private readonly personIconSymbol = this.createAccountCircleSymbol(
this.authorColor,
);
private readonly registerPersonIconSymbol = this.createAccountCircleSymbol(
this.relatedPersonColor,
);
private readonly activeCompanyIconSymbol = this.createApartmentSymbol(
this.companyActiveColor,
);
private readonly removedCompanyIconSymbol = this.createApartmentSymbol(
this.companyRemovedColor,
);
private readonly roleColors: Record<string, string> = {
Geschäftsführer: '#2678e8',
Prokurist: '#39a96b',
@@ -81,6 +107,9 @@ export class PersonCompanyConnectionsComponent implements OnInit {
expandedOfficersCompanyKey: string | null = null;
showRelatedPersons = false;
@ViewChildren('connectionRow', { read: ElementRef })
private connectionRows!: QueryList<ElementRef<HTMLElement>>;
get connections(): CompanyConnection[] {
return this.data?.connections ?? [];
}
@@ -216,11 +245,6 @@ export class PersonCompanyConnectionsComponent implements OnInit {
this.expandedOfficersCompanyKey = companyKey;
}
toggleRelatedPersons(): void {
this.showRelatedPersons = !this.showRelatedPersons;
this.refreshGraph();
}
onGraphClick(event: any): void {
if (event.dataType !== 'node') {
return;
@@ -253,6 +277,17 @@ export class PersonCompanyConnectionsComponent implements OnInit {
);
}
toggleRelatedPersons(tooltip?: MatTooltip): void {
this.showRelatedPersons = !this.showRelatedPersons;
this.refreshGraph();
tooltip?.hide(0);
window.setTimeout(() => {
tooltip?.show(0);
});
}
private loadCompanyConnections(authorId: string): void {
this.loading = true;
this.error = false;
@@ -309,8 +344,9 @@ export class PersonCompanyConnectionsComponent implements OnInit {
id: personNodeId,
name: response.display_name || 'Person',
category: this.personCategoryIndex,
symbol: 'circle',
symbolSize: 44,
symbol: this.personIconSymbol,
symbolSize: 42,
symbolKeepAspect: true,
itemStyle: {
color: this.authorColor,
},
@@ -335,8 +371,11 @@ export class PersonCompanyConnectionsComponent implements OnInit {
category: isRemoved
? this.removedCompanyCategoryIndex
: this.activeCompanyCategoryIndex,
symbol: 'roundRect',
symbolSize: [48, 34],
symbol: isRemoved
? this.removedCompanyIconSymbol
: this.activeCompanyIconSymbol,
symbolSize: 44,
symbolKeepAspect: true,
itemStyle: {
color: isRemoved ? this.companyRemovedColor : this.companyActiveColor,
},
@@ -377,8 +416,9 @@ export class PersonCompanyConnectionsComponent implements OnInit {
searchName: relatedOfficer.name,
role: relatedRole,
category: this.registerPersonCategoryIndex,
symbol: 'circle',
symbolSize: 28,
symbol: this.registerPersonIconSymbol,
symbolSize: 30,
symbolKeepAspect: true,
itemStyle: {
color: this.relatedPersonColor,
},
@@ -412,7 +452,7 @@ export class PersonCompanyConnectionsComponent implements OnInit {
roam: true,
roamTrigger: 'global',
animation: false,
top: 24,
top: 34,
left: 20,
right: 20,
bottom: 64,
@@ -444,8 +484,8 @@ export class PersonCompanyConnectionsComponent implements OnInit {
left: 'center',
orient: 'horizontal',
itemGap: 18,
itemWidth: 18,
itemHeight: 14,
itemWidth: 20,
itemHeight: 20,
selectedMode: false,
textStyle: {
color: '#3f4659',
@@ -483,31 +523,19 @@ export class PersonCompanyConnectionsComponent implements OnInit {
return [
{
name: this.personCategoryName,
symbol: 'circle',
itemStyle: {
color: this.authorColor,
},
symbol: this.personIconSymbol,
},
{
name: this.activeCompanyCategoryName,
symbol: 'roundRect',
itemStyle: {
color: this.companyActiveColor,
},
symbol: this.activeCompanyIconSymbol,
},
{
name: this.removedCompanyCategoryName,
symbol: 'roundRect',
itemStyle: {
color: this.companyRemovedColor,
},
symbol: this.removedCompanyIconSymbol,
},
{
name: this.registerPersonCategoryName,
symbol: 'circle',
itemStyle: {
color: this.relatedPersonColor,
},
symbol: this.registerPersonIconSymbol,
},
];
}
@@ -523,40 +551,28 @@ export class PersonCompanyConnectionsComponent implements OnInit {
const legendData = [
{
name: this.personCategoryName,
icon: 'circle',
itemStyle: {
color: this.authorColor,
},
icon: this.personIconSymbol,
},
];
if (hasActiveCompany) {
legendData.push({
name: this.activeCompanyCategoryName,
icon: 'roundRect',
itemStyle: {
color: this.companyActiveColor,
},
icon: this.activeCompanyIconSymbol,
});
}
if (hasRemovedCompany) {
legendData.push({
name: this.removedCompanyCategoryName,
icon: 'roundRect',
itemStyle: {
color: this.companyRemovedColor,
},
icon: this.removedCompanyIconSymbol,
});
}
if (this.showRelatedPersons) {
legendData.push({
name: this.registerPersonCategoryName,
icon: 'circle',
itemStyle: {
color: this.relatedPersonColor,
},
icon: this.registerPersonIconSymbol,
});
}
@@ -619,12 +635,10 @@ export class PersonCompanyConnectionsComponent implements OnInit {
}
getPersonSearchQueryParams(name?: string | null): {
institutionName: string;
query: string;
page: number;
} {
return {
institutionName: this.searchInstitutionName,
query: name?.trim() ?? '',
page: 1,
};
@@ -636,19 +650,53 @@ export class PersonCompanyConnectionsComponent implements OnInit {
return;
}
const rows = Array.from(
this.host.nativeElement.querySelectorAll('.connection-row'),
) as HTMLElement[];
const selectedRow = this.connectionRows.find((row) => {
return (
row.nativeElement.dataset['companyKey'] === this.selectedCompanyKey
);
});
for (const row of rows) {
if (row.dataset['companyKey'] === this.selectedCompanyKey) {
row.scrollIntoView({
block: 'nearest',
behavior: 'smooth',
});
return;
}
}
selectedRow?.nativeElement.scrollIntoView({
block: 'nearest',
behavior: 'smooth',
});
});
}
private createAccountCircleSymbol(color: string): string {
const backgroundPath =
'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z';
const foregroundPath =
'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z';
const svg = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="${backgroundPath}" fill="#fff"/>
<path d="${foregroundPath}" fill="${color}"/>
</svg>
`;
return this.toSvgImageSymbol(svg);
}
private createApartmentSymbol(color: string): string {
const backgroundPath = 'M17 11V3H7v4H3v14h18V11h-4z';
const foregroundPath =
'M17 11V3H7v4H3v14h18V11h-4zM7 19H5v-2h2v2zm0-4H5v-2h2v2zm0-4H5V9h2v2zm4 8H9v-2h2v2zm0-4H9v-2h2v2zm0-4H9V9h2v2zm0-4H9V5h2v2zm4 12h-2v-2h2v2zm0-4h-2v-2h2v2zm0-4h-2V9h2v2zm0-4h-2V5h2v2zm4 12h-2v-2h2v2zm0-4h-2v-2h2v2z';
const svg = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="${backgroundPath}" fill="#fff"/>
<path d="${foregroundPath}" fill="${color}"/>
</svg>
`;
return this.toSvgImageSymbol(svg);
}
private toSvgImageSymbol(svg: string): string {
return `image://data:image/svg+xml;utf8,${encodeURIComponent(svg.trim())}`;
}
}
@@ -59,7 +59,7 @@
</div>
<div
*ngIf="timelineViewMode !== 'wordcloud' && hasYearRange"
*ngIf="hasYearRange"
class="year-filter"
aria-label="Zeitraum eingrenzen">
<div class="year-filter-top">
@@ -110,13 +110,6 @@
<span>{{ maxYear }}</span>
</div>
</div>
<div
*ngIf="timelineViewMode === 'wordcloud'"
class="year-filter"
aria-label="Anzahl angezeigter Themen">
<ng-content select="[timeline-wordcloud-controls]"></ng-content>
</div>
</div>
<ng-container *ngIf="timelineViewMode === 'wordcloud'; else timelineViews">
@@ -38,7 +38,7 @@
.timeline-header {
display: grid;
grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
align-items: flex-start;
gap: 24px;
margin-bottom: 28px;
@@ -103,6 +103,7 @@
border: 1px solid #dbe5f6;
border-radius: 10px;
background: #fbfdff;
box-sizing: border-box;
}
.year-filter-top,
@@ -14,26 +14,6 @@
(topicSelect)="onTimelineTopicSelect($event)"
(yearSelect)="onTimelineYearSelect($event)"
(loadEarlierYears)="onTimelineLoadEarlierYears()">
<div timeline-wordcloud-controls class="word-cloud-slider-wrapper">
@if (loadingWordCloud) {
<span class="slider-label">Themen laden ...</span>
} @else if (wordCloudOptions && sliderMax > 5) {
<span class="slider-label">{{ topN }} Themen</span>
<div class="word-cloud-slider" [style.--range-value]="sliderPercent">
<div class="range-track"></div>
<input
type="range"
[min]="5"
[max]="sliderMax"
[value]="topN"
(input)="onTopNChange($event)"
aria-label="Anzahl der angezeigten Themen" />
</div>
} @else {
<span class="slider-label">Themen</span>
}
</div>
<div timeline-wordcloud-content class="word-cloud-view">
@if (loadingWordCloud) {
<div class="word-cloud-state">Forschungsthemen werden geladen ...</div>
@@ -5,91 +5,6 @@
box-sizing: border-box;
}
.word-cloud-slider-wrapper {
display: flex;
align-items: center;
justify-content: center;
gap: 0.75rem;
min-height: 86px;
}
.slider-label {
font-size: 13px;
color: var(--sg-text-muted);
white-space: nowrap;
min-width: 4.5rem;
text-align: right;
}
.word-cloud-slider {
--accent: #0057ff;
--range-value: 50%;
position: relative;
width: 160px;
height: 22px;
.range-track {
position: absolute;
top: 50%;
left: 0;
right: 0;
height: 5px;
transform: translateY(-50%);
border-radius: 999px;
background: linear-gradient(
to right,
var(--accent) 0%,
var(--accent) var(--range-value),
#d8e2f4 var(--range-value),
#d8e2f4 100%
);
}
input[type='range'] {
position: absolute;
inset: 0;
width: 100%;
height: 22px;
margin: 0;
appearance: none;
background: transparent;
&::-webkit-slider-runnable-track,
&::-moz-range-track {
height: 5px;
background: transparent;
border: none;
}
&::-webkit-slider-thumb {
appearance: none;
width: 15px;
height: 15px;
margin-top: -5px;
border: 2px solid #ffffff;
border-radius: 50%;
background: var(--accent);
box-shadow:
0 0 0 1px #9ab7ff,
0 2px 6px rgba(0, 87, 255, 0.22);
cursor: pointer;
}
&::-moz-range-thumb {
width: 15px;
height: 15px;
border: 2px solid #ffffff;
border-radius: 50%;
background: var(--accent);
box-shadow:
0 0 0 1px #9ab7ff,
0 2px 6px rgba(0, 87, 255, 0.22);
cursor: pointer;
}
}
}
.word-cloud-view {
min-height: 420px;
}
@@ -54,32 +54,10 @@ export class PersonOverviewComponent implements OnInit {
loadingWordCloud = false;
wordCloudEmpty = false;
topN = 30;
sliderMax = 50;
get sliderPercent(): string {
if (this.sliderMax <= 5) return '100%';
return `${(((this.topN - 5) / (this.sliderMax - 5)) * 100).toFixed(1)}%`;
}
onTopNChange(event: Event): void {
this.topN = Number((event.target as HTMLInputElement).value);
this.rebuildWordCloud();
}
private allTopicData: Array<{
private rawTopicOccurrences: Array<{
name: string;
value: number;
topicId: string | undefined;
textStyle: { color: string; fontSize: number };
emphasis: {
textStyle: {
fontSize: number;
color: string;
shadowBlur: number;
shadowColor: string;
};
};
topicId: string;
year: number | undefined;
}> = [];
ngOnInit(): void {
@@ -123,6 +101,7 @@ export class PersonOverviewComponent implements OnInit {
onTimelineYearRangeChange(range: TimelineYearRange): void {
this.timelineStartYear = range.startYear;
this.timelineEndYear = range.endYear;
this.rebuildWordCloud();
this.updateTimelineQueryParams(
{
@@ -308,30 +287,20 @@ export class PersonOverviewComponent implements OnInit {
this.timelineEarlierYearsLoadFailed = false;
}
private readonly blueShades = [
'#0057ff',
'#1a6fff',
'#2952d9',
'#3d7cff',
'#1240cc',
'#5a90ff',
'#0044cc',
'#4d85ff',
'#0b4fe0',
'#2563eb',
private readonly timelineColors = [
'#7255d9',
'#2678e8',
'#39a96b',
'#f59e0b',
'#e0527c',
];
private topicColor(name: string): string {
const hash = name.split('').reduce((acc, c) => acc + c.charCodeAt(0), 0);
return this.blueShades[hash % this.blueShades.length];
}
private loadWordCloud(authorId: string): void {
if (!authorId || authorId === '0') {
this.wordCloudOptions = null;
this.wordCloudEmpty = false;
this.loadingWordCloud = false;
this.allTopicData = [];
this.rawTopicOccurrences = [];
return;
}
@@ -344,64 +313,28 @@ export class PersonOverviewComponent implements OnInit {
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe({
next: (page) => {
const counts = new Map<string, number>();
const nameToId = new Map<string, string>();
this.rawTopicOccurrences = [];
page.elements?.forEach((work) => {
const year = work.publication_year ?? undefined;
work.topics?.forEach((topic) => {
if (topic.display_name && topic.id) {
counts.set(
topic.display_name,
(counts.get(topic.display_name) ?? 0) + 1,
);
if (!nameToId.has(topic.display_name)) {
nameToId.set(topic.display_name, topic.id);
}
this.rawTopicOccurrences.push({
name: topic.display_name,
topicId: topic.id,
year,
});
}
});
});
const allValues = Array.from(counts.values());
const minVal = Math.min(...allValues);
const maxVal = Math.max(...allValues);
const computeSize = (v: number): number =>
maxVal === minVal
? 22
: Math.round(12 + ((v - minVal) / (maxVal - minVal)) * (32 - 12));
this.allTopicData = Array.from(counts.entries())
.sort((a, b) => b[1] - a[1])
.map(([name, value]) => {
const fontSize = computeSize(value);
return {
name,
value,
topicId: nameToId.get(name),
textStyle: { color: this.topicColor(name), fontSize },
emphasis: {
textStyle: {
fontSize: Math.round(fontSize * 1.1),
color: '#101a3d',
shadowBlur: 16,
shadowColor: 'rgba(0, 87, 255, 0.35)',
},
},
};
});
this.loadingWordCloud = false;
if (this.allTopicData.length === 0) {
if (this.rawTopicOccurrences.length === 0) {
this.wordCloudEmpty = true;
return;
}
this.sliderMax = Math.min(50, this.allTopicData.length);
this.topN = Math.min(30, this.sliderMax);
setTimeout(() => {
this.rebuildWordCloud();
});
setTimeout(() => this.rebuildWordCloud());
},
error: (error) => {
console.error('Word cloud could not be loaded.', error);
@@ -412,8 +345,57 @@ export class PersonOverviewComponent implements OnInit {
}
private rebuildWordCloud(): void {
const data = this.allTopicData.slice(0, this.topN);
if (data.length === 0) return;
const start = this.timelineStartYear;
const end = this.timelineEndYear;
const counts = new Map<string, number>();
const nameToId = new Map<string, string>();
for (const occ of this.rawTopicOccurrences) {
if (start !== undefined && (occ.year === undefined || occ.year < start))
continue;
if (end !== undefined && (occ.year === undefined || occ.year > end))
continue;
counts.set(occ.name, (counts.get(occ.name) ?? 0) + 1);
if (!nameToId.has(occ.name)) nameToId.set(occ.name, occ.topicId);
}
if (counts.size === 0) {
this.wordCloudOptions = null;
this.wordCloudEmpty = true;
return;
}
this.wordCloudEmpty = false;
const allValues = Array.from(counts.values());
const minVal = Math.min(...allValues);
const maxVal = Math.max(...allValues);
const computeSize = (v: number): number =>
maxVal === minVal
? 22
: Math.round(12 + ((v - minVal) / (maxVal - minVal)) * (32 - 12));
const sorted = Array.from(counts.entries()).sort((a, b) => b[1] - a[1]);
const data = sorted.slice(0, 30).map(([name, value], i) => {
const fontSize = computeSize(value);
const color = this.timelineColors[i % this.timelineColors.length];
return {
name,
value,
topicId: nameToId.get(name),
textStyle: { color, fontSize },
emphasis: {
textStyle: {
fontSize: Math.round(fontSize * 1.1),
color,
shadowBlur: 16,
shadowColor: 'rgba(0, 87, 255, 0.35)',
},
},
};
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.wordCloudOptions = {
series: [
@@ -0,0 +1,385 @@
<div class="detail-page">
<div class="page-header">
<div class="breadcrumb">
<span>Bund Projekte</span>
<mat-icon>chevron_right</mat-icon>
<span>Projektdetails</span>
</div>
</div>
@if (bundProject) {
<div class="project-hero">
<div class="hero-content">
<div class="eyebrow">
<span class="project-badge">Bund Projekt</span>
<span class="project-id"
>ID: {{ bundProject.funding_reference }}</span
>
<!-- @if (isNewProject()) {
<span class="new-badge">Neu</span>
} -->
</div>
<h1>{{ bundProject.title || 'Ohne Titel' }}</h1>
@if (bundProject.funding_reference) {
<p class="project-reference">
<strong>{{ bundProject.funding_type }}</strong>
</p>
}
<div class="hero-actions">
<!-- @if (bundProject.project_agency) {
<div class="agency-info" (click)="searchForAgency(bundProject.project_agency)">
<mat-icon>account_balance</mat-icon>
<span>{{ bundProject.project_agency_fullname || bundProject.project_agency }}</span>
</div>
} -->
<!-- @if (bundProject.funding_type) {
<div class="funding-type-info" (click)="searchForFundingType(bundProject.funding_type)">
<mat-icon>category</mat-icon>
<span>{{ bundProject.funding_type }}</span>
</div>
} -->
</div>
</div>
<div class="metrics-grid">
<div class="metric-item">
<mat-icon>calendar_today</mat-icon>
<div class="metric-content">
<strong>{{ getStartDate() || 'N/A' }}</strong>
<span>Startdatum</span>
</div>
</div>
<div class="metric-item">
<mat-icon>event_busy</mat-icon>
<div class="metric-content">
<strong>{{ getFundingStatus(getEndDate()) }}</strong>
<span>Enddatum</span>
</div>
</div>
@if (bundProject.funding_amount) {
<div class="metric-item">
<mat-icon>paid</mat-icon>
<div class="metric-content">
<strong>{{ getFundingAmountDisplay() }}</strong>
<span>Fördersumme</span>
</div>
</div>
}
@if (bundProject.funding_profile) {
<div class="metric-item">
<mat-icon>assignment</mat-icon>
<div class="metric-content">
<strong>{{ bundProject.funding_profile }}</strong>
<span>Förderprofil</span>
</div>
</div>
}
</div>
</div>
@if (bundProject.description) {
<mat-card appearance="outlined" class="card description-card">
<div class="section-header">
<mat-icon>description</mat-icon>
<h2>Beschreibung</h2>
</div>
<p class="description-text">{{ bundProject.description }}</p>
</mat-card>
}
<div class="content-grid">
<main class="main-content">
<!-- Beteiligte Personen -->
@if (getAssociatedPersons().length > 0) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>people</mat-icon>
<h2>Beteiligte Personen</h2>
<span class="count-badge">{{
getAssociatedPersons().length
}}</span>
</div>
<div class="person-grid">
@for (person of getAssociatedPersons(); track person) {
<div class="person-item" (click)="searchForPersonName(person)">
<div class="avatar">{{ getInitials(person) }}</div>
<div class="person-name">{{ person }}</div>
</div>
}
</div>
</mat-card>
}
<!-- Beteiligte Institutionen -->
@if (getInstitutions().length > 0) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>business</mat-icon>
<h2>Beteiligte Institutionen</h2>
<span class="count-badge">{{ getInstitutions().length }}</span>
</div>
<div class="institution-grid">
@for (institution of getInstitutions(); track institution) {
<div
class="institution-item"
(click)="searchForInstitutionName(institution)">
<mat-icon>apartment</mat-icon>
<span>{{ institution }}</span>
</div>
}
</div>
</mat-card>
}
<!-- Joint Project Information
@if (bundProject.joint_project) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>groups</mat-icon>
<h2>Gemeinschaftsprojekt</h2>
</div>
<div class="joint-project-content">
<mat-icon>link</mat-icon>
<span>{{ bundProject.joint_project }}</span>
</div>
</mat-card>
} -->
<!-- Organisatorische Details -->
@if (
bundProject.executing_agency ||
bundProject.funding_recipient ||
bundProject.project_agency ||
bundProject.department ||
bundProject.division
) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>organization</mat-icon>
<h2>Organisation</h2>
</div>
<dl class="details-list">
@if (bundProject.executing_agency) {
<div class="detail-row">
<dt>Ausführende Stelle</dt>
<dd>
{{ bundProject.executing_agency }}
</dd>
</div>
}
@if (bundProject.funding_recipient) {
<div class="detail-row">
<dt>Förderempfänger</dt>
<dd>{{ bundProject.funding_recipient }}</dd>
</div>
}
@if (bundProject.project_agency) {
<div class="detail-row">
<dt>Projektagentur</dt>
<dd>
{{
bundProject.project_agency_fullname ||
bundProject.project_agency
}}
</dd>
</div>
}
@if (bundProject.department) {
<div class="detail-row">
<dt>Abteilung</dt>
<dd>
{{
bundProject.department_fullname || bundProject.department
}}
</dd>
</div>
}
@if (bundProject.division) {
<div class="detail-row">
<dt>Division</dt>
<dd>{{ bundProject.division }}</dd>
</div>
}
</dl>
</mat-card>
}
<!-- Standort -->
@if (
bundProject.location ||
bundProject.municipality ||
bundProject.state ||
bundProject.country
) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>location_on</mat-icon>
<h2>Standort</h2>
</div>
<dl class="details-list">
@if (bundProject.location) {
<div class="detail-row">
<dt>Standort</dt>
<dd>
{{ bundProject.location }}
</dd>
</div>
}
@if (bundProject.municipality) {
<div class="detail-row">
<dt>Gemeinde</dt>
<dd>{{ bundProject.municipality }}</dd>
</div>
}
@if (bundProject.state) {
<div class="detail-row">
<dt>Bundesland</dt>
<dd>
{{ bundProject.state }}
</dd>
</div>
}
@if (bundProject.country) {
<div class="detail-row">
<dt>Land</dt>
<dd>{{ bundProject.country }}</dd>
</div>
}
@if (bundProject.municipality_code) {
<div class="detail-row">
<dt>Gemeindeschlüssel</dt>
<dd>{{ bundProject.municipality_code }}</dd>
</div>
}
</dl>
</mat-card>
}
<!-- Zusätzliche Informationen -->
@if (
bundProject.performance_plan_code ||
bundProject.performance_plan_fullname ||
bundProject.publication_date ||
bundProject.record_date
) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>more_info</mat-icon>
<h2>Weitere Informationen</h2>
</div>
<dl class="details-list">
@if (bundProject.performance_plan_code) {
<div class="detail-row">
<dt>Leistungsplancode</dt>
<dd>{{ bundProject.performance_plan_code }}</dd>
</div>
}
@if (bundProject.performance_plan_fullname) {
<div class="detail-row">
<dt>Leistungsplan</dt>
<dd>{{ bundProject.performance_plan_fullname }}</dd>
</div>
}
@if (bundProject.publication_date) {
<div class="detail-row">
<dt>Veröffentlichungsdatum</dt>
<dd>{{ bundProject.publication_date }}</dd>
</div>
}
@if (bundProject.record_date) {
<div class="detail-row">
<dt>Datensatzdatum</dt>
<dd>{{ bundProject.record_date }}</dd>
</div>
}
</dl>
</mat-card>
}
</main>
<aside class="sidebar">
<!-- Projektdetails -->
<mat-card appearance="outlined" class="card details-card">
<div class="section-header">
<mat-icon>info</mat-icon>
<h2>Projektdetails</h2>
</div>
<dl class="details-list">
<div class="detail-row">
<dt>Projekt ID</dt>
<dd>{{ bundProject.funding_reference || 'N/A' }}</dd>
</div>
<!-- <div class="detail-row">
<dt>Titel</dt>
<dd>{{ bundProject.title || 'N/A' }}</dd>
</div> -->
<!-- @if (bundProject.funding_reference) {
<div class="detail-row">
<dt>Förderreferenz</dt>
<dd>{{ bundProject.funding_reference }}</dd>
</div>
} -->
@if (bundProject.funding_type) {
<div class="detail-row">
<dt>Förderart</dt>
<dd>
{{ bundProject.funding_type }}
</dd>
</div>
}
@if (bundProject.funding_profile) {
<div class="detail-row">
<dt>Förderprofil</dt>
<dd>{{ bundProject.funding_profile }}</dd>
</div>
}
@if (bundProject.funding_amount) {
<div class="detail-row">
<dt>Fördersumme</dt>
<dd>{{ getFundingAmountDisplay() }}</dd>
</div>
}
@if (bundProject.funding_amount) {
<div class="detail-row">
<dt>Agency</dt>
<dd>
{{
bundProject.project_agency_fullname ||
bundProject.project_agency
}}
</dd>
</div>
}
<!-- <div class="detail-row">
<dt>Startdatum</dt>
<dd>{{ getStartDate() || 'N/A' }}</dd>
</div>
<div class="detail-row">
<dt>Enddatum</dt>
<dd>{{ getFundingStatus(getEndDate()) }}</dd>
</div> -->
@if (getDuration()) {
<div class="detail-row">
<dt>Laufzeit</dt>
<dd>{{ getDuration() }}</dd>
</div>
}
@if (bundProject.joint_project) {
<div class="detail-row">
<dt>Gemeinschaftsprojekt</dt>
<dd>{{ bundProject.joint_project }}</dd>
</div>
}
</dl>
</mat-card>
</aside>
</div>
} @else {
<div class="error-container">
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<p>Bund Projekt nicht gefunden.</p>
</div>
</div>
}
</div>
@@ -0,0 +1,527 @@
// Complete SCSS with all styles including clickable elements
.detail-page {
padding: 28px 32px 42px;
max-width: 100%;
margin: 0 auto;
}
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 18px;
margin-bottom: 24px;
}
.back-link {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 16px;
border: 1px solid #d9e2f0;
border-radius: var(--sg-radius-sm);
background: #fff;
color: var(--sg-text);
cursor: pointer;
font-size: 14px;
transition: all 0.2s;
}
.back-link:hover {
background: #f5f7fa;
border-color: #b8c5d6;
}
.back-link mat-icon {
width: 20px;
height: 20px;
font-size: 20px;
}
.breadcrumb {
display: flex;
align-items: center;
gap: 6px;
color: var(--sg-text-muted);
font-size: 13px;
}
.breadcrumb mat-icon {
width: 18px;
height: 18px;
font-size: 18px;
}
.breadcrumb span:last-child {
color: var(--sg-text);
font-weight: 500;
}
.project-hero {
background: #f8fafc;
border: 1px solid #d9e2f0;
border-radius: var(--sg-radius-md);
padding: 28px 32px;
margin-bottom: 28px;
}
.hero-content {
margin-bottom: 24px;
}
.eyebrow {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 12px;
flex-wrap: wrap;
}
.project-badge {
display: inline-block;
padding: 4px 12px;
background: #e8edf5;
color: var(--sg-text);
border-radius: var(--sg-radius-sm);
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.project-id {
color: var(--sg-text-muted);
font-size: 13px;
}
.new-badge {
display: inline-block;
padding: 2px 10px;
background: #27ae60;
color: #fff;
border-radius: var(--sg-radius-sm);
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
h1 {
margin: 0 0 8px;
font-size: 26px;
line-height: 1.3;
font-weight: 700;
color: var(--sg-text);
}
.project-reference {
margin: 0 0 16px;
color: var(--sg-text-muted);
font-size: 14px;
}
.hero-actions {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.agency-info,
.funding-type-info {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 16px;
background: #fff;
border: 1px solid #d9e2f0;
border-radius: var(--sg-radius-sm);
color: var(--sg-text);
font-size: 14px;
cursor: pointer;
transition: all 0.2s;
}
.agency-info:hover,
.funding-type-info:hover {
background: #f5f7fa;
border-color: #b8c5d6;
}
.agency-info mat-icon,
.funding-type-info mat-icon {
color: var(--sg-text-muted);
width: 20px;
height: 20px;
font-size: 20px;
}
.metrics-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 16px;
padding-top: 20px;
border-top: 1px solid #d9e2f0;
}
.metric-item {
display: flex;
align-items: center;
gap: 12px;
}
.metric-item mat-icon {
color: var(--sg-text-muted);
width: 24px;
height: 24px;
font-size: 24px;
}
.metric-content {
display: flex;
flex-direction: column;
}
.metric-content strong {
font-size: 15px;
color: var(--sg-text);
line-height: 1.3;
}
.metric-content span {
font-size: 12px;
color: var(--sg-text-muted);
}
.card {
margin-bottom: 24px;
border-color: #d9e2f0 !important;
border-radius: var(--sg-radius-md) !important;
}
.card ::ng-deep .mat-mdc-card-content {
padding: 0;
}
.section-header {
display: flex;
align-items: center;
gap: 10px;
padding: 16px 20px 12px;
border-bottom: 1px solid #f0f2f5;
}
.section-header mat-icon {
color: var(--sg-text-muted);
width: 22px;
height: 22px;
font-size: 22px;
}
.section-header h2 {
margin: 0;
font-size: 16px;
font-weight: 600;
color: var(--sg-text);
}
.count-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 24px;
height: 24px;
padding: 0 8px;
margin-left: auto;
background: #e8edf5;
border-radius: 12px;
color: var(--sg-text-muted);
font-size: 12px;
font-weight: 500;
}
.description-text {
padding: 16px 20px 20px;
margin: 0;
color: var(--sg-text);
font-size: 14px;
line-height: 1.6;
}
.content-grid {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 24px;
}
.main-content {
display: flex;
flex-direction: column;
gap: 24px;
}
.sidebar {
display: flex;
flex-direction: column;
gap: 24px;
}
.person-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 12px;
padding: 16px 20px 20px;
}
.person-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 12px;
border: 1px solid #d9e2f0;
border-radius: var(--sg-radius-sm);
background: #fff;
cursor: pointer;
transition: all 0.2s;
}
.person-item:hover {
background: #f8fafc;
border-color: #b8c5d6;
transform: translateY(-1px);
}
.avatar {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 50%;
background: #e8edf5;
color: var(--sg-text);
font-size: 13px;
font-weight: 600;
flex-shrink: 0;
}
.person-name {
font-size: 13px;
font-weight: 500;
color: var(--sg-text);
}
.institution-grid {
display: grid;
grid-template-columns: 1fr;
gap: 8px;
padding: 16px 20px 20px;
}
.institution-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 12px;
border: 1px solid #d9e2f0;
border-radius: var(--sg-radius-sm);
background: #fff;
font-size: 13px;
color: var(--sg-text);
cursor: pointer;
transition: all 0.2s;
}
.institution-item:hover {
background: #f8fafc;
border-color: #b8c5d6;
}
.institution-item mat-icon {
color: var(--sg-text-muted);
width: 20px;
height: 20px;
font-size: 20px;
flex-shrink: 0;
}
.joint-project-content {
display: flex;
align-items: center;
gap: 12px;
padding: 16px 20px 20px;
color: var(--sg-text);
font-size: 14px;
}
.joint-project-content mat-icon {
color: var(--sg-text-muted);
width: 24px;
height: 24px;
font-size: 24px;
flex-shrink: 0;
}
.details-list {
margin: 0;
padding: 16px 20px 20px;
}
.detail-row {
display: grid;
grid-template-columns: 140px 1fr;
gap: 24px;
padding: 8px 0;
border-bottom: 1px solid #f0f2f5;
}
.detail-row:last-child {
border-bottom: none;
}
.detail-row dt {
color: var(--sg-text-muted);
font-size: 13px;
font-weight: 500;
}
.detail-row dd {
margin: 0;
color: var(--sg-text);
font-size: 13px;
word-break: break-word;
display: flex;
align-items: center;
gap: 6px;
}
.detail-row dd.clickable {
cursor: pointer;
transition: color 0.2s;
}
.detail-row dd.clickable:hover {
color: var(--sg-primary, #0066cc);
}
.detail-row dd.clickable:hover .search-icon {
opacity: 1;
}
.search-icon {
width: 16px;
height: 16px;
font-size: 16px;
opacity: 0;
transition: opacity 0.2s;
color: var(--sg-text-muted);
}
.detail-row dd:hover .search-icon {
opacity: 1;
}
.empty-state {
padding: 20px;
text-align: center;
color: var(--sg-text-muted);
font-size: 14px;
}
.error-container {
display: flex;
align-items: center;
justify-content: center;
min-height: 400px;
}
.error-state {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
color: var(--sg-text-muted);
}
.error-state mat-icon {
width: 48px;
height: 48px;
font-size: 48px;
color: #e74c3c;
}
.error-state p {
margin: 0;
font-size: 16px;
}
// Clickable external link styling
.external-link {
color: var(--sg-primary, #0066cc);
text-decoration: none;
}
.external-link:hover {
text-decoration: underline;
}
@media (max-width: 992px) {
.content-grid {
grid-template-columns: 1fr;
gap: 20px;
}
}
@media (max-width: 768px) {
.detail-page {
padding: 16px;
}
.page-header {
flex-direction: column;
align-items: flex-start;
gap: 12px;
}
.project-hero {
padding: 20px;
}
.metrics-grid {
grid-template-columns: 1fr 1fr;
gap: 12px;
}
h1 {
font-size: 22px;
}
.detail-row {
grid-template-columns: 1fr;
gap: 4px;
}
.person-grid {
grid-template-columns: 1fr;
}
.eyebrow {
gap: 8px;
}
}
@media (max-width: 480px) {
.metrics-grid {
grid-template-columns: 1fr;
}
.hero-actions {
flex-direction: column;
}
.agency-info,
.funding-type-info {
width: 100%;
justify-content: center;
}
}
@@ -0,0 +1,163 @@
import { Component, OnInit, inject } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { CommonModule } from '@angular/common';
import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { BundProjectDetails } from '../../../api/model/bundProjectDetails';
import { Router } from '@angular/router';
@Component({
selector: 'app-bund-details',
standalone: true,
imports: [CommonModule, MatCardModule, MatIconModule],
templateUrl: './bund-details.component.html',
styleUrl: './bund-details.component.scss',
})
export class BundDetailsComponent implements OnInit {
private route = inject(ActivatedRoute);
bundProject: BundProjectDetails | undefined;
constructor(private router: Router) {}
ngOnInit(): void {
this.route.data.subscribe(({ bundSingleProject }) => {
console.log('Bund Project:', bundSingleProject);
this.bundProject = bundSingleProject;
});
}
getInitials(name: string | null | undefined): string {
if (!name) return '';
const parts = name.trim().split(/\s+/);
if (parts.length > 1) {
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
}
return parts[0][0].toUpperCase();
}
getFundingStatus(fundingEndDate: string | null | undefined): string {
if (!fundingEndDate) return 'N/A';
if (fundingEndDate === '2999') return 'laufend';
const year = parseInt(fundingEndDate, 10);
if (isNaN(year)) return fundingEndDate;
return year >= new Date().getFullYear()
? `${fundingEndDate} (laufend)`
: `${fundingEndDate} (abgeschlossen)`;
}
formatCurrency(amount: number | null | undefined): string {
if (amount === null || amount === undefined) return 'N/A';
// Format as Euro with thousands separators
return new Intl.NumberFormat('de-DE', {
style: 'currency',
currency: 'EUR',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
}).format(amount);
}
searchForPersonName(personName: string): void {
this.router.navigate(['/persons'], {
queryParams: {
query: personName,
},
});
}
searchForInstitutionName(institutionName: string): void {
this.router.navigate(['/institutions'], {
queryParams: {
search: institutionName,
},
});
}
// searchForLocation(location: string): void {
// this.router.navigate(['/bund-projects'], {
// queryParams: {
// location: location
// }
// });
// }
// searchForState(state: string): void {
// this.router.navigate(['/bund-projects'], {
// queryParams: {
// state: state
// }
// });
// }
// searchForFundingType(fundingType: string): void {
// this.router.navigate(['/bund-projects'], {
// queryParams: {
// fundingType: fundingType
// }
// });
// }
// searchForAgency(agency: string): void {
// this.router.navigate(['/bund-projects'], {
// queryParams: {
// agency: agency
// }
// });
// }
private formatGermanDate(dateString: string): string {
if (!dateString) return '';
return new Intl.DateTimeFormat('de-DE', {
day: 'numeric',
month: 'long',
year: 'numeric',
}).format(new Date(dateString));
}
/**
* All associated persons as a simple list.
*/
getAssociatedPersons(): string[] {
return this.bundProject?.associated_persons || [];
}
getStartDate(): string {
return this.formatGermanDate(this.bundProject?.funding_start_date ?? '');
}
getEndDate(): string {
return this.formatGermanDate(this.bundProject?.funding_end_date ?? '');
}
getDuration(): string {
const start = this.bundProject?.funding_start_date;
const end = this.bundProject?.funding_end_date;
if (!start || !end) return '';
return `von ${this.formatGermanDate(start)} bis ${this.formatGermanDate(end)}`;
}
/**
* All institutions as a simple list.
*/
getInstitutions(): string[] {
return this.bundProject?.institutions || [];
}
/**
* Check if project is new
*/
isNewProject(): boolean {
return this.bundProject?.is_new === true;
}
/**
* Get display name for funding amount
*/
getFundingAmountDisplay(): string {
if (!this.bundProject?.funding_amount) return 'N/A';
return this.formatCurrency(this.bundProject.funding_amount);
}
goBack(): void {
window.history.back();
}
}
@@ -0,0 +1,245 @@
<div class="detail-page">
<div class="page-header">
<div class="breadcrumb">
<span>DFG Projekte</span>
<mat-icon>chevron_right</mat-icon>
<span>Projektdetails</span>
</div>
</div>
@if (dfgProject) {
<div class="project-hero">
<div class="hero-content">
<div class="eyebrow">
<span class="project-badge">DFG Projekt</span>
<span class="project-id">ID: {{ dfgProject.id }}</span>
</div>
<h1>{{ dfgProject.title }}</h1>
@if (dfgProject.project_identifier) {
<p class="project-identifier">
<strong>{{ dfgProject.project_identifier.split('-')[0] }}</strong>
</p>
}
<div class="hero-actions">
@if (dfgProject.link) {
<a [href]="dfgProject.link" target="_blank" class="primary-action">
<mat-icon>open_in_new</mat-icon>
<span>Zum Projekt</span>
</a>
}
@if (dfgProject.website) {
<a
[href]="dfgProject.website"
target="_blank"
class="secondary-action">
<mat-icon>language</mat-icon>
<span>Webseite</span>
</a>
}
</div>
</div>
<div class="metrics-grid">
<div class="metric-item">
<mat-icon>calendar_today</mat-icon>
<div class="metric-content">
<strong>{{ dfgProject.funding_start_date || 'N/A' }}</strong>
<span>Fördersbeginn</span>
</div>
</div>
<div class="metric-item">
<mat-icon>event_busy</mat-icon>
<div class="metric-content">
<strong>{{ getFundingStatus(dfgProject.funding_end_date) }}</strong>
<span>Fördersende</span>
</div>
</div>
<!-- @if (dfgProject.subject_area) {
<div class="metric-item">
<mat-icon>category</mat-icon>
<div class="metric-content">
<strong>{{ dfgProject.subject_area }}</strong>
<span>Fachliche Zuordnung</span>
</div>
</div>
} -->
@if (dfgProject.dfg_procedure) {
<div class="metric-item">
<mat-icon>gavel</mat-icon>
<div class="metric-content">
<strong>{{ dfgProject.dfg_procedure }}</strong>
<span>DFG Verfahren</span>
</div>
</div>
}
<!-- @if (dfgProject.funding_type) {
<div class="metric-item">
<mat-icon>paid</mat-icon>
<div class="metric-content">
<strong>{{ dfgProject.funding_type }}</strong>
<span>Förderung</span>
</div>
</div>
} -->
@if (dfgProject.international_reference) {
<div class="metric-item">
<mat-icon>public</mat-icon>
<div class="metric-content">
<strong>{{ dfgProject.international_reference }}</strong>
<span>Internationaler Bezug</span>
</div>
</div>
}
</div>
</div>
@if (dfgProject.description) {
<mat-card appearance="outlined" class="card description-card">
<div class="section-header">
<mat-icon>description</mat-icon>
<h2>Beschreibung</h2>
</div>
<p class="description-text">{{ dfgProject.description }}</p>
</mat-card>
}
<div class="content-grid">
<main class="main-content">
<!-- Beteiligte Personen -->
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>people</mat-icon>
<h2>Beteiligte Personen</h2>
<span class="count-badge">{{ getAssociatedPersons().length }}</span>
</div>
@if (getAssociatedPersons().length > 0) {
<div class="person-grid">
@for (person of getAssociatedPersons(); track person) {
<div (click)="searchForPersonName(person)" class="person-item">
<div class="avatar">{{ getInitials(person) }}</div>
<div class="person-name">{{ person }}</div>
</div>
}
</div>
} @else {
<div class="empty-state">Keine Personen gefunden.</div>
}
</mat-card>
<!-- Beteiligte Institutionen -->
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>business</mat-icon>
<h2>Beteiligte Institutionen</h2>
<span class="count-badge">{{ getInstitutions().length }}</span>
</div>
@if (getInstitutions().length > 0) {
<div class="institution-grid">
@for (institution of getInstitutions(); track institution) {
<div
(click)="searchForInstitutionName(institution)"
class="institution-item">
<mat-icon>apartment</mat-icon>
<span>{{ institution }}</span>
</div>
}
</div>
} @else {
<div class="empty-state">Keine Institutionen gefunden.</div>
}
</mat-card>
<!-- Teilprojekt -->
<!-- @if (dfgProject.subproject_of) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>account_tree</mat-icon>
<h2>Teilprojekt</h2>
</div>
<dl class="details-list">
<div class="detail-row">
<dt>Teilprojekt zu</dt>
<dd>{{ dfgProject.subproject_of }}</dd>
</div>
</dl>
</mat-card>
} -->
</main>
<aside class="sidebar">
<!-- Projektdetails -->
<mat-card appearance="outlined" class="card details-card">
<div class="section-header">
<mat-icon>info</mat-icon>
<h2>Projektdetails</h2>
</div>
<dl class="details-list">
<div class="detail-row">
<dt>Projekt ID</dt>
<dd>{{ dfgProject.id || 'N/A' }}</dd>
</div>
<div class="detail-row">
<dt>Titel</dt>
<dd>{{ dfgProject.title || 'N/A' }}</dd>
</div>
<div class="detail-row">
<dt>Projektkennung</dt>
<dd>{{ dfgProject.project_identifier || 'N/A' }}</dd>
</div>
<div class="detail-row">
<dt>Fachliche Zuordnung</dt>
<dd>{{ dfgProject.subject_area || 'N/A' }}</dd>
</div>
<div class="detail-row">
<dt>DFG-Verfahren</dt>
<dd>{{ dfgProject.dfg_procedure || 'N/A' }}</dd>
</div>
<!-- <div class="detail-row">
<dt>Förderung</dt>
<dd>{{ dfgProject.funding_type || 'N/A' }}</dd>
</div> -->
<div class="detail-row">
<dt>Fördersbeginn</dt>
<dd>{{ dfgProject.funding_start_date || 'N/A' }}</dd>
</div>
<div class="detail-row">
<dt>Fördersende</dt>
<dd>{{ getFundingStatus(dfgProject.funding_end_date) }}</dd>
</div>
@if (dfgProject.subproject_of) {
<div class="detail-row">
<dt>Teilprojekt von</dt>
<dd>{{ dfgProject.subproject_of }}</dd>
</div>
}
@if (dfgProject.international_reference) {
<div class="detail-row">
<dt>Internationaler Bezug</dt>
<dd>{{ dfgProject.international_reference }}</dd>
</div>
}
@if (dfgProject.website) {
<div class="detail-row">
<dt>Webseite</dt>
<dd>
<a
[href]="dfgProject.website"
target="_blank"
class="external-link"
>{{ dfgProject.website }}</a
>
</dd>
</div>
}
</dl>
</mat-card>
</aside>
</div>
} @else {
<div class="error-container">
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<p>DFG Projekt nicht gefunden.</p>
</div>
</div>
}
</div>
@@ -0,0 +1,467 @@
.detail-page {
padding: 28px 32px 42px;
max-width: 100%;
margin: 0 auto;
}
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 18px;
margin-bottom: 24px;
}
.back-link {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 16px;
border: 1px solid #d9e2f0;
border-radius: var(--sg-radius-sm);
background: #fff;
color: var(--sg-text);
cursor: pointer;
font-size: 14px;
transition: all 0.2s;
}
.back-link:hover {
background: #f5f7fa;
border-color: #b8c5d6;
}
.back-link mat-icon {
width: 20px;
height: 20px;
font-size: 20px;
}
.breadcrumb {
display: flex;
align-items: center;
gap: 6px;
color: var(--sg-text-muted);
font-size: 13px;
}
.breadcrumb mat-icon {
width: 18px;
height: 18px;
font-size: 18px;
}
.breadcrumb span:last-child {
color: var(--sg-text);
font-weight: 500;
}
.project-hero {
background: #f8fafc;
border: 1px solid #d9e2f0;
border-radius: var(--sg-radius-md);
padding: 28px 32px;
margin-bottom: 28px;
}
.hero-content {
margin-bottom: 24px;
}
.eyebrow {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 12px;
}
.project-badge {
display: inline-block;
padding: 4px 12px;
background: #e8edf5;
color: var(--sg-text);
border-radius: var(--sg-radius-sm);
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.project-id {
color: var(--sg-text-muted);
font-size: 13px;
}
h1 {
margin: 0 0 8px;
font-size: 26px;
line-height: 1.3;
font-weight: 700;
color: var(--sg-text);
}
.project-identifier {
margin: 0 0 16px;
color: var(--sg-text-muted);
font-size: 14px;
}
.hero-actions {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.primary-action,
.secondary-action {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 10px 20px;
border-radius: var(--sg-radius-sm);
text-decoration: none;
font-size: 14px;
font-weight: 500;
transition: all 0.2s;
}
.primary-action {
background: var(--sg-primary, #0066cc);
color: #fff;
border: none;
}
.primary-action:hover {
background: var(--sg-primary-dark, #0052a3);
}
.secondary-action {
background: #fff;
color: var(--sg-text);
border: 1px solid #d9e2f0;
}
.secondary-action:hover {
background: #f5f7fa;
border-color: #b8c5d6;
}
.primary-action mat-icon,
.secondary-action mat-icon {
width: 20px;
height: 20px;
font-size: 20px;
}
.metrics-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 16px;
padding-top: 20px;
border-top: 1px solid #d9e2f0;
}
.metric-item {
display: flex;
align-items: center;
gap: 12px;
}
.metric-item mat-icon {
color: var(--sg-text-muted);
width: 24px;
height: 24px;
font-size: 24px;
}
.metric-content {
display: flex;
flex-direction: column;
}
.metric-content strong {
font-size: 15px;
color: var(--sg-text);
line-height: 1.3;
}
.metric-content span {
font-size: 12px;
color: var(--sg-text-muted);
}
.card {
margin-bottom: 24px;
border-color: #d9e2f0 !important;
border-radius: var(--sg-radius-md) !important;
}
.card ::ng-deep .mat-mdc-card-content {
padding: 0;
}
.section-header {
display: flex;
align-items: center;
gap: 10px;
padding: 16px 20px 12px;
border-bottom: 1px solid #f0f2f5;
}
.section-header mat-icon {
color: var(--sg-text-muted);
width: 22px;
height: 22px;
font-size: 22px;
}
.section-header h2 {
margin: 0;
font-size: 16px;
font-weight: 600;
color: var(--sg-text);
}
.count-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 24px;
height: 24px;
padding: 0 8px;
margin-left: auto;
background: #e8edf5;
border-radius: 12px;
color: var(--sg-text-muted);
font-size: 12px;
font-weight: 500;
}
.description-text {
padding: 16px 20px 20px;
margin: 0;
color: var(--sg-text);
font-size: 14px;
line-height: 1.6;
}
.content-grid {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 24px;
}
.main-content {
display: flex;
flex-direction: column;
gap: 24px;
}
.sidebar {
display: flex;
flex-direction: column;
gap: 24px;
}
.person-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 12px;
padding: 16px 20px 20px;
}
.person-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 12px;
border: 1px solid #d9e2f0;
border-radius: var(--sg-radius-sm);
background: #fff;
transition: all 0.2s;
}
.person-item:hover {
cursor: pointer;
background: #f8fafc;
border-color: #b8c5d6;
}
.avatar {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 50%;
background: #e8edf5;
color: var(--sg-text);
font-size: 13px;
font-weight: 600;
flex-shrink: 0;
}
.person-name {
cursor: pointer;
font-size: 13px;
font-weight: 500;
color: var(--sg-text);
}
.institution-grid {
cursor: pointer;
display: grid;
grid-template-columns: 1fr;
gap: 8px;
padding: 16px 20px 20px;
}
.institution-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 12px;
border: 1px solid #d9e2f0;
border-radius: var(--sg-radius-sm);
background: #fff;
font-size: 13px;
color: var(--sg-text);
}
.institution-item mat-icon {
color: var(--sg-text-muted);
width: 20px;
height: 20px;
font-size: 20px;
flex-shrink: 0;
}
.details-list {
margin: 0;
padding: 16px 20px 20px;
}
.detail-row {
display: grid;
grid-template-columns: 140px 1fr;
gap: 12px;
padding: 8px 0;
border-bottom: 1px solid #f0f2f5;
}
.detail-row:last-child {
border-bottom: none;
}
.detail-row dt {
color: var(--sg-text-muted);
font-size: 13px;
font-weight: 500;
}
.detail-row dd {
margin: 0;
color: var(--sg-text);
font-size: 13px;
word-break: break-word;
}
.external-link {
color: var(--sg-primary, #0066cc);
text-decoration: none;
}
.external-link:hover {
text-decoration: underline;
}
.empty-state {
padding: 20px;
text-align: center;
color: var(--sg-text-muted);
font-size: 14px;
}
.error-container {
display: flex;
align-items: center;
justify-content: center;
min-height: 400px;
}
.error-state {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
color: var(--sg-text-muted);
}
.error-state mat-icon {
width: 48px;
height: 48px;
font-size: 48px;
color: #e74c3c;
}
.error-state p {
margin: 0;
font-size: 16px;
}
@media (max-width: 992px) {
.content-grid {
grid-template-columns: 1fr;
gap: 20px;
}
}
@media (max-width: 768px) {
.detail-page {
padding: 16px;
}
.page-header {
flex-direction: column;
align-items: flex-start;
gap: 12px;
}
.project-hero {
padding: 20px;
}
.metrics-grid {
grid-template-columns: 1fr 1fr;
gap: 12px;
}
h1 {
font-size: 22px;
}
.detail-row {
grid-template-columns: 1fr;
gap: 4px;
}
.person-grid {
grid-template-columns: 1fr;
}
}
@media (max-width: 480px) {
.metrics-grid {
grid-template-columns: 1fr;
}
.hero-actions {
flex-direction: column;
}
.primary-action,
.secondary-action {
width: 100%;
justify-content: center;
}
}
@@ -0,0 +1,77 @@
import { Component, OnInit, inject } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { CommonModule } from '@angular/common';
import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { DfgProjectDetails } from '../../../api';
import { Router } from '@angular/router';
@Component({
selector: 'app-dfg-details',
standalone: true,
imports: [CommonModule, MatCardModule, MatIconModule],
templateUrl: './dfg-details.component.html',
styleUrl: './dfg-details.component.scss',
})
export class DfgDetailsComponent implements OnInit {
private route = inject(ActivatedRoute);
dfgProject: DfgProjectDetails | undefined;
constructor(private router: Router) {}
ngOnInit(): void {
this.route.data.subscribe(({ dfgSingleProject }) => {
console.log('DFG Project:', dfgSingleProject);
this.dfgProject = dfgSingleProject;
});
}
getInitials(name: string | null | undefined): string {
if (!name) return '';
const parts = name.trim().split(/\s+/);
if (parts.length > 1) {
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
}
return parts[0][0].toUpperCase();
}
getFundingStatus(fundingEndDate: string | null | undefined): string {
if (!fundingEndDate) return 'N/A';
if (fundingEndDate === '2999') return 'laufend';
const year = parseInt(fundingEndDate, 10);
if (isNaN(year)) return fundingEndDate;
return year >= new Date().getFullYear()
? `${fundingEndDate} (laufend)`
: `${fundingEndDate} (abgeschlossen)`;
}
searchForPersonName(personName: string): void {
this.router.navigate(['/persons'], {
queryParams: {
query: personName,
},
});
}
searchForInstitutionName(institutionName: string): void {
this.router.navigate(['/institutions'], {
queryParams: {
search: institutionName,
},
});
}
/**
* All associated persons as a simple list (no role grouping).
*/
getAssociatedPersons(): string[] {
return this.dfgProject?.associated_persons || [];
}
/**
* All institutions as a simple list.
*/
getInstitutions(): string[] {
return this.dfgProject?.institutions || [];
}
goBack(): void {
window.history.back();
}
}
@@ -39,7 +39,11 @@
</div>
<ng-template #dfgProjectActionsTmp let-element>
<a href="{{ element.link }}" target="_blank" mat-icon-button color="primary">
<a
[routerLink]="['/projects/dfg', element.id]"
target="_blank"
mat-icon-button
color="primary">
<mat-icon>open_in_new</mat-icon>
</a>
</ng-template>
@@ -20,7 +20,7 @@ import { MatTabsModule } from '@angular/material/tabs';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { DebounceDirective } from '../../directives/debounce.directive';
import { ActivatedRoute, Router } from '@angular/router';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { MatPaginatorModule, PageEvent } from '@angular/material/paginator';
import { Sort, SortDirection } from '@angular/material/sort';
@@ -37,6 +37,7 @@ import { Sort, SortDirection } from '@angular/material/sort';
MatInputModule,
DebounceDirective,
MatPaginatorModule,
RouterModule,
],
templateUrl: './person-projects.component.html',
styleUrl: './person-projects.component.scss',
@@ -0,0 +1,112 @@
<div class="content">
<h1>Passende Projekte finden</h1>
<mat-divider />
<div style="padding: 0 1rem">
<mat-form-field style="width: 100%">
<mat-label>Suche nach Namen</mat-label>
<input
matInput
type="search"
[debounceTime]="300"
[(debouncedValue)]="urlSearchTerm"
(debouncedValueChange)="handleSearchTermChange($event)" />
<mat-icon matPrefix>search</mat-icon>
<button matIconButton matSuffix (click)="clearSearchTerm()">
<mat-icon>clear</mat-icon>
</button>
</mat-form-field>
<div
style="
display: flex;
justify-content: space-between;
align-items: center;
">
<mat-chip-listbox
[value]="urlChips()"
(change)="handleChipBoxChange($event)"
multiple>
<mat-chip-option value="eu">EU</mat-chip-option>
<mat-chip-option value="bund">BUND</mat-chip-option>
<mat-chip-option value="dfg">DFG</mat-chip-option>
</mat-chip-listbox>
<div class="sorting">
<select (change)="handleSortFieldChange($event)" [value]="urlSortBy()">
<option value="title">Name</option>
</select>
<select
(change)="handleSortOrderChange($event)"
[value]="urlSortingOrder()">
<option value="desc">Absteigend</option>
<option value="asc">Aufsteigend</option>
</select>
</div>
</div>
</div>
<mat-divider />
@let fundingProjectPageValue = fundingProjectPage();
@if (
fundingProjectPageValue.elements &&
fundingProjectPageValue.elements.length > 0
) {
<div class="cards">
@for (fundingProject of fundingProjectPageValue.elements; track $index) {
<mat-card
class="card"
appearance="outlined"
[routerLink]="getDetaiLink(fundingProject)">
<mat-card-header>
<mat-card-title>{{ fundingProject.title }}</mat-card-title>
<mat-card-subtitle>{{
fundingProject.type | uppercase
}}</mat-card-subtitle>
</mat-card-header>
<mat-card-content class="card-content">
<mat-divider />
<div class="card-metadata">
<span
>Von {{ fundingProject.start_date | date }} bis
{{ fundingProject.end_date | date }}</span
>
</div>
<mat-divider />
</mat-card-content>
<mat-card-footer>
<mat-card-actions>
<a
mat-button
[routerLink]="getDetaiLink(fundingProject)"
(click)="$event.stopPropagation()">
<mat-icon>info</mat-icon>
Übersicht
</a>
</mat-card-actions>
</mat-card-footer>
</mat-card>
}
</div>
} @else {
<div class="no-results">
<p>Keine passenden Projekte gefunden.</p>
</div>
}
<mat-divider />
<mat-paginator
[length]="fundingProjectPageValue.total"
[pageSize]="fundingProjectPageValue.size"
[pageSizeOptions]="[10, 20, 50]"
[pageIndex]="fundingProjectPageValue.page"
(page)="handlePageChange($event)">
</mat-paginator>
</div>
@@ -0,0 +1,99 @@
.content {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 1rem;
}
.sorting {
display: flex;
justify-content: flex-end;
gap: 0.5rem;
}
.sorting select {
padding: 0.75rem;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
font-size: 1rem;
}
.sorting select:hover {
cursor: pointer;
}
.cards {
display: grid;
gap: 1.5rem;
grid-template-columns: repeat(4, 1fr);
padding: 0 1rem;
}
@media (max-width: 900px) {
.cards {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 600px) {
.cards {
grid-template-columns: 1fr;
}
}
mat-paginator {
background-color: var(--sg-background);
}
.card {
padding: 0.5rem;
background-color: var(--sg-background);
transition: transform 0.3s ease;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.card:hover {
cursor: pointer;
transform: scale(1.05);
}
.card-content {
display: flex;
flex-direction: column;
justify-content: flex-end;
gap: 0.5rem;
flex: 1;
}
.card-metadata {
display: flex;
flex-direction: column;
gap: 0.2rem;
font-size: 0.9rem;
color: var(--sg-text-secondary);
}
mat-card-actions {
padding-top: 0.5rem;
display: flex;
gap: 0.5rem;
}
mat-card-actions a {
width: 100%;
text-decoration: none;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
}
.no-results {
text-align: center;
padding: 2rem;
color: var(--sg-text-secondary);
}
.mat-mdc-standard-chip {
border-radius: var(--sg-radius-sm);
}
@@ -0,0 +1,128 @@
import { Component, effect, input, signal } from '@angular/core';
import { FundingProject, FundingProjectPage, ProjectType } from '../../api';
import { MatDividerModule } from '@angular/material/divider';
import { MatFormFieldModule } from '@angular/material/form-field';
import { DebounceDirective } from '../../directives/debounce.directive';
import { MatIconModule } from '@angular/material/icon';
import { MatCardModule } from '@angular/material/card';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { MatInputModule } from '@angular/material/input';
import { MatButtonModule } from '@angular/material/button';
import { DatePipe, UpperCasePipe } from '@angular/common';
import { MatChipListboxChange, MatChipsModule } from '@angular/material/chips';
@Component({
selector: 'app-projects',
imports: [
MatDividerModule,
MatFormFieldModule,
DebounceDirective,
MatIconModule,
MatCardModule,
RouterModule,
MatPaginator,
MatInputModule,
MatButtonModule,
UpperCasePipe,
DatePipe,
MatChipsModule,
],
templateUrl: './projects.component.html',
styleUrl: './projects.component.scss',
})
export class ProjectsComponent {
fundingProjectPage = input.required<FundingProjectPage>();
urlSearchTerm = signal<string>('');
urlSortBy = signal<string>('relevance');
urlSortingOrder = signal<string>('desc');
urlChips = signal<ProjectType[]>(['eu', 'bund', 'dfg']);
constructor(
private readonly activatedRoute: ActivatedRoute,
private readonly router: Router,
) {
this.activatedRoute.queryParams
.pipe(takeUntilDestroyed())
.subscribe((params) => {
this.urlSearchTerm.set(params['search'] || '');
this.urlSortBy.set(params['sort_by'] || 'relevance');
this.urlSortingOrder.set(params['sorting_order'] || 'desc');
this.urlChips.set(
(params['selected_project_types'] || 'eu,bund,dfg').split(','),
);
});
effect(() => {
const searchTerm = this.urlSearchTerm();
this.router.navigate([], {
queryParams: { search: searchTerm },
queryParamsHandling: 'merge',
});
});
}
handleSearchTermChange(newTerm: string): void {
this.router.navigate([], {
queryParams: { search: newTerm },
queryParamsHandling: 'merge',
});
}
clearSearchTerm(): void {
this.router.navigate([], {
queryParams: { search: null },
queryParamsHandling: 'merge',
});
}
handlePageChange(event: PageEvent): void {
this.router.navigate([], {
queryParams: { page: event.pageIndex, size: event.pageSize },
queryParamsHandling: 'merge',
});
}
handleSortFieldChange(event: Event): void {
const selectElement = event.target as HTMLSelectElement;
const sortField = selectElement.value;
this.router.navigate([], {
queryParams: { sort_by: sortField },
queryParamsHandling: 'merge',
});
}
handleSortOrderChange(event: Event): void {
const selectElement = event.target as HTMLSelectElement;
const sortOrder = selectElement.value;
this.router.navigate([], {
queryParams: { sorting_order: sortOrder },
queryParamsHandling: 'merge',
});
}
handleChipBoxChange(change: MatChipListboxChange): void {
const selectedValues = change.value as string[];
this.router.navigate([], {
queryParams: {
selected_project_types: selectedValues.length
? selectedValues.join(',')
: null,
},
queryParamsHandling: 'merge',
});
}
getDetaiLink(fundingProject: FundingProject): string | null {
if (fundingProject.type === 'bund') {
return '/projects/bund/' + fundingProject.id;
} else if (fundingProject.type === 'dfg') {
return '/projects/dfg/' + fundingProject.id;
} else {
return null;
}
}
}
@@ -0,0 +1,29 @@
// src/app/modules/university-ranking/services/university-data.service.ts
import { inject, Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { InstitutionsService, RankingResponse } from '../../../api';
export type ResearchTopic =
| 'Artificial Intelligence'
| 'Quantum Computing'
| 'Renewable Energy'
| 'Biotechnology';
export type DashboardMetric = 'publications' | 'citations';
@Injectable({ providedIn: 'root' })
export class UniversityRankingService {
private apiService = inject(InstitutionsService);
/**
* Fetches ranking and timeseries data directly from the backend.
* Calculations for growth and trends are now handled server-side.
*/
getRankingData(
topic: ResearchTopic,
metric: DashboardMetric,
): Observable<RankingResponse> {
return this.apiService.getRankingsApiInseServiceUniversityRankingsGet(
topic,
metric,
);
}
}
@@ -0,0 +1,5 @@
<div
echarts
[options]="chartOption"
[merge]="mergeOption"
class="chart-container"></div>
@@ -0,0 +1,4 @@
.chart-container {
height: 500px;
width: 100%;
}
@@ -0,0 +1,64 @@
// src/app/modules/university-ranking/components/line-chart/university-line-chart.component.ts
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
import { EChartsOption } from 'echarts';
import { NgxEchartsDirective } from 'ngx-echarts';
import { UniversityTopicData, YearlyData } from '../../../api';
export type ResearchTopic =
| 'Artificial Intelligence'
| 'Quantum Computing'
| 'Renewable Energy'
| 'Biotechnology';
export type DashboardMetric = 'publications' | 'citations';
@Component({
selector: 'app-university-line-chart',
templateUrl: './uni-line-chart.component.html',
styleUrl: './uni-line-chart.component.scss',
imports: [NgxEchartsDirective],
standalone: true,
})
export class UniversityLineChartComponent implements OnChanges {
@Input() data: UniversityTopicData[] = [];
@Input() metric: DashboardMetric = 'publications';
chartOption: EChartsOption = {
title: {
text: 'Research Output Over Time',
left: 'center',
textStyle: { fontWeight: 'lighter' },
},
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
legend: { bottom: 0 },
grid: { left: '3%', right: '4%', bottom: '15%', containLabel: true },
xAxis: { type: 'category', boundaryGap: false, data: [] },
yAxis: { type: 'value', name: 'Volume' },
dataZoom: [{ type: 'slider', show: true, bottom: 40 }],
series: [],
};
mergeOption: EChartsOption = {};
ngOnChanges(changes: SimpleChanges): void {
if (this.data.length > 0) {
this.updateChart();
console.log('CHANGES!');
}
}
private updateChart() {
const years = this.data[0].yearly_data.map((d) => d.year);
const series = this.data.map((uni) => ({
name: uni.university,
type: 'line',
smooth: true,
emphasis: { focus: 'series' },
animationDuration: 2000,
data: uni.yearly_data.map((d) => d[this.metric]),
}));
this.mergeOption = {
xAxis: { data: years.map(String) },
series: series as any,
};
}
}
@@ -0,0 +1,42 @@
<div class="ranking-card">
<h4>Topic Rankings</h4>
@if (loading) {
<div class="skeleton-loader">Loading rankings...</div>
} @else {
<table class="ranking-table">
<thead>
<tr>
<th>Rank</th>
<th>University</th>
<th>Latest</th>
<th>5Y Growth</th>
<th>Trend</th>
</tr>
</thead>
<tbody>
@for (row of rankings; track $index) {
<tr [class.top-tier]="row.rank <= 3">
<td>#{{ row.rank }}</td>
<td>
{{ row.university }}
@if (row.is_top_mover) {
<span class="mover-badge" title="Top mover last 3 years"
>🔥</span
>
}
</td>
<td>{{ row.publications | number }}</td>
<td
[class.positive]="row.growth_rate > 0"
[class.negative]="row.growth_rate < 0">
{{ row.growth_rate | number: '1.0-1' }}%
</td>
<td class="trend-col" [attr.data-trend]="row.trend">
{{ getTrendIcon(row.trend) }}
</td>
</tr>
}
</tbody>
</table>
}
</div>
@@ -0,0 +1,21 @@
// src/app/modules/university-ranking/components/ranking-table/university-ranking-table.component.ts
import { Component, Input } from '@angular/core';
import { UniversityRanking } from '../../../api';
import { DecimalPipe } from '@angular/common';
@Component({
selector: 'app-university-ranking-table',
templateUrl: './uni-ranking-table.component.html',
styleUrls: ['./uni-ranking-table.component.scss'],
imports: [DecimalPipe],
})
export class UniversityRankingTableComponent {
@Input() rankings: UniversityRanking[] = [];
@Input() loading: boolean = false;
getTrendIcon(trend: string): string {
if (trend === 'up') return '↑';
if (trend === 'down') return '↓';
return '→';
}
}