From a278ad300f34d0f3a44da2393ae8428061b2378a Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Thu, 23 Jul 2026 09:47:14 +0200 Subject: [PATCH 01/15] add field, subfield, and topic nodes for topic treemap (backend) --- service/src/main/inse/ranking/logic.py | 48 ++++++++++++++++++++++++++ service/src/main/inse/ranking/model.py | 28 +++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/service/src/main/inse/ranking/logic.py b/service/src/main/inse/ranking/logic.py index faa023bf..5ac80c00 100644 --- a/service/src/main/inse/ranking/logic.py +++ b/service/src/main/inse/ranking/logic.py @@ -28,6 +28,9 @@ from .model import ( RankingWeights, SubfieldShare, Timespan, + FieldNode, + SubfieldNode, + TopicNode, ) logger = logging.getLogger(__name__) @@ -493,6 +496,29 @@ def _topic_profile_query( "size": 10, }, }, + # topic treemap + "by_field": { + "terms": { + "field": "primary_topic.field.display_name.keyword", + "size": 30, + }, + "aggs": { + "by_subfield": { + "terms": { + "field": "primary_topic.subfield.display_name.keyword", + "size": 30, + }, + "aggs": { + "by_topic": { + "terms": { + "field": "primary_topic.display_name.keyword", + "size": 30, + }, + }, + }, + }, + }, + }, "distinct_topics": { "cardinality": {"field": "primary_topic.id"}, }, @@ -555,6 +581,27 @@ async def topic_profile_for_authors( ) for bucket in to_work.get("by_subfield", {}).get("buckets", []) ] + field_tree = [ + FieldNode( + name=field_bucket.get("key", ""), + count=field_bucket.get("doc_count", 0), + subfields=[ + SubfieldNode( + name=subfield_bucket.get("key", ""), + count=subfield_bucket.get("doc_count", 0), + topics=[ + TopicNode( + name=topic_bucket.get("key", ""), + count=topic_bucket.get("doc_count", 0), + ) + for topic_bucket in subfield_bucket.get("by_topic", {}).get("buckets", []) + ], + ) + for subfield_bucket in field_bucket.get("by_subfield", {}).get("buckets", []) + ], + ) + for field_bucket in to_work.get("by_field", {}).get("buckets", []) + ] results.append( AuthorTopicProfile( author_id=author_bucket.get("key", ""), @@ -566,6 +613,7 @@ async def topic_profile_for_authors( distinct_subfields=to_work.get("distinct_subfields", {}).get("value", 0), distinct_fields=to_work.get("distinct_fields", {}).get("value", 0), subfields=subfields, + field_tree=field_tree, ) ) diff --git a/service/src/main/inse/ranking/model.py b/service/src/main/inse/ranking/model.py index 1321102f..ff8e6b1d 100644 --- a/service/src/main/inse/ranking/model.py +++ b/service/src/main/inse/ranking/model.py @@ -288,6 +288,29 @@ class SubfieldShare(BaseModel): count: int = Field(description="Number of works whose primary topic belongs to this subfield.") +class TopicNode(BaseModel): + name: str = Field(description="The primary-topic display name.") + count: int = Field(description="Number of works whose primary topic is this topic.") + + +class SubfieldNode(BaseModel): + name: str = Field(description="The subfield display name.") + count: int = Field(description="Number of works whose primary topic belongs to this subfield.") + topics: List[TopicNode] = Field( + default_factory=list, + description="Primary topics within this subfield, largest first.", + ) + + +class FieldNode(BaseModel): + name: str = Field(description="The field display name.") + count: int = Field(description="Number of works whose primary topic belongs to this field.") + subfields: List[SubfieldNode] = Field( + default_factory=list, + description="Subfields within this field, largest first.", + ) + + class AuthorTopicProfile(BaseModel): author_id: str = Field(description="The OpenAlex ID of the author.") display_name: str = Field(description="The name of the author.") @@ -314,6 +337,11 @@ class AuthorTopicProfile(BaseModel): default_factory=list, description="Top subfields over all works, by primary topic, largest first.", ) + field_tree: List[FieldNode] = Field( + default_factory=list, + description="Field -> subfield -> topic hierarchy over all works, by primary " + "topic, each level largest first. Drives the interactive topic treemap.", + ) class AuthorStaticStats(BaseModel): -- 2.56.1 From 2bdee211694ddffacdb1d048ff4759630b7efeed Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Thu, 23 Jul 2026 13:41:10 +0200 Subject: [PATCH 02/15] remove devcontainer from git --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 50b40718..fb1f98b9 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,6 @@ angular-app/.angular # Ignore sentence-transformer local model cache service/sentence_transformer/models/ -llm_evaluations/bio_generation/.venv \ No newline at end of file +llm_evaluations/bio_generation/.venv + +.devcontainer -- 2.56.1 From eb84d3014fc78505cd652e59df71c3e12f0b4ba8 Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Thu, 23 Jul 2026 13:56:21 +0200 Subject: [PATCH 03/15] update topic profile query and enhance data models with IDs --- service/src/main/inse/ranking/logic.py | 43 +++++++++++++++++++--- service/src/main/inse/ranking/model.py | 3 ++ service/src/main/inse/ranking/ranking.http | 10 +++++ 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/service/src/main/inse/ranking/logic.py b/service/src/main/inse/ranking/logic.py index 5ac80c00..c4997cb8 100644 --- a/service/src/main/inse/ranking/logic.py +++ b/service/src/main/inse/ranking/logic.py @@ -499,21 +499,41 @@ def _topic_profile_query( # topic treemap "by_field": { "terms": { - "field": "primary_topic.field.display_name.keyword", + "field": "primary_topic.field.id", "size": 30, }, "aggs": { + "field_name": { + "terms": { + "field": "primary_topic.field.display_name.keyword", + "size": 1, + }, + }, "by_subfield": { "terms": { - "field": "primary_topic.subfield.display_name.keyword", + "field": "primary_topic.subfield.id", "size": 30, }, "aggs": { + "subfield_name": { + "terms": { + "field": "primary_topic.subfield.display_name.keyword", + "size": 1, + }, + }, "by_topic": { "terms": { - "field": "primary_topic.display_name.keyword", + "field": "primary_topic.id", "size": 30, }, + "aggs": { + "topic_name": { + "terms": { + "field": "primary_topic.display_name.keyword", + "size": 1, + }, + }, + }, }, }, }, @@ -583,15 +603,18 @@ async def topic_profile_for_authors( ] field_tree = [ FieldNode( - name=field_bucket.get("key", ""), + id=field_bucket.get("key", ""), + name=_bucket_name(field_bucket, "field_name", field_bucket.get("key", "")), count=field_bucket.get("doc_count", 0), subfields=[ SubfieldNode( - name=subfield_bucket.get("key", ""), + id=subfield_bucket.get("key", ""), + name=_bucket_name(subfield_bucket, "subfield_name", subfield_bucket.get("key", "")), count=subfield_bucket.get("doc_count", 0), topics=[ TopicNode( - name=topic_bucket.get("key", ""), + id=topic_bucket.get("key", ""), + name=_bucket_name(topic_bucket, "topic_name", topic_bucket.get("key", "")), count=topic_bucket.get("doc_count", 0), ) for topic_bucket in subfield_bucket.get("by_topic", {}).get("buckets", []) @@ -779,6 +802,14 @@ def _display_name_from_bucket(author_bucket: dict) -> str: return "" +def _bucket_name(bucket: dict, name_agg_key: str, fallback: str) -> str: + """Reads a display name out of a bucket's name sub-aggregation, falling back to its id.""" + name_buckets = bucket.get(name_agg_key, {}).get("buckets", []) + if name_buckets and name_buckets[0].get("key"): + return str(name_buckets[0]["key"]) + return fallback + + def _citations_from_bucket(author_bucket: dict) -> int: """Reads the summed citations out of the reverse_nested sub-aggregation.""" citations_value = ( diff --git a/service/src/main/inse/ranking/model.py b/service/src/main/inse/ranking/model.py index ff8e6b1d..8fce11ef 100644 --- a/service/src/main/inse/ranking/model.py +++ b/service/src/main/inse/ranking/model.py @@ -289,11 +289,13 @@ class SubfieldShare(BaseModel): class TopicNode(BaseModel): + id: str = Field(description="The OpenAlex ID of the primary topic.") name: str = Field(description="The primary-topic display name.") count: int = Field(description="Number of works whose primary topic is this topic.") class SubfieldNode(BaseModel): + id: str = Field(description="The OpenAlex ID of the subfield.") name: str = Field(description="The subfield display name.") count: int = Field(description="Number of works whose primary topic belongs to this subfield.") topics: List[TopicNode] = Field( @@ -303,6 +305,7 @@ class SubfieldNode(BaseModel): class FieldNode(BaseModel): + id: str = Field(description="The OpenAlex ID of the field.") name: str = Field(description="The field display name.") count: int = Field(description="Number of works whose primary topic belongs to this field.") subfields: List[SubfieldNode] = Field( diff --git a/service/src/main/inse/ranking/ranking.http b/service/src/main/inse/ranking/ranking.http index 6fd0c062..d7e49ec3 100644 --- a/service/src/main/inse/ranking/ranking.http +++ b/service/src/main/inse/ranking/ranking.http @@ -116,6 +116,16 @@ Content-Type: application/json "timespan": { "from": 2018, "to": 2025 } } +### +POST http://localhost:8000/api/rank/topic-profile +Content-Type: application/json + +{ + "author_ids": ["https://openalex.org/A504035360", "https://openalex.org/A5019137844"], + "keywords": ["Augmented Reality Applications"], + "operator": "or" +} + ### GET https://project.nes.uni-due.de/elastic/_aliases Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== -- 2.56.1 From 97b7fe6a6fd0e06c4dd849ec11a5fa58136a6899 Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Thu, 23 Jul 2026 14:03:21 +0200 Subject: [PATCH 04/15] add topic treemap component and integrate into author comparison view --- .../src/app/api/model/authorTopicProfile.ts | 67 +++++++ .../compare-authors.component.html | 32 ++++ .../compare-authors.component.scss | 36 ++++ .../compare-authors.component.ts | 62 +++++- .../topic-treemap.component.html | 11 ++ .../topic-treemap.component.scss | 11 ++ .../topic-treemap/topic-treemap.component.ts | 177 ++++++++++++++++++ 7 files changed, 395 insertions(+), 1 deletion(-) create mode 100644 webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.html create mode 100644 webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.scss create mode 100644 webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.ts diff --git a/webapp/src/app/api/model/authorTopicProfile.ts b/webapp/src/app/api/model/authorTopicProfile.ts index 00d5593a..79dd0621 100644 --- a/webapp/src/app/api/model/authorTopicProfile.ts +++ b/webapp/src/app/api/model/authorTopicProfile.ts @@ -22,6 +22,68 @@ export interface SubfieldShare { count: number; } +/** + * A primary topic within a subfield. + */ +export interface TopicNode { + /** + * The OpenAlex ID of the primary topic. + */ + id: string; + /** + * The primary-topic display name. + */ + name: string; + /** + * Number of works whose primary topic is this topic. + */ + count: number; +} + +/** + * A subfield within a field, with its primary topics. + */ +export interface SubfieldNode { + /** + * The OpenAlex ID of the subfield. + */ + id: string; + /** + * The subfield display name. + */ + name: string; + /** + * Number of works whose primary topic belongs to this subfield. + */ + count: number; + /** + * Primary topics within this subfield, largest first. + */ + topics: Array; +} + +/** + * A field with its subfields, top of the primary-topic hierarchy. + */ +export interface FieldNode { + /** + * The OpenAlex ID of the field. + */ + id: string; + /** + * The field display name. + */ + name: string; + /** + * Number of works whose primary topic belongs to this field. + */ + count: number; + /** + * Subfields within this field, largest first. + */ + subfields: Array; +} + /** * Section 3: how an author\'s complete body of work distributes over topics. All counts are based on each work\'s primary topic. */ @@ -62,4 +124,9 @@ export interface AuthorTopicProfile { * Top subfields over all works, by primary topic, largest first. */ subfields: Array; + /** + * Field -> subfield -> topic hierarchy over all works, by primary topic, + * each level largest first. Drives the interactive topic treemap. + */ + field_tree: Array; } diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.html b/webapp/src/app/modules/compare-authors/compare-authors.component.html index eac43fd0..6dad5c9d 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.html +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.html @@ -93,6 +93,38 @@
+ +

Themenlandschaft

+

Field → Subfield → Thema

+
+ @for ( + author of orderedProfiles(); + track author.author_id; + let i = $index + ) { + + } +
+ } @else {

Keine Daten für das Themenprofil.

} diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.scss b/webapp/src/app/modules/compare-authors/compare-authors.component.scss index f05c3335..6e1ac55d 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.scss +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.scss @@ -262,6 +262,42 @@ height: 320px; } +.treemap-author-tabs { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin: 4px 0 10px; +} + +.treemap-author-tab { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 5px 12px; + border: 1px solid var(--sg-border, #d7deee); + border-radius: 999px; + background: var(--sg-surface, #fff); + color: var(--sg-text-muted, #64708f); + font-size: 12px; + font-weight: 600; + cursor: pointer; + transition: + background 0.15s ease, + border-color 0.15s ease, + color 0.15s ease; + + &:hover { + border-color: var(--sg-primary, #2563eb); + color: var(--sg-text, #101a3d); + } + + &.active { + border-color: var(--sg-primary, #2563eb); + background: color-mix(in srgb, var(--sg-primary, #2563eb) 10%, #fff); + color: var(--sg-text, #101a3d); + } +} + .chart-grid { display: grid; grid-template-columns: 1fr 1fr; diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.ts b/webapp/src/app/modules/compare-authors/compare-authors.component.ts index 299c1f47..24729c8b 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.ts +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.ts @@ -12,6 +12,11 @@ import { RankingService, } from '../../api'; +import { + TopicTreemapComponent, + TreemapNode, +} from '../../shared/ui/topic-treemap/topic-treemap.component'; + const AUTHOR_COLORS = ['#1565c0', '#e6550d', '#2ca02c', '#9467bd']; const SUBFIELD_COLORS = [ '#2563eb', @@ -108,7 +113,13 @@ interface SegmentDef { @Component({ selector: 'app-compare-authors', standalone: true, - imports: [DecimalPipe, NgTemplateOutlet, MatIconModule, NgxEchartsDirective], + imports: [ + DecimalPipe, + NgTemplateOutlet, + MatIconModule, + NgxEchartsDirective, + TopicTreemapComponent, + ], templateUrl: './compare-authors.component.html', styleUrl: './compare-authors.component.scss', }) @@ -569,6 +580,55 @@ export class CompareAuthorsComponent implements OnInit { } as EChartsOption; }); + readonly selectedTreemapAuthor = signal(0); + + readonly treemapProfile = computed(() => { + const profiles = this.orderedProfiles(); + if (profiles.length === 0) return null; + const index = Math.min(this.selectedTreemapAuthor(), profiles.length - 1); + return profiles[index]; + }); + + selectTreemapAuthor(index: number): void { + this.selectedTreemapAuthor.set(index); + } + + authorColor(authorId: string): string { + return ( + this.summary().find((a) => a.authorId === authorId)?.color ?? OTHER_COLOR + ); + } + + readonly treemapNodes = computed(() => { + const profile = this.treemapProfile(); + if (!profile) return []; + + return profile.field_tree.map((field) => ({ + id: field.id, + name: field.name, + value: field.count, + children: field.subfields.map((subfield) => ({ + id: subfield.id, + name: subfield.name, + value: subfield.count, + children: subfield.topics.map((topic) => ({ + id: topic.id, + name: topic.name, + value: topic.count, + })), + })), + })); + }); + + readonly treemapTooltip = (params: any): string => { + const path = (params.treePathInfo ?? []) + .slice(1) + .map((p: any) => p.name) + .join(' › '); + const count = Number(params.value ?? 0).toLocaleString('de-DE'); + return `${path || params.name}
${count} Werke`; + }; + // turns row definitions into table rows, marking the best value per row private buildRows(defs: RowDef[]): MetricRow[] { const authors = this.summary(); diff --git a/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.html b/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.html new file mode 100644 index 00000000..7d06aaac --- /dev/null +++ b/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.html @@ -0,0 +1,11 @@ +@if (nodes.length) { +
+} @else { +

+ {{ loading ? loadingText : emptyText }} +

+} diff --git a/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.scss b/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.scss new file mode 100644 index 00000000..90374d18 --- /dev/null +++ b/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.scss @@ -0,0 +1,11 @@ +.topic-treemap-chart { + width: 100%; +} + +.topic-treemap-empty { + display: grid; + min-height: 260px; + margin: 0; + place-items: center; + color: #64748b; +} diff --git a/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.ts b/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.ts new file mode 100644 index 00000000..c9fcc7a7 --- /dev/null +++ b/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.ts @@ -0,0 +1,177 @@ +import { Component, Input, OnChanges } from '@angular/core'; +import { EChartsOption } from 'echarts'; +import { NgxEchartsDirective } from 'ngx-echarts'; + +/** One node of the treemap hierarchy. `children` nests the next level. */ +export interface TreemapNode { + name: string; + value: number; + /** Optional stable id used when colouring by id. */ + id?: string; + children?: TreemapNode[]; + /** Extra payload made available to a custom tooltip formatter. */ + [key: string]: unknown; +} + +const DEFAULT_COLORS = [ + '#2563eb', + '#059669', + '#d97706', + '#dc2626', + '#7c3aed', + '#0284c7', + '#ea580c', + '#4f46e5', + '#0f766e', + '#be123c', +]; + +@Component({ + selector: 'app-topic-treemap', + imports: [NgxEchartsDirective], + templateUrl: './topic-treemap.component.html', + styleUrl: './topic-treemap.component.scss', +}) +export class TopicTreemapComponent implements OnChanges { + @Input() nodes: TreemapNode[] = []; + @Input() loading = false; + @Input() seriesName = ''; + @Input() emptyText = 'Keine Daten vorhanden.'; + @Input() loadingText = 'Wird geladen ...'; + /** CSS height of the chart area. */ + @Input() height = '560px'; + /** Colour buckets by node id or by node name. */ + @Input() colorMappingBy: 'id' | 'name' = 'name'; + /** Override the default tooltip; receives the raw ECharts params. */ + @Input() tooltipFormatter?: (params: any) => string; + + options: EChartsOption = {}; + private readonly colors = DEFAULT_COLORS; + + ngOnChanges(): void { + this.options = this.buildOptions(); + } + + private buildOptions(): EChartsOption { + const options = { + tooltip: { + formatter: this.tooltipFormatter ?? this.defaultTooltip(), + }, + series: [ + { + name: this.seriesName, + type: 'treemap', + data: this.nodes, + roam: false, + nodeClick: 'zoomToNode', + sort: 'desc', + drillDownIcon: '', + leafDepth: 1, + color: this.colors, + colorMappingBy: this.colorMappingBy, + breadcrumb: { + show: true, + bottom: 0, + height: 24, + left: 8, + right: 8, + emptyItemWidth: 80, + itemStyle: { + color: '#f8fafc', + borderColor: '#cbd5e1', + borderWidth: 1, + textStyle: { color: '#334155', fontWeight: 600 }, + }, + emphasis: { + itemStyle: { + color: '#e0f2fe', + borderColor: '#93c5fd', + textStyle: { color: '#0f172a', fontWeight: 700 }, + }, + }, + }, + label: { + show: true, + formatter: (params: any) => + `${params.name}\n${this.formatCount(params.value)}`, + color: '#ffffff', + fontWeight: 600, + lineHeight: 18, + position: 'inside', + align: 'center', + verticalAlign: 'middle', + overflow: 'truncate', + }, + upperLabel: { + show: true, + formatter: (params: any) => + `${params.name} · ${this.formatCount(params.value)}`, + height: 30, + color: '#ffffff', + fontWeight: 700, + overflow: 'truncate', + }, + levels: [ + { + color: this.colors, + upperLabel: { show: false }, + itemStyle: { + borderColor: '#ffffff', + borderWidth: 3, + gapWidth: 3, + }, + }, + { + colorSaturation: [0.35, 0.7], + upperLabel: { show: false }, + itemStyle: { + borderColor: '#ffffff', + borderWidth: 2, + gapWidth: 2, + }, + }, + { + colorSaturation: [0.45, 0.78], + upperLabel: { show: false }, + itemStyle: { + borderColor: '#ffffff', + borderWidth: 2, + gapWidth: 2, + }, + }, + ], + top: 8, + right: 8, + bottom: 32, + left: 8, + animationDurationUpdate: 450, + emphasis: { focus: 'self', label: { color: '#ffffff' } }, + itemStyle: { + borderRadius: 4, + borderColor: '#ffffff', + borderWidth: 3, + gapWidth: 3, + }, + }, + ], + }; + + return options as EChartsOption; + } + + private defaultTooltip(): (params: any) => string { + return (params: any) => { + const path = (params.treePathInfo ?? []) + .slice(1) + .map((p: any) => p.name) + .join(' › '); + return `${path || params.name}
${this.formatCount( + params.value, + )}`; + }; + } + + private formatCount(value: unknown): string { + return Number(value ?? 0).toLocaleString('de-DE'); + } +} -- 2.56.1 From 2a5f10473946c67633705c81802e8d7ebddd0d1b Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Fri, 24 Jul 2026 09:22:01 +0200 Subject: [PATCH 05/15] enhance filter layout and integrate component year range slider --- .../persons-results.component.html | 84 +++++++------------ .../persons-results.component.scss | 50 ++++++----- .../persons-results.component.ts | 4 +- 3 files changed, 58 insertions(+), 80 deletions(-) diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html index ec2355cd..ae13af47 100644 --- a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html +++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html @@ -72,29 +72,22 @@ -
+
+ class="filter-field" + subscriptSizing="dynamic"> + article Art der Work -
- + + link Keyword-Verknüpfung -
-
- + + trending_up Karrierestufe -
-
- + + business Unternehmen -
-
-
- date_range - Zeitraum -
- -
-
- {{ timespanFrom() }} – {{ timespanTo() }} -
- - - - -
+
diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss index 336c8680..5737934b 100644 --- a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss +++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss @@ -122,37 +122,43 @@ } } -/* divider between filter rows — not before the first one */ -::ng-deep .filter-section .filter-row + .filter-row { - margin-top: 0.5rem; - padding-top: 0.5rem; - border-top: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.08)); -} - -::ng-deep .company-filter-row { - font-size: 0.8rem; -} - -/* ============================================================ - TIMESPAN - ============================================================ */ -::ng-deep .timespan-range-label { - justify-content: center !important; - font-weight: 500; - color: var(--sg-text-primary) !important; -} - -::ng-deep .timespan-slider { +.filter-fields { + display: flex; + flex-wrap: wrap; + gap: 0.75rem; + align-items: flex-start; width: 100%; - margin: 0; +} + +.filter-field { + flex: 1 1 220px; + min-width: 200px; + + mat-icon[matPrefix] { + margin-right: 0.4rem; + color: var(--sg-text-secondary, rgba(0, 0, 0, 0.54)); + } +} + +.filter-field-year { + flex: 1 1 100%; } ::ng-deep .pub-type-search { display: flex; align-items: center; + gap: 0.4rem; position: sticky; top: 0; z-index: 10; background: white; + padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12)); + + input { + flex: 1; + border: none; + outline: none; + padding: 0.4rem 0; + } } diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts index e0bea4d1..c1b810b2 100644 --- a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts +++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts @@ -7,7 +7,6 @@ import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatIconModule } from '@angular/material/icon'; -import { MatSliderModule } from '@angular/material/slider'; import { MatSnackBar } from '@angular/material/snack-bar'; import { FormsModule } from '@angular/forms'; import { MatSelectModule } from '@angular/material/select'; @@ -21,6 +20,7 @@ import { WeightsSlidersValue, } from '../../../../shared/ui/weights-sliders/weights-sliders.component'; import { QueryParamPaginatorComponent } from '../../../../shared/ui/query-param-paginator/query-param-paginator.component'; +import { YearRangeSliderComponent } from '../../../../shared/ui/year-range-slider/year-range-slider.component'; import { KeywordToAuthorRequest, @@ -40,13 +40,13 @@ import { SearchResultsStateService } from '../search-results-state.service'; MatCardModule, MatCheckboxModule, MatIconModule, - MatSliderModule, FormsModule, MatSelectModule, MatInputModule, MatFormFieldModule, QueryParamPaginatorComponent, WeightsSlidersComponent, + YearRangeSliderComponent, ], templateUrl: './persons-results.component.html', styleUrl: './persons-results.component.scss', -- 2.56.1 From de709732960dd5125aab718301ebb6d033184dd6 Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Fri, 24 Jul 2026 09:39:43 +0200 Subject: [PATCH 06/15] enhance metadata display and integrate chip component --- .../compare-authors.component.html | 52 +++++++++++-------- .../compare-authors.component.scss | 51 ++++++++---------- .../compare-authors.component.ts | 7 +++ 3 files changed, 61 insertions(+), 49 deletions(-) diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.html b/webapp/src/app/modules/compare-authors/compare-authors.component.html index 6dad5c9d..de385536 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.html +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.html @@ -4,31 +4,41 @@
@if (keywords().length > 0) { - - topic - {{ keywords().join(', ') }} - +
+ Betrachtete Topics: +
+ @for (keyword of keywords(); track keyword) { + + topic + {{ keyword }} + + } +
+ Verknüpfungsoperator: {{ operatorLabel() }} +
} @if (timespan(); as span) { - - date_range - {{ span.from }}–{{ span.to }} - +
+ Betrachteter Zeitraum: + + date_range + {{ span.from }}–{{ span.to }} + +
+ } + @if (hasData()) { +
+ Betrachtete Personen: +
+ @for (author of summary(); track author.authorId) { + {{ author.name }} + } +
+
}
- - @if (hasData()) { -
    - @for (author of summary(); track author.authorId) { -
  • - - {{ author.name }} -
  • - } -
- } @if (loading()) { diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.scss b/webapp/src/app/modules/compare-authors/compare-authors.component.scss index 6e1ac55d..a4deedf6 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.scss +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.scss @@ -24,45 +24,40 @@ .compare-meta { display: flex; + flex-direction: column; + gap: 8px; +} + +.meta-row { + display: flex; + align-items: center; flex-wrap: wrap; gap: 8px; } -.meta-chip { - display: inline-flex; - align-items: center; - gap: 6px; - padding: 4px 12px; - border-radius: 999px; - background: var(--sg-surface-muted, #f7f9ff); - border: 1px solid var(--sg-border, #dde5f2); - color: var(--sg-text-muted, #64708f); +.meta-label { font-size: 13px; - - mat-icon { - font-size: 16px; - width: 16px; - height: 16px; - color: var(--sg-text-soft, #8a95b3); - } + font-weight: 600; + color: var(--sg-text-muted, #64708f); } -.author-legend { - list-style: none; - margin: 0; - padding: 0; +.meta-operator { + font-size: 13px; + font-weight: 600; + color: var(--sg-text-muted, #64708f); +} + +.meta-chip-group { display: flex; flex-wrap: wrap; - gap: 8px 18px; + gap: 8px; } -.legend-item { - display: inline-flex; - align-items: center; - gap: 8px; - font-size: 14px; - font-weight: 600; - color: var(--sg-text, #101a3d); +app-chip mat-icon { + font-size: 16px; + width: 16px; + height: 16px; + vertical-align: text-bottom; } .legend-swatch { diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.ts b/webapp/src/app/modules/compare-authors/compare-authors.component.ts index 24729c8b..8600afb4 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.ts +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.ts @@ -16,6 +16,7 @@ import { TopicTreemapComponent, TreemapNode, } from '../../shared/ui/topic-treemap/topic-treemap.component'; +import { ChipComponent } from '../../shared/ui/chip/chip.component'; const AUTHOR_COLORS = ['#1565c0', '#e6550d', '#2ca02c', '#9467bd']; const SUBFIELD_COLORS = [ @@ -119,6 +120,7 @@ interface SegmentDef { MatIconModule, NgxEchartsDirective, TopicTreemapComponent, + ChipComponent, ], templateUrl: './compare-authors.component.html', styleUrl: './compare-authors.component.scss', @@ -128,6 +130,10 @@ export class CompareAuthorsComponent implements OnInit { private readonly rankingService = inject(RankingService); readonly keywords = signal([]); + readonly operator = signal<'and' | 'or'>('or'); + readonly operatorLabel = computed(() => + this.operator() === 'and' ? 'UND' : 'ODER', + ); readonly timespan = signal<{ from: number; to: number } | null>(null); // full OpenAlex ids in the requested order — the source of truth for colour + order readonly authorIds = signal([]); @@ -692,6 +698,7 @@ export class CompareAuthorsComponent implements OnInit { } const operator = rawOperator === 'and' ? 'and' : 'or'; + this.operator.set(operator); const publication_types = rawPubType ? this.parseList(rawPubType) : undefined; -- 2.56.1 From 6d5dd88e50acb8c64206a85c66043a45242d6aed Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Fri, 24 Jul 2026 10:04:59 +0200 Subject: [PATCH 07/15] update German labels and hints for clarity in author comparison table 1 --- .../compare-authors.component.html | 13 +- .../compare-authors.component.ts | 152 ++++++++---------- 2 files changed, 76 insertions(+), 89 deletions(-) diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.html b/webapp/src/app/modules/compare-authors/compare-authors.component.html index de385536..8ba1fe87 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.html +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.html @@ -5,7 +5,7 @@
@if (keywords().length > 0) {
- Betrachtete Topics: + Betrachtete Themen:
@for (keyword of keywords(); track keyword) { @@ -48,10 +48,13 @@ } @else {
-

Kennzahlen zu den Keywords

+

+ Kennzahlen der Publikationen zu den ausgewählten Themen +

- Bester Wert je Zeile ist hervorgehoben. „–“ bedeutet, dass der Wert für - diese:n Autor:in nicht vorliegt. + Berücksichtigt werden ausschließlich Publikationen zu den ausgewählten + Themen im betrachteten Zeitraum. Bester Wert je Zeile ist hervorgehoben. + „–" bedeutet, dass der Wert für diese:n Autor:in nicht vorliegt.

Themenprofil

-

"Topic-Analyse"

+

"Themen-Analyse"

@if (profileLoading()) {

Lädt…

diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.ts b/webapp/src/app/modules/compare-authors/compare-authors.component.ts index 8600afb4..fd786d47 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.ts +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.ts @@ -198,22 +198,22 @@ export class CompareAuthorsComponent implements OnInit { readonly topicRows = computed(() => [ ...this.buildRows([ { - label: 'Werke gesamt', - hint: 'Publikationen zum Thema im Zeitraum', + label: 'Publikationen', + hint: 'Gesamtanzahl der Publikationen', select: (a) => a.totalWorks, }, { - label: 'Corresponding-Author-Werke', - hint: 'Werke, in denen die Person korrespondierende:r Autor:in ist', + label: 'Corresponding-Author', + hint: 'Gesamtanzahl der Publikationen, in denen die Person korrespondierende:r Autor:in ist', select: (a) => a.corresponding, }, ]), this.buildGroupRow( 'Zitationen', - 'Zitationen der Themen-Werke: gesamt | Ø pro Werk', + 'Wie oft die Publikationen zitiert wurden', [ { - label: 'gesamt', + label: 'Gesamt', colorClass: 'cit-total', select: (a) => a.citationsTotal, }, @@ -228,85 +228,73 @@ export class CompareAuthorsComponent implements OnInit { ...this.buildRows([ { label: 'Ø Impact-Perzentil', - hint: 'Feld-normalisiertes Zitations-Perzentil (0–1)', + hint: 'Feld-normalisierte Zitationswirkung (0–1)', select: (a) => a.avgPercentile, decimals: true, }, { label: 'h-Index', - hint: 'h-Index über die Werke zum Thema', + hint: 'Berechnet über alle Publikationen', select: (a) => a.hIndex, }, { - label: 'Meistzitiertes Werk', - hint: 'Zitationen des meistzitierten Werks zum Thema', + label: 'Meistzitierte Publikation', + hint: 'Zitationen der Publikation mit den meisten Zitationen', select: (a) => a.maxCitations, }, { - label: 'Top-10%-Werke', - hint: 'Werke unter den 10% meistzitierten', + label: 'Top-10%-Publikationen', + hint: ' Anzahl unter den 10% meistzitierten', select: (a) => a.top10, }, { - label: 'Top-1%-Werke', - hint: 'Werke unter den 1% meistzitierten', + label: 'Top-1%-Publikationen', + hint: ' Anzahl unter den 1% meistzitierten', select: (a) => a.top1, }, ]), - this.buildGroupRow( - 'FWCI', - 'Field-Weighted Citation Impact: Werke über Feld-Durchschnitt | Ø über alle', - [ - { - label: '> 1', - colorClass: 'fwci-count', - select: (a) => a.fwciAboveOne, - }, - { - label: 'Ø', - colorClass: 'fwci-avg', - decimals: true, - select: (a) => a.avgFwci, - }, - ], - ), - this.buildGroupRow( - 'Themen-Relevanz', - 'Match-Score der Keywords: Werke > 80% | Ø über alle', - [ - { - label: '> 80%', - colorClass: 'rel-count', - select: (a) => a.relevanceAbove80, - }, - { - label: 'Ø', - colorClass: 'rel-avg', - decimals: true, - select: (a) => a.avgRelevance, - }, - ], - ), - this.buildGroupRow( - 'Autor-Position', - 'Werke nach Position (Erst | Mittel | Letzt)', - [ - { - label: 'Erst', - colorClass: 'pos-first', - select: (a) => a.firstAuthor, - }, - { - label: 'Mittel', - colorClass: 'pos-middle', - select: (a) => a.middleAuthor, - }, - { label: 'Letzt', colorClass: 'pos-last', select: (a) => a.lastAuthor }, - ], - ), + this.buildGroupRow('FWCI', ' Field-Weighted Citation Impact', [ + { + label: '> 1', + colorClass: 'fwci-count', + select: (a) => a.fwciAboveOne, + }, + { + label: 'Ø', + colorClass: 'fwci-avg', + decimals: true, + select: (a) => a.avgFwci, + }, + ]), + this.buildGroupRow('Themen-Relevanz', 'Topic-Match-Score (0–1)', [ + { + label: '> 80%', + colorClass: 'rel-count', + select: (a) => a.relevanceAbove80, + }, + { + label: 'Ø', + colorClass: 'rel-avg', + decimals: true, + select: (a) => a.avgRelevance, + }, + ]), + this.buildGroupRow('Autor-Position', 'Nach Platz in der Autorenliste', [ + { + label: 'Erst', + colorClass: 'pos-first', + select: (a) => a.firstAuthor, + }, + { + label: 'Mittel', + colorClass: 'pos-middle', + select: (a) => a.middleAuthor, + }, + { label: 'Letzt', colorClass: 'pos-last', select: (a) => a.lastAuthor }, + ]), this.buildGroupRow( 'Industrie-Kollaboration', - 'Werke mit Co-Autor:in aus einem Unternehmen: Anzahl | Anteil', + 'Publikationen mit Co-Autor:in aus einem Unternehmen', [ { label: 'Anzahl', @@ -321,24 +309,20 @@ export class CompareAuthorsComponent implements OnInit { }, ], ), - this.buildGroupRow( - 'Aktiv im Thema', - 'Erstes und letztes Publikationsjahr zum Thema', - [ - { - label: 'von', - colorClass: 'year-from', - plain: true, - select: (a) => a.firstYear, - }, - { - label: 'bis', - colorClass: 'year-to', - plain: true, - select: (a) => a.lastYear, - }, - ], - ), + this.buildGroupRow('Aktiv im Thema', 'Publikationszeitraum', [ + { + label: 'von', + colorClass: 'year-from', + plain: true, + select: (a) => a.firstYear, + }, + { + label: 'bis', + colorClass: 'year-to', + plain: true, + select: (a) => a.lastYear, + }, + ]), ]); // section 2 table: author-level stats, independent of the keywords -- 2.56.1 From d19003d53144e94f4031b001465c46fbd06af5a3 Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Fri, 24 Jul 2026 10:12:09 +0200 Subject: [PATCH 08/15] update table 2 --- .../modules/compare-authors/compare-authors.component.html | 4 +++- .../app/modules/compare-authors/compare-authors.component.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.html b/webapp/src/app/modules/compare-authors/compare-authors.component.html index 8ba1fe87..a8e95b32 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.html +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.html @@ -64,7 +64,9 @@

Kennzahlen zur Person

-

Unabhängig von den Keywords und Zeitraum.

+

+ Unabhängig von den ausgewählten Themen und vom Zeitraum. +

diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.ts b/webapp/src/app/modules/compare-authors/compare-authors.component.ts index fd786d47..4a5a6872 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.ts +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.ts @@ -335,12 +335,12 @@ export class CompareAuthorsComponent implements OnInit { }, { label: 'News-Artikel', - hint: 'Nachrichtenartikel, die die Person namentlich nennen', + hint: ' Beiträge, die die Person namentlich nennen', select: (a) => a.news, }, { label: 'Patente', - hint: 'Der Person zugeordnete Patente', + hint: ' Der Person zugeordnet', select: (a) => a.patents, }, ]), -- 2.56.1 From e51d3095bcef216989f8a8646b37197afe396f0e Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Fri, 24 Jul 2026 10:23:50 +0200 Subject: [PATCH 09/15] update table 3 --- .../compare-authors.component.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.html b/webapp/src/app/modules/compare-authors/compare-authors.component.html index a8e95b32..4170471a 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.html +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.html @@ -75,15 +75,17 @@

Themenprofil

-

"Themen-Analyse"

+

+ Verteilung und Breite der Themen über alle Publikationen +

@if (profileLoading()) {

Lädt…

} @else if (orderedProfiles().length > 0) {

Themenverteilung nach Subfield

- Von allen Arbeiten der Autor:innen im Zeitraum: der Anteil je - Subfield, bestimmt über das Primärthema jeder Arbeit. (Top 5) + Anteil je Subfield an allen Publikationen im Zeitraum, bestimmt über + das Primärthema. (Top 5)

Themen-Fokus

- Anzahl der Werke zum Suchthema im Verhältnis zum Gesamtwerk – und - wie viele davon das Suchthema als Primärthema tragen. + Publikationen zum Suchthema im Verhältnis zu allen Publikationen – + und wie viele es als Primärthema tragen

Themenbreite

- Einzigartige Primärthemen, Subfields und Fields im Gesamtwerk - (Primary Topic) + Einzigartige Primärthemen, Subfields und Fields über alle + Publikationen (Primärthema)

-- 2.56.1 From ff3ac03520d4448c8643811e0a48f2ae0182d40a Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Fri, 24 Jul 2026 10:27:40 +0200 Subject: [PATCH 10/15] replace author name display with app-chip component --- .../compare-authors/compare-authors.component.html | 7 +------ .../compare-authors/compare-authors.component.scss | 8 -------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.html b/webapp/src/app/modules/compare-authors/compare-authors.component.html index 4170471a..665a7a60 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.html +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.html @@ -157,12 +157,7 @@ Kennzahl @for (author of summary(); track author.authorId) { - - - {{ author.name }} - + {{ author.name }} } diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.scss b/webapp/src/app/modules/compare-authors/compare-authors.component.scss index a4deedf6..3182ce8d 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.scss +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.scss @@ -117,14 +117,6 @@ app-chip mat-icon { text-align: right; } - .th-name { - display: inline-flex; - align-items: center; - gap: 8px; - font-weight: 700; - color: var(--sg-text, #101a3d); - } - tbody tr + tr th, tbody tr + tr td { border-top: 1px solid var(--sg-border, #dde5f2); -- 2.56.1 From 8b1f7d6eb304864dada232b6288b66beadfd4e2e Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Fri, 24 Jul 2026 10:29:56 +0200 Subject: [PATCH 11/15] center align author and value cells in comparison table --- .../modules/compare-authors/compare-authors.component.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.scss b/webapp/src/app/modules/compare-authors/compare-authors.component.scss index 3182ce8d..2f0555d9 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.scss +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.scss @@ -114,7 +114,7 @@ app-chip mat-icon { } .author-col { - text-align: right; + text-align: center; } tbody tr + tr th, @@ -147,7 +147,7 @@ app-chip mat-icon { } .value-cell { - text-align: right; + text-align: center; font-variant-numeric: tabular-nums; color: var(--sg-text, #101a3d); white-space: nowrap; -- 2.56.1 From a7548d59c0111763c24d3ac4be2bf59c4f4d0b9c Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Fri, 24 Jul 2026 10:32:52 +0200 Subject: [PATCH 12/15] center align table header cells in comparison table --- .../modules/compare-authors/compare-authors.component.scss | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.scss b/webapp/src/app/modules/compare-authors/compare-authors.component.scss index 2f0555d9..231cf8b9 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.scss +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.scss @@ -107,16 +107,12 @@ app-chip mat-icon { font-size: 14px; thead th { - text-align: left; + text-align: center; padding: 0 16px 10px; border-bottom: 2px solid var(--sg-border, #dde5f2); vertical-align: bottom; } - .author-col { - text-align: center; - } - tbody tr + tr th, tbody tr + tr td { border-top: 1px solid var(--sg-border, #dde5f2); -- 2.56.1 From 6edca93c1c7601039ae833137333d8b2dad12595 Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Fri, 24 Jul 2026 11:04:13 +0200 Subject: [PATCH 13/15] replace app-chip with app-topic-chip for keyword display and implement keyword color resolution --- .../compare-authors.component.html | 7 ++- .../compare-authors.component.ts | 50 +++++++++++++++++++ 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.html b/webapp/src/app/modules/compare-authors/compare-authors.component.html index 665a7a60..c6b4b6a2 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.html +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.html @@ -8,10 +8,9 @@ Betrachtete Themen:
@for (keyword of keywords(); track keyword) { - - topic - {{ keyword }} - + }
([]); readonly operator = signal<'and' | 'or'>('or'); readonly operatorLabel = computed(() => this.operator() === 'and' ? 'UND' : 'ODER', ); + + // resolved OpenAlex topic (field/domain) per keyword for colour matching + private readonly keywordTopics = signal>({}); + + keywordColor(keyword: string): string { + const topic = this.keywordTopics()[this.normalizeKeyword(keyword)]; + return topicHierarchyColor( + topic + ? { + id: topic.id, + name: topic.display_name, + field_id: topic.field?.id, + field_name: topic.field?.display_name, + domain_id: topic.domain?.id, + domain_name: topic.domain?.display_name, + } + : { name: keyword }, + ); + } + + private normalizeKeyword(keyword: string): string { + return keyword.trim().toLowerCase(); + } + readonly timespan = signal<{ from: number; to: number } | null>(null); // full OpenAlex ids in the requested order — the source of truth for colour + order readonly authorIds = signal([]); @@ -676,6 +706,7 @@ export class CompareAuthorsComponent implements OnInit { const authorIds = this.parseList(rawAuthors); const keywords = this.parseList(rawKeywords); this.keywords.set(keywords); + this.resolveKeywordColors(keywords); if (authorIds.length === 0 || keywords.length === 0) { return; @@ -743,6 +774,25 @@ export class CompareAuthorsComponent implements OnInit { }); } + private resolveKeywordColors(keywords: string[]): void { + if (keywords.length === 0) return; + + this.topicsService.vectorSearchTopicsBatch({ keywords }).subscribe({ + next: ({ results }) => { + const topics: Record = {}; + for (const result of results) { + if (result.topic) { + topics[this.normalizeKeyword(result.keyword)] = result.topic; + } + } + this.keywordTopics.set(topics); + }, + error: (error) => { + console.error('Error resolving keyword topics:', error); + }, + }); + } + private parseList(raw: string): string[] { return raw .split(',') -- 2.56.1 From 103b6180d0e82060112f04bbec0cf4b6b72582eb Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Fri, 24 Jul 2026 11:17:14 +0200 Subject: [PATCH 14/15] table 3: replace legend with app-chip component for author display --- .../compare-authors.component.html | 8 ++--- .../compare-authors.component.scss | 34 ++++++------------- 2 files changed, 14 insertions(+), 28 deletions(-) diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.html b/webapp/src/app/modules/compare-authors/compare-authors.component.html index c6b4b6a2..900261d7 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.html +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.html @@ -126,11 +126,11 @@ [attr.aria-selected]=" treemapProfile()?.author_id === author.author_id " + [style.--tab-color]="authorColor(author.author_id)" (click)="selectTreemapAuthor(i)"> - - {{ author.display_name }} + + {{ author.display_name }} + }
diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.scss b/webapp/src/app/modules/compare-authors/compare-authors.component.scss index 231cf8b9..f57ba1c1 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.scss +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.scss @@ -60,13 +60,6 @@ app-chip mat-icon { vertical-align: text-bottom; } -.legend-swatch { - width: 12px; - height: 12px; - border-radius: 3px; - flex: 0 0 auto; -} - /* ---- cards ---- */ .card { background: #fff; @@ -254,30 +247,23 @@ app-chip mat-icon { .treemap-author-tab { display: inline-flex; - align-items: center; - gap: 6px; - padding: 5px 12px; - border: 1px solid var(--sg-border, #d7deee); - border-radius: 999px; - background: var(--sg-surface, #fff); - color: var(--sg-text-muted, #64708f); - font-size: 12px; - font-weight: 600; + border: 0; + padding: 0; + border-radius: 7px; + background: transparent; cursor: pointer; transition: - background 0.15s ease, - border-color 0.15s ease, - color 0.15s ease; + transform 0.15s ease, + box-shadow 0.15s ease; &:hover { - border-color: var(--sg-primary, #2563eb); - color: var(--sg-text, #101a3d); + transform: translateY(-1px); } &.active { - border-color: var(--sg-primary, #2563eb); - background: color-mix(in srgb, var(--sg-primary, #2563eb) 10%, #fff); - color: var(--sg-text, #101a3d); + box-shadow: + 0 0 0 2px #ffffff, + 0 0 0 4px var(--tab-color, var(--sg-primary, #2563eb)); } } -- 2.56.1 From 0b6a74a8e399f171e387e8a59088addb79aabe9c Mon Sep 17 00:00:00 2001 From: Steven Tischer Date: Mon, 3 Aug 2026 20:23:51 +0200 Subject: [PATCH 15/15] fix: update type hints from List to built-in list for consistency --- service/src/main/inse/ranking/model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/src/main/inse/ranking/model.py b/service/src/main/inse/ranking/model.py index f5955fc7..75522114 100644 --- a/service/src/main/inse/ranking/model.py +++ b/service/src/main/inse/ranking/model.py @@ -292,7 +292,7 @@ class SubfieldNode(BaseModel): id: str = Field(description="The OpenAlex ID of the subfield.") name: str = Field(description="The subfield display name.") count: int = Field(description="Number of works whose primary topic belongs to this subfield.") - topics: List[TopicNode] = Field( + topics: list[TopicNode] = Field( default_factory=list, description="Primary topics within this subfield, largest first.", ) @@ -302,7 +302,7 @@ class FieldNode(BaseModel): id: str = Field(description="The OpenAlex ID of the field.") name: str = Field(description="The field display name.") count: int = Field(description="Number of works whose primary topic belongs to this field.") - subfields: List[SubfieldNode] = Field( + subfields: list[SubfieldNode] = Field( default_factory=list, description="Subfields within this field, largest first.", ) @@ -334,7 +334,7 @@ class AuthorTopicProfile(BaseModel): default_factory=list, description="Top subfields over all works, by primary topic, largest first.", ) - field_tree: List[FieldNode] = Field( + field_tree: list[FieldNode] = Field( default_factory=list, description="Field -> subfield -> topic hierarchy over all works, by primary " "topic, each level largest first. Drives the interactive topic treemap.", -- 2.56.1