From 3caa759e4f42956e61ec95f4d78a24e16969058c Mon Sep 17 00:00:00 2001 From: spsaefan <117728614+spsaefan@users.noreply.github.com> Date: Fri, 29 May 2026 12:14:38 +0200 Subject: [PATCH 01/19] Add topic timeline response models --- service/src/main/inse/works/model.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/service/src/main/inse/works/model.py b/service/src/main/inse/works/model.py index 02c8bf25..1e3aa5f7 100644 --- a/service/src/main/inse/works/model.py +++ b/service/src/main/inse/works/model.py @@ -216,3 +216,19 @@ class WorkPage(BaseModel): class WorkList(BaseModel): elements: List[Work] = Field(default_factory=list, description="All works.") total: int = Field(default=0, description="The total number of works.") + + +class TopicCount(BaseModel): + name: str = Field(description="The topic display name.") + count: int = Field(default=0, description="The number of occurrences.") + + +class TopicsByYear(BaseModel): + year: int = Field(description="The publication year.") + publication_count: int = Field(default=0, description="The number of works in this year.") + topics: List[TopicCount] = Field(default_factory=list, description="The topics in this year.") + + +class TopicsByTime(BaseModel): + elements: List[TopicsByYear] = Field(default_factory=list, description="Topics grouped by year.") + total: int = Field(default=0, description="The number of years.") \ No newline at end of file From f2bca2f6464ea5a5a69de84aa49e57e6b9b899b5 Mon Sep 17 00:00:00 2001 From: spsaefan <117728614+spsaefan@users.noreply.github.com> Date: Fri, 29 May 2026 12:14:56 +0200 Subject: [PATCH 02/19] Add topic aggregation by year --- service/src/main/inse/works/logic.py | 58 ++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/service/src/main/inse/works/logic.py b/service/src/main/inse/works/logic.py index 752176e4..12b8da99 100644 --- a/service/src/main/inse/works/logic.py +++ b/service/src/main/inse/works/logic.py @@ -70,6 +70,64 @@ async def get_all_author_works( return model.WorkList(elements=all_elements, total=total) +async def get_topics_by_time_by_author( + author_id: str, + max_topics_per_year: int = 3, + client: OpenAlexWorksSearchClient | None = None, +) -> model.TopicsByTime: + works = await get_all_author_works(author_id, client=client) + + years = {} + + for work in works.elements: + if work.publication_year is None: + continue + + year = work.publication_year + + if year not in years: + years[year] = { + "publication_count": 0, + "topics": {}, + } + + years[year]["publication_count"] += 1 + + for topic in work.topics: + if topic.display_name: + topic_name = topic.display_name + + if topic_name not in years[year]["topics"]: + years[year]["topics"][topic_name] = 0 + + years[year]["topics"][topic_name] += 1 + + elements = [] + + for year in sorted(years.keys()): + topic_items = list(years[year]["topics"].items()) + topic_items.sort(key=lambda item: item[1], reverse=True) + + topics = [] + + for topic_name, count in topic_items[:max_topics_per_year]: + topics.append(model.TopicCount( + name=topic_name, + count=count, + )) + + elements.append(model.TopicsByYear( + year=year, + publication_count=years[year]["publication_count"], + topics=topics, + )) + + return model.TopicsByTime( + elements=elements, + total=len(elements), + ) + + async def _search_author_works_data( search_client: OpenAlexWorksSearchClient, author_id: str, From 32cb67df7257eb1e03cf78f85cc901afd53c0316 Mon Sep 17 00:00:00 2001 From: spsaefan <117728614+spsaefan@users.noreply.github.com> Date: Fri, 29 May 2026 12:15:05 +0200 Subject: [PATCH 03/19] Add topics by time endpoint --- service/src/main/inse/works/service.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/service/src/main/inse/works/service.py b/service/src/main/inse/works/service.py index 82665c20..f60328ae 100644 --- a/service/src/main/inse/works/service.py +++ b/service/src/main/inse/works/service.py @@ -50,3 +50,18 @@ async def get_all_author_works( principal: security.Principal = Depends(security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"])), ): return await logic.get_all_author_works(author_id) + + +@router.get("/{author_id}/topics-by-time", + operation_id="getTopicsByTimeByAuthor", + response_model=model.TopicsByTime, + summary="Returns topics grouped by publication year for an author.") +async def get_topics_by_time_by_author( + author_id: Annotated[str, Path(description="The author id, for example A5023888391.")], + max_topics_per_year: Annotated[int, Query(description="The maximum number of topics per year.", ge=1, le=20)] = 3, + principal: security.Principal = Depends(security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"])), +): + return await logic.get_topics_by_time_by_author( + author_id, + max_topics_per_year=max_topics_per_year, + ) From 404386e153add1a1bb152ae108f6205bd00a3576 Mon Sep 17 00:00:00 2001 From: spsaefan <117728614+spsaefan@users.noreply.github.com> Date: Sun, 31 May 2026 23:07:25 +0200 Subject: [PATCH 04/19] Fix topic timeline response models --- service/src/main/inse/models/topic_count.py | 6 ++++++ service/src/main/inse/models/topics_by_time.py | 9 ++++----- service/src/main/inse/models/topics_by_year.py | 11 +++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/service/src/main/inse/models/topic_count.py b/service/src/main/inse/models/topic_count.py index e69de29b..3e0d1f1e 100644 --- a/service/src/main/inse/models/topic_count.py +++ b/service/src/main/inse/models/topic_count.py @@ -0,0 +1,6 @@ +from pydantic import BaseModel, Field + + +class TopicCount(BaseModel): + name: str = Field(description="The topic display name.") + count: int = Field(default=0, description="The number of occurrences.") diff --git a/service/src/main/inse/models/topics_by_time.py b/service/src/main/inse/models/topics_by_time.py index 1fdfded0..4b495e5a 100644 --- a/service/src/main/inse/models/topics_by_time.py +++ b/service/src/main/inse/models/topics_by_time.py @@ -2,10 +2,9 @@ from typing import List from pydantic import BaseModel, Field -from inse.models.topic_count import TopicCount +from inse.models.topics_by_year import TopicsByYear -class TopicsByYear(BaseModel): - year: int = Field(description="The publication year.") - publication_count: int = Field(default=0, description="The number of works in this year.") - topics: List[TopicCount] = Field(default_factory=list, description="The topics in this year.") \ No newline at end of file +class TopicsByTime(BaseModel): + elements: List[TopicsByYear] = Field(default_factory=list, description="Topics grouped by year.") + total: int = Field(default=0, description="The number of years.") diff --git a/service/src/main/inse/models/topics_by_year.py b/service/src/main/inse/models/topics_by_year.py index e69de29b..f1c90610 100644 --- a/service/src/main/inse/models/topics_by_year.py +++ b/service/src/main/inse/models/topics_by_year.py @@ -0,0 +1,11 @@ +from typing import List + +from pydantic import BaseModel, Field + +from inse.models.topic_count import TopicCount + + +class TopicsByYear(BaseModel): + year: int = Field(description="The publication year.") + publication_count: int = Field(default=0, description="The number of works in this year.") + topics: List[TopicCount] = Field(default_factory=list, description="The topics in this year.") From 96b3355f46154a543b220af7b309eced344eb8dd Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Mon, 1 Jun 2026 00:01:01 +0200 Subject: [PATCH 05/19] Add research timeline with dummy data --- .../research-timeline.component.html | 63 ++++ .../research-timeline.component.scss | 275 ++++++++++++++++++ .../research-timeline.component.ts | 57 ++++ .../person-overview.component.html | 4 +- .../person-overview.component.scss | 4 + .../person-overview.component.ts | 7 +- 6 files changed, 405 insertions(+), 5 deletions(-) create mode 100644 webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html create mode 100644 webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss create mode 100644 webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts 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 new file mode 100644 index 00000000..fde6ab41 --- /dev/null +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html @@ -0,0 +1,63 @@ +
+
+
+

Forschungstimeline

+

+ Entwicklung der Forschungsthemen im Zeitverlauf + (basierend auf Projekten und Publikationen) +

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

{{ item.title }}

+ +
+ + {{ keyword }} + +
+
+
+ +
+ + Hauptforschungsschwerpunkte im jeweiligen Zeitraum +
+
+
\ No newline at end of file diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss new file mode 100644 index 00000000..2c641366 --- /dev/null +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss @@ -0,0 +1,275 @@ +.research-timeline-card { + width: 100%; + padding: 24px 28px; + border: 1px solid #d7e4ff; + border-radius: 16px; + background: #ffffff; + box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); +} + +.timeline-header { + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 24px; + margin-bottom: 34px; + + h2 { + margin: 0 0 6px; + color: #07163d; + font-size: 20px; + font-weight: 700; + } + + p { + margin: 0; + color: #64718f; + font-size: 14px; + line-height: 1.4; + + span { + color: #74809b; + } + } +} + +.view-toggle { + display: flex; + gap: 4px; + padding: 4px; + border: 1px solid #dbe5f6; + border-radius: 10px; + background: #ffffff; + + button { + border: none; + border-radius: 8px; + padding: 9px 16px; + background: transparent; + color: #3f4b66; + font-size: 14px; + cursor: pointer; + transition: all 0.2s ease; + + &:hover { + background: #f2f6ff; + } + + &.active { + background: #eef4ff; + color: #0057ff; + box-shadow: inset 0 0 0 1px #3d7cff; + } + + &.inactive-button { + cursor: default; + } + + &.inactive-button:hover { + background: transparent; + } + } +} + +.timeline-wrapper { + width: 100%; + overflow-x: auto; + padding-top: 8px; +} + +.timeline-line { + position: relative; + display: grid; + align-items: center; + min-width: 1000px; + margin: 0 32px 18px; + border-top: 2px solid #23395d; +} + +.timeline-point { + position: relative; + transform: translateY(-50%); + text-align: center; + + .year { + position: absolute; + top: -28px; + left: 50%; + transform: translateX(-50%); + color: #15213f; + font-size: 14px; + font-weight: 600; + white-space: nowrap; + } + + .dot { + display: inline-block; + width: 12px; + height: 12px; + border: 3px solid #ffffff; + border-radius: 50%; + box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1); + } +} + +.line-arrow { + position: absolute; + right: -2px; + top: -6px; + width: 0; + height: 0; + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + border-left: 12px solid #23395d; +} + +.timeline-content { + display: grid; + min-width: 1000px; + gap: 20px; +} + +.timeline-item { + text-align: center; + + h3 { + min-height: 44px; + margin: 0 0 14px; + color: #07163d; + font-size: 15px; + font-weight: 600; + line-height: 1.35; + } +} + +.keyword-list { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; +} + +.keyword-chip { + display: inline-flex; + align-items: center; + justify-content: center; + width: fit-content; + max-width: 100%; + padding: 6px 12px; + border-radius: 7px; + font-size: 12px; + font-weight: 500; + white-space: nowrap; +} + +.purple { + .dot { + background: #7255d9; + } +} + +.blue { + .dot { + background: #2678e8; + } +} + +.green { + .dot { + background: #39a96b; + } +} + +.orange { + .dot { + background: #f59e0b; + } +} + +.pink { + .dot { + background: #e0527c; + } +} + +.keyword-chip.purple { + border: 1px solid #d8cafe; + background: #f6f0ff; + color: #7255d9; +} + +.keyword-chip.blue { + border: 1px solid #bdd4ff; + background: #f0f6ff; + color: #0b63ce; +} + +.keyword-chip.green { + border: 1px solid #bdebcf; + background: #effaf3; + color: #24834f; +} + +.keyword-chip.orange { + border: 1px solid #ffd796; + background: #fff7e8; + color: #c67500; +} + +.keyword-chip.pink { + border: 1px solid #ffc7d7; + background: #fff1f5; + color: #d12f61; +} + +.timeline-note { + display: flex; + justify-content: center; + align-items: center; + gap: 10px; + margin-top: 24px; + color: #68748f; + font-size: 13px; +} + +.note-dot { + width: 10px; + height: 10px; + border: 3px solid #dce5f5; + border-radius: 50%; + background: #52627f; +} + +@media (max-width: 1100px) { + .timeline-line { + display: none; + } + + .timeline-content { + min-width: 0; + grid-template-columns: repeat(3, 1fr) !important; + row-gap: 28px; + } +} + +@media (max-width: 700px) { + .research-timeline-card { + padding: 20px; + } + + .timeline-header { + flex-direction: column; + } + + .timeline-content { + grid-template-columns: 1fr !important; + } + + .timeline-item { + text-align: left; + } + + .keyword-list { + align-items: flex-start; + } +} \ No newline at end of file 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 new file mode 100644 index 00000000..ff324de8 --- /dev/null +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts @@ -0,0 +1,57 @@ +import { CommonModule } from '@angular/common'; +import { Component } from '@angular/core'; + +interface ResearchTimelineItem { + year: number; + title: string; + keywords: string[]; + color: 'purple' | 'blue' | 'green' | 'orange' | 'pink'; +} + +@Component({ + selector: 'app-research-timeline', + standalone: true, + imports: [CommonModule], + templateUrl: './research-timeline.component.html', + styleUrls: ['./research-timeline.component.scss'], +}) +export class ResearchTimelineComponent { + timelineItems: ResearchTimelineItem[] = [ + { + year: 2014, + title: 'Datenanalyse und Statistik', + keywords: ['Datenanalyse', 'Statistik', 'Big Data'], + color: 'purple', + }, + { + year: 2016, + title: 'Maschinelles Lernen Grundlagen', + keywords: ['Machine Learning', 'Klassifikation', 'Feature Engineering'], + color: 'blue', + }, + { + year: 2018, + title: 'Deep Learning Anwendungen', + keywords: ['Deep Learning', 'Neuronale Netze', 'Bildverarbeitung'], + color: 'green', + }, + { + year: 2020, + title: 'KI in der Industrie', + keywords: ['Industrie 4.0', 'Predictive Analytics', 'Prozessoptimierung'], + color: 'orange', + }, + { + year: 2022, + title: 'Nachhaltige KI und Ethik', + keywords: ['Nachhaltigkeit', 'Responsible AI', 'Ethik'], + color: 'pink', + }, + { + year: 2024, + title: 'KI und Gesellschaft', + keywords: ['Smart Systems', 'Gesellschaft', 'Digitale Transformation'], + color: 'purple', + }, + ]; +} \ No newline at end of file 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 bc281a0c..fa007d36 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.html +++ b/webapp/src/app/modules/person-overview/person-overview.component.html @@ -1 +1,3 @@ -

person-overview works!

+
+ +
\ No newline at end of file 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 e69de29b..52461a52 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.scss +++ b/webapp/src/app/modules/person-overview/person-overview.component.scss @@ -0,0 +1,4 @@ +.person-overview { + width: 100%; + display: block; +} \ No newline at end of file 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 37c8461e..e8891dd7 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.ts +++ b/webapp/src/app/modules/person-overview/person-overview.component.ts @@ -1,11 +1,10 @@ import { Component } from '@angular/core'; +import { ResearchTimelineComponent } from './components/research-timeline/research-timeline.component'; @Component({ selector: 'app-person-overview', - imports: [], + imports: [ResearchTimelineComponent], templateUrl: './person-overview.component.html', styleUrl: './person-overview.component.scss', }) -export class PersonOverviewComponent { - -} +export class PersonOverviewComponent {} \ No newline at end of file From aaead76390a160d33b6130c782d5307b7b032c40 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Mon, 1 Jun 2026 00:18:05 +0200 Subject: [PATCH 06/19] Adapt research timeline to topic timeline data --- .../research-timeline.component.html | 75 ++++--- .../research-timeline.component.scss | 195 ++++++++++-------- .../research-timeline.component.ts | 90 ++++---- .../person-overview.component.html | 2 +- .../person-overview.component.ts | 172 ++++++++++++++- 5 files changed, 373 insertions(+), 161 deletions(-) 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 fde6ab41..4f1fe51a 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 @@ -4,7 +4,7 @@

Forschungstimeline

Entwicklung der Forschungsthemen im Zeitverlauf - (basierend auf Projekten und Publikationen) + (basierend auf Publikationen)

@@ -19,45 +19,56 @@ -
-
-
- {{ item.year }} - +
+
+ + +
+
+ {{ item.year }} + +
- -
+
+
+

{{ getMainTopic(item) }}

-
-
-

{{ item.title }}

- -
- - {{ keyword }} + + {{ item.publication_count }} + {{ item.publication_count === 1 ? 'Publikation' : 'Publikationen' }} -
-
+ +
+ + {{ topic.name }} + {{ topic.count }} + +
+
+
- Hauptforschungsschwerpunkte im jeweiligen Zeitraum + Die drei häufigsten Topics je Jahr, gezählt über Publikationen.
+ + +
+ Keine Timeline-Daten vorhanden. +
+
\ No newline at end of file diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss index 2c641366..6fad9a1c 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss @@ -12,7 +12,7 @@ justify-content: space-between; align-items: flex-start; gap: 24px; - margin-bottom: 34px; + margin-bottom: 28px; h2 { margin: 0 0 6px; @@ -74,48 +74,28 @@ .timeline-wrapper { width: 100%; overflow-x: auto; - padding-top: 8px; + padding: 4px 0 8px; } -.timeline-line { +.timeline-inner { position: relative; - display: grid; - align-items: center; - min-width: 1000px; - margin: 0 32px 18px; - border-top: 2px solid #23395d; + padding: 0 34px 8px; } -.timeline-point { - position: relative; - transform: translateY(-50%); - text-align: center; - - .year { - position: absolute; - top: -28px; - left: 50%; - transform: translateX(-50%); - color: #15213f; - font-size: 14px; - font-weight: 600; - white-space: nowrap; - } - - .dot { - display: inline-block; - width: 12px; - height: 12px; - border: 3px solid #ffffff; - border-radius: 50%; - box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1); - } -} - -.line-arrow { +.timeline-axis { position: absolute; - right: -2px; - top: -6px; + top: 34px; + left: 34px; + right: 34px; + height: 2px; + background: #23395d; +} + +.timeline-axis::after { + content: ""; + position: absolute; + top: -5px; + right: -10px; width: 0; height: 0; border-top: 6px solid transparent; @@ -123,43 +103,107 @@ border-left: 12px solid #23395d; } -.timeline-content { +.timeline-points { + position: relative; + z-index: 1; display: grid; - min-width: 1000px; - gap: 20px; + align-items: start; + min-height: 58px; } -.timeline-item { - text-align: center; +.timeline-point { + display: flex; + flex-direction: column; + align-items: center; + min-width: 0; - h3 { - min-height: 44px; - margin: 0 0 14px; - color: #07163d; - font-size: 15px; - font-weight: 600; - line-height: 1.35; + .year { + margin-bottom: 9px; + color: #15213f; + font-size: 14px; + font-weight: 700; + line-height: 18px; + white-space: nowrap; + } + + .dot { + width: 13px; + height: 13px; + border: 3px solid #ffffff; + border-radius: 50%; + box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16); } } -.keyword-list { +.timeline-content { + display: grid; + gap: 0; + margin-top: 8px; +} + +.timeline-item { + min-width: 0; + padding: 0 16px; + text-align: center; + + h3 { + min-height: 42px; + margin: 0 0 8px; + color: #07163d; + font-size: 15px; + font-weight: 700; + line-height: 1.35; + overflow-wrap: anywhere; + } +} + +.publication-count { + display: block; + margin-bottom: 14px; + color: #68748f; + font-size: 12px; +} + +.topic-list { display: flex; flex-direction: column; align-items: center; gap: 8px; } -.keyword-chip { +.topic-chip { display: inline-flex; align-items: center; justify-content: center; + gap: 7px; width: fit-content; - max-width: 100%; - padding: 6px 12px; - border-radius: 7px; + max-width: 210px; + min-height: 34px; + padding: 6px 10px; + border-radius: 8px; font-size: 12px; font-weight: 500; - white-space: nowrap; + line-height: 1.25; +} + +.topic-name { + min-width: 0; + overflow-wrap: anywhere; +} + +.topic-count { + display: inline-flex; + flex: 0 0 auto; + align-items: center; + justify-content: center; + min-width: 18px; + height: 18px; + padding: 0 5px; + border-radius: 999px; + background: rgba(255, 255, 255, 0.78); + color: inherit; + font-size: 11px; + font-weight: 700; } .purple { @@ -192,31 +236,31 @@ } } -.keyword-chip.purple { +.topic-chip.purple { border: 1px solid #d8cafe; background: #f6f0ff; color: #7255d9; } -.keyword-chip.blue { +.topic-chip.blue { border: 1px solid #bdd4ff; background: #f0f6ff; color: #0b63ce; } -.keyword-chip.green { +.topic-chip.green { border: 1px solid #bdebcf; background: #effaf3; color: #24834f; } -.keyword-chip.orange { +.topic-chip.orange { border: 1px solid #ffd796; background: #fff7e8; color: #c67500; } -.keyword-chip.pink { +.topic-chip.pink { border: 1px solid #ffc7d7; background: #fff1f5; color: #d12f61; @@ -227,7 +271,7 @@ justify-content: center; align-items: center; gap: 10px; - margin-top: 24px; + margin-top: 22px; color: #68748f; font-size: 13px; } @@ -240,16 +284,13 @@ background: #52627f; } -@media (max-width: 1100px) { - .timeline-line { - display: none; - } - - .timeline-content { - min-width: 0; - grid-template-columns: repeat(3, 1fr) !important; - row-gap: 28px; - } +.empty-timeline { + display: flex; + min-height: 120px; + align-items: center; + justify-content: center; + color: #68748f; + font-size: 14px; } @media (max-width: 700px) { @@ -260,16 +301,4 @@ .timeline-header { flex-direction: column; } - - .timeline-content { - grid-template-columns: 1fr !important; - } - - .timeline-item { - text-align: left; - } - - .keyword-list { - align-items: flex-start; - } } \ No newline at end of file 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 ff324de8..665acc45 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,11 +1,15 @@ import { CommonModule } from '@angular/common'; -import { Component } from '@angular/core'; +import { Component, Input } from '@angular/core'; -interface ResearchTimelineItem { +export interface TopicTimelineTopic { + name: string; + count: number; +} + +export interface TopicTimelineElement { year: number; - title: string; - keywords: string[]; - color: 'purple' | 'blue' | 'green' | 'orange' | 'pink'; + publication_count: number; + topics: TopicTimelineTopic[]; } @Component({ @@ -16,42 +20,42 @@ interface ResearchTimelineItem { styleUrls: ['./research-timeline.component.scss'], }) export class ResearchTimelineComponent { - timelineItems: ResearchTimelineItem[] = [ - { - year: 2014, - title: 'Datenanalyse und Statistik', - keywords: ['Datenanalyse', 'Statistik', 'Big Data'], - color: 'purple', - }, - { - year: 2016, - title: 'Maschinelles Lernen Grundlagen', - keywords: ['Machine Learning', 'Klassifikation', 'Feature Engineering'], - color: 'blue', - }, - { - year: 2018, - title: 'Deep Learning Anwendungen', - keywords: ['Deep Learning', 'Neuronale Netze', 'Bildverarbeitung'], - color: 'green', - }, - { - year: 2020, - title: 'KI in der Industrie', - keywords: ['Industrie 4.0', 'Predictive Analytics', 'Prozessoptimierung'], - color: 'orange', - }, - { - year: 2022, - title: 'Nachhaltige KI und Ethik', - keywords: ['Nachhaltigkeit', 'Responsible AI', 'Ethik'], - color: 'pink', - }, - { - year: 2024, - title: 'KI und Gesellschaft', - keywords: ['Smart Systems', 'Gesellschaft', 'Digitale Transformation'], - color: 'purple', - }, - ]; + @Input() elements: TopicTimelineElement[] = []; + + private readonly colors = ['purple', 'blue', 'green', 'orange', 'pink']; + private readonly columnWidth = 240; + + get timelineItems(): TopicTimelineElement[] { + return this.elements ?? []; + } + + get gridTemplateColumns(): string { + const count = Math.max(this.timelineItems.length, 1); + return `repeat(${count}, minmax(${this.columnWidth}px, 1fr))`; + } + + get timelineMinWidth(): number { + const count = Math.max(this.timelineItems.length, 1); + return Math.max(count * this.columnWidth, 1000); + } + + getTopTopics(item: TopicTimelineElement): TopicTimelineTopic[] { + return (item.topics ?? []).slice(0, 3); + } + + getMainTopic(item: TopicTimelineElement): string { + return this.getTopTopics(item)[0]?.name ?? 'Keine Topics'; + } + + getColorClass(index: number): string { + return this.colors[index % this.colors.length]; + } + + trackByYear(_: number, item: TopicTimelineElement): number { + return item.year; + } + + trackByTopic(_: number, topic: TopicTimelineTopic): string { + return topic.name; + } } \ No newline at end of file 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 fa007d36..8831e155 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.html +++ b/webapp/src/app/modules/person-overview/person-overview.component.html @@ -1,3 +1,3 @@
- +
\ No newline at end of file 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 e8891dd7..6416bbf3 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.ts +++ b/webapp/src/app/modules/person-overview/person-overview.component.ts @@ -1,5 +1,8 @@ import { Component } from '@angular/core'; -import { ResearchTimelineComponent } from './components/research-timeline/research-timeline.component'; +import { + ResearchTimelineComponent, + TopicTimelineElement, +} from './components/research-timeline/research-timeline.component'; @Component({ selector: 'app-person-overview', @@ -7,4 +10,169 @@ import { ResearchTimelineComponent } from './components/research-timeline/resear templateUrl: './person-overview.component.html', styleUrl: './person-overview.component.scss', }) -export class PersonOverviewComponent {} \ No newline at end of file +export class PersonOverviewComponent { + topicTimelineElements: TopicTimelineElement[] = [ + { + year: 2009, + publication_count: 1, + topics: [ + { name: 'Security and Verification in Computing', count: 1 }, + { name: 'Advanced Malware Detection Techniques', count: 1 }, + { name: 'Cloud Data Security Solutions', count: 1 }, + ], + }, + { + year: 2010, + publication_count: 2, + topics: [ + { name: 'Security and Verification in Computing', count: 2 }, + { name: 'Distributed systems and fault tolerance', count: 2 }, + { name: 'Parallel Computing and Optimization Techniques', count: 1 }, + ], + }, + { + year: 2011, + publication_count: 9, + topics: [ + { name: 'Advanced Malware Detection Techniques', count: 8 }, + { name: 'Security and Verification in Computing', count: 8 }, + { name: 'Digital and Cyber Forensics', count: 3 }, + ], + }, + { + year: 2012, + publication_count: 5, + topics: [ + { name: 'Advanced Malware Detection Techniques', count: 3 }, + { name: 'Security and Verification in Computing', count: 3 }, + { name: 'Network Security and Intrusion Detection', count: 3 }, + ], + }, + { + year: 2013, + publication_count: 6, + topics: [ + { name: 'Security and Verification in Computing', count: 6 }, + { name: 'Advanced Malware Detection Techniques', count: 6 }, + { name: 'Network Security and Intrusion Detection', count: 2 }, + ], + }, + { + year: 2014, + publication_count: 14, + topics: [ + { name: 'Advanced Malware Detection Techniques', count: 9 }, + { name: 'Security and Verification in Computing', count: 8 }, + { name: 'Diamond and Carbon-based Materials Research', count: 3 }, + ], + }, + { + year: 2015, + publication_count: 19, + topics: [ + { name: 'Security and Verification in Computing', count: 19 }, + { name: 'Advanced Malware Detection Techniques', count: 19 }, + { name: 'Diamond and Carbon-based Materials Research', count: 6 }, + ], + }, + { + year: 2016, + publication_count: 23, + topics: [ + { name: 'Security and Verification in Computing', count: 13 }, + { name: 'Advanced Malware Detection Techniques', count: 8 }, + { name: 'Cloud Data Security Solutions', count: 4 }, + ], + }, + { + year: 2017, + publication_count: 7, + topics: [ + { name: 'Security and Verification in Computing', count: 7 }, + { name: 'Advanced Malware Detection Techniques', count: 5 }, + { name: 'Diamond and Carbon-based Materials Research', count: 4 }, + ], + }, + { + year: 2018, + publication_count: 5, + topics: [ + { name: 'Security and Verification in Computing', count: 5 }, + { name: 'Advanced Malware Detection Techniques', count: 4 }, + { name: 'Diamond and Carbon-based Materials Research', count: 2 }, + ], + }, + { + year: 2019, + publication_count: 4, + topics: [ + { name: 'Advanced Malware Detection Techniques', count: 2 }, + { name: 'Security and Verification in Computing', count: 2 }, + { name: 'Blockchain Technology Applications and Security', count: 2 }, + ], + }, + { + year: 2020, + publication_count: 5, + topics: [ + { name: 'Security and Verification in Computing', count: 5 }, + { name: 'Advanced Malware Detection Techniques', count: 4 }, + { name: 'Diamond and Carbon-based Materials Research', count: 2 }, + ], + }, + { + year: 2021, + publication_count: 7, + topics: [ + { name: 'Physical Unclonable Functions (PUFs) and Hardware Security', count: 3 }, + { name: 'Parallel Computing and Optimization Techniques', count: 2 }, + { name: 'Security and Verification in Computing', count: 2 }, + ], + }, + { + year: 2022, + publication_count: 5, + topics: [ + { name: 'Security and Verification in Computing', count: 5 }, + { name: 'Advanced Malware Detection Techniques', count: 5 }, + { name: 'Physical Unclonable Functions (PUFs) and Hardware Security', count: 2 }, + ], + }, + { + year: 2023, + publication_count: 6, + topics: [ + { name: 'Security and Verification in Computing', count: 5 }, + { name: 'Advanced Malware Detection Techniques', count: 5 }, + { name: 'Blockchain Technology Applications and Security', count: 2 }, + ], + }, + { + year: 2024, + publication_count: 6, + topics: [ + { name: 'Security and Verification in Computing', count: 5 }, + { name: 'Advanced Malware Detection Techniques', count: 3 }, + { name: 'User Authentication and Security Systems', count: 2 }, + ], + }, + { + year: 2025, + publication_count: 6, + topics: [ + { name: 'Blockchain Technology Applications and Security', count: 2 }, + { name: 'Radiation Effects in Electronics', count: 1 }, + { name: 'Risk and Safety Analysis', count: 1 }, + ], + }, + { + year: 2026, + publication_count: 6, + topics: [ + { name: 'Advanced Malware Detection Techniques', count: 6 }, + { name: 'Security and Verification in Computing', count: 6 }, + { name: 'Web Application Security Vulnerabilities', count: 2 }, + ], + }, + ]; +} \ No newline at end of file From 644b111280a7a4291c3884cbf4b361bf5e5a5f43 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Mon, 1 Jun 2026 00:25:05 +0200 Subject: [PATCH 07/19] Keep research timeline legend centered --- .../research-timeline.component.html | 76 ++++++++++--------- .../research-timeline.component.scss | 3 +- 2 files changed, 41 insertions(+), 38 deletions(-) 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 4f1fe51a..5f469cd8 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 @@ -19,44 +19,46 @@
-
-
- + +
+
+ -
-
- {{ item.year }} - -
-
- -
-
-

{{ getMainTopic(item) }}

- - - {{ item.publication_count }} - {{ item.publication_count === 1 ? 'Publikation' : 'Publikationen' }} - - -
- - {{ topic.name }} - {{ topic.count }} - +
+
+ {{ item.year }} +
-
+
+ +
+
+

{{ getMainTopic(item) }}

+ + + {{ item.publication_count }} + {{ item.publication_count === 1 ? 'Publikation' : 'Publikationen' }} + + +
+ + {{ topic.name }} + {{ topic.count }} + +
+
+
@@ -64,7 +66,7 @@ Die drei häufigsten Topics je Jahr, gezählt über Publikationen.
-
+
diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss index 6fad9a1c..4a3d9654 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss @@ -271,9 +271,10 @@ justify-content: center; align-items: center; gap: 10px; - margin-top: 22px; + margin-top: 18px; color: #68748f; font-size: 13px; + text-align: center; } .note-dot { From de571d47bd2db0c5185d95cf2baf7ed0994a1024 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Mon, 1 Jun 2026 00:44:21 +0200 Subject: [PATCH 08/19] Connect research timeline to topics by time in backend --- .../research-timeline.component.html | 96 +++---- .../research-timeline.component.scss | 22 +- .../research-timeline.component.ts | 4 +- .../person-overview.component.html | 6 +- .../person-overview.component.ts | 240 ++++++------------ 5 files changed, 154 insertions(+), 214 deletions(-) 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 5f469cd8..2034bfd4 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 @@ -19,57 +19,67 @@
- -
-
- +
+ Forschungstimeline wird geladen ... +
-
-
- {{ item.year }} - +
+ Forschungstimeline konnte nicht geladen werden. +
+ + + +
+
+ + +
+
+ {{ item.year }} + +
+
+ +
+
+

{{ getMainTopic(item) }}

+ + + {{ item.publication_count }} + {{ item.publication_count === 1 ? 'Publikation' : 'Publikationen' }} + + +
+ + {{ topic.name }} + {{ topic.count }} + +
+
- -
-
-

{{ getMainTopic(item) }}

- - - {{ item.publication_count }} - {{ item.publication_count === 1 ? 'Publikation' : 'Publikationen' }} - - -
- - {{ topic.name }} - {{ topic.count }} - -
-
-
-
-
- - Die drei häufigsten Topics je Jahr, gezählt über Publikationen. -
+
+ + Die drei häufigsten Topics je Jahr, gezählt über Publikationen. +
+ -
+
Keine Timeline-Daten vorhanden.
diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss index 4a3d9654..f41b3916 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss @@ -5,6 +5,7 @@ border-radius: 16px; background: #ffffff; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); + box-sizing: border-box; } .timeline-header { @@ -19,6 +20,7 @@ color: #07163d; font-size: 20px; font-weight: 700; + line-height: 1.25; } p { @@ -36,6 +38,7 @@ .view-toggle { display: flex; gap: 4px; + flex: 0 0 auto; padding: 4px; border: 1px solid #dbe5f6; border-radius: 10px; @@ -74,6 +77,7 @@ .timeline-wrapper { width: 100%; overflow-x: auto; + overflow-y: hidden; padding: 4px 0 8px; } @@ -285,13 +289,19 @@ background: #52627f; } -.empty-timeline { +.timeline-state { display: flex; - min-height: 120px; + min-height: 140px; align-items: center; justify-content: center; + padding: 20px; color: #68748f; font-size: 14px; + text-align: center; +} + +.timeline-state-error { + color: #b42318; } @media (max-width: 700px) { @@ -302,4 +312,12 @@ .timeline-header { flex-direction: column; } + + .view-toggle { + width: 100%; + + button { + flex: 1; + } + } } \ No newline at end of file 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 665acc45..fa6bd6f3 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 @@ -17,10 +17,12 @@ export interface TopicTimelineElement { standalone: true, imports: [CommonModule], templateUrl: './research-timeline.component.html', - styleUrls: ['./research-timeline.component.scss'], + styleUrl: './research-timeline.component.scss', }) export class ResearchTimelineComponent { @Input() elements: TopicTimelineElement[] = []; + @Input() loading = false; + @Input() loadFailed = false; private readonly colors = ['purple', 'blue', 'green', 'orange', 'pink']; private readonly columnWidth = 240; 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 8831e155..3f70b27a 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.html +++ b/webapp/src/app/modules/person-overview/person-overview.component.html @@ -1,3 +1,7 @@
- +
\ No newline at end of file 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 6416bbf3..ff40b5a9 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.ts +++ b/webapp/src/app/modules/person-overview/person-overview.component.ts @@ -1,178 +1,84 @@ -import { Component } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { HttpClient } from '@angular/common/http'; +import { Component, DestroyRef, OnInit, inject } from '@angular/core'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { ActivatedRoute, ParamMap } from '@angular/router'; +import { combineLatest, distinctUntilChanged, map } from 'rxjs'; + import { ResearchTimelineComponent, TopicTimelineElement, } from './components/research-timeline/research-timeline.component'; +interface TopicTimelineResponse { + elements: TopicTimelineElement[]; + total: number; +} + @Component({ selector: 'app-person-overview', - imports: [ResearchTimelineComponent], + standalone: true, + imports: [CommonModule, ResearchTimelineComponent], templateUrl: './person-overview.component.html', styleUrl: './person-overview.component.scss', }) -export class PersonOverviewComponent { - topicTimelineElements: TopicTimelineElement[] = [ - { - year: 2009, - publication_count: 1, - topics: [ - { name: 'Security and Verification in Computing', count: 1 }, - { name: 'Advanced Malware Detection Techniques', count: 1 }, - { name: 'Cloud Data Security Solutions', count: 1 }, - ], - }, - { - year: 2010, - publication_count: 2, - topics: [ - { name: 'Security and Verification in Computing', count: 2 }, - { name: 'Distributed systems and fault tolerance', count: 2 }, - { name: 'Parallel Computing and Optimization Techniques', count: 1 }, - ], - }, - { - year: 2011, - publication_count: 9, - topics: [ - { name: 'Advanced Malware Detection Techniques', count: 8 }, - { name: 'Security and Verification in Computing', count: 8 }, - { name: 'Digital and Cyber Forensics', count: 3 }, - ], - }, - { - year: 2012, - publication_count: 5, - topics: [ - { name: 'Advanced Malware Detection Techniques', count: 3 }, - { name: 'Security and Verification in Computing', count: 3 }, - { name: 'Network Security and Intrusion Detection', count: 3 }, - ], - }, - { - year: 2013, - publication_count: 6, - topics: [ - { name: 'Security and Verification in Computing', count: 6 }, - { name: 'Advanced Malware Detection Techniques', count: 6 }, - { name: 'Network Security and Intrusion Detection', count: 2 }, - ], - }, - { - year: 2014, - publication_count: 14, - topics: [ - { name: 'Advanced Malware Detection Techniques', count: 9 }, - { name: 'Security and Verification in Computing', count: 8 }, - { name: 'Diamond and Carbon-based Materials Research', count: 3 }, - ], - }, - { - year: 2015, - publication_count: 19, - topics: [ - { name: 'Security and Verification in Computing', count: 19 }, - { name: 'Advanced Malware Detection Techniques', count: 19 }, - { name: 'Diamond and Carbon-based Materials Research', count: 6 }, - ], - }, - { - year: 2016, - publication_count: 23, - topics: [ - { name: 'Security and Verification in Computing', count: 13 }, - { name: 'Advanced Malware Detection Techniques', count: 8 }, - { name: 'Cloud Data Security Solutions', count: 4 }, - ], - }, - { - year: 2017, - publication_count: 7, - topics: [ - { name: 'Security and Verification in Computing', count: 7 }, - { name: 'Advanced Malware Detection Techniques', count: 5 }, - { name: 'Diamond and Carbon-based Materials Research', count: 4 }, - ], - }, - { - year: 2018, - publication_count: 5, - topics: [ - { name: 'Security and Verification in Computing', count: 5 }, - { name: 'Advanced Malware Detection Techniques', count: 4 }, - { name: 'Diamond and Carbon-based Materials Research', count: 2 }, - ], - }, - { - year: 2019, - publication_count: 4, - topics: [ - { name: 'Advanced Malware Detection Techniques', count: 2 }, - { name: 'Security and Verification in Computing', count: 2 }, - { name: 'Blockchain Technology Applications and Security', count: 2 }, - ], - }, - { - year: 2020, - publication_count: 5, - topics: [ - { name: 'Security and Verification in Computing', count: 5 }, - { name: 'Advanced Malware Detection Techniques', count: 4 }, - { name: 'Diamond and Carbon-based Materials Research', count: 2 }, - ], - }, - { - year: 2021, - publication_count: 7, - topics: [ - { name: 'Physical Unclonable Functions (PUFs) and Hardware Security', count: 3 }, - { name: 'Parallel Computing and Optimization Techniques', count: 2 }, - { name: 'Security and Verification in Computing', count: 2 }, - ], - }, - { - year: 2022, - publication_count: 5, - topics: [ - { name: 'Security and Verification in Computing', count: 5 }, - { name: 'Advanced Malware Detection Techniques', count: 5 }, - { name: 'Physical Unclonable Functions (PUFs) and Hardware Security', count: 2 }, - ], - }, - { - year: 2023, - publication_count: 6, - topics: [ - { name: 'Security and Verification in Computing', count: 5 }, - { name: 'Advanced Malware Detection Techniques', count: 5 }, - { name: 'Blockchain Technology Applications and Security', count: 2 }, - ], - }, - { - year: 2024, - publication_count: 6, - topics: [ - { name: 'Security and Verification in Computing', count: 5 }, - { name: 'Advanced Malware Detection Techniques', count: 3 }, - { name: 'User Authentication and Security Systems', count: 2 }, - ], - }, - { - year: 2025, - publication_count: 6, - topics: [ - { name: 'Blockchain Technology Applications and Security', count: 2 }, - { name: 'Radiation Effects in Electronics', count: 1 }, - { name: 'Risk and Safety Analysis', count: 1 }, - ], - }, - { - year: 2026, - publication_count: 6, - topics: [ - { name: 'Advanced Malware Detection Techniques', count: 6 }, - { name: 'Security and Verification in Computing', count: 6 }, - { name: 'Web Application Security Vulnerabilities', count: 2 }, - ], - }, - ]; +export class PersonOverviewComponent implements OnInit { + private readonly route = inject(ActivatedRoute); + private readonly http = inject(HttpClient); + private readonly destroyRef = inject(DestroyRef); + + topicTimelineElements: TopicTimelineElement[] = []; + loadingTimeline = false; + timelineLoadFailed = false; + + ngOnInit(): void { + combineLatest(this.route.pathFromRoot.map((route) => route.paramMap)) + .pipe( + map((paramMaps) => this.findAuthorId(paramMaps)), + distinctUntilChanged(), + takeUntilDestroyed(this.destroyRef), + ) + .subscribe((authorId) => { + this.loadTopicTimeline(authorId); + }); + } + + private findAuthorId(paramMaps: readonly ParamMap[]): string { + return ( + paramMaps + .map((paramMap) => paramMap.get('id')) + .find((id): id is string => Boolean(id)) ?? '' + ); + } + + private loadTopicTimeline(authorId: string): void { + if (!authorId || authorId === '0') { + this.topicTimelineElements = []; + this.loadingTimeline = false; + this.timelineLoadFailed = false; + return; + } + + this.loadingTimeline = true; + this.timelineLoadFailed = false; + + const url = `/inse-service/authors/${encodeURIComponent(authorId)}/topics-by-time`; + + this.http + .get(url) + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe({ + next: (response) => { + this.topicTimelineElements = response.elements ?? []; + this.loadingTimeline = false; + this.timelineLoadFailed = false; + }, + error: (error) => { + console.error('Topic timeline could not be loaded.', error); + this.topicTimelineElements = []; + this.loadingTimeline = false; + this.timelineLoadFailed = true; + }, + }); + } } \ No newline at end of file From 0a86a3f5bccb8282eac6200a1bd144ac280c3311 Mon Sep 17 00:00:00 2001 From: spsaefan <117728614+spsaefan@users.noreply.github.com> Date: Mon, 1 Jun 2026 10:32:29 +0200 Subject: [PATCH 09/19] Add primary topics to topic timeline --- .../src/main/inse/models/topics_by_year.py | 1 + service/src/main/inse/works/logic.py | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/service/src/main/inse/models/topics_by_year.py b/service/src/main/inse/models/topics_by_year.py index f1c90610..91efe7c6 100644 --- a/service/src/main/inse/models/topics_by_year.py +++ b/service/src/main/inse/models/topics_by_year.py @@ -9,3 +9,4 @@ class TopicsByYear(BaseModel): year: int = Field(description="The publication year.") publication_count: int = Field(default=0, description="The number of works in this year.") topics: List[TopicCount] = Field(default_factory=list, description="The topics in this year.") + primary_topics: List[TopicCount] = Field(default_factory=list, description="The primary topics in this year.") diff --git a/service/src/main/inse/works/logic.py b/service/src/main/inse/works/logic.py index cf522fca..94557c87 100644 --- a/service/src/main/inse/works/logic.py +++ b/service/src/main/inse/works/logic.py @@ -107,6 +107,7 @@ async def get_topics_by_time_by_author( years[year] = { "publication_count": 0, "topics": {}, + "primary_topics": {}, } years[year]["publication_count"] += 1 @@ -120,6 +121,16 @@ async def get_topics_by_time_by_author( years[year]["topics"][topic_name] += 1 + primary_topic = work.primary_topic + + if primary_topic and primary_topic.display_name: + primary_topic_name = primary_topic.display_name + + if primary_topic_name not in years[year]["primary_topics"]: + years[year]["primary_topics"][primary_topic_name] = 0 + + years[year]["primary_topics"][primary_topic_name] += 1 + elements = [] for year in sorted(years.keys()): @@ -134,10 +145,22 @@ async def get_topics_by_time_by_author( count=count, )) + primary_topic_items = list(years[year]["primary_topics"].items()) + primary_topic_items.sort(key=lambda item: item[1], reverse=True) + + primary_topics = [] + + for topic_name, count in primary_topic_items[:max_topics_per_year]: + primary_topics.append(TopicCount( + name=topic_name, + count=count, + )) + elements.append(TopicsByYear( year=year, publication_count=years[year]["publication_count"], topics=topics, + primary_topics=primary_topics, )) return TopicsByTime( From 0a32a2c19199a2df4b0e5f106051dbe9ef6295fd Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Mon, 1 Jun 2026 19:56:20 +0200 Subject: [PATCH 10/19] Integrate primary topics into research timeline --- .../research-timeline.component.html | 28 ++++++++++------ .../research-timeline.component.scss | 5 +++ .../research-timeline.component.ts | 32 +++++++++++++++++-- .../person-overview.component.ts | 3 +- 4 files changed, 55 insertions(+), 13 deletions(-) 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 2034bfd4..360980ba 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 @@ -57,14 +57,22 @@
- - {{ topic.name }} - {{ topic.count }} - + + + {{ topic.name }} + {{ topic.count }} + + + + + + Keine weiteren Topics + +
@@ -73,7 +81,9 @@
- Die drei häufigsten Topics je Jahr, gezählt über Publikationen. + + Hauptforschungsschwerpunkte im jeweiligen Zeitraum +
diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss index f41b3916..0b1b5ba4 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss @@ -210,6 +210,11 @@ font-weight: 700; } +.no-topics { + color: #9aa5bc; + font-size: 12px; +} + .purple { .dot { background: #7255d9; 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 fa6bd6f3..c170583f 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 @@ -10,6 +10,7 @@ export interface TopicTimelineElement { year: number; publication_count: number; topics: TopicTimelineTopic[]; + primary_topics?: TopicTimelineTopic[]; } @Component({ @@ -26,6 +27,7 @@ export class ResearchTimelineComponent { private readonly colors = ['purple', 'blue', 'green', 'orange', 'pink']; private readonly columnWidth = 240; + private readonly displayedTopicLimit = 3; get timelineItems(): TopicTimelineElement[] { return this.elements ?? []; @@ -41,12 +43,20 @@ export class ResearchTimelineComponent { return Math.max(count * this.columnWidth, 1000); } - getTopTopics(item: TopicTimelineElement): TopicTimelineTopic[] { - return (item.topics ?? []).slice(0, 3); + getPrimaryTopic(item: TopicTimelineElement): TopicTimelineTopic | undefined { + return (item.primary_topics ?? [])[0]; } getMainTopic(item: TopicTimelineElement): string { - return this.getTopTopics(item)[0]?.name ?? 'Keine Topics'; + return this.getPrimaryTopic(item)?.name ?? this.getFirstTopic(item)?.name ?? 'Keine Topics'; + } + + getDisplayedTopics(item: TopicTimelineElement): TopicTimelineTopic[] { + const primaryTopicName = this.getPrimaryTopic(item)?.name; + + return (item.topics ?? []) + .filter((topic) => !this.isSameTopic(topic.name, primaryTopicName)) + .slice(0, this.displayedTopicLimit); } getColorClass(index: number): string { @@ -60,4 +70,20 @@ export class ResearchTimelineComponent { trackByTopic(_: number, topic: TopicTimelineTopic): string { return topic.name; } + + private getFirstTopic(item: TopicTimelineElement): TopicTimelineTopic | undefined { + return (item.topics ?? [])[0]; + } + + private isSameTopic(topicName: string, primaryTopicName: string | undefined): boolean { + if (!primaryTopicName) { + return false; + } + + return this.normalizeTopicName(topicName) === this.normalizeTopicName(primaryTopicName); + } + + private normalizeTopicName(topicName: string): string { + return topicName.trim().toLowerCase(); + } } \ No newline at end of file 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 ff40b5a9..5edfefd6 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.ts +++ b/webapp/src/app/modules/person-overview/person-overview.component.ts @@ -62,7 +62,8 @@ export class PersonOverviewComponent implements OnInit { this.loadingTimeline = true; this.timelineLoadFailed = false; - const url = `/inse-service/authors/${encodeURIComponent(authorId)}/topics-by-time`; + const topicCountLimit = 4; + const url = `/inse-service/authors/${encodeURIComponent(authorId)}/topics-by-time?max_topics_per_year=${topicCountLimit}`; this.http .get(url) From 9a06211a0a9cfac77ae8eb0e63e9a7849d1f619c Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Mon, 1 Jun 2026 20:12:10 +0200 Subject: [PATCH 11/19] Add year range filter to research timeline --- .../research-timeline.component.html | 72 ++++++- .../research-timeline.component.scss | 179 +++++++++++++++++- .../research-timeline.component.ts | 111 ++++++++++- 3 files changed, 350 insertions(+), 12 deletions(-) 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 360980ba..83f217f8 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 @@ -1,6 +1,6 @@
-
+

Forschungstimeline

Entwicklung der Forschungsthemen im Zeitverlauf @@ -8,14 +8,70 @@

-
- +
+
+
+ Zeitraum - + +
+ +
+ {{ selectedStartYear }} + bis + {{ selectedEndYear }} +
+ +
+
+ + + + +
+ +
+ {{ minYear }} + {{ maxYear }} +
+
+ +
+ + + +
diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss index 0b1b5ba4..0d673ef0 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss @@ -14,6 +14,10 @@ align-items: flex-start; gap: 24px; margin-bottom: 28px; +} + +.timeline-title { + min-width: 260px; h2 { margin: 0 0 6px; @@ -35,6 +39,164 @@ } } +.timeline-header-actions { + display: flex; + align-items: flex-start; + justify-content: flex-end; + gap: 14px; + flex: 1; +} + +.year-filter { + width: min(250px, 100%); + padding: 1px 10px; + border: 1px solid #dbe5f6; + border-radius: 10px; + background: #fbfdff; +} + +.year-filter-top { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + margin-bottom: 4px; +} + +.year-filter-label { + color: #07163d; + font-size: 12px; + font-weight: 700; +} + +.reset-range-button { + border: none; + background: transparent; + color: #0057ff; + font-size: 11px; + cursor: pointer; + padding: 0; + + &:disabled { + color: #9aa5bc; + cursor: default; + } +} + +.year-filter-values { + display: flex; + align-items: center; + justify-content: center; + gap: 7px; + margin-bottom: 5px; + color: #40506f; + font-size: 12px; + font-weight: 600; +} + +.year-range-slider { + --range-start: 0%; + --range-end: 100%; + + position: relative; + height: 22px; + margin: 0; +} + +.range-track { + position: absolute; + top: 50%; + left: 0; + right: 0; + height: 5px; + transform: translateY(-50%); + border-radius: 999px; + background: + linear-gradient( + to right, + #d8e2f4 0%, + #d8e2f4 var(--range-start), + #0057ff var(--range-start), + #0057ff var(--range-end), + #d8e2f4 var(--range-end), + #d8e2f4 100% + ); +} + +.range-input { + position: absolute; + top: 0; + left: 0; + width: 100%; + margin: 0; + height: 22px; + appearance: none; + background: transparent; + pointer-events: none; +} + +.range-input::-webkit-slider-runnable-track { + height: 5px; + background: transparent; + border: none; +} + +.range-input::-moz-range-track { + height: 5px; + background: transparent; + border: none; +} + +.range-input::-webkit-slider-thumb { + appearance: none; + width: 15px; + height: 15px; + margin-top: -5px; + border: 2px solid #ffffff; + border-radius: 50%; + background: #0057ff; + box-shadow: 0 0 0 1px #9ab7ff, 0 2px 6px rgba(0, 87, 255, 0.22); + cursor: pointer; + pointer-events: auto; +} + +.range-input::-moz-range-thumb { + width: 15px; + height: 15px; + border: 2px solid #ffffff; + border-radius: 50%; + background: #0057ff; + box-shadow: 0 0 0 1px #9ab7ff, 0 2px 6px rgba(0, 87, 255, 0.22); + cursor: pointer; + pointer-events: auto; +} + +.range-input:focus-visible::-webkit-slider-thumb { + outline: 2px solid #07163d; + outline-offset: 2px; +} + +.range-input:focus-visible::-moz-range-thumb { + outline: 2px solid #07163d; + outline-offset: 2px; +} + +.range-input-start { + z-index: 2; +} + +.range-input-end { + z-index: 3; +} + +.year-filter-bounds { + display: flex; + justify-content: space-between; + margin-top: 1px; + color: #7c88a3; + font-size: 10px; +} + .view-toggle { display: flex; gap: 4px; @@ -309,15 +471,30 @@ color: #b42318; } +@media (max-width: 980px) { + .timeline-header { + flex-direction: column; + } + + .timeline-header-actions { + width: 100%; + justify-content: space-between; + } +} + @media (max-width: 700px) { .research-timeline-card { padding: 20px; } - .timeline-header { + .timeline-header-actions { flex-direction: column; } + .year-filter { + width: 100%; + } + .view-toggle { width: 100%; 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 c170583f..aa5b00c2 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,5 @@ import { CommonModule } from '@angular/common'; -import { Component, Input } from '@angular/core'; +import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; export interface TopicTimelineTopic { name: string; @@ -20,17 +20,46 @@ export interface TopicTimelineElement { templateUrl: './research-timeline.component.html', styleUrl: './research-timeline.component.scss', }) -export class ResearchTimelineComponent { +export class ResearchTimelineComponent implements OnChanges { @Input() elements: TopicTimelineElement[] = []; @Input() loading = false; @Input() loadFailed = false; + minYear = 0; + maxYear = 0; + selectedStartYear = 0; + selectedEndYear = 0; + private readonly colors = ['purple', 'blue', 'green', 'orange', 'pink']; private readonly columnWidth = 240; private readonly displayedTopicLimit = 3; + ngOnChanges(changes: SimpleChanges): void { + if (changes['elements']) { + this.initializeYearRange(); + } + } + get timelineItems(): TopicTimelineElement[] { - return this.elements ?? []; + return this.sortedElements.filter((item) => { + return item.year >= this.selectedStartYear && item.year <= this.selectedEndYear; + }); + } + + get hasYearRange(): boolean { + return this.minYear > 0 && this.maxYear > 0 && this.minYear < this.maxYear; + } + + get canResetYearRange(): boolean { + return this.selectedStartYear !== this.minYear || this.selectedEndYear !== this.maxYear; + } + + get rangeStartPercent(): string { + return `${this.calculateRangePercent(this.selectedStartYear)}%`; + } + + get rangeEndPercent(): string { + return `${this.calculateRangePercent(this.selectedEndYear)}%`; } get gridTemplateColumns(): string { @@ -43,6 +72,31 @@ export class ResearchTimelineComponent { return Math.max(count * this.columnWidth, 1000); } + onStartYearInput(event: Event): void { + const nextStartYear = this.parseYearInput(event); + + this.selectedStartYear = this.clampYear(nextStartYear); + + if (this.selectedStartYear > this.selectedEndYear) { + this.selectedEndYear = this.selectedStartYear; + } + } + + onEndYearInput(event: Event): void { + const nextEndYear = this.parseYearInput(event); + + this.selectedEndYear = this.clampYear(nextEndYear); + + if (this.selectedEndYear < this.selectedStartYear) { + this.selectedStartYear = this.selectedEndYear; + } + } + + resetYearRange(): void { + this.selectedStartYear = this.minYear; + this.selectedEndYear = this.maxYear; + } + getPrimaryTopic(item: TopicTimelineElement): TopicTimelineTopic | undefined { return (item.primary_topics ?? [])[0]; } @@ -71,6 +125,28 @@ export class ResearchTimelineComponent { return topic.name; } + private get sortedElements(): TopicTimelineElement[] { + return [...(this.elements ?? [])].sort((left, right) => left.year - right.year); + } + + private initializeYearRange(): void { + const years = this.sortedElements + .map((item) => item.year) + .filter((year) => Number.isFinite(year)); + + if (years.length === 0) { + this.minYear = 0; + this.maxYear = 0; + this.selectedStartYear = 0; + this.selectedEndYear = 0; + return; + } + + this.minYear = Math.min(...years); + this.maxYear = Math.max(...years); + this.resetYearRange(); + } + private getFirstTopic(item: TopicTimelineElement): TopicTimelineTopic | undefined { return (item.topics ?? [])[0]; } @@ -86,4 +162,33 @@ export class ResearchTimelineComponent { private normalizeTopicName(topicName: string): string { return topicName.trim().toLowerCase(); } + + private parseYearInput(event: Event): number { + const input = event.target as HTMLInputElement | null; + const value = Number(input?.value ?? this.minYear); + + if (!Number.isFinite(value)) { + return this.minYear; + } + + return value; + } + + private clampYear(year: number): number { + return Math.min(Math.max(year, this.minYear), this.maxYear); + } + + private calculateRangePercent(year: number): number { + if (!this.hasYearRange) { + return 0; + } + + const totalRange = this.maxYear - this.minYear; + + if (totalRange <= 0) { + return 0; + } + + return ((year - this.minYear) / totalRange) * 100; + } } \ No newline at end of file From 24ee9df743077861558352ac6255fbd540ca1c5a Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Mon, 1 Jun 2026 20:56:45 +0200 Subject: [PATCH 12/19] Add compact research timeline view --- .../research-timeline.component.html | 299 ++++++++++++------ .../research-timeline.component.scss | 245 +++++++++++--- .../research-timeline.component.ts | 179 +++++++++++ 3 files changed, 582 insertions(+), 141 deletions(-) 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 83f217f8..cfd25c2e 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 @@ -8,69 +8,75 @@

-
-
-
- Zeitraum +
+ - -
+ +
-
- {{ selectedStartYear }} - bis - {{ selectedEndYear }} -
+
+
+ Zeitraum -
-
- - - - -
- -
- {{ minYear }} - {{ maxYear }} -
+ Zurücksetzen +
-
- +
+ {{ selectedStartYear }} + bis + {{ selectedEndYear }} +
- +
+
+ + + + +
+ +
+ {{ minYear }} + {{ maxYear }}
@@ -85,55 +91,146 @@ -
-
- + +
+
+ -
-
- {{ item.year }} - +
+
+ {{ item.year }} + +
+
+ +
+
+

{{ getMainTopic(item) }}

+ + + {{ item.publication_count }} + {{ item.publication_count === 1 ? 'Publikation' : 'Publikationen' }} + + +
+ + + {{ topic.name }} + {{ topic.count }} + + + + + + Keine weiteren Topics + + +
+
- -
-
-

{{ getMainTopic(item) }}

- - - {{ item.publication_count }} - {{ item.publication_count === 1 ? 'Publikation' : 'Publikationen' }} - - -
- - - {{ topic.name }} - {{ topic.count }} - - - - - - Keine weiteren Topics - - -
-
-
-
+ + + +
+
+
+ + +
+ {{ getPhaseYearLabel(phase) }} +

{{ phase.primaryTopicName }}

+ + {{ phase.publication_count }} + {{ phase.publication_count === 1 ? 'Publikation' : 'Publikationen' }} + +
+
+ +
+ + + {{ topic.name }} + {{ topic.count }} + + + + + + Keine weiteren Topics + + +
+ + + +
+
+
+ {{ year.year }} + + {{ year.publication_count }} + {{ year.publication_count === 1 ? 'Publikation' : 'Publikationen' }} + +
+ +
+ + + {{ topic.name }} + {{ topic.count }} + + + + + + Keine weiteren Topics + + +
+
+
+
+
+
diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss index 0d673ef0..f5daf94e 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss @@ -9,15 +9,15 @@ } .timeline-header { - display: flex; - justify-content: space-between; + display: grid; + grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr); align-items: flex-start; gap: 24px; margin-bottom: 28px; } .timeline-title { - min-width: 260px; + min-width: 0; h2 { margin: 0 0 6px; @@ -39,17 +39,10 @@ } } -.timeline-header-actions { - display: flex; - align-items: flex-start; - justify-content: flex-end; - gap: 14px; - flex: 1; -} - .year-filter { - width: min(250px, 100%); - padding: 1px 10px; + justify-self: end; + width: min(285px, 100%); + padding: 8px 10px; border: 1px solid #dbe5f6; border-radius: 10px; background: #fbfdff; @@ -198,9 +191,9 @@ } .view-toggle { + justify-self: center; display: flex; gap: 4px; - flex: 0 0 auto; padding: 4px; border: 1px solid #dbe5f6; border-radius: 10px; @@ -209,7 +202,7 @@ button { border: none; border-radius: 8px; - padding: 9px 16px; + padding: 9px 18px; background: transparent; color: #3f4b66; font-size: 14px; @@ -225,14 +218,6 @@ color: #0057ff; box-shadow: inset 0 0 0 1px #3d7cff; } - - &.inactive-button { - cursor: default; - } - - &.inactive-button:hover { - background: transparent; - } } } @@ -377,36 +362,206 @@ font-size: 12px; } +.compact-phase-list { + display: flex; + flex-wrap: wrap; + align-items: stretch; + gap: 14px; +} + +.phase-card { + flex: 0 1 calc((100% - 28px) / 3); + max-width: 520px; + min-width: 300px; + box-sizing: border-box; + padding: 15px 16px; + border: 1px solid #dbe5f6; + border-left-width: 4px; + border-radius: 14px; + background: #fbfdff; +} + +.phase-card-header { + display: flex; + align-items: flex-start; + gap: 10px; +} + +.phase-marker { + flex: 0 0 auto; + width: 11px; + height: 11px; + margin-top: 5px; + border: 3px solid #ffffff; + border-radius: 50%; + box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.14); +} + +.phase-title-block { + min-width: 0; + + h3 { + margin: 3px 0 4px; + color: #07163d; + font-size: 15px; + font-weight: 700; + line-height: 1.35; + } +} + +.phase-years { + display: inline-flex; + width: fit-content; + padding: 2px 8px; + border-radius: 999px; + background: #eef4ff; + color: #0057ff; + font-size: 12px; + font-weight: 700; +} + +.phase-publications { + color: #68748f; + font-size: 12px; +} + +.phase-topics { + display: flex; + flex-wrap: wrap; + gap: 7px; + margin-top: 14px; +} + +.phase-toggle { + margin-top: 13px; + border: none; + background: transparent; + color: #0057ff; + font-size: 12px; + font-weight: 700; + cursor: pointer; + padding: 0; +} + +.phase-year-details { + display: flex; + flex-direction: column; + margin-top: 13px; + padding-top: 4px; + border-top: 1px solid #dbe5f6; +} + +.phase-year-row { + display: grid; + grid-template-columns: 72px 1fr; + gap: 10px; + align-items: start; + padding: 10px 0; +} + +.phase-year-row + .phase-year-row { + border-top: 1px solid #e4ebf7; +} + +.phase-year-meta { + display: flex; + flex-direction: column; + gap: 2px; + + strong { + color: #07163d; + font-size: 13px; + } + + span { + color: #68748f; + font-size: 11px; + } +} + +.phase-year-topics { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.mini-topic-chip { + display: inline-flex; + align-items: center; + gap: 5px; + max-width: 100%; + padding: 4px 7px; + border-radius: 7px; + background: #f2f6ff; + color: #40506f; + font-size: 11px; + line-height: 1.25; + + span { + overflow-wrap: anywhere; + } + + strong { + color: #0057ff; + font-size: 10px; + } +} + .purple { - .dot { + .dot, + .phase-marker { background: #7255d9; } } .blue { - .dot { + .dot, + .phase-marker { background: #2678e8; } } .green { - .dot { + .dot, + .phase-marker { background: #39a96b; } } .orange { - .dot { + .dot, + .phase-marker { background: #f59e0b; } } .pink { - .dot { + .dot, + .phase-marker { background: #e0527c; } } +.phase-card.purple { + border-left-color: #7255d9; +} + +.phase-card.blue { + border-left-color: #2678e8; +} + +.phase-card.green { + border-left-color: #39a96b; +} + +.phase-card.orange { + border-left-color: #f59e0b; +} + +.phase-card.pink { + border-left-color: #e0527c; +} + .topic-chip.purple { border: 1px solid #d8cafe; background: #f6f0ff; @@ -471,14 +626,23 @@ color: #b42318; } -@media (max-width: 980px) { +@media (max-width: 1100px) { .timeline-header { - flex-direction: column; + grid-template-columns: 1fr; } - .timeline-header-actions { + .view-toggle { + justify-self: start; + } + + .year-filter { + justify-self: stretch; width: 100%; - justify-content: space-between; + } + + .phase-card { + flex-basis: calc((100% - 14px) / 2); + max-width: none; } } @@ -487,14 +651,6 @@ padding: 20px; } - .timeline-header-actions { - flex-direction: column; - } - - .year-filter { - width: 100%; - } - .view-toggle { width: 100%; @@ -502,4 +658,13 @@ flex: 1; } } + + .phase-card { + flex-basis: 100%; + min-width: 0; + } + + .phase-year-row { + grid-template-columns: 1fr; + } } \ No newline at end of file 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 aa5b00c2..1f478634 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 @@ -13,6 +13,26 @@ export interface TopicTimelineElement { primary_topics?: TopicTimelineTopic[]; } +type TimelineViewMode = 'years' | 'compact'; + +interface ResearchTimelinePhase { + id: string; + startYear: number; + endYear: number; + publication_count: number; + primaryTopicName: string; + years: TopicTimelineElement[]; + topics: TopicTimelineTopic[]; +} + +interface WorkingResearchTimelinePhase { + startYear: number; + endYear: number; + publication_count: number; + primaryTopicName: string; + years: TopicTimelineElement[]; +} + @Component({ selector: 'app-research-timeline', standalone: true, @@ -25,6 +45,8 @@ export class ResearchTimelineComponent implements OnChanges { @Input() loading = false; @Input() loadFailed = false; + timelineViewMode: TimelineViewMode = 'years'; + minYear = 0; maxYear = 0; selectedStartYear = 0; @@ -33,6 +55,8 @@ export class ResearchTimelineComponent implements OnChanges { private readonly colors = ['purple', 'blue', 'green', 'orange', 'pink']; private readonly columnWidth = 240; private readonly displayedTopicLimit = 3; + private readonly displayedPhaseTopicLimit = 4; + private readonly expandedPhaseIds = new Set(); ngOnChanges(changes: SimpleChanges): void { if (changes['elements']) { @@ -46,6 +70,10 @@ export class ResearchTimelineComponent implements OnChanges { }); } + get compactPhases(): ResearchTimelinePhase[] { + return this.buildCompactPhases(this.timelineItems); + } + get hasYearRange(): boolean { return this.minYear > 0 && this.maxYear > 0 && this.minYear < this.maxYear; } @@ -72,6 +100,10 @@ export class ResearchTimelineComponent implements OnChanges { return Math.max(count * this.columnWidth, 1000); } + setTimelineViewMode(mode: TimelineViewMode): void { + this.timelineViewMode = mode; + } + onStartYearInput(event: Event): void { const nextStartYear = this.parseYearInput(event); @@ -108,11 +140,39 @@ export class ResearchTimelineComponent implements OnChanges { getDisplayedTopics(item: TopicTimelineElement): TopicTimelineTopic[] { const primaryTopicName = this.getPrimaryTopic(item)?.name; + return this.getDisplayedTopicsForPrimaryTopic(item, primaryTopicName); + } + + getDisplayedTopicsForPrimaryTopic( + item: TopicTimelineElement, + primaryTopicName: string | undefined, + ): TopicTimelineTopic[] { return (item.topics ?? []) .filter((topic) => !this.isSameTopic(topic.name, primaryTopicName)) .slice(0, this.displayedTopicLimit); } + getPhaseYearLabel(phase: ResearchTimelinePhase): string { + if (phase.startYear === phase.endYear) { + return `${phase.startYear}`; + } + + return `${phase.startYear}–${phase.endYear}`; + } + + togglePhase(phase: ResearchTimelinePhase): void { + if (this.expandedPhaseIds.has(phase.id)) { + this.expandedPhaseIds.delete(phase.id); + return; + } + + this.expandedPhaseIds.add(phase.id); + } + + isPhaseExpanded(phase: ResearchTimelinePhase): boolean { + return this.expandedPhaseIds.has(phase.id); + } + getColorClass(index: number): string { return this.colors[index % this.colors.length]; } @@ -125,6 +185,10 @@ export class ResearchTimelineComponent implements OnChanges { return topic.name; } + trackByPhase(_: number, phase: ResearchTimelinePhase): string { + return phase.id; + } + private get sortedElements(): TopicTimelineElement[] { return [...(this.elements ?? [])].sort((left, right) => left.year - right.year); } @@ -147,6 +211,121 @@ export class ResearchTimelineComponent implements OnChanges { this.resetYearRange(); } + private buildCompactPhases(items: TopicTimelineElement[]): ResearchTimelinePhase[] { + const phases: ResearchTimelinePhase[] = []; + let currentPhase: WorkingResearchTimelinePhase | undefined; + + for (const item of items) { + const candidates = this.getDominantPrimaryTopicCandidates(item); + + if (candidates.length === 0) { + this.pushWorkingPhase(phases, currentPhase); + currentPhase = this.createWorkingPhase(item, this.getMainTopic(item)); + continue; + } + + const matchingCandidate = currentPhase + ? candidates.find((candidate) => this.isSameTopic(candidate.name, currentPhase?.primaryTopicName)) + : undefined; + + const canExtendCurrentPhase = + Boolean(currentPhase) && + Boolean(matchingCandidate) && + item.year === currentPhase!.endYear + 1; + + if (currentPhase && canExtendCurrentPhase) { + currentPhase.endYear = item.year; + currentPhase.publication_count += item.publication_count; + currentPhase.years.push(item); + continue; + } + + this.pushWorkingPhase(phases, currentPhase); + currentPhase = this.createWorkingPhase(item, candidates[0].name); + } + + this.pushWorkingPhase(phases, currentPhase); + + return phases; + } + + private createWorkingPhase( + item: TopicTimelineElement, + primaryTopicName: string, + ): WorkingResearchTimelinePhase { + return { + startYear: item.year, + endYear: item.year, + publication_count: item.publication_count, + primaryTopicName, + years: [item], + }; + } + + private pushWorkingPhase( + phases: ResearchTimelinePhase[], + workingPhase: WorkingResearchTimelinePhase | undefined, + ): void { + if (!workingPhase) { + return; + } + + phases.push({ + ...workingPhase, + id: `${workingPhase.startYear}-${workingPhase.endYear}-${this.normalizeTopicName( + workingPhase.primaryTopicName, + )}`, + topics: this.aggregatePhaseTopics(workingPhase.years, workingPhase.primaryTopicName), + }); + } + + private aggregatePhaseTopics( + years: TopicTimelineElement[], + primaryTopicName: string, + ): TopicTimelineTopic[] { + const counts = new Map(); + const originalNames = new Map(); + + for (const year of years) { + for (const topic of year.topics ?? []) { + if (this.isSameTopic(topic.name, primaryTopicName)) { + continue; + } + + const normalizedName = this.normalizeTopicName(topic.name); + + originalNames.set(normalizedName, topic.name); + counts.set(normalizedName, (counts.get(normalizedName) ?? 0) + topic.count); + } + } + + return Array.from(counts.entries()) + .map(([normalizedName, count]) => ({ + name: originalNames.get(normalizedName) ?? normalizedName, + count, + })) + .sort((left, right) => { + if (right.count !== left.count) { + return right.count - left.count; + } + + return left.name.localeCompare(right.name); + }) + .slice(0, this.displayedPhaseTopicLimit); + } + + private getDominantPrimaryTopicCandidates(item: TopicTimelineElement): TopicTimelineTopic[] { + const primaryTopics = item.primary_topics ?? []; + + if (primaryTopics.length === 0) { + return []; + } + + const maxCount = Math.max(...primaryTopics.map((topic) => topic.count)); + + return primaryTopics.filter((topic) => topic.count === maxCount); + } + private getFirstTopic(item: TopicTimelineElement): TopicTimelineTopic | undefined { return (item.topics ?? [])[0]; } From b27e960e0aeac6dcaf252d2b7980717f29e947bd Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 2 Jun 2026 11:08:01 +0200 Subject: [PATCH 13/19] elastic client updated --- .../main/inse/integrations/elasticsearch.py | 32 ++++++++++- service/src/main/inse/logic.py | 56 ++++++++++--------- 2 files changed, 59 insertions(+), 29 deletions(-) diff --git a/service/src/main/inse/integrations/elasticsearch.py b/service/src/main/inse/integrations/elasticsearch.py index e3ad986f..00656fb9 100644 --- a/service/src/main/inse/integrations/elasticsearch.py +++ b/service/src/main/inse/integrations/elasticsearch.py @@ -5,15 +5,15 @@ from .. import config def search( index: str, - query_field: str, - query_value: str + query_field: str = None, + query_value: str = None, + body: dict = None, ) -> dict[str, Any]: headers = { "Authorization": f"ApiKey {config.settings.elasticsearch_api_key}", "Content-Type": "application/json" } - payload = { "query": { "query_string": { @@ -22,6 +22,8 @@ def search( } } } + if body != None: + payload = body with httpx.Client() as client: response = client.post( @@ -31,3 +33,27 @@ def search( ) response.raise_for_status() return response.json() +def get( + index: str, + doc_id:str, + body: dict = None, + +) -> dict[str, Any]: + + headers = { + "Authorization": f"ApiKey {config.settings.elasticsearch_api_key}", + "Content-Type": "application/json" + } + payload = body + + # get document directly + with httpx.Client() as client: + response = client.get( + f"{config.settings.elasticsearch_url}/{index}/_doc/{doc_id}", + json=payload, + headers=headers + ) + response.raise_for_status() + return response.json() + + diff --git a/service/src/main/inse/logic.py b/service/src/main/inse/logic.py index 69cfe1ef..5bd6d268 100644 --- a/service/src/main/inse/logic.py +++ b/service/src/main/inse/logic.py @@ -40,10 +40,6 @@ from inse.models.topic_domain import TopicDomain logger = logging.getLogger(__name__) topic_cache_filename: str = "topic_hierarchy_cache.json" -es_client = Elasticsearch( - hosts=[config.settings.elasticsearch_url], - api_key=config.settings.elasticsearch_api_key, -) S = TypeVar('S', bound=schema.Base) M = TypeVar('M', bound=model.BaseModel) @@ -309,13 +305,15 @@ def generate_person_bio(author_id: str, include: Optional[set[str]] = None) -> s def get_person_by_id(author_id: str, include: Optional[str] = None) -> AuthorsListResponse: + body = { + "_source":include.split(",") if include else True, + } try: - hit = es_client.get( + hit = elasticsearch.get( index="openalex-authors", - id=author_id, - source=include.split(",") if include else True, + body=body, + doc_id=author_id ) - except NotFoundError: raise HTTPException( status_code=404, @@ -357,24 +355,27 @@ def search_persons_by_name(author_name: str, limit: Optional[int] = 10, include: } } }, - { - "match": { - "display_name": { - "query": author_name, - "fuzziness": 1 - } - } - } + # { + # "match": { + # "display_name": { + # "query": author_name, + # "fuzziness": 1 + # } + # } + # } ], "minimum_should_match": 1 } } + body = { + "size":limit, + "query":search_query, + "_source":include.split(",") if include else True, + } try: - response = es_client.search( + response = elasticsearch.search( index="openalex-authors", - query=search_query, - source=include.split(",") if include else True, - size=limit + body=body ) except Exception as e: @@ -411,14 +412,17 @@ def search_persons_by_institution( } } } - print (include,institution_name) + body = { + "size":limit, + "query":search_query, + "_source":include.split(",") if include else True, + "sort":[{"works_count": {"order": "desc"}}] + } + print(body) try: - response = es_client.search( + response = elasticsearch.search( index="openalex-authors", - source=include.split(",") if include else True, - query=search_query, - size=limit, - sort=[{"works_count": {"order": "desc"}}] + body=body ) except Exception as e: From c409c1860d42db534b5f3cf4338983d1b2174364 Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Thu, 4 Jun 2026 09:33:31 +0200 Subject: [PATCH 14/19] fix unsolved merge conflicts --- service/src/main/inse/logic.py | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/service/src/main/inse/logic.py b/service/src/main/inse/logic.py index ce13ef88..5906facb 100644 --- a/service/src/main/inse/logic.py +++ b/service/src/main/inse/logic.py @@ -345,17 +345,11 @@ def generate_person_bio(author_id: str, include: Optional[set[str]] = None) -> s return bio - -<<<<<<< HEAD def get_person_by_id(author_id: str, include: Optional[str] = None) -> AuthorsListResponse: body = { "_source":include.split(",") if include else True, } -======= -def get_person_by_id( - author_id: str, include: Optional[str] = None -) -> AuthorsListResponse: ->>>>>>> dev + try: hit = elasticsearch.get( index="openalex-authors", @@ -389,7 +383,6 @@ def search_persons_by_name( "display_name": {"query": author_name, "boost": 3} } }, -<<<<<<< HEAD # { # "match": { # "display_name": { @@ -398,9 +391,6 @@ def search_persons_by_name( # } # } # } -======= - {"match": {"display_name": {"query": author_name, "fuzziness": 1}}}, ->>>>>>> dev ], "minimum_should_match": 1, } @@ -413,13 +403,10 @@ def search_persons_by_name( try: response = elasticsearch.search( index="openalex-authors", -<<<<<<< HEAD body=body -======= query=search_query, source=include.split(",") if include else True, size=limit, ->>>>>>> dev ) except Exception as e: @@ -451,28 +438,21 @@ def search_persons_by_institution( }, } } -<<<<<<< HEAD body = { "size":limit, "query":search_query, "_source":include.split(",") if include else True, "sort":[{"works_count": {"order": "desc"}}] } - print(body) -======= - print(include, institution_name) ->>>>>>> dev + try: response = elasticsearch.search( index="openalex-authors", -<<<<<<< HEAD body=body -======= source=include.split(",") if include else True, query=search_query, size=limit, sort=[{"works_count": {"order": "desc"}}], ->>>>>>> dev ) except Exception as e: From 547a82336e89d45bba5912f658262a09b690a1e1 Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Thu, 4 Jun 2026 09:37:18 +0200 Subject: [PATCH 15/19] fix: add missing comma in elasticsearch search body parameter --- service/src/main/inse/logic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/main/inse/logic.py b/service/src/main/inse/logic.py index 5906facb..dda0e94f 100644 --- a/service/src/main/inse/logic.py +++ b/service/src/main/inse/logic.py @@ -403,7 +403,7 @@ def search_persons_by_name( try: response = elasticsearch.search( index="openalex-authors", - body=body + body=body, query=search_query, source=include.split(",") if include else True, size=limit, @@ -448,7 +448,7 @@ def search_persons_by_institution( try: response = elasticsearch.search( index="openalex-authors", - body=body + body=body, source=include.split(",") if include else True, query=search_query, size=limit, From e0015c3ea91e749871acf74a2a3c10df992d3181 Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Thu, 4 Jun 2026 09:55:54 +0200 Subject: [PATCH 16/19] fix(backend/person_search): search failing due to unsupported search parameters --- .../main/inse/integrations/elasticsearch.py | 30 ++++++++++++++----- service/src/main/inse/logic.py | 16 +--------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/service/src/main/inse/integrations/elasticsearch.py b/service/src/main/inse/integrations/elasticsearch.py index 00656fb9..3d744ad9 100644 --- a/service/src/main/inse/integrations/elasticsearch.py +++ b/service/src/main/inse/integrations/elasticsearch.py @@ -7,6 +7,10 @@ def search( index: str, query_field: str = None, query_value: str = None, + query: dict = None, + source = None, + size: int = None, + sort: list = None, body: dict = None, ) -> dict[str, Any]: @@ -14,16 +18,26 @@ def search( "Authorization": f"ApiKey {config.settings.elasticsearch_api_key}", "Content-Type": "application/json" } - payload = { - "query": { - "query_string": { - "default_field": query_field, - "query": query_value + + if body is not None: + payload = body + elif query is not None: + payload = {"query": query} + if source is not None: + payload["_source"] = source + if size is not None: + payload["size"] = size + if sort is not None: + payload["sort"] = sort + else: + payload = { + "query": { + "query_string": { + "default_field": query_field, + "query": query_value + } } } - } - if body != None: - payload = body with httpx.Client() as client: response = client.post( diff --git a/service/src/main/inse/logic.py b/service/src/main/inse/logic.py index dda0e94f..688c81d9 100644 --- a/service/src/main/inse/logic.py +++ b/service/src/main/inse/logic.py @@ -395,15 +395,9 @@ def search_persons_by_name( "minimum_should_match": 1, } } - body = { - "size":limit, - "query":search_query, - "_source":include.split(",") if include else True, - } try: response = elasticsearch.search( index="openalex-authors", - body=body, query=search_query, source=include.split(",") if include else True, size=limit, @@ -438,19 +432,11 @@ def search_persons_by_institution( }, } } - body = { - "size":limit, - "query":search_query, - "_source":include.split(",") if include else True, - "sort":[{"works_count": {"order": "desc"}}] - } - try: response = elasticsearch.search( index="openalex-authors", - body=body, - source=include.split(",") if include else True, query=search_query, + source=include.split(",") if include else True, size=limit, sort=[{"works_count": {"order": "desc"}}], ) From d37140866b98b19a900eae1ac687e754806b9dec Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Thu, 4 Jun 2026 13:57:30 +0200 Subject: [PATCH 17/19] fix(frontend/person): replace wrong orcid link prefix in profile component --- webapp/src/app/modules/person/person.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webapp/src/app/modules/person/person.component.ts b/webapp/src/app/modules/person/person.component.ts index 283cfcce..317a5782 100644 --- a/webapp/src/app/modules/person/person.component.ts +++ b/webapp/src/app/modules/person/person.component.ts @@ -101,7 +101,13 @@ readonly personBio = toSignal( ); readonly worksCount = computed(() => this.person()?.works_count ?? null); readonly citedByCount = computed(() => this.person()?.cited_by_count ?? null); - readonly orcid = computed(() => this.getId('orcid')); + readonly orcid = computed(() => { + const rawOrcid = this.getId('orcid'); + if (!rawOrcid) { + return null; + } + return rawOrcid.replace('https://orcid.org/', ''); + }); readonly orcidUrl = computed(() => this.orcid() ? `https://orcid.org/${this.orcid()}` : null, ); From 97db19f0424ab82ea12f31c19ec765b4815937f6 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Thu, 4 Jun 2026 15:42:36 +0200 Subject: [PATCH 18/19] load research timeline via generated works API --- webapp/src/app/api/.openapi-generator/FILES | 3 + webapp/src/app/api/api/works.service.ts | 66 +++++++++++++++++++ webapp/src/app/api/model/models.ts | 3 + webapp/src/app/api/model/topicCount.ts | 22 +++++++ webapp/src/app/api/model/topicsByTime.ts | 23 +++++++ webapp/src/app/api/model/topicsByYear.ts | 31 +++++++++ .../person-overview.component.ts | 37 +++++++---- webapp/src/proxy.conf.json | 5 ++ 8 files changed, 178 insertions(+), 12 deletions(-) create mode 100644 webapp/src/app/api/model/topicCount.ts create mode 100644 webapp/src/app/api/model/topicsByTime.ts create mode 100644 webapp/src/app/api/model/topicsByYear.ts diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 0fa5c409..0da98db0 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -53,6 +53,9 @@ model/models.ts model/openAccess.ts model/personBio.ts model/score.ts +model/topicCount.ts +model/topicsByTime.ts +model/topicsByYear.ts model/validationError.ts model/validationErrorLocInner.ts model/value.ts diff --git a/webapp/src/app/api/api/works.service.ts b/webapp/src/app/api/api/works.service.ts index 56e33449..6b6dd9fa 100644 --- a/webapp/src/app/api/api/works.service.ts +++ b/webapp/src/app/api/api/works.service.ts @@ -19,6 +19,8 @@ import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore +import { TopicsByTime } from '../model/topicsByTime'; +// @ts-ignore import { WorkPage } from '../model/workPage'; // @ts-ignore import { WorksListResponse } from '../model/worksListResponse'; @@ -185,4 +187,68 @@ export class WorksService extends BaseService { ); } + /** + * Returns topics grouped by publication year for an author. + * @endpoint get /api/works/{author_id}/topics-by-time + * @param authorId The author id, for example A5023888391. + * @param maxTopicsPerYear The maximum number of topics per year. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + maxTopicsPerYear, 'max_topics_per_year'); + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/topics-by-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + } diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index 7a7099b5..859f206d 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -35,6 +35,9 @@ export * from './model2YrMeanCitedness'; export * from './openAccess'; export * from './personBio'; export * from './score'; +export * from './topicCount'; +export * from './topicsByTime'; +export * from './topicsByYear'; export * from './validationError'; export * from './validationErrorLocInner'; export * from './value'; diff --git a/webapp/src/app/api/model/topicCount.ts b/webapp/src/app/api/model/topicCount.ts new file mode 100644 index 00000000..d6c3c481 --- /dev/null +++ b/webapp/src/app/api/model/topicCount.ts @@ -0,0 +1,22 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface TopicCount { + /** + * The topic display name. + */ + name: string; + /** + * The number of occurrences. + */ + count?: number; +} + diff --git a/webapp/src/app/api/model/topicsByTime.ts b/webapp/src/app/api/model/topicsByTime.ts new file mode 100644 index 00000000..0dac04a7 --- /dev/null +++ b/webapp/src/app/api/model/topicsByTime.ts @@ -0,0 +1,23 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { TopicsByYear } from './topicsByYear'; + + +export interface TopicsByTime { + /** + * Topics grouped by year. + */ + elements?: Array; + /** + * The number of years. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/topicsByYear.ts b/webapp/src/app/api/model/topicsByYear.ts new file mode 100644 index 00000000..fded8da0 --- /dev/null +++ b/webapp/src/app/api/model/topicsByYear.ts @@ -0,0 +1,31 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { TopicCount } from './topicCount'; + + +export interface TopicsByYear { + /** + * The publication year. + */ + year: number; + /** + * The number of works in this year. + */ + publication_count?: number; + /** + * The topics in this year. + */ + topics?: Array; + /** + * The primary topics in this year. + */ + primary_topics?: Array; +} + 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 5edfefd6..ef984db6 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.ts +++ b/webapp/src/app/modules/person-overview/person-overview.component.ts @@ -1,20 +1,16 @@ import { CommonModule } from '@angular/common'; -import { HttpClient } from '@angular/common/http'; import { Component, DestroyRef, OnInit, inject } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { ActivatedRoute, ParamMap } from '@angular/router'; import { combineLatest, distinctUntilChanged, map } from 'rxjs'; +import { TopicCount, TopicsByYear, WorksService } from '../../api'; import { ResearchTimelineComponent, TopicTimelineElement, + TopicTimelineTopic, } from './components/research-timeline/research-timeline.component'; -interface TopicTimelineResponse { - elements: TopicTimelineElement[]; - total: number; -} - @Component({ selector: 'app-person-overview', standalone: true, @@ -24,7 +20,7 @@ interface TopicTimelineResponse { }) export class PersonOverviewComponent implements OnInit { private readonly route = inject(ActivatedRoute); - private readonly http = inject(HttpClient); + private readonly worksService = inject(WorksService); private readonly destroyRef = inject(DestroyRef); topicTimelineElements: TopicTimelineElement[] = []; @@ -63,14 +59,13 @@ export class PersonOverviewComponent implements OnInit { this.timelineLoadFailed = false; const topicCountLimit = 4; - const url = `/inse-service/authors/${encodeURIComponent(authorId)}/topics-by-time?max_topics_per_year=${topicCountLimit}`; - this.http - .get(url) + this.worksService + .getTopicsByTimeByAuthor(authorId, topicCountLimit) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe({ next: (response) => { - this.topicTimelineElements = response.elements ?? []; + this.topicTimelineElements = this.mapTimelineElements(response.elements); this.loadingTimeline = false; this.timelineLoadFailed = false; }, @@ -82,4 +77,22 @@ export class PersonOverviewComponent implements OnInit { }, }); } -} \ No newline at end of file + + private mapTimelineElements( + elements: TopicsByYear[] | undefined, + ): TopicTimelineElement[] { + return (elements ?? []).map((element) => ({ + year: element.year, + publication_count: element.publication_count ?? 0, + topics: this.mapTopicCounts(element.topics), + primary_topics: this.mapTopicCounts(element.primary_topics), + })); + } + + private mapTopicCounts(topics: TopicCount[] | undefined): TopicTimelineTopic[] { + return (topics ?? []).map((topic) => ({ + name: topic.name, + count: topic.count ?? 0, + })); + } +} diff --git a/webapp/src/proxy.conf.json b/webapp/src/proxy.conf.json index 1e0c9ebd..b6617689 100644 --- a/webapp/src/proxy.conf.json +++ b/webapp/src/proxy.conf.json @@ -4,6 +4,11 @@ "secure": false, "changeOrigin": true }, + "/api/": { + "target": "http://127.0.0.1:8000", + "secure": false, + "changeOrigin": true + }, "/inse-account/": { "target": "http://127.0.0.1:8000", "secure": false, From 8201913738354879affd1f8255c8c3df88d4549c Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Thu, 4 Jun 2026 16:44:04 +0200 Subject: [PATCH 19/19] Fix research timeline API integration --- webapp/src/proxy.conf.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/webapp/src/proxy.conf.json b/webapp/src/proxy.conf.json index b6617689..54ba9d84 100644 --- a/webapp/src/proxy.conf.json +++ b/webapp/src/proxy.conf.json @@ -4,14 +4,9 @@ "secure": false, "changeOrigin": true }, - "/api/": { - "target": "http://127.0.0.1:8000", - "secure": false, - "changeOrigin": true - }, "/inse-account/": { "target": "http://127.0.0.1:8000", "secure": false, "changeOrigin": true } -} +} \ No newline at end of file