diff --git a/service/src/main/inse/works/logic.py b/service/src/main/inse/works/logic.py index 3b1f61fe..40e2c9f1 100644 --- a/service/src/main/inse/works/logic.py +++ b/service/src/main/inse/works/logic.py @@ -391,6 +391,19 @@ async def get_topics_by_time_by_author( years[year]["primary_topics"][primary_topic_name]["count"] += 1 + topic_ids = set() + + for year_data in years.values(): + for topic in year_data["topics"].values(): + if topic["id"]: + topic_ids.add(topic["id"]) + + for topic in year_data["primary_topics"].values(): + if topic["id"]: + topic_ids.add(topic["id"]) + + topic_details = _get_topic_details(list(topic_ids)) + elements = [] for year in sorted(years.keys()): @@ -400,11 +413,14 @@ async def get_topics_by_time_by_author( topics = [] for topic in topic_items[:max_topics_per_year]: + info = topic_details.get(topic["id"], {}) + topics.append( TopicCount( id=topic["id"], name=topic["name"], count=topic["count"], + description=info.get("description"), ) ) @@ -414,11 +430,14 @@ async def get_topics_by_time_by_author( primary_topics = [] for topic in primary_topic_items[:max_topics_per_year]: + info = topic_details.get(topic["id"], {}) + primary_topics.append( TopicCount( id=topic["id"], name=topic["name"], count=topic["count"], + description=info.get("description"), ) ) diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html index 39f4d7e6..5376284b 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html @@ -49,10 +49,17 @@ (click)="setTimelineViewMode('compact')"> Kompakt + +
@@ -103,311 +110,331 @@ {{ maxYear }}
+ +
+ +
-
- - Forschungstimeline wird geladen ... -
+ + + -
- Forschungstimeline konnte nicht geladen werden. -
+ +
+ + Forschungstimeline wird geladen ... +
- - - -
-
- +
+ Forschungstimeline konnte nicht geladen werden. +
-
-
- - -
+ + + +
+
+
- - -
-
- -
-
-

+ class="timeline-points" + [style.grid-template-columns]="gridTemplateColumns"> +
-

+ +
- - Laden fehlgeschlagen. - - - -
-

+
-

- - - -
- + {{ item.year }} + + +
+
+ +
+
+

- +

- - Keine weiteren Topics - -
- + + Laden fehlgeschlagen. + + + +
+

+ +

+ + + +
+ + + + + + Keine weiteren Topics + +
+
+
- -
+
- -
-
-
- + +
+
+
+ -
-
- - - -
- -

- -

-
-
- -
- - - - - - Keine weiteren Topics - -
- - - -
-
-
- - - -
- -
- +
+
- - - Keine weiteren Topics - + +
+ +

+ +

-
-
-
-
-
- - Hauptforschungsschwerpunkte im jeweiligen Zeitraum -
+
+ + + + + + Keine weiteren Topics + +
+ + + +
+
+
+ + + +
+ +
+ + + + + + Keine weiteren Topics + +
+
+
+
+
+
+ +
+ + Hauptforschungsschwerpunkte im jeweiligen Zeitraum +
+
- +
Keine Timeline-Daten vorhanden.
diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts index 98c1da9c..90dfbe9f 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts @@ -1,5 +1,6 @@ import { CommonModule } from '@angular/common'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { AfterViewChecked, Component, @@ -25,7 +26,7 @@ export interface TopicTimelineElement { primary_topics?: TopicTimelineTopic[]; } -export type TimelineViewMode = 'years' | 'compact'; +export type TimelineViewMode = 'years' | 'compact' | 'wordcloud'; export interface TimelineYearRange { startYear: number; @@ -66,7 +67,7 @@ interface TimelineScrollAnchor { @Component({ selector: 'app-research-timeline', standalone: true, - imports: [CommonModule, MatProgressSpinnerModule], + imports: [CommonModule, MatProgressSpinnerModule, MatTooltipModule], templateUrl: './research-timeline.component.html', styleUrl: './research-timeline.component.scss', }) @@ -315,6 +316,20 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { return phase.years.map((year) => year.year); } + getYearPublicationTooltip(item: TopicTimelineElement): string { + return this.getPublicationTooltip( + item.publication_count, + `im Jahr ${item.year}`, + ); + } + + getPhasePublicationTooltip(phase: ResearchTimelinePhase): string { + return this.getPublicationTooltip( + phase.publication_count, + this.getPhasePublicationTooltipPeriod(phase), + ); + } + togglePhase(phase: ResearchTimelinePhase): void { if (this.expandedPhaseIds.has(phase.id)) { this.expandedPhaseIds.delete(phase.id); @@ -440,6 +455,23 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { return bestAnchor; } + private getPublicationTooltip(count: number, period: string): string { + const publicationLabel = + count === 1 ? 'Publikation wurde' : 'Publikationen wurden'; + + return `Insgesamt ${count} ${publicationLabel} ${period} veröffentlicht.`; + } + + private getPhasePublicationTooltipPeriod( + phase: ResearchTimelinePhase, + ): string { + if (phase.startYear === phase.endYear) { + return `im Jahr ${phase.startYear}`; + } + + return `im Zeitraum ${this.getPhaseYearLabel(phase)}`; + } + private get earlierYearsColumnCount(): number { return this.showEarlierYearsControl ? 1 : 0; } @@ -717,7 +749,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { } private isTimelineViewMode(value: string): value is TimelineViewMode { - return value === 'years' || value === 'compact'; + return value === 'years' || value === 'compact' || value === 'wordcloud'; } private isValidYear(value: number | undefined): value is number { diff --git a/webapp/src/app/modules/person-overview/person-overview.component.html b/webapp/src/app/modules/person-overview/person-overview.component.html index dbba4131..3d3ffa2d 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.html +++ b/webapp/src/app/modules/person-overview/person-overview.component.html @@ -13,31 +13,31 @@ (yearRangeChange)="onTimelineYearRangeChange($event)" (topicSelect)="onTimelineTopicSelect($event)" (yearSelect)="onTimelineYearSelect($event)" - (loadEarlierYears)="onTimelineLoadEarlierYears()"> + (loadEarlierYears)="onTimelineLoadEarlierYears()"> +
+ @if (loadingWordCloud) { + Themen laden ... + } @else if (wordCloudOptions && sliderMax > 5) { + {{ topN }} Themen +
+
+ +
+ } @else { + Themen + } +
- @if (!loadingWordCloud) { -
-
-

Forschungsthemen

- @if (wordCloudOptions && sliderMax > 5) { -
- {{ topN }} Themen -
-
- -
-
- } -
- @if (wordCloudOptions) { +
+ @if (loadingWordCloud) { +
Forschungsthemen werden geladen ...
+ } @else if (wordCloudOptions) {
Keine Forschungsthemen gefunden.

}
- } + diff --git a/webapp/src/app/modules/person-overview/person-overview.component.scss b/webapp/src/app/modules/person-overview/person-overview.component.scss index 4e70b0e9..7b40485a 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.scss +++ b/webapp/src/app/modules/person-overview/person-overview.component.scss @@ -5,37 +5,12 @@ box-sizing: border-box; } -.word-cloud-card { - margin-top: 1.5rem; - padding: 24px 28px; - border: 1px solid #d7e4ff; - border-radius: 16px; - background: #ffffff; - box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); - box-sizing: border-box; -} - -.word-cloud-header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 1.5rem; - margin-bottom: 0.75rem; -} - -.word-cloud-title { - margin: 0; - font-family: 'Montserrat', 'Open Sans', Arial, sans-serif; - font-size: 20px; - font-weight: 700; - color: var(--sg-text); -} - .word-cloud-slider-wrapper { display: flex; align-items: center; + justify-content: center; gap: 0.75rem; - flex-shrink: 0; + min-height: 86px; } .slider-label { @@ -115,15 +90,24 @@ } } +.word-cloud-view { + min-height: 420px; +} + .word-cloud-chart { width: 100%; - height: 400px; + height: 420px; cursor: pointer; } +.word-cloud-state, .word-cloud-empty { - margin: 2rem 0 0.5rem; - text-align: center; + margin: 0; + min-height: 420px; + display: flex; + align-items: center; + justify-content: center; color: var(--sg-text-muted); font-size: 14px; + text-align: center; } diff --git a/webapp/src/app/modules/person-overview/person-overview.component.ts b/webapp/src/app/modules/person-overview/person-overview.component.ts index d6963b71..5291c82a 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.ts +++ b/webapp/src/app/modules/person-overview/person-overview.component.ts @@ -489,7 +489,11 @@ export class PersonOverviewComponent implements OnInit { } private parseTimelineViewMode(value: string | null): TimelineViewMode { - return value === 'compact' ? 'compact' : 'years'; + if (value === 'compact' || value === 'wordcloud') { + return value; + } + + return 'years'; } private parseOptionalYear(value: string | null): number | undefined {