From 29dbf622330e4ec54d73f54a606113d8cd4842b2 Mon Sep 17 00:00:00 2001 From: genja Date: Fri, 6 Nov 2026 11:38:45 +0100 Subject: [PATCH] added initial design for founding potential and multipliers components --- webapp/src/app/app.routes.ts | 20 ++ .../founder-dashboard.component.html | 253 ++++++++--------- .../founder-dashboard.component.scss | 4 + .../founder-dashboard.component.ts | 47 +--- .../founder-potential.utils.ts | 24 +- .../multipliers-dashboard.component.html | 242 ++++++++++++++++ .../multipliers-dashboard.component.scss | 239 ++++++++++++++++ .../multipliers-dashboard.component.ts | 266 ++++++++++++++++++ .../researcher-network.component.html | 226 ++++++--------- .../researcher-network.component.scss | 82 ++---- .../researcher-network.component.ts | 163 +++++------ .../multiplicator-researchers.resolver.ts | 91 ++++++ .../shared/ui/app-menu/app-menu.component.ts | 42 ++- .../methodology-note.component.html | 12 + .../methodology-note.component.scss | 64 +++++ .../methodology-note.component.ts | 13 + .../multiplier-role-labels.ts | 24 ++ .../multiplier-role-scores.component.html | 25 ++ .../multiplier-role-scores.component.scss | 21 ++ .../multiplier-role-scores.component.ts | 45 +++ 20 files changed, 1396 insertions(+), 507 deletions(-) create mode 100644 webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.html create mode 100644 webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.scss create mode 100644 webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.ts create mode 100644 webapp/src/app/resolvers/multiplicator-researchers.resolver.ts create mode 100644 webapp/src/app/shared/ui/methodology-note/methodology-note.component.html create mode 100644 webapp/src/app/shared/ui/methodology-note/methodology-note.component.scss create mode 100644 webapp/src/app/shared/ui/methodology-note/methodology-note.component.ts create mode 100644 webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-labels.ts create mode 100644 webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.html create mode 100644 webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.scss create mode 100644 webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.ts diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index aaa7467f..56f2575e 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -4,6 +4,7 @@ import { personListResolver } from './resolvers/person-list.resolver'; import { founderStatisticsResolver } from './resolvers/founder-statistics.resolver'; import { founderCandidatesResolver } from './resolvers/founder-candidates.resolver'; import { multiplierResearcherPageResolver } from './resolvers/multiplier-researcher-page.resolver'; +import { multiplicatorResearchersResolver } from './resolvers/multiplicator-researchers.resolver'; import { personBioResolver } from './resolvers/person-bio.resolver'; import { personPatentsResolver } from './resolvers/person-patents.resolver'; import { personResolver } from './resolvers/person.resolver'; @@ -139,6 +140,25 @@ export const routes: Routes = [ (mod) => mod.CompareAuthorsComponent, ), }, + { + path: 'multipliers', + canActivate: [ + roleGuard([ + UserRole.User, + UserRole.Manager, + UserRole.Admin, + UserRole.SuperAdmin, + ]), + ], + loadComponent: () => + import( + './modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component' + ).then((mod) => mod.MultipliersDashboardComponent), + resolve: { + researchers: multiplicatorResearchersResolver, + }, + runGuardsAndResolvers: 'paramsOrQueryParamsChange', + }, { path: 'founders', canActivate: [ diff --git a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.html b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.html index 911aa83a..98a03668 100644 --- a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.html +++ b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.html @@ -1,7 +1,33 @@
-

Gründungspotenzial · {{ universityName() }}

+

Gründungspotenzial {{ universityName() }}

+ +

+ Datenbasis: Publikationen, Patente, Förderungen und + Industriekooperationen werden für Forschende der Universität bis zum + jeweiligen Datenstichtag zusammengeführt. Ein vortrainiertes, symmetrisch + aufgebautes Modell schätzt die Ähnlichkeit zu Profilen von Personen, die + gegründet haben. +

+
    +
  • + Der Hauptwert ist ein + Perzentil gegenüber einer festen Referenzkohorte von rund 9.000 + Forschenden aus acht anderen Universitäten + – keine individuelle Gründungswahrscheinlichkeit. +
  • +
  • + „Innerhalb 1 / 3 / 5 Jahre“ kommt aus drei eigenen Horizont-Modellen. + Bewertbar sind Profile ab mindestens vier Publikationen. Die + Kandidatenliste blendet standardmäßig Profile mit weniger als sieben + Publikationen, unplausibel langen Karrieren (über 40 Jahre) und + wahrscheinlichen Profilzusammenführungen aus. +
  • +
+
@if (hasData()) {

Welche Forschenden könnten künftig gründen?

@@ -43,7 +69,7 @@
-
+ +
+

1 · Woher die Kandidat:innen kommen

+

+ Beide Panels nutzen die Shortlist am aktuellen Schwellenwert. +

+
+ + +
Karrierestufe
+
+ @for (s of stageRows(); track s.career_bucket) { +
+ {{ s.career_bucket }} + + + + {{ s.shortlist_plain ?? 0 }} + / {{ fmtInt(s.screened) }} +
+ } +
+
+ Balken sind Kandidatenzahlen; die graue Zahl ist der gescreente + Pool der Stufe. +
+
+
+ + +
+ Forschungsfeld, vs. Anteil an der Kohorte +
+
+ @for (a of areaRows(); track a.code) { +
+ {{ a.label ?? a.code }} + + + + {{ a.shortlist_count ?? 0 }} + · {{ fmt1((a.cohort_share ?? 0) * 100) }} % der + Kohorte +
+ } +
+
+ Balken sind Kandidatenzahlen. Die graue Zahl ist der Anteil des + Feldes an der gescreenten Kohorte – ein Feld deutlich über seinem + Anteil überproduziert. +
+
+
+
+

2 · Die Shortlist

@@ -149,21 +253,14 @@ } - -

+
Gründungspotenzial

- Rang gegen ~9.000 Wissenschaftler:innen an anderen - Universitäten. + Perzentil gegenüber der Modell-Referenzkohorte; keine + individuelle Wahrscheinlichkeit.

- -
-
Multiplikator-Rollen
-

- Rang gegen Peers dieser Universität auf derselben - Karrierestufe. -

- @for (s of subScores(); track s.key) { - - } -
- @if (row.candidate.tags?.length) { - @for (tag of row.candidate.tags ?? []; track tag) { - - {{ tagLabel(tag) }} - - } - } @else { - kein Multiplikator-Badge - } -
-
@@ -248,86 +315,6 @@ }
- -
-

3 · Woher die Kandidat:innen kommen

-

- Beide Panels nutzen die Shortlist am aktuellen Schwellenwert. -

-
- - -
Karrierestufe
-
- @for (s of stageRows(); track s.career_bucket) { -
- {{ s.career_bucket }} - - - - {{ s.shortlist_plain ?? 0 }} - / {{ fmtInt(s.screened) }} -
- } -
-
- Balken sind Kandidatenzahlen; die graue Zahl ist der gescreente - Pool der Stufe. -
-
-
- - - -
- Forschungsfeld, vs. Anteil an der Kohorte -
-
- @for (a of areaRows(); track a.code) { -
- {{ a.label ?? a.code }} - - - - {{ a.shortlist_count ?? 0 }} - · {{ fmt1((a.cohort_share ?? 0) * 100) }} % der - Kohorte -
- } -
-
- Balken sind Kandidatenzahlen. Die graue Zahl ist der Anteil des - Feldes an der gescreenten Kohorte – ein Feld deutlich über seinem - Anteil überproduziert. -
-
-
-
-
} @else { @@ -336,8 +323,8 @@

Für die {{ universityName() }} wurde das Gründungspotenzial noch nicht berechnet. Sobald die Auswertung - vorliegt, erscheinen hier die Kandidat:innen, ihre Scores und ihre - Multiplikator-Netzwerke. + vorliegt, erscheinen hier die Kandidat:innen und ihre + Gründungspotenzial-Scores.

@@ -394,19 +381,3 @@ } - - - - @if (!row.candidate.screen.passed && row.flagLabel) { - {{ row.flagLabel }} - } - - - diff --git a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.scss b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.scss index cfb880bf..634a2305 100644 --- a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.scss +++ b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.scss @@ -432,6 +432,10 @@ h2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; + + &--founder-only { + grid-template-columns: minmax(0, 1fr); + } } .panel { diff --git a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.ts b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.ts index 5c3e11c1..72f04534 100644 --- a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.ts +++ b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.ts @@ -11,13 +11,11 @@ import { import { CommonModule } from '@angular/common'; import { ActivatedRoute, Router } from '@angular/router'; import { toSignal } from '@angular/core/rxjs-interop'; -import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { MatSliderModule } from '@angular/material/slider'; -import { MatTooltipModule } from '@angular/material/tooltip'; import { CareerStageStatistics, @@ -32,9 +30,6 @@ import { clamp, fmt1, fmtInt, - fmtSubScore, - tagDescription, - tagLabel, } from '../founder-potential.utils'; import { ScoreBarComponent } from '../../../shared/ui/score-bar/score-bar.component'; import { QueryParamPaginatorComponent } from '../../../shared/ui/query-param-paginator/query-param-paginator.component'; @@ -43,11 +38,11 @@ import { DataTableComponent, GenericColumn, } from '../../../shared/ui/data-table/data-table.component'; -import { FOUNDER_ICON, NETWORK_ICON } from '../../../shared/ui/icons'; +import { MethodologyNoteComponent } from '../../../shared/ui/methodology-note/methodology-note.component'; +import { FOUNDER_ICON } from '../../../shared/ui/icons'; import { CredentialService } from '../../../shared/services/credential.service'; const FALLBACK_UNIVERSITY = 'Universität Duisburg-Essen'; -const SUB_SCORE_KEYS = ['bridger', 'mentor', 'amplifier'] as const; /** * A shortlist row: the generated candidate plus only the values that the @@ -68,23 +63,21 @@ interface FounderRow { standalone: true, imports: [ CommonModule, - MatButtonModule, MatCardModule, MatIconModule, MatProgressBarModule, MatSlideToggleModule, MatSliderModule, - MatTooltipModule, ScoreBarComponent, QueryParamPaginatorComponent, ChipComponent, DataTableComponent, + MethodologyNoteComponent, ], templateUrl: './founder-dashboard.component.html', styleUrl: './founder-dashboard.component.scss', }) export class FounderDashboardComponent { - readonly NETWORK_ICON = NETWORK_ICON; readonly FOUNDER_ICON = FOUNDER_ICON; readonly statistics = input.required(); @@ -108,8 +101,12 @@ export class FounderDashboardComponent { initialValue: this.route.snapshot.queryParamMap, }); - readonly threshold = computed(() => toNumber(this.queryParams().get('threshold')) ?? 90); - readonly screened = computed(() => (this.queryParams().get('screened') ?? 'true') === 'true'); + readonly threshold = computed( + () => toNumber(this.queryParams().get('threshold')) ?? 90, + ); + readonly screened = computed( + () => this.queryParams().get('screened') === 'true', + ); /** Live value while dragging the slider; committed to the URL on release. */ readonly thresholdDraft = signal(90); @@ -159,8 +156,6 @@ export class FounderDashboardComponent { viewChild.required>('withinTemplate'); private readonly evidenceTemplate = viewChild.required>('evidenceTemplate'); - private readonly actionsTemplate = - viewChild.required>('actionsTemplate'); readonly columns = computed[]>(() => [ { @@ -187,12 +182,6 @@ export class FounderDashboardComponent { type: 'display', cellTemplate: this.evidenceTemplate(), }, - { - id: 'actions', - header: '', - type: 'display', - cellTemplate: this.actionsTemplate(), - }, ]); readonly total = computed(() => this.candidates().total ?? 0); @@ -212,25 +201,10 @@ export class FounderDashboardComponent { return rows[0] ?? null; }); - /** The three multiplier roles of the selected person, with their tooltips. */ - readonly subScores = computed(() => { - const peerRanks = this.selectedRow()?.candidate.multiplier_peer_ranks; - return SUB_SCORE_KEYS.map((key) => ({ - key, - label: tagLabel(key), - hint: tagDescription(key), - value: peerRanks?.[key] ?? 0, - })); - }); - selectCandidate(id: string): void { this.selectedId.set(id); } - openNetwork(id: string): void { - void this.router.navigate(['/founders', id]); - } - // -- Controls ----------------------------------------------------------- /** Discrete label inside the Material slider thumb. */ @@ -283,9 +257,6 @@ export class FounderDashboardComponent { readonly fmtInt = fmtInt; readonly fmt1 = fmt1; - readonly fmtSubScore = fmtSubScore; - readonly tagLabel = tagLabel; - readonly tagDescription = tagDescription; /** Clamp a percentile into the 0-100 band for bar widths. */ readonly clamp0 = (value: number | null) => diff --git a/webapp/src/app/modules/founder-potential/founder-potential.utils.ts b/webapp/src/app/modules/founder-potential/founder-potential.utils.ts index 521e30de..b05281f2 100644 --- a/webapp/src/app/modules/founder-potential/founder-potential.utils.ts +++ b/webapp/src/app/modules/founder-potential/founder-potential.utils.ts @@ -1,34 +1,30 @@ import { ResearcherMetrics } from '../../api'; +import { + MULTIPLIER_TAG_DESCRIPTIONS, + MULTIPLIER_TAG_LABELS, + multiplierTagDescription, + multiplierTagLabel, +} from '../../shared/ui/multiplier-role-scores/multiplier-role-labels'; /** * Multiplier archetype labels. These stay in English on purpose: Bridger, * Mentor and Amplifier are the model's own role names and are not translated. */ export const TAG_LABELS: Record = { - bridger: 'Bridger', - mentor: 'Mentor', - amplifier: 'Amplifier', + ...MULTIPLIER_TAG_LABELS, }; /** What each multiplier archetype means, shown as a tooltip. */ export const TAG_DESCRIPTIONS: Record = { - bridger: - 'Bridger: verbindet Personengruppen, die sonst nicht zusammenarbeiten würden. ' + - 'Hohe Brokerage zwischen ansonsten getrennten Koautor:innen-Netzen.', - mentor: - 'Mentor: führt Nachwuchsforschende als Erstautor:innen in gemeinsame ' + - 'Publikationen und fördert deren weitere Laufbahn.', - amplifier: - 'Amplifier: trägt Wissen nach außen – über Patente, ' + - 'Industriekollaborationen, Medienresonanz und EU-Projekte.', + ...MULTIPLIER_TAG_DESCRIPTIONS, }; export function tagLabel(tag: string): string { - return TAG_LABELS[tag] ?? tag; + return multiplierTagLabel(tag); } export function tagDescription(tag: string): string { - return TAG_DESCRIPTIONS[tag] ?? TAG_LABELS[tag] ?? tag; + return multiplierTagDescription(tag); } /** German labels for the data-quality screen reasons. */ diff --git a/webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.html b/webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.html new file mode 100644 index 00000000..8dab5248 --- /dev/null +++ b/webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.html @@ -0,0 +1,242 @@ +
+
+

Multiplikatoren · {{ universityName() }}

+

Wer stärkt das Innovationsökosystem?

+

+ Entdecke Forschende, die Forschungsgruppen verbinden, Nachwuchs fördern + oder Wissen in Wirtschaft und Öffentlichkeit tragen. Die Rollen-Scores + vergleichen Forschende derselben Karrierestufe an der + {{ universityName() }}. +

+
+ + +

+ Datenbasis: Die UDE-Kohorte umfasst die Universität und + acht zugehörige Einrichtungen. Forschende werden anhand jüngerer + OpenAlex-Affiliationen ausgewählt; ihre Publikationen und + Koautorenschaften werden anschließend institutionsübergreifend + ausgewertet. Die Rollen-Scores vergleichen nur Personen derselben + Karrierestufe. +

+
    +
  • + Bridger: Netzwerkvermittlung, Verbindungen zwischen + Fachgebieten und Institutionen. +
  • +
  • + Mentor: gemeinsame Publikationen mit Nachwuchs sowie + Hinweise auf Betreuung und deren berufliche Entwicklung. +
  • +
  • + Amplifier: Industriekooperationen, verknüpfte Patente, + EU-Projekte und relevante Medienerwähnungen. +
  • +
+

+ Rohmetriken werden zunächst innerhalb der vier Karrierestufen + Early, Emerging, Established, Senior in Peer-Ränge + umgerechnet. Die drei Rollen-Scores sind gewichtete Mittel dieser Ränge: + Bridger (35 % Betweenness, 25 % Brokerage, 20 % Feldbreite, + 20 % institutionsübergreifende Zusammenarbeit), Mentor (35 % + Nachwuchs, 25 % Mentoring-Rate, 25 % typische Autor:innenrollen, + 15 % Nachwuchsentwicklung) und Amplifier (50 % Industrie, + 25 % Patente, 15 % EU-Projekte, 10 % Medien). Ab 85 % + und mindestens zwei aktiven Jahren wird ein Badge vergeben. Ein Score + beschreibt ein relatives Signal, keinen kausalen Nachweis. +

+

+ Die aktuelle Multiplikator-Auswertung ist für die definierte UDE-Kohorte + berechnet. Für andere Universitäten erscheinen Daten erst, wenn deren + Kohorte ebenfalls durch die Pipeline verarbeitet wurde. +

+
+ +
+ + +
+ + Name suchen + + {{ SEARCH_ICON }} + + + + Rollen-Badge + + @for (role of roleOptions; track role.value) { + {{ role.label }} + } + + + + + Karrierestufe + + @for (bucket of careerOptions; track bucket) { + {{ bucket }} + } + + + + + Rolle für Mindest-Rang + + @for (field of peerRankFields; track field.value) { + {{ field.label }} + } + + + +
+ + + + +
+
+ +
+ + {{ fmtInt(pageTotal()) }} + {{ pageTotal() === 1 ? 'Forschende:r' : 'Forschende' }} + + + +
+
+
+
+ +
+
+
+

Multiplikator:innen in der Kohorte

+

+ Nach dem stärksten Rollen-Rang sortiert. Öffne das Netzwerk, um + Kooperationen und die zugrunde liegenden Metriken anzusehen. +

+
+
+ + + + @if (rows().length > 0) { + + } @else if (pageTotal() === 0 && selectedTags().length === 0 && selectedCareerBuckets().length === 0 && !nameDraft() && appliedMinPeerRank() === 0) { +
+ hub +

Noch keine Multiplikator-Daten

+

+ Für die {{ universityName() }} wurden noch keine + Multiplikator-Scores berechnet. +

+
+ } @else { +
+

Keine passenden Forschenden gefunden

+

Ändere oder entferne einen Filter, um weitere Ergebnisse zu sehen.

+
+ } +
+
+ + +
+
+ + +
+ {{ row.name }} + + {{ fmtInt(row.nWorks) }} Publikationen · + {{ fmtInt(row.activeYears) }} aktive Jahre + @if (row.researcher.suspicious_profile) { + · Profil mit möglicher Zusammenführung + } + +
+
+ + + + + + + @if (row.tags.length) { +
+ @for (tag of row.tags; track tag) { + + {{ tagLabel(tag) }} + + } +
+ } @else { + – + } +
+ + + + + {{ fmtSubScore(row.max) }} + + + + + + diff --git a/webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.scss b/webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.scss new file mode 100644 index 00000000..9c9d3409 --- /dev/null +++ b/webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.scss @@ -0,0 +1,239 @@ +.multipliers-dashboard { + max-width: 1280px; + margin: 0 auto; + padding: 24px 8px 64px; +} + +.hero { + max-width: 75ch; + + .eyebrow { + margin: 0 0 10px; + color: var(--sg-text-soft); + font-size: 11px; + letter-spacing: 0.14em; + text-transform: uppercase; + } + + h1 { + margin: 0 0 12px; + color: var(--sg-text); + font-size: 30px; + line-height: 1.15; + } + + .lede { + margin: 0; + color: var(--sg-text-muted); + font-size: 15px; + line-height: 1.55; + + strong { + color: var(--sg-text); + } + } +} + +.filters-section, +.table-section { + margin-top: 28px; +} + +.filters-card, +.table-card { + background: var(--sg-surface-muted); +} + +.filters-card .mat-mdc-card-content { + padding: 16px 18px; +} + +.filters-grid { + display: grid; + grid-template-columns: minmax(190px, 1.4fr) repeat(3, minmax(150px, 1fr)) minmax(190px, 1.1fr); + gap: 12px; + align-items: center; + + mat-form-field { + width: 100%; + } + + .name-filter { + min-width: 0; + } +} + +.rank-filter { + min-width: 0; + padding: 0 8px; + + label { + display: block; + margin-bottom: 2px; + color: var(--sg-text-muted); + font-size: 12px; + font-weight: 500; + } + + mat-slider { + width: 100%; + } +} + +.filter-actions { + display: flex; + justify-content: flex-end; + align-items: center; + gap: 8px; + + .result-count { + margin-right: auto; + color: var(--sg-text-soft); + font-size: 12.5px; + font-variant-numeric: tabular-nums; + } + + mat-icon { + margin-right: 4px; + } +} + +.section-heading { + display: flex; + align-items: flex-end; + justify-content: space-between; + margin-bottom: 12px; + + h2 { + margin: 0 0 4px; + color: var(--sg-text); + font-size: 20px; + } + + .note { + margin: 0; + color: var(--sg-text-muted); + font-size: 13px; + } +} + +.table-card { + overflow: hidden; + + .mat-mdc-card-content { + padding: 0; + } +} + +.person-cell { + display: flex; + flex-direction: column; + gap: 3px; + min-width: 160px; + + &__name { + color: var(--sg-text); + font-weight: 600; + } + + &__meta { + color: var(--sg-text-soft); + font-size: 11.5px; + white-space: nowrap; + } +} + +.warning { + color: var(--sg-warning); +} + +.tags-cell { + display: flex; + flex-wrap: wrap; + gap: 5px; +} + +.muted { + color: var(--sg-text-soft); +} + +.max-score { + display: inline-flex; + align-items: center; + gap: 8px; + min-width: 105px; + color: var(--sg-text); + font-size: 12px; + font-variant-numeric: tabular-nums; + + .mat-mdc-progress-bar { + --mat-progress-bar-track-height: 7px; + --mat-progress-bar-active-indicator-height: 7px; + --mat-progress-bar-track-color: var(--sg-surface-soft); + --mat-progress-bar-active-indicator-color: var(--sg-success); + width: 62px; + } +} + +.empty-state { + display: flex; + min-height: 190px; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 28px; + text-align: center; + + mat-icon { + width: 34px; + height: 34px; + color: var(--sg-text-soft); + font-size: 34px; + } + + h3 { + margin: 10px 0 5px; + color: var(--sg-text); + font-size: 18px; + } + + p { + max-width: 60ch; + margin: 0; + color: var(--sg-text-muted); + font-size: 13px; + } + + strong { + color: var(--sg-text); + } + + &--filtered { + min-height: 130px; + } +} + +@media (max-width: 1100px) { + .filters-grid { + grid-template-columns: repeat(2, minmax(180px, 1fr)); + } +} + +@media (max-width: 640px) { + .hero h1 { + font-size: 25px; + } + + .filters-grid { + grid-template-columns: 1fr; + gap: 2px; + } + + .filter-actions { + flex-wrap: wrap; + } + + .section-heading h2 { + font-size: 18px; + } +} diff --git a/webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.ts b/webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.ts new file mode 100644 index 00000000..58f32638 --- /dev/null +++ b/webapp/src/app/modules/founder-potential/multipliers-dashboard/multipliers-dashboard.component.ts @@ -0,0 +1,266 @@ +import { + Component, + computed, + effect, + inject, + input, + signal, + TemplateRef, + viewChild, +} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { ActivatedRoute, Router, RouterModule } from '@angular/router'; +import { toSignal } from '@angular/core/rxjs-interop'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSliderModule } from '@angular/material/slider'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { + CareerBucket, + MultiplierTag, + PeerRankField, + ResearcherSortBy, + ResearcherSummary, + ResearcherSummaryPage, +} from '../../../api'; +import { fmtInt, fmtSubScore, tagDescription, tagLabel } from '../founder-potential.utils'; +import { ChipComponent } from '../../../shared/ui/chip/chip.component'; +import { + DataTableComponent, + GenericColumn, +} from '../../../shared/ui/data-table/data-table.component'; +import { MethodologyNoteComponent } from '../../../shared/ui/methodology-note/methodology-note.component'; +import { MultiplierRoleScoresComponent } from '../../../shared/ui/multiplier-role-scores/multiplier-role-scores.component'; +import { QueryParamPaginatorComponent } from '../../../shared/ui/query-param-paginator/query-param-paginator.component'; +import { CredentialService } from '../../../shared/services/credential.service'; +import { NETWORK_ICON, SEARCH_ICON } from '../../../shared/ui/icons'; + +const FALLBACK_UNIVERSITY = 'Universität Duisburg-Essen'; + +interface MultiplierRow { + researcher: ResearcherSummary; + name: string; + careerBucket: string; + activeYears: number; + nWorks: number; + tags: string[]; + max: number; +} + +@Component({ + selector: 'app-multipliers-dashboard', + standalone: true, + imports: [ + CommonModule, + RouterModule, + MatButtonModule, + MatCardModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatProgressBarModule, + MatSelectModule, + MatSliderModule, + MatTooltipModule, + ChipComponent, + DataTableComponent, + MethodologyNoteComponent, + MultiplierRoleScoresComponent, + QueryParamPaginatorComponent, + ], + templateUrl: './multipliers-dashboard.component.html', + styleUrl: './multipliers-dashboard.component.scss', +}) +export class MultipliersDashboardComponent { + readonly NETWORK_ICON = NETWORK_ICON; + readonly SEARCH_ICON = SEARCH_ICON; + + readonly researchers = input.required(); + + private readonly router = inject(Router); + private readonly route = inject(ActivatedRoute); + private readonly credentials = inject(CredentialService, { optional: true }); + + private readonly queryParams = toSignal(this.route.queryParamMap, { + initialValue: this.route.snapshot.queryParamMap, + }); + + readonly universityName = computed( + () => this.credentials?.organizationName() || FALLBACK_UNIVERSITY, + ); + readonly pageTotal = computed(() => this.researchers().total ?? 0); + readonly nameDraft = signal(''); + readonly minPeerRankDraft = signal(0); + + readonly selectedTags = computed(() => this.queryParams().getAll('tag')); + readonly selectedCareerBuckets = computed(() => + this.queryParams().getAll('careerBucket'), + ); + readonly selectedPeerRankField = computed( + () => this.queryParams().get('peerRankField') ?? PeerRankField.Max, + ); + readonly appliedMinPeerRank = computed( + () => Math.round((toNumber(this.queryParams().get('minPeerRank')) ?? 0) * 100), + ); + + readonly roleOptions = [ + { value: MultiplierTag.Bridger, label: tagLabel(MultiplierTag.Bridger) }, + { value: MultiplierTag.Mentor, label: tagLabel(MultiplierTag.Mentor) }, + { value: MultiplierTag.Amplifier, label: tagLabel(MultiplierTag.Amplifier) }, + ]; + readonly careerOptions = Object.values(CareerBucket); + readonly peerRankFields = [ + { value: PeerRankField.Max, label: 'Stärkste Rolle' }, + { value: PeerRankField.Bridger, label: tagLabel(MultiplierTag.Bridger) }, + { value: PeerRankField.Mentor, label: tagLabel(MultiplierTag.Mentor) }, + { value: PeerRankField.Amplifier, label: tagLabel(MultiplierTag.Amplifier) }, + ]; + + constructor() { + effect(() => { + this.nameDraft.set(this.queryParams().get('name') ?? ''); + this.minPeerRankDraft.set(this.appliedMinPeerRank()); + }, { allowSignalWrites: true }); + } + + private readonly nameTemplate = + viewChild.required>('nameTemplate'); + private readonly rolesTemplate = + viewChild.required>('rolesTemplate'); + private readonly tagsTemplate = + viewChild.required>('tagsTemplate'); + private readonly maxTemplate = + viewChild.required>('maxTemplate'); + private readonly actionTemplate = + viewChild.required>('actionTemplate'); + + readonly rows = computed(() => + (this.researchers().elements ?? []).map((researcher) => ({ + researcher, + name: researcher.display_name ?? researcher.author_id, + careerBucket: researcher.career_bucket ?? '–', + activeYears: researcher.active_years ?? 0, + nWorks: researcher.n_works ?? 0, + tags: researcher.tags ?? [], + max: researcher.max_multiplier_peer_rank ?? 0, + })), + ); + + readonly columns = computed[]>(() => [ + { + id: 'name', + header: 'Forschende:r', + type: 'display', + cellTemplate: this.nameTemplate(), + }, + { + id: 'roles', + header: 'Multiplikator-Rollen', + type: 'display', + cellTemplate: this.rolesTemplate(), + }, + { + id: 'tags', + header: 'Badges', + type: 'display', + cellTemplate: this.tagsTemplate(), + }, + { + id: ResearcherSortBy.Max, + header: 'Stärkster Rang', + type: 'accessor', + accessorKey: 'max', + cellTemplate: this.maxTemplate(), + }, + { + id: 'network', + header: '', + type: 'display', + cellTemplate: this.actionTemplate(), + }, + ]); + + readonly formatPercent = (value: number): string => `${value}%`; + readonly fmtInt = fmtInt; + readonly fmtSubScore = fmtSubScore; + readonly tagLabel = tagLabel; + readonly tagDescription = tagDescription; + + onNameInput(event: Event): void { + this.nameDraft.set((event.target as HTMLInputElement).value); + } + + onMinRankInput(value: number): void { + this.minPeerRankDraft.set(value); + } + + onFilterCommit(): void { + const rank = this.minPeerRankDraft(); + void this.router.navigate([], { + relativeTo: this.route, + queryParams: { + name: this.nameDraft().trim() || null, + minPeerRank: rank > 0 ? rank / 100 : null, + peerRankField: this.selectedPeerRankField() || PeerRankField.Max, + page: 0, + }, + queryParamsHandling: 'merge', + }); + } + + onTagsChange(values: string[]): void { + void this.router.navigate([], { + relativeTo: this.route, + queryParams: { tag: values.length ? values : null, page: 0 }, + queryParamsHandling: 'merge', + }); + } + + onCareerBucketsChange(values: string[]): void { + void this.router.navigate([], { + relativeTo: this.route, + queryParams: { careerBucket: values.length ? values : null, page: 0 }, + queryParamsHandling: 'merge', + }); + } + + onPeerRankFieldChange(value: string): void { + void this.router.navigate([], { + relativeTo: this.route, + queryParams: { peerRankField: value, page: 0 }, + queryParamsHandling: 'merge', + }); + } + + openNetwork(row: MultiplierRow): void { + void this.router.navigate(['/founders', row.researcher.author_id]); + } + + clearFilters(): void { + void this.router.navigate([], { + relativeTo: this.route, + queryParams: { + tag: null, + careerBucket: null, + name: null, + minPeerRank: null, + peerRankField: PeerRankField.Max, + suspiciousProfile: null, + page: 0, + }, + queryParamsHandling: 'merge', + }); + } +} + +function toNumber(value: string | null): number | null { + if (value === null || value === '') return null; + const parsed = Number(value); + return Number.isFinite(parsed) && parsed >= 0 && parsed <= 1 ? parsed : null; +} diff --git a/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.html b/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.html index 319187b2..f451e1ee 100644 --- a/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.html +++ b/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.html @@ -1,4 +1,9 @@
+ + {{ ARROW_BACK_ICON }} + Zurück zu den Multiplikatoren + + @if (unavailable(); as empty) { @@ -8,16 +13,16 @@ @if (empty.hint) {

{{ empty.hint }}

} - +
} @else {

- Smart-Guide · Multiplikator-Detektion · {{ universityName() }} + Smart-Guide · Multiplikatoren · {{ universityName() }}

{{ name() }}

@@ -27,15 +32,15 @@ [activeYears]="activeYears()" size="md" /> } - {{ fmtInt(nWorks()) }} Publikationen · - {{ fmtInt(activeYears()) }} aktive Jahre + + {{ fmtInt(nWorks()) }} Publikationen · + {{ fmtInt(activeYears()) }} aktive Jahre + @if (suspicious()) { - {{ WARNING_ICON }} Zusammengeführtes - Profil + + {{ WARNING_ICON }} + Zusammengeführtes Profil · Daten vorsichtig interpretieren + }
@if (tags().length) { @@ -52,6 +57,24 @@ }
+ +

+ Für das Diagramm werden Koautor:innen-Paare aus Publikationen zu einem + gewichteten Netzwerk verbunden. Arbeiten mit mehr als 50 Autor:innen + werden nur aus dem Graphen ausgeschlossen (sie zählen weiterhin für + Publikations- und Karrierewerte); ältere Kanten werden mit 0,8 pro Jahr + abgewichtet. Gezeigt werden bis zu 42 starke Koautor:innen, wobei + Nachwuchs-Koautor:innen bevorzugt aufgenommen werden. +

+

+ Die drei Rollen-Scores sind gewichtete Mittel von Metrik-Perzentilen + gegenüber Forschenden derselben Karrierestufe an der + {{ universityName() }}. Ein Score von 85 % ist + damit ein relativer Peer-Rang, kein kausaler Nachweis. Die Badges + markieren Rollen-Scores ab 85 %. +

+
+
@for (entry of roleLegend(); track entry.role) { @@ -62,13 +85,14 @@ {{ entry.label }} } - Kollaboration (Breite = Stärke) - überwiegend - institutionsübergreifend + + + Kollaboration (Breite = Stärke) + + + + überwiegend institutionsübergreifend + Knotengröße = aktive Jahre
@@ -88,143 +112,61 @@
Kein Netzwerk verfügbar.
}
- {{ fmtInt(netMeta().shown) }} der + {{ fmtInt(netMeta().shown) }} von {{ fmtInt(netMeta().totalCoauthors) }} Koautor:innen dargestellt · - {{ fmtInt(netMeta().cohortCoauthors) }} aus der UDE-Kohorte · - {{ fmtInt(netMeta().mentees) }} Mentees + {{ fmtInt(netMeta().cohortCoauthors) }} aus der + Universitätskohorte · {{ fmtInt(netMeta().mentees) }} Mentees
-
-
-

Multiplikator-Scores

-

- Rang gegen Peers dieser Universität, gleiche Karrierestufe. - Schwelle: 85. -

- @for (s of subScores(); track s.key) { - - } -
+
+

Multiplikator-Rollen

+

+ Peer-Rang innerhalb derselben Karrierestufe. Die gestrichelte + Markierung zeigt die Badge-Schwelle von 85 %. +

+ +
-
-

Gründungspotenzial

-

- Rang gegen ~9.000 Wissenschaftler:innen an anderen - Universitäten. -

- - - - - @if ( - founder().timingApplicable && founder().yearsToFounding !== null - ) { -

- @if ((founder().yearsToFounding ?? 0) <= 0) { - Das Aktivitätsmuster wirkt bereits gründungsbereit. - } @else { - Voraussichtlich in - {{ fmt1(founder().yearsToFounding) }} Jahren gründungsreif. - } -

- } -
- -
- Publikationen {{ fmtInt(facts().pubs) }} - Patente {{ fmtInt(facts().patents) }} - Industrie-Publikationen - {{ fmtInt(facts().industry) }} - Förderungen {{ fmtInt(facts().grants) }} - aktive Jahre {{ fmtInt(facts().activeYears) }} -
- -
-

Metriken im Detail

-

- Jeder Rohwert steht neben seinem Peer-Rang (0–1), damit - nachvollziehbar bleibt, warum eine Person so eingestuft wurde. -

-
- - - - - - - - - - - - - - - - - - -
Metrik{{ row.label }}Wert - {{ fmtMetricValue(row.metric.raw) }} - - Peer-Rang - - {{ fmtPeerRank(row.metric.peer_rank) }} -
-
-
-
+
+

Metriken im Detail

+

+ Rohwerte und zugehörige Peer-Ränge zeigen, welche Netzwerk- und + Kooperationssignale in die Rollen-Scores einfließen. +

+ +
- Konfiguration + Netzwerk-Konfiguration {{ network()?.config_hash ?? '–' }} · berechnet - am - {{ - network()?.computed_at | date: 'dd.MM.yyyy HH:mm' - }} + {{ network()?.computed_at | date: 'dd.MM.yyyy HH:mm' }}
} + + + {{ row.label }} + + + + {{ fmtMetricValue(row.metric.raw) }} + + + + + {{ fmtPeerRank(row.metric.peer_rank) }} + + diff --git a/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.scss b/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.scss index 8cfa7d8b..ce199262 100644 --- a/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.scss +++ b/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.scss @@ -159,15 +159,13 @@ .panel { display: flex; flex-direction: column; - gap: 22px; + gap: 12px; - h3 { - font-size: 11px; - letter-spacing: 0.12em; - text-transform: uppercase; - color: var(--sg-text-soft); - margin: 0 0 8px; - font-weight: 600; + h2 { + margin: 0; + color: var(--sg-text); + font-size: 17px; + font-weight: 650; } } @@ -178,65 +176,25 @@ line-height: 1.45; } -.timing-note { - font-size: 12.5px; - color: var(--sg-success); - margin: 2px 0 0; -} - -.facts { - display: flex; - flex-wrap: wrap; - gap: 7px; - - b { - color: var(--sg-text); - font-variant-numeric: tabular-nums; - } -} - .metrics { min-width: 0; -} + margin-top: 24px; -.scroller { - overflow-x: auto; -} - -table.mx { - width: 100%; - background: transparent; - font-size: 12px; - - .mat-mdc-header-cell { - padding: 0 7px; - height: 20px; - color: var(--sg-text-soft); - font-weight: 600; - font-size: 11px; - text-transform: uppercase; - letter-spacing: 0.06em; - } - - .mat-mdc-cell { - color: var(--sg-text-muted); - vertical-align: middle; - line-height: 1.2; - } - .mat-mdc-row { - height: 25px; - } - - .num { - text-align: right; - font-variant-numeric: tabular-nums; + h2 { + margin: 0 0 6px; color: var(--sg-text); - white-space: nowrap; + font-size: 17px; + } +} - &.hot { - font-weight: 700; - color: var(--sg-success); - } +.num { + font-variant-numeric: tabular-nums; + color: var(--sg-text); + white-space: nowrap; + + &.hot { + font-weight: 700; + color: var(--sg-success); } } diff --git a/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.ts b/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.ts index 097477ea..2e7bc872 100644 --- a/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.ts +++ b/webapp/src/app/modules/founder-potential/researcher-network/researcher-network.component.ts @@ -1,44 +1,36 @@ -import { Component, computed, inject, input } from '@angular/core'; +import { Component, computed, inject, input, TemplateRef, viewChild } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { NavigationEnd, Router, RouterModule } from '@angular/router'; +import { Router, RouterModule } from '@angular/router'; import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; -import { MatTableModule } from '@angular/material/table'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { pipe } from 'rxjs'; +import { MetricValue, ResearcherMetrics } from '../../../api'; import { METRIC_DEFS, - fmt1, fmtInt, fmtMetricValue, fmtPeerRank, - fmtSubScore, tagDescription, tagLabel, } from '../founder-potential.utils'; -import { MetricValue, ResearcherMetrics } from '../../../api'; import { ResearcherPageState } from '../../../resolvers/multiplier-researcher-page.resolver'; import { MULTIPLIER_ROLE_LABELS, multiplierRoleColor, MultiplierNetworkGraphComponent, } from '../../../shared/ui/multiplier-network-graph/multiplier-network-graph.component'; -import { ScoreBarComponent } from '../../../shared/ui/score-bar/score-bar.component'; +import { DataTableComponent, GenericColumn } from '../../../shared/ui/data-table/data-table.component'; import { CareerStageChipComponent } from '../../../shared/ui/career-stage-chip/career-stage-chip.component'; import { ChipComponent } from '../../../shared/ui/chip/chip.component'; +import { MethodologyNoteComponent } from '../../../shared/ui/methodology-note/methodology-note.component'; +import { MultiplierRoleScoresComponent } from '../../../shared/ui/multiplier-role-scores/multiplier-role-scores.component'; import { ChartThemeService } from '../../../shared/services/chart-theme.service'; import { CredentialService } from '../../../shared/services/credential.service'; -import { - ARROW_BACK_ICON, - PERSON_OFF_ICON, - WARNING_ICON, -} from '../../../shared/ui/icons'; -import { filter } from 'rxjs/operators'; -const TAG_THRESHOLD = 0.85; +import { ARROW_BACK_ICON, PERSON_OFF_ICON, WARNING_ICON } from '../../../shared/ui/icons'; + const ROLE_ORDER = ['ego', 'cohort', 'mentee', 'industry', 'external']; -const SUB_SCORE_KEYS = ['bridger', 'mentor', 'amplifier'] as const; const FALLBACK_UNIVERSITY = 'Universität Duisburg-Essen'; interface UnavailableView { @@ -47,7 +39,6 @@ interface UnavailableView { hint: string | null; } -/** A metric definition paired with the API's own raw/peer-rank block. */ interface MetricRow { key: keyof ResearcherMetrics; label: string; @@ -63,33 +54,22 @@ interface MetricRow { MatButtonModule, MatCardModule, MatIconModule, - MatTableModule, MatTooltipModule, + DataTableComponent, MultiplierNetworkGraphComponent, - ScoreBarComponent, CareerStageChipComponent, ChipComponent, + MethodologyNoteComponent, + MultiplierRoleScoresComponent, ], templateUrl: './researcher-network.component.html', styleUrl: './researcher-network.component.scss', }) export class ResearcherNetworkComponent { - constructor() { - this.router.events - .pipe(filter((event: any) => event instanceof NavigationEnd)) - .subscribe(() => { - document.body.scrollTo({ - top: 0, - behavior: 'smooth', - }); - }); - } - readonly ARROW_BACK_ICON = ARROW_BACK_ICON; readonly WARNING_ICON = WARNING_ICON; readonly PERSON_OFF_ICON = PERSON_OFF_ICON; - /** Resolved detail + network, or the backend's explanation why they are missing. */ readonly page = input.required(); private readonly router = inject(Router); @@ -114,26 +94,25 @@ export class ResearcherNetworkComponent { const university = this.universityName(); const who = page.displayName ?? 'diese Person'; - if (page.reason === 'OTHER_INSTITUTION') { return { - title: 'Kein Gründungspotenzial für diese Universität', - body: `Für ${who} wurde kein Gründungspotenzial für die ${university} berechnet.`, + title: 'Keine Multiplikator-Daten für diese Universität', + body: `Für ${who} wurde an der ${university} keine Multiplikator-Auswertung erstellt.`, hint: page.authorInstitution - ? `Die Person ist aktuell der Einrichtung „${page.authorInstitution}“ zugeordnet, nicht der ${university}.` + ? `Die Person ist aktuell der Einrichtung „${page.authorInstitution}“ zugeordnet.` : `Die Person ist keiner Einrichtung der ${university} zugeordnet.`, }; } if (page.reason === 'NOT_INDEXED') { return { - title: 'Noch keine berechneten Daten', - body: `Für ${who} wurde noch kein Gründungspotenzial berechnet.`, + title: 'Noch keine Multiplikator-Daten', + body: `Für ${who} wurden noch keine Multiplikator-Scores berechnet.`, hint: `Die Person gehört zur ${university}, ist aber noch nicht in der Auswertung enthalten.`, }; } return { - title: 'Keine Daten zu dieser Person', - body: 'Zu dieser Person liegen keine berechneten Daten vor.', + title: 'Keine Multiplikator-Daten zu dieser Person', + body: 'Zu dieser Person liegen keine berechneten Multiplikator-Daten vor.', hint: null, }; }); @@ -145,70 +124,59 @@ export class ResearcherNetworkComponent { this.researcher()?.author_id ?? 'Unbekannt', ); - - readonly careerBucket = computed( - () => this.researcher()?.career_bucket ?? null, - ); + readonly careerBucket = computed(() => this.researcher()?.career_bucket ?? null); readonly activeYears = computed(() => this.researcher()?.active_years ?? 0); readonly nWorks = computed(() => this.researcher()?.n_works ?? 0); - readonly suspicious = computed( - () => this.researcher()?.suspicious_profile ?? false, - ); - + readonly suspicious = computed(() => this.researcher()?.suspicious_profile ?? false); readonly tags = computed(() => this.researcher()?.tags ?? []); - - readonly subScores = computed(() => { - const pr = this.researcher()?.multiplier_peer_ranks; - return SUB_SCORE_KEYS.map((key) => ({ - key, - label: tagLabel(key), - hint: tagDescription(key), - value: pr?.[key] ?? 0, - })); - }); - - readonly founder = computed(() => { - const fp = this.researcher()?.founder_potential; - return { - score: fp?.external_percentile ?? null, - within1: fp?.external_percentile_within_1y ?? null, - within3: fp?.external_percentile_within_3y ?? null, - within5: fp?.external_percentile_within_5y ?? null, - yearsToFounding: fp?.timing?.years_to_founding ?? null, - timingApplicable: fp?.timing_applicable ?? false, - }; - }); - - readonly facts = computed(() => { - const ff = this.researcher()?.founder_features; - return { - pubs: ff?.publications ?? 0, - patents: ff?.patents ?? 0, - industry: ff?.industry_collab_papers ?? 0, - grants: ff?.grants ?? 0, - activeYears: this.activeYears(), - }; - }); + readonly tagLabel = tagLabel; + readonly tagDescription = tagDescription; readonly netMeta = computed(() => { - const n = this.network(); + const network = this.network(); return { - totalCoauthors: n?.total_coauthors ?? 0, - cohortCoauthors: n?.cohort_coauthors ?? 0, - mentees: n?.mentee_count ?? 0, - shown: n?.shown ?? 0, + totalCoauthors: network?.total_coauthors ?? 0, + cohortCoauthors: network?.cohort_coauthors ?? 0, + mentees: network?.mentee_count ?? 0, + shown: network?.shown ?? 0, }; }); + private readonly metricTemplate = + viewChild.required>('metricTemplate'); + private readonly metricValueTemplate = + viewChild.required>('metricValueTemplate'); + private readonly metricRankTemplate = + viewChild.required>('metricRankTemplate'); + readonly metricRows = computed(() => - METRIC_DEFS.map((def) => ({ - key: def.key, - label: def.label, - metric: this.researcher()?.metrics?.[def.key] ?? {}, + METRIC_DEFS.map((definition) => ({ + key: definition.key, + label: definition.label, + metric: this.researcher()?.metrics?.[definition.key] ?? {}, })), ); - readonly displayedMetricColumns = ['metric', 'value', 'rank']; + readonly metricColumns = computed[]>(() => [ + { + id: 'metric', + header: 'Metrik', + type: 'display', + cellTemplate: this.metricTemplate(), + }, + { + id: 'value', + header: 'Wert', + type: 'display', + cellTemplate: this.metricValueTemplate(), + }, + { + id: 'rank', + header: 'Peer-Rang', + type: 'display', + cellTemplate: this.metricRankTemplate(), + }, + ]); readonly roleLegend = computed(() => ROLE_ORDER.map((role) => ({ @@ -219,17 +187,14 @@ export class ResearcherNetworkComponent { ); onNodeClick(event: { id: string }): void { - if (event?.id) { - void this.router.navigate(['/person', event.id]); - } + if (event?.id) void this.router.navigate(['/person', event.id]); + } + + backToMultipliers(): void { + void this.router.navigate(['/multipliers']); } readonly fmtInt = fmtInt; - readonly fmt1 = fmt1; - readonly fmtSubScore = fmtSubScore; - readonly fmtPeerRank = fmtPeerRank; readonly fmtMetricValue = fmtMetricValue; - readonly tagLabel = tagLabel; - readonly tagDescription = tagDescription; - readonly tagThreshold = TAG_THRESHOLD * 100; + readonly fmtPeerRank = fmtPeerRank; } diff --git a/webapp/src/app/resolvers/multiplicator-researchers.resolver.ts b/webapp/src/app/resolvers/multiplicator-researchers.resolver.ts new file mode 100644 index 00000000..324f6f45 --- /dev/null +++ b/webapp/src/app/resolvers/multiplicator-researchers.resolver.ts @@ -0,0 +1,91 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; + +import { + CareerBucket, + MultiplierTag, + MultiplicatorsService, + PeerRankField, + ResearcherSortBy, + ResearcherSummaryPage, + SortDirection, +} from '../api'; + +const VALID_TAGS = Object.values(MultiplierTag); +const VALID_CAREER_BUCKETS = Object.values(CareerBucket); +const VALID_PEER_RANK_FIELDS = Object.values(PeerRankField); +const VALID_SORT_FIELDS = Object.values(ResearcherSortBy); + +/** + * Cohort-wide multiplier table, driven by URL params so filter, pagination, + * and sort changes re-query Elasticsearch on the server. + */ +export const multiplicatorResearchersResolver: ResolveFn = ( + route, +) => { + const service = inject(MultiplicatorsService); + const params = route.queryParamMap; + + const page = toInt(params.get('page'), 0); + const size = toInt(params.get('size'), 25); + const tags = validValues(params.getAll('tag'), VALID_TAGS); + const careerBuckets = validValues( + params.getAll('careerBucket'), + VALID_CAREER_BUCKETS, + ); + const minPeerRank = toNumber(params.get('minPeerRank')); + const peerRankField = validValue( + params.get('peerRankField'), + VALID_PEER_RANK_FIELDS, + PeerRankField.Max, + ); + const name = params.get('name')?.trim() || undefined; + const sortBy = validValue( + params.get('sortBy'), + VALID_SORT_FIELDS, + ResearcherSortBy.Max, + ); + const sortOrder = params.get('sortOrder') === SortDirection.Asc + ? SortDirection.Asc + : SortDirection.Desc; + const suspiciousRaw = params.get('suspiciousProfile'); + const suspiciousProfile = + suspiciousRaw === 'true' ? true : suspiciousRaw === 'false' ? false : undefined; + + return service.searchMultiplicatorResearchers( + page, + size, + tags.length ? tags : undefined, + careerBuckets.length ? careerBuckets : undefined, + minPeerRank ?? undefined, + peerRankField, + suspiciousProfile, + name, + sortBy, + sortOrder, + ); +}; + +function toInt(value: string | null, fallback: number): number { + if (!value) return fallback; + const parsed = Number.parseInt(value, 10); + return Number.isFinite(parsed) && parsed >= 0 ? parsed : fallback; +} + +function toNumber(value: string | null): number | null { + if (value === null || value === '') return null; + const parsed = Number(value); + return Number.isFinite(parsed) && parsed >= 0 && parsed <= 1 ? parsed : null; +} + +function validValues(values: string[], valid: readonly T[]): T[] { + return values.filter((value): value is T => valid.includes(value as T)); +} + +function validValue( + value: string | null, + valid: readonly T[], + fallback: T, +): T { + return value && valid.includes(value as T) ? (value as T) : fallback; +} diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts index 0c478cb4..9862db54 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts @@ -32,6 +32,7 @@ import { LOGOUT_ICON, MANAGE_ACCOUNTS_ICON, NEWS_ICON, + NETWORK_ICON, ORGANIZATIONS_ICON, PATENT_ICON, PERSONS_ICON, @@ -100,12 +101,18 @@ export class AppMenuComponent { isItemActive(item: NavItem): boolean { const path = this.currentPath(); + // `/founders/:authorId` is the multiplier-network detail route. Do not + // highlight the founder-potential dashboard for that path. + if (item.route === '/founders' && path.startsWith('/founders/')) { + return false; + } + if ((item.detailRoutePrefixes ?? []).some((prefix) => path.startsWith(prefix))) { + return true; + } if (path === item.route || path.startsWith(`${item.route}/`)) { return true; } - return (item.detailRoutePrefixes ?? []).some((prefix) => - path.startsWith(prefix), - ); + return false; } readonly navItems = computed(() => { @@ -116,14 +123,6 @@ export class AppMenuComponent { route: '/dashboard', disabled: false, }, - { - label: 'Gründungspotenzial', - icon: FOUNDER_ICON, - route: '/founders', - disabled: false, - queryParams: { threshold: 90, screened: 'true', page: 0, size: 25 }, - detailRoutePrefixes: ['/founders/'], - }, { label: 'Personen', icon: PERSONS_ICON, @@ -225,6 +224,27 @@ export class AppMenuComponent { route: '/hierarchy', disabled: false, }, + { + label: 'Gründungspotenzial', + icon: FOUNDER_ICON, + route: '/founders', + disabled: false, + queryParams: { threshold: 90, screened: 'true', page: 0, size: 25 }, + }, + { + label: 'Multiplikatoren', + icon: NETWORK_ICON, + route: '/multipliers', + disabled: false, + queryParams: { + page: 0, + size: 25, + sortBy: 'max', + sortOrder: 'desc', + peerRankField: 'max', + }, + detailRoutePrefixes: ['/founders/'], + }, { label: 'Accounts', icon: MANAGE_ACCOUNTS_ICON, diff --git a/webapp/src/app/shared/ui/methodology-note/methodology-note.component.html b/webapp/src/app/shared/ui/methodology-note/methodology-note.component.html new file mode 100644 index 00000000..89d8c91b --- /dev/null +++ b/webapp/src/app/shared/ui/methodology-note/methodology-note.component.html @@ -0,0 +1,12 @@ + + + + info + Datenbasis & Methodik + + Wie diese Ergebnisse entstanden sind + +
+ +
+
diff --git a/webapp/src/app/shared/ui/methodology-note/methodology-note.component.scss b/webapp/src/app/shared/ui/methodology-note/methodology-note.component.scss new file mode 100644 index 00000000..6d5ce999 --- /dev/null +++ b/webapp/src/app/shared/ui/methodology-note/methodology-note.component.scss @@ -0,0 +1,64 @@ +:host { + display: block; + margin-top: 18px; +} + +.methodology-note { + background: var(--sg-surface-muted); + border: 1px solid var(--sg-border); + box-shadow: none; + + mat-panel-title { + align-items: center; + gap: 8px; + color: var(--sg-text); + font-size: 13px; + font-weight: 600; + } + + mat-panel-description { + color: var(--sg-text-soft); + font-size: 12px; + } + + mat-icon { + width: 18px; + height: 18px; + font-size: 18px; + color: var(--sg-blue-highlight); + } + + &__content { + color: var(--sg-text-muted); + font-size: 13px; + line-height: 1.55; + } +} + +:host ::ng-deep .methodology-note__content p { + margin: 0 0 10px; +} + +:host ::ng-deep .methodology-note__content p:last-child { + margin-bottom: 0; +} + +:host ::ng-deep .methodology-note__content ul { + margin: 8px 0 10px; + padding-left: 20px; +} + +:host ::ng-deep .methodology-note__content li + li { + margin-top: 4px; +} + +:host ::ng-deep .methodology-note__content strong { + color: var(--sg-text); + font-weight: 600; +} + +@media (max-width: 700px) { + .methodology-note mat-panel-description { + display: none; + } +} diff --git a/webapp/src/app/shared/ui/methodology-note/methodology-note.component.ts b/webapp/src/app/shared/ui/methodology-note/methodology-note.component.ts new file mode 100644 index 00000000..355294c6 --- /dev/null +++ b/webapp/src/app/shared/ui/methodology-note/methodology-note.component.ts @@ -0,0 +1,13 @@ +import { Component } from '@angular/core'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { MatIconModule } from '@angular/material/icon'; + +/** A consistent, collapsible methodology note used by data-heavy views. */ +@Component({ + selector: 'app-methodology-note', + standalone: true, + imports: [MatExpansionModule, MatIconModule], + templateUrl: './methodology-note.component.html', + styleUrl: './methodology-note.component.scss', +}) +export class MethodologyNoteComponent {} diff --git a/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-labels.ts b/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-labels.ts new file mode 100644 index 00000000..6c2462ed --- /dev/null +++ b/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-labels.ts @@ -0,0 +1,24 @@ +/** Stable role names used by the multiplier model. */ +export const MULTIPLIER_TAG_LABELS: Record = { + bridger: 'Bridger', + mentor: 'Mentor', + amplifier: 'Amplifier', +}; + +/** Coach-facing descriptions for the three multiplier archetypes. */ +export const MULTIPLIER_TAG_DESCRIPTIONS: Record = { + bridger: + 'Verbindet Forschungsgruppen, Fachgebiete oder Institutionen, die sonst wenig zusammenarbeiten.', + mentor: + 'Publiziert mit Nachwuchsforschenden und zeigt Signale für deren Förderung und Entwicklung.', + amplifier: + 'Trägt Wissen über Industriekooperationen, Patente, EU-Projekte und Medienresonanz nach außen.', +}; + +export function multiplierTagLabel(tag: string): string { + return MULTIPLIER_TAG_LABELS[tag] ?? tag; +} + +export function multiplierTagDescription(tag: string): string { + return MULTIPLIER_TAG_DESCRIPTIONS[tag] ?? MULTIPLIER_TAG_LABELS[tag] ?? tag; +} diff --git a/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.html b/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.html new file mode 100644 index 00000000..7e6095d8 --- /dev/null +++ b/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.html @@ -0,0 +1,25 @@ +@if (presentation() === 'compact') { +
+ @for (role of roles(); track role.key) { + + {{ role.label }} {{ role.display }} + + } +
+} @else { +
+ @for (role of roles(); track role.key) { + + } +
+} diff --git a/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.scss b/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.scss new file mode 100644 index 00000000..72f126e6 --- /dev/null +++ b/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.scss @@ -0,0 +1,21 @@ +.role-scores { + &--compact { + display: flex; + flex-wrap: wrap; + gap: 5px; + align-items: center; + font-size: 11px; + + b { + color: var(--sg-text); + font-variant-numeric: tabular-nums; + margin-left: 3px; + } + } + + &--detailed { + display: flex; + flex-direction: column; + gap: 2px; + } +} diff --git a/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.ts b/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.ts new file mode 100644 index 00000000..b002d53f --- /dev/null +++ b/webapp/src/app/shared/ui/multiplier-role-scores/multiplier-role-scores.component.ts @@ -0,0 +1,45 @@ +import { Component, computed, input } from '@angular/core'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { MultiplierPeerRanks } from '../../../api'; +import { ChipComponent } from '../chip/chip.component'; +import { ScoreBarComponent } from '../score-bar/score-bar.component'; +import { + multiplierTagDescription, + multiplierTagLabel, +} from './multiplier-role-labels'; + +const ROLE_KEYS = ['bridger', 'mentor', 'amplifier'] as const; + +/** Reusable compact or detailed rendering of the three multiplier roles. */ +@Component({ + selector: 'app-multiplier-role-scores', + standalone: true, + imports: [MatTooltipModule, ChipComponent, ScoreBarComponent], + templateUrl: './multiplier-role-scores.component.html', + styleUrl: './multiplier-role-scores.component.scss', +}) +export class MultiplierRoleScoresComponent { + readonly scores = input(null); + readonly presentation = input<'compact' | 'detailed'>('detailed'); + readonly showThreshold = input(false); + + readonly roles = computed(() => + ROLE_KEYS.map((key) => ({ + key, + label: multiplierTagLabel(key), + hint: multiplierTagDescription(key), + value: this.scores()?.[key] ?? 0, + display: formatScore(this.scores()?.[key] ?? 0), + })), + ); + + readonly threshold = 85; +} + +function formatScore(value: number): string { + return `${(value * 100).toLocaleString('de-DE', { + minimumFractionDigits: 1, + maximumFractionDigits: 1, + })} %`; +}