diff --git a/service/src/main/inse/logic.py b/service/src/main/inse/logic.py index 03706004..d98c878f 100644 --- a/service/src/main/inse/logic.py +++ b/service/src/main/inse/logic.py @@ -152,7 +152,8 @@ def get_topics_from_cache(topic_names: List[str]) -> List[model.Topic]: continue topics.append(model.Topic( id=data.get("topic_id", ""), - name=name, + display_name=name, + count=data.get("count", 1), subfield=data.get("subfield", ""), field=data.get("field", ""), domain=data.get("domain", "") diff --git a/service/src/main/inse/model.py b/service/src/main/inse/model.py index b9ddf38b..6c798a1c 100644 --- a/service/src/main/inse/model.py +++ b/service/src/main/inse/model.py @@ -38,11 +38,15 @@ class ItemPage(Page[Item]): class Topic(BaseModel): id: str = Field(description="The openalex topic id.") - name: str = Field(description="The topic name.") + display_name: str = Field(description="The topic name.") + count: int = Field(description="The number of works associated with the topic.") subfield: str = Field(description="The subfield of the topic.") field: str = Field(description="The field of the topic.") domain: str = Field(description="The domain of the topic.") +class TopicShare(Topic): + count: float = Field(description="Share value (0..1) for this topic.") + class PersonBio(BaseModel): bio: str = Field(description="The generated biography.") diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.html b/webapp/src/app/modules/person-interesting/person-interesting.component.html new file mode 100644 index 00000000..7f79895c --- /dev/null +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.html @@ -0,0 +1,12 @@ + diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.scss b/webapp/src/app/modules/person-interesting/person-interesting.component.scss new file mode 100644 index 00000000..e80f1d41 --- /dev/null +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.scss @@ -0,0 +1,59 @@ +:host { + display: block; +} + +.interest-card { + align-self: center; + padding: 24px 28px; + border-radius: var(--sg-radius-sm); + background: var(--sg-surface-muted); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); +} + +.interest-card h3 { + margin: 0 0 18px; + font-size: 14px; + font-weight: 700; +} + +.interest-tags { + display: flex; + flex-wrap: wrap; + gap: 12px; +} + +.interest-tag-button { + padding: 9px 16px; + border: 1px solid #a8c0ff; + border-radius: 7px; + background: #ffffff; + color: var(--sg-primary); + font-size: 13px; + font-weight: 600; + cursor: pointer; + outline: none; + transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease; + + &:hover { + background-color: var(--sg-primary-light, #f0f4ff); + border-color: var(--sg-primary); + } + + &:active { + transform: scale(0.96); + } + + &:focus-visible { + box-shadow: 0 0 0 2px var(--sg-primary-light, #f0f4ff), 0 0 0 4px var(--sg-primary); + } +} + +.interest-tags .interest-empty { + padding: 9px 16px; + border: 1px solid #e2e8f0; + border-style: dashed; + border-radius: 7px; + color: var(--sg-text-muted); + font-size: 13px; + font-weight: 600; +} diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.spec.ts b/webapp/src/app/modules/person-interesting/person-interesting.component.spec.ts new file mode 100644 index 00000000..bb382718 --- /dev/null +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PersonInterestingComponent } from './person-interesting.component'; + +describe('PersonInterestingComponent', () => { + let component: PersonInterestingComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [PersonInterestingComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(PersonInterestingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.ts b/webapp/src/app/modules/person-interesting/person-interesting.component.ts new file mode 100644 index 00000000..763f810b --- /dev/null +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.ts @@ -0,0 +1,36 @@ +import { Component, input, computed } from '@angular/core'; + +import { Topic } from '../../api'; + +interface InterestTag { + label: string; + score: number; +} + +@Component({ + selector: 'app-person-interesting', + imports: [], + templateUrl: './person-interesting.component.html', + styleUrl: './person-interesting.component.scss', +}) +export class PersonInterestingComponent { + readonly topics = input(null); + + readonly tags = computed(() => { + const topicsList = this.topics() ?? []; + const grouped = new Map(); + + for (const topic of topicsList) { + const label = (topic.subfield?.display_name ?? '').trim(); + if (!label) continue; + + const score = typeof topic.score === 'number' ? topic.score : 0; + grouped.set(label, (grouped.get(label) ?? 0) + score); + } + + return Array.from(grouped.entries()) + .map(([label, score]) => ({ label, score })) + .sort((a, b) => b.score - a.score) + .slice(0, 8); + }); +} diff --git a/webapp/src/app/modules/person/person.component.html b/webapp/src/app/modules/person/person.component.html index a937e2a5..0378513a 100644 --- a/webapp/src/app/modules/person/person.component.html +++ b/webapp/src/app/modules/person/person.component.html @@ -1,41 +1,56 @@
-
AB
+
{{ initials() }}
- Prof. Dr. -

Anna Becker

+ Person +

{{ displayName() }}

-

Universität Duisburg-Essen

- Fakultät für Ingenieurwissenschaften - Lehrstuhl für Datenanalyse +

{{ institution() }}

+ @if (countryCode()) { + {{ countryCode() }} + } + @if (worksCount() !== null || citedByCount() !== null) { + + @if (worksCount() !== null) { + {{ worksCount() }} Publikationen + } + @if (worksCount() !== null && citedByCount() !== null) { + · + } + @if (citedByCount() !== null) { + {{ citedByCount() }} Zitationen + } + + }
mail anna.becker@uni-due.de
-
- verified - 0000-0002-1234-5678 -
+ @if (openAlexId()) { +
+ person + {{ openAlexId() }} +
+ } + @if (orcid()) { +
+ verified + {{ orcid() }} +
+ }
- +