Compare commits

...
Author SHA1 Message Date
Kazgatari 767f532e6f removed old unused components
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-23 17:15:56 +02:00
Kazgatari a21d5eaea4 changed other hardcoded icon values to variables 2026-08-23 17:06:20 +02:00
Kazgatari d8de0c2156 changed person-card to use global institution chip
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-23 16:46:37 +02:00
genja ba1c53b642 Merge pull request 'feature/keywords-analysis' (#299) from feature/keywords-analysis into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #299
2026-08-23 11:10:45 +02:00
genja ef00947786 disabled search button while new keyword is being added
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-23 11:03:46 +02:00
genja 9a4a4de379 prevented mouse event propagation in project tables 2026-08-23 11:00:21 +02:00
genja 04e3f97b8b prevented mouse event propagation for chips and togglers 2026-08-23 10:59:36 +02:00
genja 2bf8e03117 Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis 2026-08-23 10:28:25 +02:00
tischer 1219970ba8 Merge pull request 'refactor/bio' (#298) from refactor/bio into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #298
2026-08-22 17:08:55 +02:00
Steven Tischer 5c50c29760 fix build: ensure client is closed after API calls
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-22 17:03:34 +02:00
Steven Tischer 5343c3204d execute pipeline
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit
2026-08-22 16:48:55 +02:00
Steven Tischer 613640a730 add AI-generated badge to bio
LocationBasedServices/smartguide/pipeline/head There was a failure building this commit
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit
2026-08-22 16:41:28 +02:00
Steven Tischer 3147de9fcb improve error handling in bio generation and update tests 2026-08-22 16:20:36 +02:00
Steven Tischer 7d3792c7b4 fix: update parameter documentation to use 'examples' instead of 'example'
LocationBasedServices/smartguide/pipeline/head There was a failure building this commit
2026-08-22 14:14:17 +02:00
Steven Tischer eb5d6830a5 test: add tests for person bio generation 2026-08-22 14:12:03 +02:00
Steven Tischer 7da36d8777 remove unused 'include' parameter 2026-08-22 14:04:03 +02:00
Steven Tischer 21482f3c6f refactor: move bio logic to a separate module 2026-08-22 13:59:29 +02:00
tischer b772b100d5 Merge pull request 'feat/ranking' (#296) from feat/ranking into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #296
2026-08-22 13:39:52 +02:00
Steven Tischer bbce780609 fix: update toggleSelect to select only 4 authors
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-22 13:34:47 +02:00
Steven Tischer d719a34ab0 add fuzzy search logic and remove some stats from compare page
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-22 13:08:59 +02:00
Steven Tischer 57d0daa21b enable fuzzy search button 2026-08-22 09:35:55 +02:00
kuzko 1ca3db5c78 Merge pull request 'refactor/icons' (#295) from refactor/icons into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #295
2026-08-18 20:17:52 +02:00
Kazgatari c85d3fa03f fix: bound routing link to signal to remove console error
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-18 20:07:57 +02:00
Kazgatari ffc02a4e59 fix: used set to deduplicate entries 2026-08-18 20:06:55 +02:00
Kazgatari 6c20dc2b58 added expandible toggle to associated institutions 2026-08-18 20:02:12 +02:00
Kazgatari 24cc476dbe implemented overview in institution and added guardrails for card to fetch new information if existing is incomplete 2026-08-18 19:56:56 +02:00
Kazgatari b2f55bd05a changed institutions to hold associated institution array 2026-08-18 19:55:48 +02:00
Kazgatari e153e2d74a Merge branch 'dev' of https://project.nes.uni-due.de/gitea/lbs/smartguide into refactor/icons 2026-08-18 18:27:38 +02:00
farajollahi 171b296c2a Merge pull request 'multi-organisations-statics' (#294) from multi-organisations-statics into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #294
2026-08-18 18:00:08 +02:00
Kazgatari 435c4ae3db added tooltip disable to undefined values for authors and institutions to avoid empty tooltips and links to undefined entities 2026-08-18 17:56:14 +02:00
Kazgatari ac6b5aa72b started with icon duplicate merge 2026-08-18 17:54:32 +02:00
genja e7269c6bd2 Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-18 11:18:21 +02:00
genja 5aff658c16 replaced the keywords search results navbar with generic navbar component 2026-08-18 11:16:30 +02:00
80 changed files with 2041 additions and 1352 deletions
@@ -29,12 +29,17 @@ async def get_institution_by_id(
raw_oa_institution_id=institution_id,
source=[
"id",
"ror",
"display_name",
"country_code",
"type",
"homepage_url",
"display_name_alternatives",
"works_count",
"cited_by_count",
"geo",
"summary_stats",
"associated_institutions",
],
)
@@ -43,6 +43,8 @@ async def call(
)
except APIConnectionError:
return "Etwas ist schiefgelaufen. Bitte versuche es später erneut."
finally:
await client.close()
return response.choices[0].message.content or (
"Etwas ist schiefgelaufen. Bitte versuche es erneut."
@@ -126,5 +128,7 @@ async def call_stream(
print(f"LLM streaming failed: {type(e).__name__}: {e}")
traceback.print_exc()
return ""
finally:
await client.close()
return full_content
@@ -25,6 +25,7 @@ from pydantic_core import to_jsonable_python
from inse.models.openalex.author_counts_by_year_inner import AuthorCountsByYearInner
from inse.models.openalex.author_summary_stats import AuthorSummaryStats
from inse.models.openalex.dehydrated_institution import DehydratedInstitution
from inse.models.openalex.institution_geo import InstitutionGeo
from inse.models.openalex.institution_ids import InstitutionIds
@@ -51,9 +52,10 @@ class Institution(BaseModel):
ids: InstitutionIds | None = None
counts_by_year: list[AuthorCountsByYearInner] | None = Field(default=None, description="`works_count` and `cited_by_count` for each of the last ten years.")
works_api_url: StrictStr | None = Field(default=None, description="A URL that will get you a list of all works affiliated with this institution.")
associated_institutions: list[DehydratedInstitution] | None = Field(default=None, description="Associated institutions list.")
created_date: date | None = Field(default=None, description="When this institution was added to OpenAlex (ISO 8601 date).")
updated_date: datetime | None = Field(default=None, description="When this institution was last updated (ISO 8601 datetime).")
__properties: ClassVar[list[str]] = ["id", "ror", "display_name", "country_code", "type", "homepage_url", "image_url", "image_thumbnail_url", "display_name_acronyms", "display_name_alternatives", "works_count", "cited_by_count", "summary_stats", "geo", "lineage", "ids", "counts_by_year", "works_api_url", "created_date", "updated_date"]
__properties: ClassVar[list[str]] = ["id", "ror", "display_name", "country_code", "type", "homepage_url", "image_url", "image_thumbnail_url", "display_name_acronyms", "display_name_alternatives", "works_count", "cited_by_count", "summary_stats", "geo", "lineage", "ids", "counts_by_year", "works_api_url", "associated_institutions", "created_date", "updated_date"]
@field_validator('type')
def type_validate_enum(cls, value):
@@ -151,6 +153,7 @@ class Institution(BaseModel):
"ids": InstitutionIds.from_dict(obj["ids"]) if obj.get("ids") is not None else None,
"counts_by_year": [AuthorCountsByYearInner.from_dict(_item) for _item in obj["counts_by_year"]] if obj.get("counts_by_year") is not None else None,
"works_api_url": obj.get("works_api_url"),
"associated_institutions": [DehydratedInstitution.from_dict(_item) for _item in obj["associated_institutions"]] if obj.get("associated_institutions") is not None else None,
"created_date": obj.get("created_date"),
"updated_date": obj.get("updated_date")
})
+1
View File
@@ -874,3 +874,4 @@ async def _related_search_terms(query_text: str) -> list:
terms.append(term)
return terms
+186
View File
@@ -0,0 +1,186 @@
"""
Bio generation for persons / authors.
"""
import json
import logging
import time
from pydantic import ValidationError
from inse.exceptions import NotFoundException, UpstreamAPIException
from inse.integrations import elasticsearch
from inse.model import ESIndex
from inse.persons.model import PersonBio
from .. import config
from ..integrations import llm
logger = logging.getLogger(__name__)
async def _fetch_author_display_name(author_id: str) -> str | None:
query = {
"query_string": {
"default_field": "_id",
"query": author_id,
}
}
response = await elasticsearch.search(
index=ESIndex.OPENALEX_AUTHORS,
query=query,
source=["display_name"],
)
hits = response.get("hits", {}).get("hits", [])
if not hits:
return None
return hits[0].get("_source", {}).get("display_name")
async def _fetch_works_and_topics(author_id: str) -> tuple[list, list]:
WORK_SOURCE_FIELDS = [
"title",
"display_name",
"abstract",
"cited_by_count",
"primary_topic",
]
author_url = f"https://openalex.org/{author_id.strip()}"
authorship_query = {
"nested": {
"path": "authorships",
"query": {
"bool": {
"filter": [{"term": {"authorships.author.id": author_url}}],
}
},
}
}
body = {
"size": 100,
"sort": [{"cited_by_count": {"order": "desc"}}],
"_source": WORK_SOURCE_FIELDS,
"query": authorship_query,
"aggs": {
"primary_topics": {
"terms": {"field": "primary_topic.id", "size": 5},
"aggs": {
"topic_name": {
"top_hits": {
"size": 1,
"_source": ["primary_topic.display_name"],
}
}
},
}
},
}
response = await elasticsearch.search(
index=config.settings.openalex_works_search_index,
body=body,
)
works = []
for hit in response.get("hits", {}).get("hits", []):
works.append(hit.get("_source", {}))
topics = []
buckets = (
response.get("aggregations", {}).get("primary_topics", {}).get("buckets", [])
)
for bucket in buckets:
topic_hits = bucket.get("topic_name", {}).get("hits", {}).get("hits", [])
display_name = None
if topic_hits:
primary_topic = topic_hits[0].get("_source", {}).get("primary_topic", {})
display_name = primary_topic.get("display_name")
topics.append(
{
"id": bucket.get("key"),
"display_name": display_name,
"count": bucket.get("doc_count"),
}
)
return works, topics
def _build_papers(works: list) -> list:
papers = []
for work in works:
name = work.get("title") or work.get("display_name")
abstract = work.get("abstract")
papers.append(
{
"name": name,
"abstract": abstract,
"stats": {
"cited_by_count": work.get("cited_by_count"),
},
}
)
return papers
async def get_data_for_bio(author_id: str) -> dict | None:
display_name = await _fetch_author_display_name(author_id)
if display_name is None:
return None
works, top_topics = await _fetch_works_and_topics(author_id)
papers = _build_papers(works)
author_data = {
"display_name": display_name,
"topics": top_topics,
"papers": papers,
}
return author_data
async def generate_person_bio(author_id: str) -> str:
start_time = time.time()
author_data = await get_data_for_bio(author_id)
if author_data is None:
raise NotFoundException(f"No person found for author ID {author_id}.")
person_json = json.dumps(author_data, ensure_ascii=False)
system_prompt = """\
Beschreibe in zwei Sätzen das Hauptforschungsfeld des Autors. Formuliere dabei allgemeinverständlich, sodass auch Personen ohne Fachwissen einen Einblick in die Forschung gewinnen. Nenne keine konkreten Publikationen oder Einzelwerke, sondern konzentriere dich auf die übergeordneten Forschungsinteressen und Themen. Verzichte auf bloße Aufzählungen und verbinde die Informationen zu einem flüssigen Text.
Beschreibe anschließend in ein bis zwei Sätzen die wirtschaftliche Relevanz der Forschung anhand von Anwendungen, Technologien oder Branchen, die davon profitieren könnten.
Verwende insgesamt maximal 100 bis 120 Wörter. Formuliere die Antwort so, dass sie ohne weitere Anpassungen direkt als Kurzbiografie verwendet werden kann. Verwende keine Superlative oder übertriebene Formulierungen, sondern bleibe sachlich und informativ. Gebe den Text als One-Liner zurück, ohne Zeilenumbrüche oder Aufzählungen. Verwende keine Gedankenstriche (– oder —) zur Gliederung von Sätzen. Formuliere stattdessen mit Kommas, Klammern oder zwei getrennten Sätzen.
Gib ausschließlich ein JSON-Objekt zurück, das den Text im Feld "bio" enthält.
"""
user_prompt = f"Daten zur Person:\n{person_json}"
response = await llm.call(
system_prompt=system_prompt,
user_prompt=user_prompt,
json_schema=PersonBio.model_json_schema(),
schema_name="bio",
temperature=0.8,
top_p=0.95,
)
try:
bio = PersonBio.model_validate_json(response).bio
except ValidationError as error:
logger.warning(
f"Bio generation for author {author_id} returned no valid bio: {response}"
)
raise UpstreamAPIException("Bio generation failed.") from error
elapsed_time = time.time() - start_time
logger.info(f"Bio generation for author {author_id} took {elapsed_time:.2f} seconds")
return bio
-172
View File
@@ -4,13 +4,10 @@ Business logic for persons / authors.
"""
import hashlib
import json
import logging
import time
from datetime import datetime
from pydantic import ValidationError
from inse.exceptions import (
BadRequestException,
ElasticsearchException,
@@ -26,13 +23,11 @@ from inse.persons.model import (
CareerMetrics,
CustomAuthor,
CustomAuthorsListResponse,
PersonBio,
)
from inse.persons.query_builder import build_authors_search_rescored
from inse.works.logic import enrich_topic_descriptions
from .. import config, util
from ..integrations import llm
logger = logging.getLogger(__name__)
INDEX_NAME = "openalex-authors"
@@ -220,100 +215,6 @@ async def count_authors_by_last_name(last_name: str) -> int:
return await _count_authors(query)
async def _fetch_author_display_name(author_id: str) -> str | None:
query = {
"query_string": {
"default_field": "_id",
"query": author_id,
}
}
response = await elasticsearch.search(
index=INDEX_NAME,
query=query,
source=["display_name"],
)
hits = response.get("hits", {}).get("hits", [])
if not hits:
return None
return hits[0].get("_source", {}).get("display_name")
async def _fetch_works_and_topics(author_id: str) -> tuple[list, list]:
WORK_SOURCE_FIELDS = [
"title",
"display_name",
"abstract",
"cited_by_count",
"primary_topic",
]
author_url = f"https://openalex.org/{author_id.strip()}"
authorship_query = {
"nested": {
"path": "authorships",
"query": {
"bool": {
"filter": [{"term": {"authorships.author.id": author_url}}],
}
},
}
}
body = {
"size": 100,
"sort": [{"cited_by_count": {"order": "desc"}}],
"_source": WORK_SOURCE_FIELDS,
"query": authorship_query,
"aggs": {
"primary_topics": {
"terms": {"field": "primary_topic.id", "size": 5},
"aggs": {
"topic_name": {
"top_hits": {
"size": 1,
"_source": ["primary_topic.display_name"],
}
}
},
}
},
}
response = await elasticsearch.search(
index=config.settings.openalex_works_search_index,
body=body,
)
works = []
for hit in response.get("hits", {}).get("hits", []):
works.append(hit.get("_source", {}))
topics = []
buckets = (
response.get("aggregations", {}).get("primary_topics", {}).get("buckets", [])
)
for bucket in buckets:
topic_hits = bucket.get("topic_name", {}).get("hits", {}).get("hits", [])
display_name = None
if topic_hits:
primary_topic = topic_hits[0].get("_source", {}).get("primary_topic", {})
display_name = primary_topic.get("display_name")
topics.append(
{
"id": bucket.get("key"),
"display_name": display_name,
"count": bucket.get("doc_count"),
}
)
return works, topics
async def _get_publication_years_for_author(author_id: str) -> list[int]:
author_url = f"https://openalex.org/{author_id.strip()}"
@@ -427,79 +328,6 @@ async def get_career_metrics_for_author(author_id: str) -> CareerMetrics:
return _compute_career_metrics(publication_years)
def _build_papers(works: list) -> list:
papers = []
for work in works:
name = work.get("title") or work.get("display_name")
abstract = work.get("abstract")
papers.append(
{
"name": name,
"abstract": abstract,
"stats": {
"cited_by_count": work.get("cited_by_count"),
},
}
)
return papers
async def get_data_for_bio(author_id: str) -> dict | None:
display_name = await _fetch_author_display_name(author_id)
if display_name is None:
return None
works, top_topics = await _fetch_works_and_topics(author_id)
papers = _build_papers(works)
author_data = {
"display_name": display_name,
"topics": top_topics,
"papers": papers,
}
return author_data
async def generate_person_bio(
author_id: str, include: set[str] | None = None
) -> str:
start_time = time.time()
author_data = await get_data_for_bio(author_id)
if author_data is None:
return "No person found."
person_json = json.dumps(author_data, ensure_ascii=False)
system_prompt = """\
Beschreibe in zwei Sätzen das Hauptforschungsfeld des Autors. Formuliere dabei allgemeinverständlich, sodass auch Personen ohne Fachwissen einen Einblick in die Forschung gewinnen. Nenne keine konkreten Publikationen oder Einzelwerke, sondern konzentriere dich auf die übergeordneten Forschungsinteressen und Themen. Verzichte auf bloße Aufzählungen und verbinde die Informationen zu einem flüssigen Text.
Beschreibe anschließend in ein bis zwei Sätzen die wirtschaftliche Relevanz der Forschung anhand von Anwendungen, Technologien oder Branchen, die davon profitieren könnten.
Verwende insgesamt maximal 100 bis 120 Wörter. Formuliere die Antwort so, dass sie ohne weitere Anpassungen direkt als Kurzbiografie verwendet werden kann. Verwende keine Superlative oder übertriebene Formulierungen, sondern bleibe sachlich und informativ. Gebe den Text als One-Liner zurück, ohne Zeilenumbrüche oder Aufzählungen. Verwende keine Gedankenstriche (– oder —) zur Gliederung von Sätzen. Formuliere stattdessen mit Kommas, Klammern oder zwei getrennten Sätzen.
Gib ausschließlich ein JSON-Objekt zurück, das den Text im Feld "bio" enthält.
"""
user_prompt = f"Daten zur Person:\n{person_json}"
response = await llm.call(
system_prompt=system_prompt,
user_prompt=user_prompt,
json_schema=PersonBio.model_json_schema(),
schema_name="bio",
temperature=0.8,
top_p=0.95,
)
try:
bio = PersonBio.model_validate_json(response).bio
except ValidationError:
logger.warning(f"Bio generation for author {author_id} returned no valid JSON: {response}")
bio = "Etwas ist schiefgelaufen."
elapsed_time = time.time() - start_time
logger.info(f"Bio generation for author {author_id} took {elapsed_time:.2f} seconds")
return bio
async def get_person_by_id(
author_id: str, include: str | None = None
) -> CustomAuthorsListResponse:
+8 -36
View File
@@ -9,7 +9,7 @@ from fastapi import APIRouter, HTTPException, Path, Query, status
from inse.models.openalex.authors_list_response import AuthorsListResponse
from . import logic, model
from . import bio as bio_logic, logic, model
router = APIRouter(
prefix="/api/inse-service",
@@ -32,23 +32,7 @@ async def search_persons(
query: Annotated[
str, Query(description="Search query (e.g., Arman AND Arzani)")
] = None,
include: Annotated[
str | None,
Query(
description=(
"Comma-separated include tags: topics_full, topic_share, summary_stats, ids, "
"last_known_institutions, sources, counts_by_year, works_api_url, dates, "
"cited_by_count_boost"
),
example="topics_full,topic_share",
),
] = None,
):
include_set = (
{tag.strip().lower() for tag in include.split(",") if tag.strip()}
if include
else None
)
return await logic.search_persons(author_id, query)
@@ -62,20 +46,8 @@ async def generate_person_bio(
author_id: Annotated[
str, Query(description="OpenAlex author ID (e.g., A5093075883)")
],
include: Annotated[
str | None,
Query(
description=("Comma-separated list to include tags"),
example="topics_full,topic_share",
),
] = None,
):
include_set = (
{tag.strip().lower() for tag in include.split(",") if tag.strip()}
if include
else None
)
bio = await logic.generate_person_bio(author_id, include_set)
bio = await bio_logic.generate_person_bio(author_id)
return model.PersonBio(bio=bio)
@router.get(
@@ -96,7 +68,7 @@ async def get_person_by_id(
"Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, "
"last_known_institutions, ..."
),
example="topics_full,topic_share",
examples="topics_full,topic_share",
),
] = None,
):
@@ -119,11 +91,11 @@ async def search_persons_by_name(
"Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, "
"last_known_institutions, ..."
),
example="topics_full,topic_share",
examples="topics_full,topic_share",
),
],
limit:Annotated[int | None, Query(description=("Limit of search page results"),example ="2")]= None,
page_offset : Annotated[int | None, Query(description=("Offset of the result page"),example="2")] = None,
limit:Annotated[int | None, Query(description=("Limit of search page results"),examples ="2")]= None,
page_offset : Annotated[int | None, Query(description=("Offset of the result page"),examples="2")] = None,
):
return await logic.search_persons_by_name(author_name=author_name, include=include, page_offset=page_offset, limit=limit)
@@ -141,7 +113,7 @@ async def search_persons_autocomplete(
"Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, "
"last_known_institutions, ..."
),
example="topics_full,topic_share"
examples="topics_full,topic_share"
)]):
return await logic.search_persons_autocomplete(author_name=author_name, include=include)
@@ -181,7 +153,7 @@ async def search_persons_list(
str | None,
Query(
description="Comma-separated include tags",
example="topics_full,topic_share",
examples="topics_full,topic_share",
),
] = None,
year_filter_enabled: Annotated[
+48
View File
@@ -0,0 +1,48 @@
import pytest
from inse import config
from inse.exceptions import NotFoundException
from inse.persons import service
@pytest.fixture()
def anyio_backend():
return "asyncio"
def elasticsearch_configured():
return bool(
config.settings.elasticsearch_url and config.settings.elasticsearch_api_key
)
def llm_configured():
return bool(
config.settings.llm_api_url
and config.settings.llm_api_key
and config.settings.llm_model
)
requires_elasticsearch = pytest.mark.skipif(
not elasticsearch_configured(), reason="Elasticsearch is not configured"
)
requires_elasticsearch_and_llm = pytest.mark.skipif(
not (elasticsearch_configured() and llm_configured()),
reason="Elasticsearch and/or LLM are not configured",
)
@pytest.mark.anyio
@requires_elasticsearch_and_llm
async def test_bio_is_generated_for_person():
response = await service.generate_person_bio(author_id="A5093075883")
assert len(response.bio) >= 10, f"bio is too short: {response.bio!r}"
@pytest.mark.anyio
@requires_elasticsearch
async def test_bio_generation_fails_for_unknown_author():
with pytest.raises(NotFoundException):
await service.generate_person_bio(author_id="A000")
+98 -102
View File
@@ -2,7 +2,6 @@
import asyncio
import logging
from dataclasses import dataclass
from math import floor
from time import time
from typing import Any
@@ -21,7 +20,6 @@ from .model import (
AuthorTopicStats,
CareerStage,
CompanyStatusFilter,
FilterType,
KeywordOperator,
PublicationType,
PublicationTypeCount,
@@ -69,59 +67,88 @@ async def _get_author_ids_from_institution(institution_id: str) -> list[str]:
@dataclass(frozen=True)
class MatchConfig:
"""Where a topic filter matches on a work: keyword display names or topic ids."""
path: str
match_field: str
score_field: str
_KEYWORD_MATCH = MatchConfig(
path="keywords",
match_field="keywords.display_name.keyword",
score_field="keywords.score",
)
_TOPIC_MATCH = MatchConfig(
path="topics",
match_field="topics.display_name.keyword",
score_field="topics.score",
)
def _match_config(filter_type: FilterType) -> MatchConfig:
"""Resolves the request's filter_type into the single set of fields to match on."""
if filter_type == FilterType.TOPIC:
return _TOPIC_MATCH
return _KEYWORD_MATCH
def _keyword_clause(value: str, config: MatchConfig = _KEYWORD_MATCH) -> dict:
"""A single nested clause that matches one keyword/topic value on a work."""
def _topics_nested_clause(should_clauses: list[dict]) -> dict:
"""Wraps should-clauses on the nested topics of a work."""
return {
"nested": {
"path": config.path,
"path": "topics",
"query": {
"term": {config.match_field: value},
"bool": {
"should": should_clauses,
"minimum_should_match": 1,
},
},
},
}
def _topic_id_clause(topic_id: str) -> dict:
"""Matches one OpenAlex topic id against a work (fuzzy mode).
A work matches when the topic is either its primary topic or one of its
other topics.
"""
return {
"bool": {
"should": [
_topics_nested_clause([{"term": {"topics.id": topic_id}}]),
{"term": {"primary_topic.id": topic_id}},
],
"minimum_should_match": 1,
},
}
def _keyword_clause(keyword: str) -> dict:
"""Matches one raw keyword as a phrase against a work (non-fuzzy mode).
The keyword has to occur as a phrase in at least one of the work's own text
fields or in one of the names of its topic hierarchy.
"""
return {
"bool": {
"should": [
{
"nested": {
"path": "keywords",
"query": {
"match_phrase": {"keywords.display_name": keyword},
},
},
},
{"match_phrase": {"primary_topic.display_name": keyword}},
{"match_phrase": {"title": keyword}},
{"match_phrase": {"abstract": keyword}},
_topics_nested_clause(
[
{"match_phrase": {"topics.display_name": keyword}},
{"match_phrase": {"topics.field.display_name": keyword}},
{"match_phrase": {"topics.subfield.display_name": keyword}},
{"match_phrase": {"topics.domain.display_name": keyword}},
]
),
],
"minimum_should_match": 1,
},
}
def _build_keyword_query(
keywords: list[str],
operator: KeywordOperator,
config: MatchConfig = _KEYWORD_MATCH,
fuzzy: bool = False,
) -> dict:
"""Combines the keyword/topic clauses according to the operator.
AND: a work must carry all values (every clause is required).
OR: a work must carry at least one of the values.
AND: a work must match all values (every clause is required).
OR: a work must match at least one of the values.
"""
clauses = []
for keyword in keywords:
clauses.append(_keyword_clause(keyword, config))
if fuzzy:
clauses.append(_topic_id_clause(keyword))
else:
clauses.append(_keyword_clause(keyword))
if operator == KeywordOperator.OR:
return {
@@ -156,12 +183,12 @@ def _topic_stats_query(
operator: KeywordOperator,
publication_types: list[PublicationType],
timespan: Timespan | None,
config: MatchConfig = _KEYWORD_MATCH,
fuzzy: bool = False,
) -> dict:
"""Builds a single query with all stats for Section 1"""
filters = [
_build_keyword_query(keywords, operator, config),
_build_keyword_query(keywords, operator, fuzzy),
_author_filter(author_ids),
]
@@ -283,38 +310,6 @@ def _topic_stats_query(
"_source": {"includes": ["cited_by_count"]},
},
},
# works whose matched keyword/topic scores above 0.8
"relevance_above_80": {
"filter": {
"nested": {
"path": config.path,
"query": {
"bool": {
"filter": [
{"terms": {config.match_field: keywords}},
{"range": {config.score_field: {"gt": 0.8}}},
],
},
},
},
},
},
# average matched relevance score over the works
"matched_keywords": {
"nested": {"path": config.path},
"aggs": {
"only_searched": {
"filter": {
"terms": {config.match_field: keywords},
},
"aggs": {
"avg_score": {
"avg": {"field": config.score_field},
},
},
},
},
},
},
},
},
@@ -347,17 +342,16 @@ async def topic_stats_for_authors(
operator: KeywordOperator,
publication_types: list[PublicationType],
timespan: Timespan | None,
filter_type: FilterType = FilterType.KEYWORD,
fuzzy: bool = False,
) -> list[AuthorTopicStats]:
if not author_ids:
return []
match_cfg = _match_config(filter_type)
response: dict[str, Any] = await elasticsearch.search(
index=config.settings.openalex_works_search_index,
body=_topic_stats_query(
author_ids, keywords, operator, publication_types, timespan, match_cfg
author_ids, keywords, operator, publication_types, timespan, fuzzy
),
cluster=ESCluster.NES,
)
@@ -375,12 +369,6 @@ async def topic_stats_for_authors(
for author_bucket in author_buckets:
to_work = author_bucket.get("to_work", {})
avg_value = to_work.get("avg_percentile", {}).get("value")
avg_rel = (
to_work.get("matched_keywords", {})
.get("only_searched", {})
.get("avg_score", {})
.get("value")
)
positions = {
bucket.get("key", ""): bucket.get("doc_count", 0)
for bucket in author_bucket.get("positions", {}).get("buckets", [])
@@ -413,8 +401,6 @@ async def topic_stats_for_authors(
industry_works_count=to_work.get("industry_collab", {}).get("doc_count", 0),
first_year=int(first_year) if first_year is not None else None,
last_year=int(last_year) if last_year is not None else None,
relevance_above_80_count=to_work.get("relevance_above_80", {}).get("doc_count", 0),
avg_relevance=float(avg_rel) if avg_rel is not None else 0.0,
first_author_count=positions.get("first", 0),
middle_author_count=positions.get("middle", 0),
last_author_count=positions.get("last", 0),
@@ -424,13 +410,29 @@ async def topic_stats_for_authors(
return results
def _primary_topic_match(keywords: list[str], fuzzy: bool) -> dict:
"""Matches works whose primary topic is one of the searched topics/keywords."""
if fuzzy:
return {"terms": {"primary_topic.id": keywords}}
return {
"bool": {
"should": [
{"match_phrase": {"primary_topic.display_name": keyword}}
for keyword in keywords
],
"minimum_should_match": 1,
},
}
def _topic_profile_query(
author_ids: list[str],
keywords: list[str],
operator: KeywordOperator,
publication_types: list[PublicationType],
timespan: Timespan | None,
config: MatchConfig = _KEYWORD_MATCH,
fuzzy: bool = False,
) -> dict:
"""Builds the Section 3 query"""
@@ -474,14 +476,10 @@ def _topic_profile_query(
"reverse_nested": {},
"aggs": {
"matched": {
"filter": _build_keyword_query(keywords, operator, config),
"filter": _build_keyword_query(keywords, operator, fuzzy),
"aggs": {
"primary_match": {
"filter": {
"terms": {
"primary_topic.display_name.keyword": keywords,
},
},
"filter": _primary_topic_match(keywords, fuzzy),
},
},
},
@@ -561,17 +559,16 @@ async def topic_profile_for_authors(
operator: KeywordOperator,
publication_types: list[PublicationType],
timespan: Timespan | None,
filter_type: FilterType = FilterType.KEYWORD,
fuzzy: bool = False,
) -> list[AuthorTopicProfile]:
if not author_ids:
return []
match_cfg = _match_config(filter_type)
response: dict[str, Any] = await elasticsearch.search(
index=config.settings.openalex_works_search_index,
body=_topic_profile_query(
author_ids, keywords, operator, publication_types, timespan, match_cfg
author_ids, keywords, operator, publication_types, timespan, fuzzy
),
cluster=ESCluster.NES,
)
@@ -727,11 +724,11 @@ def _build_query(
author_ids: list[str],
publication_types: list[PublicationType],
timespan: Timespan | None,
config: MatchConfig = _KEYWORD_MATCH,
fuzzy: bool = False,
) -> dict:
"""Builds the Elasticsearch query that returns the raw stats per author."""
work_filters = [
_build_keyword_query(keywords, operator, config),
_build_keyword_query(keywords, operator, fuzzy),
_author_filter(author_ids),
]
if publication_types:
@@ -794,7 +791,7 @@ def _build_publication_type_counts_query(
operator: KeywordOperator,
author_ids: list[str],
timespan: Timespan | None,
config: MatchConfig = _KEYWORD_MATCH,
fuzzy: bool = False,
) -> dict:
"""Builds the query that counts matching works per publication type.
@@ -802,7 +799,7 @@ def _build_publication_type_counts_query(
filter itself, since it aggregates over all types instead of one score.
"""
work_filters = [
_build_keyword_query(keywords, operator, config),
_build_keyword_query(keywords, operator, fuzzy),
_author_filter(author_ids),
]
if timespan is not None:
@@ -832,7 +829,7 @@ async def publication_type_counts_for_keywords(
institution_id: str,
career_stages: list[CareerStage],
timespan: Timespan | None,
filter_type: FilterType = FilterType.KEYWORD,
fuzzy: bool = False,
) -> list[PublicationTypeCount]:
"""Counts the university's matching works per publication type, largest first."""
author_ids = await _get_author_ids_from_institution(institution_id)
@@ -844,7 +841,7 @@ async def publication_type_counts_for_keywords(
author_ids = await _filter_author_ids_by_career_stage(author_ids, career_stages)
query_body = _build_publication_type_counts_query(
keywords, operator, author_ids, timespan, _match_config(filter_type),
keywords, operator, author_ids, timespan, fuzzy,
)
response: dict[str, Any] = await elasticsearch.search(
@@ -1175,7 +1172,7 @@ async def rank_authors_by_keywords(
publication_types: list[PublicationType],
timespan: Timespan | None,
company_status: CompanyStatusFilter = CompanyStatusFilter.ALL,
filter_type: FilterType = FilterType.KEYWORD,
fuzzy: bool = False,
) -> list[RankedAuthor]:
"""Ranks the university's authors by a weighted score over works and citations.
@@ -1193,8 +1190,7 @@ async def rank_authors_by_keywords(
author_ids = await _filter_author_ids_by_career_stage(author_ids, career_stages)
query_body = _build_query(
keywords, operator, author_ids, publication_types, timespan,
_match_config(filter_type),
keywords, operator, author_ids, publication_types, timespan, fuzzy,
)
response: dict[str, Any] = await elasticsearch.search(
+21 -36
View File
@@ -12,11 +12,6 @@ class KeywordOperator(StrEnum):
OR = "or"
class FilterType(StrEnum):
KEYWORD = "keyword"
TOPIC = "topic"
class CompanyStatusFilter(StrEnum):
ALL = "all"
ACTIVE = "active"
@@ -107,10 +102,12 @@ class KeywordToAuthorRequest(BaseModel):
default=KeywordOperator.AND,
description="How to combine the keywords: 'and' or 'or'. Defaults to 'and'.",
)
filter_type: FilterType = Field(
default=FilterType.KEYWORD,
description="What the 'keywords' values match against: 'keyword' (OpenAlex "
"keyword display names) or 'topic' (OpenAlex topic display names). Defaults to 'keyword'.",
fuzzy: bool = Field(
default=False,
description="How the 'keywords' values are matched: True means they are "
"OpenAlex topic ids matched against the work's topics, False means they are "
"raw keywords matched as phrases in the work's title, abstract, keywords and "
"topic names. Defaults to False.",
)
weights: RankingWeights = Field(
description="Weights for the ranking metrics. Required.",
@@ -133,7 +130,7 @@ class KeywordToAuthorRequest(BaseModel):
"'all', only 'active' (non-deleted), or only 'deleted'.",
)
@field_validator("operator", "filter_type", mode="before")
@field_validator("operator", mode="before")
@classmethod
def operator_case_insensitive(cls, value):
if isinstance(value, str):
@@ -154,10 +151,12 @@ class SelectedAuthorsRequest(BaseModel):
default=KeywordOperator.AND,
description="How to combine the keywords: 'and' or 'or'. Defaults to 'and'.",
)
filter_type: FilterType = Field(
default=FilterType.KEYWORD,
description="What the 'keywords' values match against: 'keyword' (OpenAlex "
"keyword display names) or 'topic' (OpenAlex topic ids). Defaults to 'keyword'.",
fuzzy: bool = Field(
default=False,
description="How the 'keywords' values are matched: True means they are "
"OpenAlex topic ids matched against the work's topics, False means they are "
"raw keywords matched as phrases in the work's title, abstract, keywords and "
"topic names. Defaults to False.",
)
publication_types: list[PublicationType] = Field(
default_factory=list,
@@ -175,13 +174,6 @@ class SelectedAuthorsRequest(BaseModel):
return value.lower()
return value
@field_validator("filter_type", mode="before")
@classmethod
def filter_type_case_insensitive(cls, value):
if isinstance(value, str):
return value.lower()
return value
class AuthorMetricsRequest(BaseModel):
author_ids: list[str] = Field(
@@ -204,10 +196,12 @@ class PublicationTypeCountsRequest(BaseModel):
default=KeywordOperator.AND,
description="How to combine the keywords: 'and' or 'or'. Defaults to 'and'.",
)
filter_type: FilterType = Field(
default=FilterType.KEYWORD,
description="What the 'keywords' values match against: 'keyword' (OpenAlex "
"keyword display names) or 'topic' (OpenAlex topic display names). Defaults to 'keyword'.",
fuzzy: bool = Field(
default=False,
description="How the 'keywords' values are matched: True means they are "
"OpenAlex topic ids matched against the work's topics, False means they are "
"raw keywords matched as phrases in the work's title, abstract, keywords and "
"topic names. Defaults to False.",
)
career_stages: list[CareerStage] = Field(
default_factory=list,
@@ -218,7 +212,7 @@ class PublicationTypeCountsRequest(BaseModel):
description="Optional filter: only count works whose publication_year is within [from, to].",
)
@field_validator("operator", "filter_type", mode="before")
@field_validator("operator", mode="before")
@classmethod
def operator_case_insensitive(cls, value):
if isinstance(value, str):
@@ -290,15 +284,6 @@ class AuthorTopicStats(BaseModel):
default=None,
description="Latest publication year among the author's topic works.",
)
relevance_above_80_count: int = Field(
default=0,
description="Number of the author's topic works where the matched keyword's "
"relevance score is above 0.8.",
)
avg_relevance: float = Field(
default=0.0,
description="Average matched-keyword relevance score (0-1) over the author's topic works.",
)
first_author_count: int = Field(
default=0,
description="Number of the author's topic works where they are the first author.",
@@ -355,7 +340,7 @@ class AuthorTopicProfile(BaseModel):
)
primary_topic_matches: int = Field(
description="Matched works where one of the searched topics is the work's "
"primary topic (only meaningful for filter_type 'topic').",
"primary topic.",
)
distinct_topics: int = Field(
description="Number of distinct primary topics across all works.",
+12 -12
View File
@@ -48,11 +48,11 @@ async def rank_author(
)
logger.info(
"rank-author keywords=%s operator=%s filter_type=%s institution_id=%s career_stages=%s "
"rank-author keywords=%s operator=%s fuzzy=%s institution_id=%s career_stages=%s "
"publication_types=%s timespan=%s",
request.keywords,
request.operator,
request.filter_type,
request.fuzzy,
institution_id,
request.career_stages,
request.publication_types,
@@ -67,7 +67,7 @@ async def rank_author(
publication_types=request.publication_types,
timespan=request.timespan,
company_status=request.company_status,
filter_type=request.filter_type,
fuzzy=request.fuzzy,
)
# Publication-type facet counts for the "Art der Work" filter
@@ -86,11 +86,11 @@ async def publication_type_counts(
)
logger.info(
"publication-type-counts keywords=%s operator=%s filter_type=%s institution_id=%s "
"publication-type-counts keywords=%s operator=%s fuzzy=%s institution_id=%s "
"career_stages=%s timespan=%s",
request.keywords,
request.operator,
request.filter_type,
request.fuzzy,
institution_id,
request.career_stages,
request.timespan,
@@ -101,18 +101,18 @@ async def publication_type_counts(
institution_id=institution_id,
career_stages=request.career_stages,
timespan=request.timespan,
filter_type=request.filter_type,
fuzzy=request.fuzzy,
)
# Compare authors table 1 (topic stats)
@router.post("/topic-stats", response_model=list[AuthorTopicStats])
async def topic_stats(request: SelectedAuthorsRequest):
logger.info(
"topic-stats author_ids=%s keywords=%s operator=%s filter_type=%s publication_types=%s timespan=%s",
"topic-stats author_ids=%s keywords=%s operator=%s fuzzy=%s publication_types=%s timespan=%s",
request.author_ids,
request.keywords,
request.operator,
request.filter_type,
request.fuzzy,
request.publication_types,
request.timespan,
)
@@ -122,19 +122,19 @@ async def topic_stats(request: SelectedAuthorsRequest):
request.operator,
request.publication_types,
request.timespan,
request.filter_type,
request.fuzzy,
)
# Compare authors section 3 (topic profile over ALL works of each author)
@router.post("/topic-profile", response_model=list[AuthorTopicProfile])
async def topic_profile(request: SelectedAuthorsRequest):
logger.info(
"topic-profile author_ids=%s keywords=%s operator=%s filter_type=%s "
"topic-profile author_ids=%s keywords=%s operator=%s fuzzy=%s "
"publication_types=%s timespan=%s",
request.author_ids,
request.keywords,
request.operator,
request.filter_type,
request.fuzzy,
request.publication_types,
request.timespan,
)
@@ -144,7 +144,7 @@ async def topic_profile(request: SelectedAuthorsRequest):
request.operator,
request.publication_types,
request.timespan,
request.filter_type,
request.fuzzy,
)
# Compare authors table 2 (author-level stats, keyword/time-independent)
@@ -138,7 +138,6 @@ model/extractedKeywordsLLM.ts
model/extractedKeywordsResponse.ts
model/fieldNode.ts
model/fileUpload.ts
model/filterType.ts
model/fp7EurosciVoc.ts
model/fp7LegalBasis.ts
model/fp7Organization.ts
-20
View File
@@ -52,13 +52,11 @@ export class PersonsService extends BaseService {
* Generates a bio for a person by author ID.
* @endpoint get /api/inse-service/persons/bio
* @param authorId OpenAlex author ID (e.g., A5093075883)
* @param include Comma-separated list to include tags
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public generatePersonBio(
authorId: string,
include?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
@@ -69,7 +67,6 @@ export class PersonsService extends BaseService {
): Observable<PersonBio>;
public generatePersonBio(
authorId: string,
include?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
@@ -80,7 +77,6 @@ export class PersonsService extends BaseService {
): Observable<HttpResponse<PersonBio>>;
public generatePersonBio(
authorId: string,
include?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
@@ -91,7 +87,6 @@ export class PersonsService extends BaseService {
): Observable<HttpEvent<PersonBio>>;
public generatePersonBio(
authorId: string,
include?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
@@ -112,11 +107,6 @@ export class PersonsService extends BaseService {
<any>authorId,
'author_id',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>include,
'include',
);
let localVarHeaders = this.defaultHeaders;
@@ -403,14 +393,12 @@ export class PersonsService extends BaseService {
* @endpoint get /api/inse-service/persons/search
* @param authorId OpenAlex author ID (e.g., A5093075883)
* @param query Search query (e.g., Arman AND Arzani)
* @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public searchPersons(
authorId?: string,
query?: string,
include?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
@@ -422,7 +410,6 @@ export class PersonsService extends BaseService {
public searchPersons(
authorId?: string,
query?: string,
include?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
@@ -434,7 +421,6 @@ export class PersonsService extends BaseService {
public searchPersons(
authorId?: string,
query?: string,
include?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
@@ -446,7 +432,6 @@ export class PersonsService extends BaseService {
public searchPersons(
authorId?: string,
query?: string,
include?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
@@ -466,11 +451,6 @@ export class PersonsService extends BaseService {
<any>query,
'query',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>include,
'include',
);
let localVarHeaders = this.defaultHeaders;
@@ -28,7 +28,7 @@ export interface AuthorTopicProfile {
*/
matched_works: number;
/**
* Matched works where one of the searched topics is the work\'s primary topic (only meaningful for filter_type \'topic\').
* Matched works where one of the searched topics is the work\'s primary topic.
*/
primary_topic_matches: number;
/**
@@ -70,14 +70,6 @@ export interface AuthorTopicStats {
industry_works_count?: number;
first_year?: number | null;
last_year?: number | null;
/**
* Number of the author\'s topic works where the matched keyword\'s relevance score is above 0.8.
*/
relevance_above_80_count?: number;
/**
* Average matched-keyword relevance score (0-1) over the author\'s topic works.
*/
avg_relevance?: number;
/**
* Number of the author\'s topic works where they are the first author.
*/
-17
View File
@@ -1,17 +0,0 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export const FilterType = {
Keyword: 'keyword',
Topic: 'topic'
} as const;
export type FilterType = typeof FilterType[keyof typeof FilterType];
+24 -24
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -11,31 +11,31 @@ import { InstitutionIds } from './institutionIds';
import { AuthorCountsByYearInner } from './authorCountsByYearInner';
import { AuthorSummaryStats } from './authorSummaryStats';
import { InstitutionGeo } from './institutionGeo';
import { DehydratedInstitution } from './dehydratedInstitution';
/**
* A university, research organization, or other affiliation
*/
export interface Institution {
id?: string | null;
ror?: string | null;
display_name?: string | null;
country_code?: string | null;
type?: string | null;
homepage_url?: string | null;
image_url?: string | null;
image_thumbnail_url?: string | null;
display_name_acronyms?: Array<string> | null;
display_name_alternatives?: Array<string> | null;
works_count?: number | null;
cited_by_count?: number | null;
summary_stats?: AuthorSummaryStats | null;
geo?: InstitutionGeo | null;
lineage?: Array<string> | null;
ids?: InstitutionIds | null;
counts_by_year?: Array<AuthorCountsByYearInner> | null;
works_api_url?: string | null;
created_date?: string | null;
updated_date?: string | null;
export interface Institution {
id?: string | null;
ror?: string | null;
display_name?: string | null;
country_code?: string | null;
type?: string | null;
homepage_url?: string | null;
image_url?: string | null;
image_thumbnail_url?: string | null;
display_name_acronyms?: Array<string> | null;
display_name_alternatives?: Array<string> | null;
works_count?: number | null;
cited_by_count?: number | null;
summary_stats?: AuthorSummaryStats | null;
geo?: InstitutionGeo | null;
lineage?: Array<string> | null;
ids?: InstitutionIds | null;
counts_by_year?: Array<AuthorCountsByYearInner> | null;
works_api_url?: string | null;
associated_institutions?: Array<DehydratedInstitution> | null;
created_date?: string | null;
updated_date?: string | null;
}
@@ -8,7 +8,6 @@
* Do not edit the class manually.
*/
import { Timespan } from './timespan';
import { FilterType } from './filterType';
import { CareerStage } from './careerStage';
import { KeywordOperator } from './keywordOperator';
import { PublicationType } from './publicationType';
@@ -25,9 +24,9 @@ export interface KeywordToAuthorRequest {
*/
operator?: KeywordOperator;
/**
* What the \'keywords\' values match against: \'keyword\' (OpenAlex keyword display names) or \'topic\' (OpenAlex topic display names). Defaults to \'keyword\'.
* How the \'keywords\' values are matched: True means they are OpenAlex topic ids matched against the work\'s topics, False means they are raw keywords matched as phrases in the work\'s title, abstract, keywords and topic names. Defaults to False.
*/
filter_type?: FilterType;
fuzzy?: boolean;
/**
* Weights for the ranking metrics. Required.
*/
-1
View File
@@ -104,7 +104,6 @@ export * from './extractedKeywordsLLM';
export * from './extractedKeywordsResponse';
export * from './fieldNode';
export * from './fileUpload';
export * from './filterType';
export * from './fp7EurosciVoc';
export * from './fp7LegalBasis';
export * from './fp7Organization';
@@ -8,7 +8,6 @@
* Do not edit the class manually.
*/
import { Timespan } from './timespan';
import { FilterType } from './filterType';
import { CareerStage } from './careerStage';
import { KeywordOperator } from './keywordOperator';
@@ -22,9 +21,9 @@ export interface PublicationTypeCountsRequest {
*/
operator?: KeywordOperator;
/**
* What the \'keywords\' values match against: \'keyword\' (OpenAlex keyword display names) or \'topic\' (OpenAlex topic display names). Defaults to \'keyword\'.
* How the \'keywords\' values are matched: True means they are OpenAlex topic ids matched against the work\'s topics, False means they are raw keywords matched as phrases in the work\'s title, abstract, keywords and topic names. Defaults to False.
*/
filter_type?: FilterType;
fuzzy?: boolean;
/**
* Optional filter: only count works of authors in one of these career stages. Empty = no filter.
*/
@@ -1,42 +1,37 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { Timespan } from './timespan';
import { FilterType } from './filterType';
import { KeywordOperator } from './keywordOperator';
import { PublicationType } from './publicationType';
export interface SelectedAuthorsRequest {
/**
* OpenAlex IDs of the authors to rank.
*/
author_ids: Array<string>;
/**
* One or more keywords defining the topic.
*/
keywords: Array<string>;
/**
* How to combine the keywords: \'and\' or \'or\'. Defaults to \'and\'.
*/
operator?: KeywordOperator;
/**
* What the \'keywords\' values match against: \'keyword\' (OpenAlex keyword display names) or \'topic\' (OpenAlex topic ids). Defaults to \'keyword\'.
*/
filter_type?: FilterType;
/**
* Optional filter: only count works of these publication types. Empty = no filter.
*/
publication_types?: Array<PublicationType>;
timespan?: Timespan | null;
export interface SelectedAuthorsRequest {
/**
* OpenAlex IDs of the authors to rank.
*/
author_ids: Array<string>;
/**
* One or more keywords defining the topic.
*/
keywords: Array<string>;
/**
* How to combine the keywords: \'and\' or \'or\'. Defaults to \'and\'.
*/
operator?: KeywordOperator;
/**
* How the \'keywords\' values are matched: True means they are OpenAlex topic ids matched against the work\'s topics, False means they are raw keywords matched as phrases in the work\'s title, abstract, keywords and topic names. Defaults to False.
*/
fuzzy?: boolean;
/**
* Optional filter: only count works of these publication types. Empty = no filter.
*/
publication_types?: Array<PublicationType>;
timespan?: Timespan | null;
}
export namespace SelectedAuthorsRequest {
}
export namespace SelectedAuthorsRequest {}
@@ -220,12 +220,6 @@ app-chip mat-icon {
&.pos-last {
color: var(--sg-primary);
}
&.rel-count {
color: var(--sg-blue-highlight);
}
&.rel-avg {
color: var(--sg-blue-highlight);
}
&.cit-total {
color: var(--sg-error);
}
@@ -66,9 +66,6 @@ interface AuthorSummary {
// active years within the topic
firstYear: number | null;
lastYear: number | null;
// topic-relevance (matched keyword score)
relevanceAbove80: number | null;
avgRelevance: number | null;
// author-position split (first / middle / last)
firstAuthor: number | null;
middleAuthor: number | null;
@@ -227,8 +224,6 @@ export class CompareAuthorsComponent implements OnInit {
: null,
firstYear: t?.first_year ?? null,
lastYear: t?.last_year ?? null,
relevanceAbove80: t?.relevance_above_80_count ?? null,
avgRelevance: t?.avg_relevance ?? null,
firstAuthor: t?.first_author_count ?? null,
middleAuthor: t?.middle_author_count ?? null,
lastAuthor: t?.last_author_count ?? null,
@@ -319,23 +314,6 @@ export class CompareAuthorsComponent implements OnInit {
},
],
),
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)',
@@ -765,6 +743,8 @@ export class CompareAuthorsComponent implements OnInit {
const rawAuthors = this.route.snapshot.queryParamMap.get('authors') ?? '';
const rawKeywords = this.route.snapshot.queryParamMap.get('keywords') ?? '';
const rawOperator = this.route.snapshot.queryParamMap.get('operator');
const rawTopics = this.route.snapshot.queryParamMap.get('topics') ?? '';
const fuzzy = this.route.snapshot.queryParamMap.get('fuzzy') === 'true';
const rawPubType = this.route.snapshot.queryParamMap.get('pubType');
const rawTFrom = this.route.snapshot.queryParamMap.get('tFrom');
const rawTTo = this.route.snapshot.queryParamMap.get('tTo');
@@ -793,11 +773,13 @@ export class CompareAuthorsComponent implements OnInit {
const fullIds = authorIds.map((id) => `https://openalex.org/${id}`);
this.authorIds.set(fullIds);
// same two match modes as the persons list: topic ids when fuzzy, raw keywords otherwise
const topicIds = this.parseList(rawTopics);
const request: SelectedAuthorsRequest = {
author_ids: fullIds,
keywords: keywords,
keywords: fuzzy && topicIds.length > 0 ? topicIds : keywords,
operator: operator,
filter_type: 'topic',
fuzzy: fuzzy && topicIds.length > 0,
publication_types: publication_types,
timespan: timespan,
};
@@ -205,7 +205,7 @@
[disabled]="!canScrollAnalyticalInstitutionTabsLeft"
aria-label="Vorherige Institutionen anzeigen"
(click)="scrollAnalyticalInstitutionTabs(-1)">
<mat-icon>chevron_left</mat-icon>
<mat-icon>{{ CHEVRON_LEFT_ICON }}</mat-icon>
</button>
<div
#analyticalInstitutionTabList
@@ -232,7 +232,7 @@
[disabled]="!canScrollAnalyticalInstitutionTabsRight"
aria-label="Weitere Institutionen anzeigen"
(click)="scrollAnalyticalInstitutionTabs(1)">
<mat-icon>chevron_right</mat-icon>
<mat-icon>{{ CHEVRON_RIGHT_ICON }}</mat-icon>
</button>
</div>
@if (dashboardInstitutionsError) {
@@ -243,334 +243,334 @@
</section>
@if (selectedAnalyticalInstitutionId) {
@if (
euProjectStatusesLoading ||
bmbfProjectStatusesLoading ||
dfgProjectStatusesLoading ||
euProjectStatusesError ||
bmbfProjectStatusesError ||
dfgProjectStatusesError ||
(euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses)
) {
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>Projektstatus nach Fördergeber</h2>
<p>
Laufende, kommende und abgeschlossene EU-, Bund- und DFG-Projekte
Ihrer Organisation.
</p>
</div>
@if (euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses) {
<div class="project-status-summary">
<span>
EU:
{{
euProjectStatuses.ongoing +
euProjectStatuses.upcoming +
euProjectStatuses.completed | number
}}
</span>
<span>
Bund:
{{
bmbfProjectStatuses.ongoing +
bmbfProjectStatuses.upcoming +
bmbfProjectStatuses.completed | number
}}
</span>
<span>
DFG:
{{
dfgProjectStatuses.ongoing +
dfgProjectStatuses.upcoming +
dfgProjectStatuses.completed | number
}}
</span>
@if (
euProjectStatusesLoading ||
bmbfProjectStatusesLoading ||
dfgProjectStatusesLoading ||
euProjectStatusesError ||
bmbfProjectStatusesError ||
dfgProjectStatusesError ||
(euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses)
) {
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>Projektstatus nach Fördergeber</h2>
<p>
Laufende, kommende und abgeschlossene EU-, Bund- und DFG-Projekte
Ihrer Organisation.
</p>
</div>
}
</header>
@if (euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses) {
<div class="project-status-summary">
<span>
EU:
{{
euProjectStatuses.ongoing +
euProjectStatuses.upcoming +
euProjectStatuses.completed | number
}}
</span>
<span>
Bund:
{{
bmbfProjectStatuses.ongoing +
bmbfProjectStatuses.upcoming +
bmbfProjectStatuses.completed | number
}}
</span>
<span>
DFG:
{{
dfgProjectStatuses.ongoing +
dfgProjectStatuses.upcoming +
dfgProjectStatuses.completed | number
}}
</span>
</div>
}
</header>
@if (
euProjectStatusesLoading ||
bmbfProjectStatusesLoading ||
dfgProjectStatusesLoading
) {
<div class="project-status-loading" role="status" aria-live="polite">
<app-loading
text="Projektstatus wird geladen …"
[icon]="STACKED_BAR_CHART_ICON"
size="64"
diameter="64"></app-loading>
</div>
} @else if (
euProjectStatusesError &&
bmbfProjectStatusesError &&
dfgProjectStatusesError
) {
<p class="statistics-error">
Der Status der EU-, Bund- und DFG-Projekte konnte nicht geladen
werden.
</p>
} @else if (
euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses
) {
@if (
euProjectStatusesError ||
bmbfProjectStatusesError ||
euProjectStatusesLoading ||
bmbfProjectStatusesLoading ||
dfgProjectStatusesLoading
) {
<div class="project-status-loading" role="status" aria-live="polite">
<app-loading
text="Projektstatus wird geladen …"
[icon]="STACKED_BAR_CHART_ICON"
size="64"
diameter="64"></app-loading>
</div>
} @else if (
euProjectStatusesError &&
bmbfProjectStatusesError &&
dfgProjectStatusesError
) {
<p class="statistics-error">
Projektstatusdaten für {{ failedProjectStatusSources() }} konnten
nicht geladen werden. Die übrigen Daten werden weiterhin
angezeigt.
Der Status der EU-, Bund- und DFG-Projekte konnte nicht geladen
werden.
</p>
} @else if (
euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses
) {
@if (
euProjectStatusesError ||
bmbfProjectStatusesError ||
dfgProjectStatusesError
) {
<p class="statistics-error">
Projektstatusdaten für {{ failedProjectStatusSources() }} konnten
nicht geladen werden. Die übrigen Daten werden weiterhin
angezeigt.
</p>
}
<app-eu-project-status-chart
[statuses]="euProjectStatuses"
[bmbfStatuses]="bmbfProjectStatuses"
[dfgStatuses]="dfgProjectStatuses"></app-eu-project-status-chart>
}
<app-eu-project-status-chart
[statuses]="euProjectStatuses"
[bmbfStatuses]="bmbfProjectStatuses"
[dfgStatuses]="dfgProjectStatuses"></app-eu-project-status-chart>
}
</section>
}
</section>
}
@if (topicTreemapLoading || topicTreemapError || hasTopicTreemapData()) {
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>Field Treemap</h2>
<p>Publikationen Ihrer Organisation nach Field.</p>
</div>
</header>
@if (topicTreemapLoading || topicTreemapError || hasTopicTreemapData()) {
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>Field Treemap</h2>
<p>Publikationen Ihrer Organisation nach Field.</p>
</div>
</header>
@if (topicTreemapLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="Treemap-Daten für den gewählten Zeitraum werden geladen …"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
} @else if (topicTreemapError) {
<p class="statistics-error">
Die Field-Treemap konnte nicht geladen werden.
</p>
} @else {
<app-topic-treemap
[data]="topicTreemap"
[selectedNodeId]="selectedTopicTreemapNode"
(selectedNodeIdChange)="onTopicTreemapNodeChange($event)"
(topicSelect)="onTopicTreemapTopicSelect($event)">
</app-topic-treemap>
}
</section>
}
@if (dfgTopicsLoading || dfgTopicsError || dfgProjectTopics) {
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>DFG-Projekt-Topics</h2>
<p>
Gematchte DFG-Projekte nach Field, Subfield und Topic. Ein Klick auf
ein Topic zeigt die zugehörigen Keywords.
</p>
</div>
@if (dfgProjectTopics) {
<p class="dfg-topic-summary">
{{ dfgProjectTopics.matched_project_count | number }} von
{{ dfgProjectTopics.project_count | number }} Projekten gematcht
@if (topicTreemapLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="Treemap-Daten für den gewählten Zeitraum werden geladen …"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
} @else if (topicTreemapError) {
<p class="statistics-error">
Die Field-Treemap konnte nicht geladen werden.
</p>
} @else {
<app-topic-treemap
[data]="topicTreemap"
[selectedNodeId]="selectedTopicTreemapNode"
(selectedNodeIdChange)="onTopicTreemapNodeChange($event)"
(topicSelect)="onTopicTreemapTopicSelect($event)">
</app-topic-treemap>
}
</header>
</section>
}
@if (dfgTopicsLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="DFG-Topics werden geladen …"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
} @else if (dfgTopicsError) {
<p class="statistics-error">
Die DFG-Topic-Treemap konnte nicht geladen werden.
</p>
} @else {
<app-topic-treemap
[data]="dfgTopicTreemap"
[selectedNodeId]="selectedDfgTopicTreemapNode"
countLabel="DFG-Projekte"
[showCountInTooltip]="false"
(selectedNodeIdChange)="onDfgTopicTreemapNodeChange($event)"
(topicSelect)="onDfgTopicTreemapTopicSelect($event)">
</app-topic-treemap>
}
</section>
}
@if (dfgTopicsLoading || dfgTopicsError || dfgProjectTopics) {
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>DFG-Projekt-Topics</h2>
<p>
Gematchte DFG-Projekte nach Field, Subfield und Topic. Ein Klick
auf ein Topic zeigt die zugehörigen Keywords.
</p>
</div>
@if (dfgProjectTopics) {
<p class="dfg-topic-summary">
{{ dfgProjectTopics.matched_project_count | number }} von
{{ dfgProjectTopics.project_count | number }} Projekten gematcht
</p>
}
</header>
@if (euTopicsLoading || euTopicsError || euProjectTopics) {
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>EU-Projekt-Topics</h2>
<p>
Gematchte EU-Projekte nach Field, Subfield und Topic. Ein Klick auf
ein Topic zeigt die zugehörigen Keywords.
</p>
</div>
@if (euProjectTopics) {
<p class="dfg-topic-summary">
{{ euProjectTopics.matched_project_count | number }} von
{{ euProjectTopics.project_count | number }} Projekten gematcht
@if (dfgTopicsLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="DFG-Topics werden geladen …"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
} @else if (dfgTopicsError) {
<p class="statistics-error">
Die DFG-Topic-Treemap konnte nicht geladen werden.
</p>
} @else {
<app-topic-treemap
[data]="dfgTopicTreemap"
[selectedNodeId]="selectedDfgTopicTreemapNode"
countLabel="DFG-Projekte"
[showCountInTooltip]="false"
(selectedNodeIdChange)="onDfgTopicTreemapNodeChange($event)"
(topicSelect)="onDfgTopicTreemapTopicSelect($event)">
</app-topic-treemap>
}
</header>
</section>
}
@if (euTopicsLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="EU-Topics werden geladen …"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
} @else if (euTopicsError) {
<p class="statistics-error">
Die EU-Topic-Treemap konnte nicht geladen werden.
</p>
} @else {
<app-topic-treemap
[data]="euTopicTreemap"
[selectedNodeId]="selectedEuTopicTreemapNode"
countLabel="EU-Projekte"
[showCountInTooltip]="false"
(selectedNodeIdChange)="onEuTopicTreemapNodeChange($event)"
(topicSelect)="onEuTopicTreemapTopicSelect($event)">
</app-topic-treemap>
}
</section>
}
@if (euTopicsLoading || euTopicsError || euProjectTopics) {
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>EU-Projekt-Topics</h2>
<p>
Gematchte EU-Projekte nach Field, Subfield und Topic. Ein Klick
auf ein Topic zeigt die zugehörigen Keywords.
</p>
</div>
@if (euProjectTopics) {
<p class="dfg-topic-summary">
{{ euProjectTopics.matched_project_count | number }} von
{{ euProjectTopics.project_count | number }} Projekten gematcht
</p>
}
</header>
@if (bundTopicsLoading || bundTopicsError || bundProjectTopics) {
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>BUND-Projekt-Topics</h2>
<p>
Gematchte BUND-Projekte nach Field, Subfield und Topic. Ein Klick
auf ein Topic zeigt die zugehörigen Keywords.
</p>
</div>
@if (bundProjectTopics) {
<p class="dfg-topic-summary">
{{ bundProjectTopics.matched_project_count | number }} von
{{ bundProjectTopics.project_count | number }} Projekten gematcht
@if (euTopicsLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="EU-Topics werden geladen …"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
} @else if (euTopicsError) {
<p class="statistics-error">
Die EU-Topic-Treemap konnte nicht geladen werden.
</p>
} @else {
<app-topic-treemap
[data]="euTopicTreemap"
[selectedNodeId]="selectedEuTopicTreemapNode"
countLabel="EU-Projekte"
[showCountInTooltip]="false"
(selectedNodeIdChange)="onEuTopicTreemapNodeChange($event)"
(topicSelect)="onEuTopicTreemapTopicSelect($event)">
</app-topic-treemap>
}
</header>
</section>
}
@if (bundTopicsLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="BUND-Topics werden geladen …"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
} @else if (bundTopicsError) {
<p class="statistics-error">
Die BUND-Topic-Treemap konnte nicht geladen werden.
</p>
} @else {
<app-topic-treemap
[data]="bundTopicTreemap"
[selectedNodeId]="selectedBundTopicTreemapNode"
countLabel="BUND-Projekte"
[showCountInTooltip]="false"
(selectedNodeIdChange)="onBundTopicTreemapNodeChange($event)"
(topicSelect)="onBundTopicTreemapTopicSelect($event)">
</app-topic-treemap>
}
</section>
}
@if (bundTopicsLoading || bundTopicsError || bundProjectTopics) {
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>BUND-Projekt-Topics</h2>
<p>
Gematchte BUND-Projekte nach Field, Subfield und Topic. Ein Klick
auf ein Topic zeigt die zugehörigen Keywords.
</p>
</div>
@if (bundProjectTopics) {
<p class="dfg-topic-summary">
{{ bundProjectTopics.matched_project_count | number }} von
{{ bundProjectTopics.project_count | number }} Projekten gematcht
</p>
}
</header>
@if (topAuthorsLoading || topAuthorsError || hasTopAuthorData()) {
<section class="top-authors-section">
<header class="top-authors-header">
<div>
<h2>Top 10 Personen</h2>
<p>
Nach Anzahl der Works, DFG-Projekte, Patente und News Ihrer
Organisation.
@if (bundTopicsLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="BUND-Topics werden geladen …"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
} @else if (bundTopicsError) {
<p class="statistics-error">
Die BUND-Topic-Treemap konnte nicht geladen werden.
</p>
</div>
</header>
} @else {
<app-topic-treemap
[data]="bundTopicTreemap"
[selectedNodeId]="selectedBundTopicTreemapNode"
countLabel="BUND-Projekte"
[showCountInTooltip]="false"
(selectedNodeIdChange)="onBundTopicTreemapNodeChange($event)"
(topicSelect)="onBundTopicTreemapTopicSelect($event)">
</app-topic-treemap>
}
</section>
}
@if (topAuthorsError) {
<p class="statistics-error">
Die Autorenstatistiken konnten nicht geladen werden.
</p>
} @else {
<div class="top-authors-grid" [class.loading]="topAuthorsLoading">
@for (dataset of visibleTopAuthorDatasets(); track dataset.title) {
<article class="top-authors-chart">
<h3>
<mat-icon>{{ dataset.icon }}</mat-icon
>{{ dataset.title }}
</h3>
@for (
entry of dataset.entries;
track entry.id || entry.name;
let rank = $index
) {
<div class="author-bar-row">
<span class="author-rank">{{ rank + 1 }}</span>
<div class="author-bar-content">
<div class="author-bar-label">
@if (entry.id) {
<a
class="author-name author-link"
[routerLink]="authorLink(dataset, entry)"
[queryParams]="authorQueryParams(dataset, entry)"
[appComponentTooltip]="AuthorTooltipComponent"
[tooltipInputs]="{ authorId: entry.id }"
[tooltipMaxWidth]="'500px'"
[title]="authorDisplayName(dataset, entry)">
{{ authorDisplayName(dataset, entry) }}
</a>
} @else {
@if (topAuthorsLoading || topAuthorsError || hasTopAuthorData()) {
<section class="top-authors-section">
<header class="top-authors-header">
<div>
<h2>Top 10 Personen</h2>
<p>
Nach Anzahl der Works, DFG-Projekte, Patente und News Ihrer
Organisation.
</p>
</div>
</header>
@if (topAuthorsError) {
<p class="statistics-error">
Die Autorenstatistiken konnten nicht geladen werden.
</p>
} @else {
<div class="top-authors-grid" [class.loading]="topAuthorsLoading">
@for (dataset of visibleTopAuthorDatasets(); track dataset.title) {
<article class="top-authors-chart">
<h3>
<mat-icon>{{ dataset.icon }}</mat-icon
>{{ dataset.title }}
</h3>
@for (
entry of dataset.entries;
track entry.id || entry.name;
let rank = $index
) {
<div class="author-bar-row">
<span class="author-rank">{{ rank + 1 }}</span>
<div class="author-bar-content">
<div class="author-bar-label">
@if (entry.id) {
<a
class="author-name author-link"
[routerLink]="authorLink(dataset, entry)"
[queryParams]="authorQueryParams(dataset, entry)"
[appComponentTooltip]="AuthorTooltipComponent"
[tooltipInputs]="{ authorId: entry.id }"
[tooltipMaxWidth]="'500px'"
[title]="authorDisplayName(dataset, entry)">
{{ authorDisplayName(dataset, entry) }}
</a>
} @else {
<span
class="author-name"
[title]="authorDisplayName(dataset, entry)">
{{ authorDisplayName(dataset, entry) }}
</span>
}
<strong>{{ entry.count | number }}</strong>
</div>
<div class="author-bar-track">
<span
class="author-name"
[title]="authorDisplayName(dataset, entry)">
{{ authorDisplayName(dataset, entry) }}
</span>
}
<strong>{{ entry.count | number }}</strong>
</div>
<div class="author-bar-track">
<span
class="author-bar-fill"
[style.width.%]="
authorBarWidth(dataset.entries, entry.count)
"></span>
class="author-bar-fill"
[style.width.%]="
authorBarWidth(dataset.entries, entry.count)
"></span>
</div>
</div>
</div>
</div>
} @empty {
<p class="empty-chart">
{{
topAuthorsLoading
? 'Wird geladen …'
: 'Keine Daten vorhanden.'
}}
</p>
}
</article>
}
</div>
}
</section>
}
} @empty {
<p class="empty-chart">
{{
topAuthorsLoading
? 'Wird geladen …'
: 'Keine Daten vorhanden.'
}}
</p>
}
</article>
}
</div>
}
</section>
}
}
</div>
@@ -20,6 +20,8 @@ import {
ACCOUNT_BALANCE_ICON,
ACCOUNT_TREE_ICON,
ARTICLE_ICON,
CHEVRON_LEFT_ICON,
CHEVRON_RIGHT_ICON,
DESCRIPTION_ICON,
GROUPS_ICON,
MENU_BOOK_ICON,
@@ -102,6 +104,9 @@ export class DashboardComponent implements OnInit, AfterViewInit {
readonly AuthorTooltipComponent = AppAuthorTooltipComponent;
readonly patentIcon = PATENT_ICON;
readonly PATENT_ICON = PATENT_ICON;
readonly CHEVRON_LEFT_ICON = CHEVRON_LEFT_ICON;
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
readonly MENU_BOOK_ICON = MENU_BOOK_ICON;
readonly GROUPS_ICON = GROUPS_ICON;
readonly PUBLIC_ICON = PUBLIC_ICON;
@@ -223,9 +228,11 @@ export class DashboardComponent implements OnInit, AfterViewInit {
const restoredAnalyticalInstitution =
restoredInstitution === 'all' ? '' : restoredInstitution;
if (
restoredAnalyticalInstitution !== this.selectedAnalyticalInstitutionId
restoredAnalyticalInstitution !==
this.selectedAnalyticalInstitutionId
) {
this.selectedAnalyticalInstitutionId = restoredAnalyticalInstitution;
this.selectedAnalyticalInstitutionId =
restoredAnalyticalInstitution;
this.reloadAnalyticalData();
}
},
@@ -1003,7 +1010,9 @@ export class DashboardComponent implements OnInit, AfterViewInit {
};
}
private loadTopicTreemap(analyticalRequestId = this.analyticalRequestId): void {
private loadTopicTreemap(
analyticalRequestId = this.analyticalRequestId,
): void {
if (this.dashboardFromYear > this.dashboardToYear) {
this.topicTreemapLoading = false;
this.topicTreemapError = true;
@@ -25,7 +25,7 @@
<mat-form-field
class="patents-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix [fontIcon]="RULE_ICON"></mat-icon>
<mat-icon matPrefix>{{ RULE_ICON }}</mat-icon>
<mat-select
[value]="activeMatchType"
(selectionChange)="setMatchType($event.value)">
@@ -42,7 +42,7 @@
<mat-form-field
class="patents-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
<mat-icon matPrefix>{{ SORT_ICON }}</mat-icon>
<mat-select
[value]="sortColumn"
(selectionChange)="setSort($event.value)">
@@ -0,0 +1,166 @@
<div class="institution-overview">
<mat-card class="institution-overview-card" appearance="outlined">
<!-- Header Section -->
<div class="overview-header">
<div class="avatar-col">
<div class="institution-avatar" [class]="typeInfo().badgeClass">
<mat-icon>{{ typeInfo().icon }}</mat-icon>
</div>
</div>
<div class="identity-col">
<div class="title-row">
<h1 class="institution-name">{{ displayName() }}</h1>
<span [class]="'type-badge ' + typeInfo().badgeClass">
<mat-icon class="badge-icon">{{ typeInfo().icon }}</mat-icon>
{{ typeInfo().label }}
</span>
</div>
<div class="meta-row">
@if (locationText()) {
<div class="meta-item location-item">
@if (countryCode()) {
<app-country-flag
[countryCode]="countryCode()!"
[height]="14"
[bordered]="false" />
}
<span>{{ locationText() }}</span>
</div>
}
@if (homepageUrl()) {
<a
class="meta-link"
[href]="homepageUrl()!"
target="_blank"
rel="noopener noreferrer"
matTooltip="Offizielle Webseite öffnen">
<mat-icon>{{ LANGUAGE_ICON }}</mat-icon>
<span>Webseite</span>
<mat-icon class="external-icon">{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
}
@if (rorUrl()) {
<a
class="meta-link ror-link"
[href]="rorUrl()!"
target="_blank"
rel="noopener noreferrer"
matTooltip="ROR-Register öffnen">
<span class="ror-tag">ROR</span>
<mat-icon class="external-icon">{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
}
</div>
</div>
</div>
<!-- Key Metrics Section -->
<div class="metrics-row">
@if (worksCount() !== null && worksCount() !== undefined) {
<div class="stat-card">
<div class="stat-icon-wrapper pub-icon">
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
</div>
<div class="stat-content">
<span class="stat-value">{{
worksCount() | number: undefined : 'de'
}}</span>
<span class="stat-label">Publikationen</span>
</div>
</div>
}
@if (citedByCount() !== null && citedByCount() !== undefined) {
<div class="stat-card">
<div class="stat-icon-wrapper cite-icon">
<mat-icon>{{ CITATION_ICON }}</mat-icon>
</div>
<div class="stat-content">
<span class="stat-value">{{
citedByCount() | number: undefined : 'de'
}}</span>
<span class="stat-label">Zitationen</span>
</div>
</div>
}
@if (hIndex() !== null && hIndex() !== undefined) {
<div class="stat-card">
<div class="stat-icon-wrapper hindex-icon">
<mat-icon>{{ TRENDING_UP_ICON }}</mat-icon>
</div>
<div class="stat-content">
<span class="stat-value">{{ hIndex() }}</span>
<span class="stat-label">h-Index</span>
</div>
</div>
}
</div>
<!-- Alternative Names / Acronyms -->
@if (alternatives().length > 0) {
<mat-divider />
<div class="details-section">
<h4 class="section-title">Alternative Bezeichnungen</h4>
<div class="alternatives-list">
@for (alt of visibleAlternatives(); track alt) {
<span class="alternative-chip">{{ alt }}</span>
}
@if (hasMoreAlternatives()) {
<button
mat-button
class="expand-btn"
(click)="toggleAlternatives()">
{{
showAllAlternatives()
? 'Weniger anzeigen'
: '+' + (alternatives().length - 4) + ' weitere'
}}
</button>
}
</div>
</div>
}
<!-- Associated Institutions -->
@if (associatedInstitutions().length > 0) {
<mat-divider />
<div class="details-section">
<h4 class="section-title">
Assoziierte Institutionen
<span class="section-count"
>({{ associatedInstitutions().length }})</span
>
</h4>
<div class="associated-chips-container">
@for (
assoc of visibleAssociatedInstitutions();
track assoc.id ?? assoc.display_name ?? $index
) {
<div class="associated-chip-wrapper">
<app-institution-chip
[institution]="assoc"
[showIcon]="true"
size="normal"
[isClickable]="true"
(handleChipClick)="navigateToInstitution(assoc)" />
</div>
}
@if (hasMoreAssociated()) {
<button mat-button class="expand-btn" (click)="toggleAssociated()">
{{
showAllAssociated()
? 'Weniger anzeigen'
: '+' + (associatedInstitutions().length - 10) + ' weitere'
}}
</button>
}
</div>
</div>
}
</mat-card>
</div>
@@ -0,0 +1,346 @@
.institution-overview {
width: 100%;
margin-bottom: 1.5rem;
}
.institution-overview-card {
padding: 1.5rem;
background: var(--sg-surface);
border: 1px solid var(--sg-border);
border-radius: 12px;
display: flex;
flex-direction: column;
gap: 1.25rem;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
/* --- Header & Avatar --- */
.overview-header {
display: flex;
align-items: flex-start;
gap: 1.25rem;
@media (max-width: 768px) {
flex-direction: column;
align-items: center;
text-align: center;
}
}
.avatar-col {
flex-shrink: 0;
}
.institution-avatar {
width: 64px;
height: 64px;
border-radius: 14px;
display: flex;
align-items: center;
justify-content: center;
background: var(--sg-surface-container-high, rgba(0, 0, 0, 0.04));
border: 1px solid var(--sg-border);
color: var(--sg-primary);
mat-icon {
font-size: 34px;
width: 34px;
height: 34px;
}
&.type-education {
background: rgba(33, 150, 243, 0.1);
color: #1976d2;
border-color: rgba(33, 150, 243, 0.25);
}
&.type-healthcare {
background: rgba(233, 30, 99, 0.1);
color: #c2185b;
border-color: rgba(233, 30, 99, 0.25);
}
&.type-facility {
background: rgba(156, 39, 176, 0.1);
color: #7b1fa2;
border-color: rgba(156, 39, 176, 0.25);
}
&.type-company {
background: rgba(255, 152, 0, 0.1);
color: #f57c00;
border-color: rgba(255, 152, 0, 0.25);
}
&.type-government {
background: rgba(0, 150, 136, 0.1);
color: #00796b;
border-color: rgba(0, 150, 136, 0.25);
}
}
.identity-col {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.5rem;
min-width: 0;
}
.title-row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.75rem;
@media (max-width: 768px) {
justify-content: center;
}
}
.institution-name {
font-size: 1.6rem;
font-weight: 700;
color: var(--sg-text-primary);
margin: 0;
line-height: 1.25;
}
.type-badge {
display: inline-flex;
align-items: center;
gap: 0.35rem;
font-size: 0.75rem;
font-weight: 600;
padding: 0.25rem 0.65rem;
border-radius: 9999px;
background: var(--sg-surface-container-high, rgba(0, 0, 0, 0.05));
color: var(--sg-text-secondary);
border: 1px solid var(--sg-border);
.badge-icon {
font-size: 14px;
width: 14px;
height: 14px;
}
&.type-education {
background: rgba(33, 150, 243, 0.1);
color: #1565c0;
border-color: rgba(33, 150, 243, 0.3);
}
&.type-healthcare {
background: rgba(233, 30, 99, 0.1);
color: #ad1457;
border-color: rgba(233, 30, 99, 0.3);
}
&.type-facility {
background: rgba(156, 39, 176, 0.1);
color: #6a1b9a;
border-color: rgba(156, 39, 176, 0.3);
}
&.type-company {
background: rgba(255, 152, 0, 0.1);
color: #e65100;
border-color: rgba(255, 152, 0, 0.3);
}
&.type-government {
background: rgba(0, 150, 136, 0.1);
color: #004d40;
border-color: rgba(0, 150, 136, 0.3);
}
}
.meta-row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 1rem;
font-size: 0.875rem;
color: var(--sg-text-secondary);
@media (max-width: 768px) {
justify-content: center;
}
}
.meta-item {
display: inline-flex;
align-items: center;
gap: 0.4rem;
}
.meta-link {
display: inline-flex;
align-items: center;
gap: 0.35rem;
color: var(--sg-primary);
text-decoration: none;
font-weight: 500;
transition: opacity 0.2s;
mat-icon {
font-size: 16px;
width: 16px;
height: 16px;
}
.external-icon {
font-size: 13px;
width: 13px;
height: 13px;
opacity: 0.7;
}
&:hover {
text-decoration: underline;
opacity: 0.85;
}
}
.ror-tag {
background: var(--sg-primary);
color: #ffffff;
font-size: 0.65rem;
font-weight: 700;
padding: 1px 4px;
border-radius: 4px;
letter-spacing: 0.5px;
}
/* --- Metrics Grid --- */
.metrics-row {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 0.85rem;
width: 100%;
}
.stat-card {
display: flex;
align-items: center;
gap: 0.85rem;
padding: 0.85rem 1rem;
background: var(--sg-surface-container-low, rgba(0, 0, 0, 0.02));
border: 1px solid var(--sg-border);
border-radius: 10px;
}
.stat-icon-wrapper {
width: 40px;
height: 40px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
mat-icon {
font-size: 20px;
width: 20px;
height: 20px;
}
&.pub-icon {
background: rgba(33, 150, 243, 0.12);
color: #1976d2;
}
&.cite-icon {
background: rgba(156, 39, 176, 0.12);
color: #7b1fa2;
}
&.hindex-icon {
background: rgba(76, 175, 80, 0.12);
color: #2e7d32;
}
}
.stat-content {
display: flex;
flex-direction: column;
}
.stat-value {
font-size: 1.15rem;
font-weight: 700;
color: var(--sg-text-primary);
line-height: 1.2;
}
.stat-label {
font-size: 0.75rem;
color: var(--sg-text-secondary);
}
/* --- Section Lists --- */
.details-section {
display: flex;
flex-direction: column;
gap: 0.65rem;
}
.section-title {
display: inline-flex;
align-items: center;
gap: 0.45rem;
font-size: 0.85rem;
font-weight: 600;
color: var(--sg-text-secondary);
text-transform: uppercase;
letter-spacing: 0.5px;
margin: 0;
mat-icon {
font-size: 16px;
width: 16px;
height: 16px;
color: var(--sg-primary);
}
.section-count {
font-weight: normal;
opacity: 0.8;
}
}
.alternatives-list {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
align-items: center;
}
.alternative-chip {
font-size: 0.8rem;
padding: 0.3rem 0.7rem;
background: var(--sg-surface-container-high, rgba(0, 0, 0, 0.04));
border: 1px solid var(--sg-border);
border-radius: 6px;
color: var(--sg-text-primary);
}
.expand-btn {
font-size: 0.75rem;
height: 28px;
line-height: 28px;
padding: 0 0.5rem;
color: var(--sg-primary);
}
.associated-chips-container {
display: flex;
flex-wrap: wrap;
gap: 0.65rem;
align-items: center;
}
.associated-chip-wrapper {
display: inline-flex;
align-items: center;
}
@@ -0,0 +1,216 @@
import { Component, computed, inject, input, signal } from '@angular/core';
import { Router, RouterModule } from '@angular/router';
import { DecimalPipe } from '@angular/common';
import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { MatButtonModule } from '@angular/material/button';
import { MatChipsModule } from '@angular/material/chips';
import { MatDividerModule } from '@angular/material/divider';
import { MatTooltipModule } from '@angular/material/tooltip';
import { DehydratedInstitution, Institution } from '../../../../api';
import { CountryFlagComponent } from '../../../../shared/ui/country-flag/country-flag.component';
import { AppInstitutionChipComponent } from '../../../../shared/ui/app-institution-chip/app-institution-chip.component';
import {
APARTMENT_ICON,
BUSINESS_ICON,
CITATION_ICON,
FUNDING_ICON,
INSTITUTION_ICON,
LANGUAGE_ICON,
LIBRARY_BOOKS_ICON,
LOCAL_HOSPITAL_ICON,
OPEN_IN_NEW_ICON,
PAID_ICON,
PUBLICATION_ICON,
SCHOOL_ICON,
SCIENCE_ICON,
TRENDING_UP_ICON,
VOLUNTEER_ACTIVISM_ICON,
} from '../../../../shared/ui/icons';
interface InstitutionTypeInfo {
label: string;
icon: string;
badgeClass: string;
}
const INSTITUTION_TYPE_MAP: Record<string, InstitutionTypeInfo> = {
education: {
label: 'Bildung / Hochschule',
icon: SCHOOL_ICON,
badgeClass: 'type-education',
},
healthcare: {
label: 'Klinik / Gesundheit',
icon: LOCAL_HOSPITAL_ICON,
badgeClass: 'type-healthcare',
},
company: {
label: 'Unternehmen',
icon: BUSINESS_ICON,
badgeClass: 'type-company',
},
facility: {
label: 'Forschungseinrichtung',
icon: SCIENCE_ICON,
badgeClass: 'type-facility',
},
government: {
label: 'Staatliche Einrichtung',
icon: FUNDING_ICON,
badgeClass: 'type-government',
},
nonprofit: {
label: 'Gemeinnützige Organisation',
icon: VOLUNTEER_ACTIVISM_ICON,
badgeClass: 'type-nonprofit',
},
archive: {
label: 'Archiv / Bibliothek',
icon: LIBRARY_BOOKS_ICON,
badgeClass: 'type-archive',
},
funder: {
label: 'Förderorganisation',
icon: PAID_ICON,
badgeClass: 'type-funder',
},
other: {
label: 'Sonstige Institution',
icon: INSTITUTION_ICON,
badgeClass: 'type-other',
},
};
@Component({
selector: 'app-institution-overview',
imports: [
RouterModule,
DecimalPipe,
MatCardModule,
MatIconModule,
MatButtonModule,
MatChipsModule,
MatDividerModule,
MatTooltipModule,
CountryFlagComponent,
AppInstitutionChipComponent,
],
templateUrl: './institution-overview.component.html',
styleUrl: './institution-overview.component.scss',
})
export class InstitutionOverviewComponent {
private readonly router = inject(Router);
readonly PUBLICATION_ICON = PUBLICATION_ICON;
readonly CITATION_ICON = CITATION_ICON;
readonly TRENDING_UP_ICON = TRENDING_UP_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
readonly LANGUAGE_ICON = LANGUAGE_ICON;
institution = input.required<Institution>();
showAllAlternatives = signal<boolean>(false);
displayName = computed(() => {
const inst = this.institution();
return (
inst.display_name?.trim() ||
inst.display_name_alternatives?.[0]?.trim() ||
'Unbekannte Institution'
);
});
typeInfo = computed<InstitutionTypeInfo>(() => {
const typeKey = this.institution().type?.toLowerCase() ?? 'other';
return (
INSTITUTION_TYPE_MAP[typeKey] ?? {
label: 'Institution',
icon: APARTMENT_ICON,
badgeClass: 'type-other',
}
);
});
locationText = computed(() => {
const geo = this.institution().geo;
if (!geo) return null;
const parts = [geo.city, geo.country].filter(Boolean);
return parts.length > 0 ? parts.join(', ') : null;
});
countryCode = computed(() => {
return (
this.institution().geo?.country_code ??
this.institution().country_code ??
null
);
});
alternatives = computed(() => {
return this.institution().display_name_alternatives ?? [];
});
visibleAlternatives = computed(() => {
const alts = this.alternatives();
if (this.showAllAlternatives()) return alts;
return alts.slice(0, 4);
});
hasMoreAlternatives = computed(() => {
return this.alternatives().length > 4;
});
worksCount = computed(() => this.institution().works_count);
citedByCount = computed(() => this.institution().cited_by_count);
hIndex = computed(() => this.institution().summary_stats?.h_index);
associatedInstitutions = computed<DehydratedInstitution[]>(() => {
const list = this.institution().associated_institutions ?? [];
const seen = new Set<string>();
const unique: DehydratedInstitution[] = [];
for (const item of list) {
const key = item.id || item.display_name || JSON.stringify(item);
if (!seen.has(key)) {
seen.add(key);
unique.push(item);
}
}
return unique;
});
showAllAssociated = signal<boolean>(false);
visibleAssociatedInstitutions = computed(() => {
const list = this.associatedInstitutions();
if (this.showAllAssociated()) return list;
return list.slice(0, 10);
});
hasMoreAssociated = computed(() => {
return this.associatedInstitutions().length > 10;
});
homepageUrl = computed(() => this.institution().homepage_url);
rorUrl = computed(() => this.institution().ror);
toggleAlternatives(): void {
this.showAllAlternatives.update((v) => !v);
}
toggleAssociated(): void {
this.showAllAssociated.update((v) => !v);
}
navigateToInstitution(assoc: DehydratedInstitution): void {
const cleanId = this.stripOpenAlexId(assoc.id);
if (cleanId) {
this.router.navigate(['/institution', cleanId]);
}
}
stripOpenAlexId(id: string | null | undefined): string | undefined {
if (!id) return undefined;
return id.replace('https://openalex.org/', '');
}
}
@@ -1,14 +1,5 @@
<div class="container">
<div class="content">
<h1>{{ institution().display_name }}</h1>
<mat-card appearance="outlined">
<mat-card-content>
<p>{{ institution().homepage_url }}</p>
<p>{{ institution().display_name_alternatives }}</p>
<p>And many more useful details...</p>
</mat-card-content>
</mat-card>
</div>
<div class="institution-container">
<app-institution-overview [institution]="institution()" />
<app-link-tab-nav-bar [links]="_links()" [tabPanel]="tabPanel" />
</div>
<mat-tab-nav-panel #tabPanel>
@@ -1,12 +1,6 @@
.container {
.institution-container {
display: flex;
flex-direction: column;
gap: 1rem;
}
.content {
display: flex;
flex-direction: column;
gap: 1rem;
margin: 0 1rem;
margin: 1rem;
}
@@ -1,8 +1,8 @@
import { Component, computed, input } from '@angular/core';
import { RouterModule } from '@angular/router';
import { Institution } from '../../api';
import { MatCardModule } from '@angular/material/card';
import { MatTabsModule } from '@angular/material/tabs';
import { InstitutionOverviewComponent } from './components/institution-overview/institution-overview.component';
import {
LinkTabNavBarComponent,
LinkTabNavBarItem,
@@ -15,7 +15,12 @@ import {
@Component({
selector: 'app-institution',
imports: [MatCardModule, MatTabsModule, RouterModule, LinkTabNavBarComponent],
imports: [
InstitutionOverviewComponent,
LinkTabNavBarComponent,
MatTabsModule,
RouterModule,
],
templateUrl: './institution.component.html',
styleUrl: './institution.component.scss',
})
@@ -19,7 +19,7 @@
<mat-form-field
class="patents-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
<mat-icon matPrefix>{{ SORT_ICON }}</mat-icon>
<mat-select
[value]="sortColumn()"
(selectionChange)="setSort($event.value)">
@@ -623,7 +623,11 @@ export class KeywordsSearchComponent {
}
isSearchDisabled(): boolean {
return this.selectedKeywords().length === 0 || this.isExtracting();
return (
this.selectedKeywords().length === 0 ||
this.isExtracting() ||
this.loadingNewKeyword()
);
}
onExtractKeywordsClick(): void {
@@ -29,7 +29,7 @@
<mat-checkbox
class="author-select"
[checked]="isSelected(author)"
(change)="toggleSelect(author)" />
(change)="toggleSelect(author, $event)" />
<a
class="author-name"
[routerLink]="['/person', authorProfileId(author), 'overview']">
@@ -1,11 +1,15 @@
import { Component, OnInit, computed, inject, signal } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
import { distinctUntilChanged, map, skip } from 'rxjs';
import { DecimalPipe } from '@angular/common';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatCheckboxModule } from '@angular/material/checkbox';
import {
MatCheckboxChange,
MatCheckboxModule,
} from '@angular/material/checkbox';
import { MatIconModule } from '@angular/material/icon';
import { MatSnackBar } from '@angular/material/snack-bar';
import { FormsModule } from '@angular/forms';
@@ -98,6 +102,35 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
return p && p['size'] ? +p['size'] || 10 : 10;
});
// The ranking matches the same two ways the works tab does: with fuzzy on,
// the searched values are the OpenAlex topic ids; with fuzzy off, they are the
// raw keywords. The url is authoritative for the ids (deep links, reload),
// with the parent state as fallback.
private readonly urlTopicIds = computed(() => {
const raw = this.queryParams()?.['topics'];
if (!raw) return [];
const joined = Array.isArray(raw) ? raw.join(',') : raw;
return joined
.split(',')
.map((id: string) => id.trim())
.filter(Boolean);
});
private readonly topicIds = computed(() => {
const fromUrl = this.urlTopicIds();
return fromUrl.length > 0 ? fromUrl : this.state.topicIds();
});
// fuzzy only applies when topic ids are actually available; without them the
// works tab falls back to matching the raw keywords, and so does this
private readonly fuzzyMatch = computed(
() => this.state.fuzzySearch() && this.topicIds().length > 0,
);
private readonly searchTerms = computed(() =>
this.fuzzyMatch() ? this.topicIds() : this.state.keywordsList(),
);
readonly paginatedAuthors = computed(() => {
const all = this.authors();
const start = this.pageIndex() * this.pageSize();
@@ -297,6 +330,23 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
private hasLoadedInitial = false;
constructor() {
// The Fuzzy Search toggle sits in the parent component and only writes to
// the url, so the ranking has to be re-requested when the flag flips.
// skip(1) drops the state at mount, which the initial load already covers.
this.route.queryParamMap
.pipe(
map((params) => params.get('fuzzy') === 'true'),
distinctUntilChanged(),
skip(1),
takeUntilDestroyed(),
)
.subscribe(() => {
this.loadAuthors();
this.loadPublicationTypeCounts();
});
}
ngOnInit(): void {
// restore the timespan from the URL so the range is shareable/bookmarkable
this.timespanFrom.set(this.readYearParam('tFrom', this.minYear));
@@ -419,7 +469,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
return this.selectedIds().includes(this.authorProfileId(author));
}
toggleSelect(author: RankedAuthor): void {
toggleSelect(author: RankedAuthor, event?: MatCheckboxChange): void {
const id = this.authorProfileId(author);
const current = this.selectedIds();
@@ -429,6 +479,11 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
}
if (current.length >= this.MAX_SELECTED) {
// the checkbox already toggled itself, so revert it: the [checked] input
// does not change here and would leave the box visually ticked
if (event) {
event.source.checked = false;
}
this.snackBar.open(
`Es können maximal ${this.MAX_SELECTED} Autoren verglichen werden.`,
'OK',
@@ -449,7 +504,9 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
this.router.navigate(['/compare'], {
queryParams: {
authors: this.selectedIds().join(','),
keywords: this.state.topicsList().join(','),
keywords: this.state.keywordsList().join(','),
topics: this.fuzzyMatch() ? this.topicIds().join(',') : null,
fuzzy: this.fuzzyMatch(),
operator: this.keywordOperator(),
pubType:
this.selectedPubTypes().length > 0
@@ -465,9 +522,9 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
const rawWeights = this.currentWeights().raw;
const request: KeywordToAuthorRequest = {
keywords: this.state.topicsList(),
keywords: this.searchTerms(),
operator: this.keywordOperator(),
filter_type: 'topic',
fuzzy: this.fuzzyMatch(),
publication_types:
this.selectedPubTypes().length > 0
? this.selectedPubTypes()
@@ -506,9 +563,9 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
// career-stage/timespan filters — drives the "Art der Work" filter options
private loadPublicationTypeCounts(): void {
const request: PublicationTypeCountsRequest = {
keywords: this.state.topicsList(),
keywords: this.searchTerms(),
operator: this.keywordOperator(),
filter_type: 'topic',
fuzzy: this.fuzzyMatch(),
career_stages:
this.careerStages().length > 0 ? this.careerStages() : undefined,
timespan: {
@@ -22,14 +22,9 @@
<span class="mode-badge">
<mat-slide-toggle
labelPosition="before"
[matTooltip]="
isPersonsTab()
? 'Auf dem Personen-Tab wird immer nach Themen gerankt, daher ist Fuzzy Search hier fest aktiviert.'
: 'Wenn aktiviert, werden die extrahierten Keywords auf bekannte Themenbereiche abgebildet, man kann dann nach Themen filtern. Wenn deaktiviert, werden die Keywords direkt für die Suche verwendet.'
"
matTooltip="Wenn aktiviert, werden die extrahierten Keywords auf bekannte Themenbereiche abgebildet, man kann dann nach Themen filtern. Wenn deaktiviert, werden die Keywords direkt für die Suche verwendet."
(change)="onToggleFuzzySearch($event)"
[checked]="state.fuzzySearch()"
[disabled]="isPersonsTab()">
[checked]="state.fuzzySearch()">
Fuzzy Search
</mat-slide-toggle>
</span>
@@ -64,29 +59,9 @@
</mat-card-content>
</mat-card>
<nav
mat-tab-nav-bar
[tabPanel]="resultTabPanel"
class="result-nav sg-tab-nav">
@for (route of childRoutes; track route.path) {
<a
mat-tab-link
[routerLink]="route.path"
routerLinkActive
#rla="routerLinkActive"
[active]="rla.isActive"
[queryParams]="{
keywords: state.payload()?.keywords?.join(','),
fuzzy: tabFuzzyValue(route),
topics: tabFuzzyValue(route) ? state.topicIds() : null,
topicId: null,
}"
queryParamsHandling="replace">
<mat-icon>{{ route.icon }}</mat-icon>
{{ route.label }}
</a>
}
</nav>
@if (resultTabPanel) {
<app-link-tab-nav-bar [links]="_links()" [tabPanel]="resultTabPanel" />
}
<mat-tab-nav-panel #resultTabPanel>
<router-outlet />
@@ -101,13 +101,6 @@ $touch-target: 44px;
}
}
/* ============================================================
CHILD ROUTE NAV
============================================================ */
.result-nav {
margin-top: 0.5rem;
}
/* ============================================================
EMPTY STATE
============================================================ */
@@ -170,8 +163,4 @@ $touch-target: 44px;
width: 100%;
justify-content: center;
}
.result-nav {
overflow-x: auto;
}
}
@@ -1,12 +1,6 @@
import { Component, computed, inject, signal } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import {
ActivatedRoute,
Router,
RouterLink,
RouterLinkActive,
RouterOutlet,
} from '@angular/router';
import { ActivatedRoute, Router, RouterOutlet } from '@angular/router';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
@@ -34,19 +28,21 @@ import {
PERSONS_ICON,
PROJECT_ICON,
} from '../../../shared/ui/icons';
import {
LinkTabNavBarComponent,
LinkTabNavBarItem,
} from '../../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
@Component({
selector: 'app-keywords-search-results',
standalone: true,
imports: [
RouterLink,
RouterLinkActive,
RouterOutlet,
MatButtonModule,
MatCardModule,
MatIconModule,
TopicChipComponent,
MatTabsModule,
LinkTabNavBarComponent,
MatSlideToggleModule,
MatTooltipModule,
],
@@ -76,6 +72,90 @@ export class KeywordsSearchResultsComponent {
{ path: 'trends', label: 'Visualisierung', icon: BAR_CHART_ICON },
];
_links = computed<LinkTabNavBarItem[]>(() => {
const links: LinkTabNavBarItem[] = [
{
label: 'Personen',
icon: PERSONS_ICON,
path: 'persons',
queryParams: {
keywords: this.state.payload()?.keywords?.join(','),
fuzzy: this.tabFuzzyValue('persons'),
topics: this.tabFuzzyValue('persons') ? this.state.topicIds() : null,
topicId: null,
},
queryParamsHandling: 'replace',
disabled: false,
},
{
label: 'Projekte',
icon: PROJECT_ICON,
path: 'projects',
queryParams: {
keywords: this.state.payload()?.keywords?.join(','),
fuzzy: this.tabFuzzyValue('projects'),
topics: this.tabFuzzyValue('projects') ? this.state.topicIds() : null,
topicId: null,
},
queryParamsHandling: 'replace',
disabled: false,
},
{
label: 'Patente',
icon: PATENT_ICON,
path: 'patents',
queryParams: {
keywords: this.state.payload()?.keywords?.join(','),
fuzzy: this.tabFuzzyValue('patents'),
topics: this.tabFuzzyValue('patents') ? this.state.topicIds() : null,
topicId: null,
},
queryParamsHandling: 'replace',
disabled: false,
},
{
label: 'Publikationen',
icon: ARTICLE_ICON,
path: 'works',
queryParams: {
keywords: this.state.payload()?.keywords?.join(','),
fuzzy: this.tabFuzzyValue('works'),
topics: this.tabFuzzyValue('works') ? this.state.topicIds() : null,
topicId: null,
},
queryParamsHandling: 'replace',
disabled: false,
},
{
label: 'Nachrichten',
icon: NEWS_ICON,
path: 'news',
queryParams: {
keywords: this.state.payload()?.keywords?.join(','),
fuzzy: this.tabFuzzyValue('news'),
topics: this.tabFuzzyValue('news') ? this.state.topicIds() : null,
topicId: null,
},
queryParamsHandling: 'replace',
disabled: false,
},
{
label: 'Visualisierung',
icon: BAR_CHART_ICON,
path: 'trends',
queryParams: {
keywords: this.state.payload()?.keywords?.join(','),
fuzzy: this.tabFuzzyValue('trends'),
topics: this.tabFuzzyValue('trends') ? this.state.topicIds() : null,
topicId: null,
},
queryParamsHandling: 'replace',
disabled: false,
},
];
return links;
});
private readonly lastUserFuzzy = signal(false);
readonly selectedKeywordCount = computed(() => this.state.keywords().length);
@@ -100,12 +180,7 @@ export class KeywordsSearchResultsComponent {
// previous search never gets silently applied to a new one.
this.route.queryParamMap.pipe(takeUntilDestroyed()).subscribe((params) => {
const keywords = this.parseKeywordList(params.get('keywords'));
const onPersonsTab = this.isPersonsTab();
const fuzzySearch = onPersonsTab || params.get('fuzzy') === 'true';
if (!onPersonsTab) {
this.lastUserFuzzy.set(params.get('fuzzy') === 'true');
}
const fuzzySearch = params.get('fuzzy') === 'true';
const cached = this.readHandoffCache();
const cacheMatches =
@@ -120,10 +195,6 @@ export class KeywordsSearchResultsComponent {
? cached!.patentKeywordEntries
: undefined,
});
if (onPersonsTab && params.get('fuzzy') !== 'true') {
this.updateQueryParams(true);
}
});
}
@@ -132,8 +203,8 @@ export class KeywordsSearchResultsComponent {
return this.route.snapshot.firstChild?.routeConfig?.path === 'persons';
}
tabFuzzyValue(route: { path: string }): boolean {
if (route.path === 'persons') return true;
tabFuzzyValue(path: string): boolean {
if (path === 'persons') return true;
return this.lastUserFuzzy();
}
goBackToSearch(): void {
@@ -51,52 +51,13 @@
<div class="card-body">
@if (institution(); as inst) {
<div class="institution-row" style="margin-bottom: 8px">
<button
type="button"
class="institution-tag"
[class.active]="isInstitutionActive()"
[class.is-loading]="loading()"
[matTooltip]="inst.display_name || ''"
[matTooltipDisabled]="loading()"
matTooltipPosition="above"
(click)="institutionClick.emit(inst); $event.stopPropagation()">
<mat-icon
style="
font-size: 12px;
width: 12px;
height: 12px;
margin-right: 4px;
vertical-align: middle;
"
>{{ APARTMENT_ICON }}</mat-icon
>
<span
[skText]="loading()"
class="institution-name"
style="vertical-align: middle"
>{{ inst.display_name ?? '' }}</span
>
@if (inst.country_code && !loading()) {
<app-country-flag
[countryCode]="inst.country_code"
[height]="10"
[bordered]="false"
style="margin-left: 6px" />
<span
class="country-code"
style="font-size: 9px; margin-left: 2px; vertical-align: middle"
>{{ inst.country_code.toUpperCase() }}</span
>
}
@if (institutionPageId() && !loading()) {
<mat-icon
class="institution-open-icon"
(click)="openInstitutionPage($event)"
aria-label="Institutionsseite öffnen"
>{{ OPEN_IN_NEW_ICON }}</mat-icon
>
}
</button>
<app-institution-chip
[institution]="inst"
size="mini"
[showIcon]="true"
[isClickable]="true"
[isSelected]="isInstitutionActive()"
(handleChipClick)="institutionClick.emit($event)" />
</div>
}
@@ -136,111 +136,6 @@
overflow: hidden;
text-overflow: ellipsis;
}
.institution {
display: flex;
align-items: center;
gap: 6px;
margin: 0;
font-size: 12px;
color: var(--sg-text-muted);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.institution-tag {
background: var(--sg-primary-soft);
border: 1px solid var(--sg-primary-border, var(--sg-border));
color: var(--sg-primary);
font-size: 10px;
font-weight: 600;
padding: 2px 6px;
border-radius: 4px;
cursor: pointer;
display: inline-flex;
align-items: center;
transition: all 0.2s ease;
max-width: 100%;
box-sizing: border-box;
margin: 0;
line-height: normal;
font-family: inherit;
.institution-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
min-width: 0;
flex: 1;
}
app-country-flag {
flex-shrink: 0;
}
.country-code {
display: inline-block;
flex-shrink: 0;
white-space: nowrap;
}
.institution-open-icon {
flex-shrink: 0;
width: 12px;
height: 12px;
margin-left: 5px;
font-size: 12px;
line-height: 1;
vertical-align: middle;
cursor: pointer;
opacity: 0;
transition: opacity 0.15s ease;
&:hover {
opacity: 1;
}
}
&:hover .institution-open-icon {
opacity: 0.7;
&:hover {
opacity: 1;
}
}
&:hover,
&:focus-visible {
background: var(--sg-primary);
color: var(--sg-background);
border-color: var(--sg-primary);
outline: none;
box-shadow:
0 0 0 2px var(--sg-background),
0 0 0 4px var(--sg-primary);
}
&.active {
border-color: var(--sg-primary);
box-shadow:
0 0 0 1px var(--sg-background),
0 0 0 3px var(--sg-primary);
}
&.active:hover,
&.active:focus-visible {
background: var(--sg-primary);
color: var(--sg-background);
}
&.is-loading {
pointer-events: none;
background: var(--sg-surface-soft);
border-color: var(--sg-border);
color: var(--sg-text-soft);
box-shadow: none;
}
}
.person-id {
margin: 2px 0 0;
@@ -1,20 +1,18 @@
import { Component, inject, input, computed, output } from '@angular/core';
import { Component, input, computed, output } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Router, RouterLink } from '@angular/router';
import { RouterLink } from '@angular/router';
import { MatIconModule } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';
import { CustomAuthor, DehydratedInstitution, WorkTopic } from '../../api';
import { SkTextDirective } from '../../custom-directives/sk-text.directive';
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
import { CountryFlagComponent } from '../../shared/ui/country-flag/country-flag.component';
import { AppInstitutionChipComponent } from '../../shared/ui/app-institution-chip/app-institution-chip.component';
import { CareerStageChipComponent } from '../../shared/ui/career-stage-chip/career-stage-chip.component';
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
import {
APARTMENT_ICON,
BOOKMARK_BORDER_ICON,
BOOKMARK_ICON,
NETWORK_ICON,
OPEN_IN_NEW_ICON,
OVERVIEW_ICON,
PUBLICATION_ICON,
} from '../../shared/ui/icons';
@@ -29,7 +27,7 @@ import {
SkTextDirective,
MatTooltipModule,
TopicChipComponent,
CountryFlagComponent,
AppInstitutionChipComponent,
CareerStageChipComponent,
],
templateUrl: './person-card.component.html',
@@ -38,14 +36,10 @@ import {
export class PersonCardComponent {
readonly BOOKMARK_ICON = BOOKMARK_ICON;
readonly BOOKMARK_BORDER_ICON = BOOKMARK_BORDER_ICON;
readonly APARTMENT_ICON = APARTMENT_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
readonly OVERVIEW_ICON = OVERVIEW_ICON;
readonly PUBLICATION_ICON = PUBLICATION_ICON;
readonly NETWORK_ICON = NETWORK_ICON;
private readonly router = inject(Router);
person = input.required<CustomAuthor>();
isBookmarked = input<boolean>(false);
loading = input<boolean>(false);
@@ -89,20 +83,6 @@ export class PersonCardComponent {
return newestInstitution;
});
institutionPageId = computed<string | null>(
() => this.institution()?.id?.split('/').pop() ?? null,
);
openInstitutionPage(event: Event): void {
event.stopPropagation();
event.preventDefault();
const id = this.institutionPageId();
if (!id) return;
void this.router.navigate(['/institution', id]);
}
isInstitutionActive = computed<boolean>(() => {
const active = this.normalizeInstitutionId(this.activeInstitutionId());
if (!active) return false;
@@ -17,7 +17,7 @@
<mat-form-field
class="funding-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix [fontIcon]="FILTER_ICON"></mat-icon>
<mat-icon matPrefix>{{ FILTER_ICON }}</mat-icon>
<mat-select
[value]="activeFilter"
(selectionChange)="setFilter($event.value)">
@@ -31,7 +31,7 @@
<mat-form-field
class="funding-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
<mat-icon matPrefix>{{ SORT_ICON }}</mat-icon>
<mat-select
[value]="sortColumn"
(selectionChange)="setSort($event.value)">
@@ -19,7 +19,7 @@
<mat-form-field
class="patents-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
<mat-icon matPrefix>{{ SORT_ICON }}</mat-icon>
<mat-select
[value]="sortColumn"
(selectionChange)="setSort($event.value)">
@@ -122,7 +122,17 @@
[size]="150"
[diameter]="150"></app-loading>
} @else if (personBio() != null) {
<h3>Biografie</h3>
<div class="bio-header">
<h3>Biografie</h3>
<span
class="ai-badge"
matTooltip="Diese Biografie wurde automatisch mit KI erstellt und kann Fehler enthalten."
matTooltipPosition="above"
[matTooltipShowDelay]="250">
<mat-icon>{{ AI_GENERATED_ICON }}</mat-icon>
KI-generiert
</span>
</div>
<p>{{ personBio() }}</p>
}
</div>
@@ -217,12 +217,41 @@
box-shadow: var(--sg-shadow-sm);
}
.bio-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 18px;
}
.bio-card h3 {
margin: 0 0 18px;
margin: 0;
font-size: 14px;
font-weight: 700;
}
.ai-badge {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 2px 8px;
border-radius: 999px;
background: var(--sg-warning-soft);
color: var(--sg-warning);
font-size: 11px;
font-weight: 600;
line-height: 1.4;
white-space: nowrap;
cursor: help;
}
.ai-badge mat-icon {
width: 14px;
height: 14px;
font-size: 14px;
}
.bio-card p {
margin: 0;
color: var(--sg-text);
@@ -49,6 +49,7 @@ import {
LinkTabNavBarItem,
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
import {
AI_GENERATED_ICON,
APARTMENT_ICON,
BOOKMARK_BORDER_ICON,
BOOKMARK_ICON,
@@ -95,6 +96,7 @@ export class PersonComponent {
readonly VERIFIED_ICON = VERIFIED_ICON;
readonly DESCRIPTION_ICON = DESCRIPTION_ICON;
readonly PERSON_ICON = PERSON_ICON;
readonly AI_GENERATED_ICON = AI_GENERATED_ICON;
private readonly router = inject(Router);
private readonly activatedRoute = inject(ActivatedRoute);
@@ -1,5 +0,0 @@
<div
echarts
[options]="chartOption()"
[autoResize]="true"
class="chart-container"></div>
@@ -1,4 +0,0 @@
.chart-container {
height: 500px;
width: 100%;
}
@@ -1,69 +0,0 @@
import {
Component,
ChangeDetectionStrategy,
input,
computed,
} from '@angular/core';
import { EChartsOption } from 'echarts';
import { NgxEchartsDirective } from 'ngx-echarts';
import { UniversityTopicData } from '../../../api';
export type DashboardMetric = 'publications' | 'citations';
@Component({
selector: 'app-university-line-chart',
templateUrl: './uni-line-chart.component.html',
styleUrl: './uni-line-chart.component.scss',
imports: [NgxEchartsDirective],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class UniversityLineChartComponent {
readonly data = input<UniversityTopicData[] | null>(null);
readonly metric = input<DashboardMetric>('publications');
readonly chartOption = computed<EChartsOption>(() => {
const rawData = this.data();
if (!rawData || rawData.length === 0) {
return {};
}
const years = rawData[0].yearly_data.map((d) => d.year);
const chosenMetric = this.metric();
const series = rawData.map((uni) => ({
name: uni.university,
type: 'line',
smooth: true,
emphasis: { focus: 'series' },
animationDuration: 2000,
data: uni.yearly_data.map((d) => {
if (chosenMetric === 'citations') {
return d.citations || 0;
}
return d.publications || 0;
}),
}));
return {
title: {
text: 'Research Output Over Time',
left: 'center',
textStyle: { fontWeight: 'lighter' },
},
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
legend: { bottom: 0 },
grid: { left: '3%', right: '4%', bottom: '15%', containLabel: true },
xAxis: {
type: 'category',
boundaryGap: false,
data: years.map(String),
},
yAxis: {
type: 'value',
name: chosenMetric === 'citations' ? 'Citations' : 'Publications',
},
dataZoom: [{ type: 'slider', show: true, bottom: 40 }],
series: series as any,
};
});
}
@@ -1,42 +0,0 @@
<div class="ranking-card">
<h4>Topic Rankings</h4>
@if (loading) {
<div class="skeleton-loader">Loading rankings...</div>
} @else {
<table class="ranking-table">
<thead>
<tr>
<th>Rank</th>
<th>University</th>
<th>Latest</th>
<th>5Y Growth</th>
<th>Trend</th>
</tr>
</thead>
<tbody>
@for (row of rankings; track $index) {
<tr [class.top-tier]="row.rank <= 3">
<td>#{{ row.rank }}</td>
<td>
{{ row.university }}
@if (row.is_top_mover) {
<span class="mover-badge" title="Top mover last 3 years"
>🔥</span
>
}
</td>
<td>{{ row.publications | number }}</td>
<td
[class.positive]="row.growth_rate > 0"
[class.negative]="row.growth_rate < 0">
{{ row.growth_rate | number: '1.0-1' }}%
</td>
<td class="trend-col" [attr.data-trend]="row.trend">
{{ getTrendIcon(row.trend) }}
</td>
</tr>
}
</tbody>
</table>
}
</div>
@@ -1,21 +0,0 @@
// src/app/modules/university-ranking/components/ranking-table/university-ranking-table.component.ts
import { Component, Input } from '@angular/core';
import { UniversityRanking } from '../../../api';
import { DecimalPipe } from '@angular/common';
@Component({
selector: 'app-university-ranking-table',
templateUrl: './uni-ranking-table.component.html',
styleUrls: ['./uni-ranking-table.component.scss'],
imports: [DecimalPipe],
})
export class UniversityRankingTableComponent {
@Input() rankings: UniversityRanking[] = [];
@Input() loading: boolean = false;
getTrendIcon(trend: string): string {
if (trend === 'up') return '↑';
if (trend === 'down') return '↓';
return '→';
}
}
@@ -33,33 +33,35 @@
}
</mat-card-content>
<mat-divider />
@if (this.rawOaAuthorId()) {
<mat-divider />
<mat-card-footer>
<mat-card-actions class="card-actions">
<a
class="card-action"
[routerLink]="['/person', this.rawOaAuthorId()]"
matButton="outlined">
<mat-icon>{{ INFO_ICON }}</mat-icon>
Übersicht
</a>
<a
class="card-action"
[routerLink]="['/person', this.rawOaAuthorId(), 'publications']"
matButton="outlined">
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
Publikationen
</a>
@if (this.showProjects()) {
<mat-card-footer>
<mat-card-actions class="card-actions">
<a
class="card-action"
[routerLink]="['/person', this.rawOaAuthorId(), 'projects']"
[routerLink]="['/person', this.rawOaAuthorId()]"
matButton="outlined">
<mat-icon>{{ PROJECT_ICON }}</mat-icon>
Projekte
<mat-icon>{{ INFO_ICON }}</mat-icon>
Übersicht
</a>
}
</mat-card-actions>
</mat-card-footer>
<a
class="card-action"
[routerLink]="['/person', this.rawOaAuthorId(), 'publications']"
matButton="outlined">
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
Publikationen
</a>
@if (this.showProjects()) {
<a
class="card-action"
[routerLink]="['/person', this.rawOaAuthorId(), 'projects']"
matButton="outlined">
<mat-icon>{{ PROJECT_ICON }}</mat-icon>
Projekte
</a>
}
</mat-card-actions>
</mat-card-footer>
}
</mat-card>
@@ -2,6 +2,7 @@
class="author-chip"
[appComponentTooltip]="AuthorTooltipComponent"
[tooltipInputs]="{ author: _author(), authorId: rawOaAuthorId() }"
[tooltipDisabled]="isTooltipDisabled()"
[tooltipMaxWidth]="'500px'"
(keydown)="_onChipClick($event)"
(click)="_onChipClick($event)">
@@ -54,6 +54,20 @@ export class AppAuthorChipComponent {
size = input<'normal' | 'mini'>('normal');
isMiniSize = computed(() => this.size() === 'mini');
tooltipDisabled = input<boolean>(false);
hasValidAuthor = computed(() => {
const rawId = this.rawOaAuthorId();
return Boolean(
rawId &&
rawId.trim().length > 0 &&
rawId !== 'undefined' &&
rawId !== 'null',
);
});
isTooltipDisabled = computed(() => {
return this.tooltipDisabled() || !this.hasValidAuthor();
});
constructor() {
effect(() => {
const author = this.author();
@@ -73,6 +87,7 @@ export class AppAuthorChipComponent {
}
_onChipClick(event: MouseEvent | KeyboardEvent) {
event.stopPropagation();
const author = this._author();
if (this.handleChipClick && author) {
this.handleChipClick.emit(author);
@@ -1,5 +1,5 @@
@let author = this._author();
@if (author) {
@if (author && hasValidId()) {
<app-author-card [author]="author" />
}
@@ -1,4 +1,11 @@
import { Component, effect, inject, input, signal } from '@angular/core';
import {
Component,
computed,
effect,
inject,
input,
signal,
} from '@angular/core';
import { Author, AuthorsV2Service } from '../../../api';
import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
@@ -27,9 +34,16 @@ export class AppAuthorTooltipComponent {
author = input<Author | null | undefined>(undefined);
_author = signal<Author | undefined>(undefined);
_isLoading = signal<boolean>(false);
hasValidId = computed(() => {
const a = this._author();
const id = this.authorId() ?? a?.id;
return Boolean(
id && id.trim().length > 0 && id !== 'undefined' && id !== 'null',
);
});
constructor() {
effect(() => {
const authorObj = this.author();
@@ -8,46 +8,76 @@
">
<mat-card-header>
<mat-card-title>{{ displayName() }}</mat-card-title>
<mat-card-subtitle class="city-country">
{{ institution().geo?.city }},
{{ institution().geo?.country }}
@if (institution().geo?.country_code) {
<app-country-flag
[countryCode]="institution().geo?.country_code"
[height]="10"
[bordered]="false"
style="margin-left: 6px" />
}
</mat-card-subtitle>
@if (locationText()) {
<mat-card-subtitle class="city-country">
<span>{{ locationText() }}</span>
@if (countryCode()) {
<app-country-flag
[countryCode]="countryCode()!"
[height]="10"
[bordered]="false"
style="margin-left: 6px" />
}
</mat-card-subtitle>
}
</mat-card-header>
<mat-divider />
<mat-card-content class="metrics">
<div class="metric-item">
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
<span
>{{
institution().works_count | number: undefined : 'de'
}}
Publikationen</span
>
</div>
<div class="metric-item">
<mat-icon>{{ CITATION_ICON }}</mat-icon>
<span
>{{
institution().cited_by_count | number: undefined : 'de'
}}
Zitationen</span
>
</div>
@if (
institution().works_count !== null &&
institution().works_count !== undefined
) {
<div class="metric-item">
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
<span
>{{
institution().works_count | number: undefined : 'de'
}}
Publikationen</span
>
</div>
}
@if (
institution().cited_by_count !== null &&
institution().cited_by_count !== undefined
) {
<div class="metric-item">
<mat-icon>{{ CITATION_ICON }}</mat-icon>
<span
>{{
institution().cited_by_count | number: undefined : 'de'
}}
Zitationen</span
>
</div>
}
@if (
institution().summary_stats?.h_index !== null &&
institution().summary_stats?.h_index !== undefined
) {
<div class="metric-item">
<mat-icon>{{ TRENDING_UP_ICON }}</mat-icon>
<span>h-Index: {{ institution().summary_stats?.h_index }}</span>
</div>
}
</mat-card-content>
<mat-divider />
<mat-card-footer>
<mat-card-actions class="card-actions">
@if (institution().id) {
<a
class="card-action"
[routerLink]="['/institution', stripOpenAlexId(institution().id)]"
matButton="outlined"
(click)="$event.stopPropagation()">
<mat-icon>{{ INFO_ICON }}</mat-icon>
Übersicht
</a>
}
<a
class="card-action"
[routerLink]="[
@@ -18,8 +18,10 @@ import { CountryFlagComponent } from '../country-flag/country-flag.component';
import {
CITATION_ICON,
INFO_ICON,
PROJECT_ICON,
PUBLICATION_ICON,
TRENDING_UP_ICON,
VERIFIED_ICON,
} from '../icons';
@@ -42,6 +44,8 @@ export class AppInstitutionCardComponent {
readonly CITATION_ICON = CITATION_ICON;
readonly PROJECT_ICON = PROJECT_ICON;
readonly VERIFIED_ICON = VERIFIED_ICON;
readonly INFO_ICON = INFO_ICON;
readonly TRENDING_UP_ICON = TRENDING_UP_ICON;
private readonly authService = inject(AuthService);
private readonly patentsApi = inject(PatentsService);
@@ -58,6 +62,21 @@ export class AppInstitutionCardComponent {
return 'Unbekannte Institution';
});
locationText = computed(() => {
const geo = this.institution().geo;
if (!geo) return null;
const parts = [geo.city, geo.country].filter(Boolean);
return parts.length > 0 ? parts.join(', ') : null;
});
countryCode = computed(() => {
return (
this.institution().geo?.country_code ??
this.institution().country_code ??
null
);
});
private readonly isOwnInstitutionSignal = signal(false);
isOwnInstitution = this.isOwnInstitutionSignal.asReadonly();
@@ -5,6 +5,7 @@
institution: _institution(),
institutionId: rawOaInstitutionId(),
}"
[tooltipDisabled]="isTooltipDisabled()"
[tooltipMaxWidth]="'500px'"
(keydown)="_onChipClick($event)"
(click)="_onChipClick($event)">
@@ -7,11 +7,16 @@ import {
output,
signal,
} from '@angular/core';
import { Institution, InstitutionsV2Service } from '../../../api';
import {
DehydratedInstitution,
Institution,
InstitutionsV2Service,
} from '../../../api';
import { AppInstitutionTooltipComponent } from '../app-institution-tooltip/app-institution-tooltip.component';
import { MatIconModule } from '@angular/material/icon';
import { MatChipsModule } from '@angular/material/chips';
import { ComponentTooltipDirective } from '../../../directives/component-tooltip.directive';
import { INSTITUTION_ICON } from '../icons';
@Component({
host: {
@@ -33,22 +38,40 @@ export class AppInstitutionChipComponent {
isSelected = input<boolean>(false);
isClickable = input<boolean>(false);
handleChipClick = output<Institution>();
handleChipClick = output<Institution | DehydratedInstitution>();
showIcon = input<boolean>(false);
icon = input<string>('apartment');
icon = input<string>(INSTITUTION_ICON);
institution = input<Institution | undefined>(undefined);
institution = input<Institution | DehydratedInstitution | undefined>(
undefined,
);
rawOaInstitutionId = computed(() => {
return this.stripOpenAlexId(this.institution()?.id);
});
institutionId = input<string | undefined>(undefined);
_institution = signal<Institution | undefined>(undefined);
_institution = signal<Institution | DehydratedInstitution | undefined>(
undefined,
);
size = input<'normal' | 'mini'>('normal');
isMiniSize = computed(() => this.size() === 'mini');
tooltipDisabled = input<boolean>(false);
hasValidInstitution = computed(() => {
const rawId = this.rawOaInstitutionId() ?? this.institutionId();
return Boolean(
rawId &&
rawId.trim().length > 0 &&
rawId !== 'undefined' &&
rawId !== 'null',
);
});
isTooltipDisabled = computed(() => {
return this.tooltipDisabled() || !this.hasValidInstitution();
});
constructor() {
effect(() => {
const institution = this.institution();
@@ -1,5 +1,5 @@
@let institution = this._institution();
@if (institution) {
@if (institution && hasValidId()) {
<app-institution-card [institution]="institution" />
}
@@ -1,5 +1,16 @@
import { Component, effect, inject, input, signal } from '@angular/core';
import { Institution, InstitutionsV2Service } from '../../../api';
import {
Component,
computed,
effect,
inject,
input,
signal,
} from '@angular/core';
import {
DehydratedInstitution,
Institution,
InstitutionsV2Service,
} from '../../../api';
import { AppInstitutionCardComponent } from '../app-institution-card/app-institution-card.component';
@Component({
@@ -12,24 +23,42 @@ export class AppInstitutionTooltipComponent {
private readonly institutionsService = inject(InstitutionsV2Service);
institutionId = input<string | null | undefined>(undefined);
institution = input<Institution | null | undefined>(undefined);
institution = input<Institution | DehydratedInstitution | null | undefined>(
undefined,
);
_institution = signal<Institution | undefined>(undefined);
_isLoading = signal<boolean>(false);
hasValidId = computed(() => {
const inst = this._institution();
const id = this.institutionId() ?? inst?.id;
return Boolean(
id && id.trim().length > 0 && id !== 'undefined' && id !== 'null',
);
});
constructor() {
effect(() => {
const institutionObj = this.institution();
const institutionId = this.institutionId() ?? institutionObj?.id;
if (institutionObj) {
this._institution.set(institutionObj);
this._isLoading.set(false);
}
const hasCompleteMetrics = Boolean(
institutionObj &&
(institutionObj as Institution).works_count !== undefined &&
(institutionObj as Institution).works_count !== null &&
(institutionObj as Institution).cited_by_count !== undefined &&
(institutionObj as Institution).cited_by_count !== null,
);
if (institutionId) {
if (hasCompleteMetrics && institutionObj) {
this._institution.set(institutionObj as Institution);
this._isLoading.set(false);
} else if (institutionId) {
const cleanId = institutionId.replace('https://openalex.org/', '');
if (institutionObj) {
this._institution.set(institutionObj as Institution);
}
this._isLoading.set(true);
this.institutionsService.getInstitutionById2(cleanId).subscribe({
next: (fetchedInst) => {
@@ -43,7 +72,10 @@ export class AppInstitutionTooltipComponent {
this._isLoading.set(false);
},
});
} else if (!institutionObj) {
} else if (institutionObj) {
this._institution.set(institutionObj as Institution);
this._isLoading.set(false);
} else {
this._institution.set(undefined);
this._isLoading.set(false);
}
@@ -11,23 +11,40 @@ import { AppPublicationCardComponent } from '../app-publication-card/app-publica
export class AppPublicationTooltipComponent {
private readonly worksService = inject(WorksV2Service);
workId = input.required<string>();
workId = input<string | null | undefined>(undefined);
work = input<Work | null | undefined>(undefined);
_work = signal<Work | undefined>(undefined);
_isLoading = signal<boolean>(false);
constructor() {
effect(() => {
const workId = this.workId();
if (!workId) {
this._work.set(undefined);
}
this._isLoading.set(true);
this.worksService.getWorkById(workId).subscribe((work) => {
this._work.set(work);
const workObj = this.work();
const workId = this.workId() ?? workObj?.id;
if (workObj) {
this._work.set(workObj);
this._isLoading.set(false);
});
}
if (workId) {
this._isLoading.set(true);
this.worksService.getWorkById(workId).subscribe({
next: (fetchedWork) => {
this._work.set({
...workObj,
...fetchedWork,
});
this._isLoading.set(false);
},
error: () => {
this._isLoading.set(false);
},
});
} else if (!workObj) {
this._work.set(undefined);
this._isLoading.set(false);
}
});
}
}
@@ -90,6 +90,7 @@ export class AppTopicChipComponent {
});
_onChipClick(event: MouseEvent | KeyboardEvent) {
event.stopPropagation();
const topic = this.topic();
if (this.isClickable() && this.handleChipClick && topic) {
this.handleChipClick.emit(topic);
@@ -55,7 +55,7 @@
[matTooltip]="getInstitutionTooltipText(institutions[0])"
matTooltipPosition="above"
[attr.aria-label]="getInstitutionTooltipText(institutions[0])"
(click)="filterByInstitution(institutions[0])">
(click)="filterByInstitution($event, institutions[0])">
<mat-icon class="institution-icon">{{ APARTMENT_ICON }}</mat-icon>
<span class="institution-name">{{
institutions[0].name || institutions[0].recepient || '-'
@@ -72,7 +72,7 @@
[class.active]="isFundingTypeActive(project.funding_type)"
matTooltip="Nach Typ filtern"
matTooltipPosition="above"
(click)="toggleFundingTypeFilter(project.funding_type)">
(click)="toggleFundingTypeFilter($event, project.funding_type)">
<app-chip [color]="getFundingTypeColor(project.funding_type)">
<span>{{ project.funding_type }}</span>
</app-chip>
@@ -203,7 +203,8 @@ export class BundProjectTableComponent implements OnInit {
if (normalized == 'übrige indirekte projektförderung') return 'help';
return 'info';
}
toggleFundingTypeFilter(type: string): void {
toggleFundingTypeFilter(event: Event, type: string): void {
event.stopPropagation();
const selectedTypes = this.selectedFundingTypesQueryParams();
if (selectedTypes.includes(type)) {
this.router.navigate([], {
@@ -271,7 +272,8 @@ export class BundProjectTableComponent implements OnInit {
);
}
filterByInstitution(institution: any): void {
filterByInstitution(event: Event, institution: any): void {
event.stopPropagation();
const institutionName = institution.name ?? institution.recepient;
if (!institutionName || !this.institutionFilterEnabled()) return;
@@ -2,6 +2,6 @@
type="button"
class="chip-overflow-toggle"
[attr.aria-expanded]="expanded()"
(click)="toggle.emit()">
(click)="handleToggleClick($event)">
{{ expanded() ? 'weniger' : '+' + hiddenCount() }}
</button>
@@ -10,5 +10,9 @@ export class ChipOverflowToggleComponent {
expanded = input<boolean>(false);
hiddenCount = input<number>(0);
toggle = output<void>();
toggle = output<MouseEvent>();
handleToggleClick(event: MouseEvent): void {
event.stopPropagation();
this.toggle.emit(event);
}
}
@@ -37,10 +37,7 @@
@let isClassificationsExpanded = isProjectClassificationsExpanded(project);
@let visibleClassifications =
isClassificationsExpanded ? classifications : classifications.slice(0, 3);
<div
class="classification-tags"
aria-label="Fachsystematik"
style="padding: 0.5rem 0.5rem">
<div class="classification-tags" aria-label="Fachsystematik">
@for (classification of visibleClassifications; track $index) {
<span
class="publication-institution-tag classification-tag"
@@ -183,7 +180,7 @@
[matTooltip]="getAuthorTooltipText(author)"
matTooltipPosition="above"
[attr.aria-label]="getAuthorTooltipText(author)"
(click)="filterByAuthor(author.person_id!)">
(click)="filterByAuthor($event, author.person_id!)">
<mat-icon class="institution-icon">{{ PERSON_ICON }}</mat-icon>
<span class="institution-name">{{ author.full_name }}</span>
</button>
@@ -219,7 +216,7 @@
[matTooltip]="getInstitutionTooltipText(institution)"
matTooltipPosition="above"
[attr.aria-label]="getInstitutionTooltipText(institution)"
(click)="filterByInstitution(institution)">
(click)="filterByInstitution($event, institution)">
<mat-icon class="institution-icon">{{ APARTMENT_ICON }}</mat-icon>
<span class="institution-name">{{
institution.institute_name_de || institution.institute_name_en
@@ -112,7 +112,9 @@
flex-wrap: wrap;
gap: 6px;
}
.classification-tags {
padding: 0.5rem 0.5rem;
}
.topic-chips {
max-width: 320px;
}
@@ -234,7 +234,8 @@ export class DfgProjectTableComponent implements OnInit {
}
return `Autor: ${author.full_name}`;
}
filterByAuthor(authorId: number): void {
filterByAuthor(event: Event, authorId: number): void {
event.stopPropagation();
if (!authorId || !this.authorFilterEnabled()) return;
const selectedAuthorIds = this.selectedAuthorIdsQueryParams();
if (selectedAuthorIds.includes(String(authorId))) {
@@ -317,7 +318,8 @@ export class DfgProjectTableComponent implements OnInit {
);
}
filterByInstitution(institution: any): void {
filterByInstitution(event: Event, institution: any): void {
event.stopPropagation();
const institutionId = this.getProjectInstitutionId(institution);
if (!institutionId || !this.institutionFilterEnabled()) return;
@@ -19,7 +19,7 @@
[class.active]="isTypeActive(project.project_type)"
matTooltip="Nach Typ filtern"
matTooltipPosition="above"
(click)="toggleTypeFilter(project.project_type)">
(click)="toggleTypeFilter($event, project.project_type)">
<app-chip [color]="getProjectTypeColor(project.project_type)">
<span>{{ getProjectTypeLabel(project) }}</span>
</app-chip>
@@ -92,7 +92,7 @@
[matTooltip]="getOrganizationTooltipText(organization)"
matTooltipPosition="above"
[attr.aria-label]="getOrganizationTooltipText(organization)"
(click)="filterByOrganization(organization)">
(click)="filterByOrganization($event, organization)">
<mat-icon class="institution-icon">{{ APARTMENT_ICON }}</mat-icon>
<span class="institution-name">
{{ getOrganizationName(organization) }}
@@ -106,7 +106,7 @@
<app-chip-overflow-toggle
[expanded]="isExpanded"
[hiddenCount]="organizations.length - 3"
(toggle)="toggleProjectOrganizationsExpansion(project)" />
(toggle)="toggleProjectOrganizationsExpansion($event, project)" />
}
</div>
</ng-template>
@@ -133,7 +133,7 @@
<app-chip-overflow-toggle
[expanded]="isExpanded"
[hiddenCount]="projectTopics.length - 3"
(toggle)="toggleProjectTopicsExpansion(project)" />
(toggle)="toggleProjectTopicsExpansion($event, project)" />
}
</div>
</ng-template>
@@ -207,7 +207,8 @@ export class EuProjectTableComponent {
isTypeActive(type: string): boolean {
return this.selectedTypesQueryParams().includes(type);
}
toggleTypeFilter(type: string): void {
toggleTypeFilter(event: Event, type: string): void {
event.stopPropagation();
const selectedTypes = this.selectedTypesQueryParams();
if (selectedTypes.includes(type)) {
this.router.navigate([], {
@@ -427,7 +428,11 @@ export class EuProjectTableComponent {
return `Organisation: ${name}`;
}
filterByOrganization(organization: EuCordisOrganizationSummary | any): void {
filterByOrganization(
event: Event,
organization: EuCordisOrganizationSummary | any,
): void {
event.stopPropagation();
const organizationId = this.getOrganizationId(organization);
if (!organizationId || !this.institutionFilterEnabled()) return;
@@ -452,7 +457,11 @@ export class EuProjectTableComponent {
return this.expandedProjectOrganizationsIds.includes(projectId);
}
toggleProjectOrganizationsExpansion(project: EuCordisProjectSummary): void {
toggleProjectOrganizationsExpansion(
event: Event,
project: EuCordisProjectSummary,
): void {
event.stopPropagation();
const projectId = this.getProjectId(project);
if (!projectId) return;
@@ -523,7 +532,11 @@ export class EuProjectTableComponent {
return this.expandedProjectTopicsIds.includes(projectId);
}
toggleProjectTopicsExpansion(project: EuCordisProjectSummary): void {
toggleProjectTopicsExpansion(
event: Event,
project: EuCordisProjectSummary,
): void {
event.stopPropagation();
const projectId = this.getProjectId(project);
if (!projectId) return;
+27 -20
View File
@@ -1,31 +1,35 @@
// ============================================================================
// 1. Core Domain & Entity Icons
// ============================================================================
export const ACCOUNT_BALANCE_ICON = 'account_balance' as const;
export const ACCOUNT_CIRCLE_ICON = 'account_circle' as const;
export const BOOKMARK_ICON = 'bookmark' as const;
export const BOOKMARKS_ICON = 'bookmarks' as const;
export const COMPANY_CONNECTION_ICON = 'business' as const;
export const DASHBOARD_ICON = 'dashboard' as const;
export const FUNDING_ICON = 'account_balance' as const;
export const GROUPS_ICON = 'groups' as const;
export const INSTITUTION_ICON = 'school' as const;
export const INSTITUTION_ICON = 'apartment' as const; //was 'school'
export const JOBS_ICON = 'sync' as const;
export const KEYWORDS_ICON = 'join_left' as const;
export const NEWS_ICON = 'newspaper' as const;
export const NO_ACCOUNTS_ICON = 'no_accounts' as const;
export const ORGANIZATIONS_ICON = 'domain' as const;
export const OVERVIEW_ICON = 'visibility' as const;
export const PATENT_ICON = 'workspace_premium' as const;
export const PERSON_CHECK_ICON = 'person_check' as const;
export const PERSON_CHECK_ICON = 'person_check' as const; // person check and person look the same to me
export const PERSON_ICON = 'person' as const;
export const PERSON_OFF_ICON = 'person_off' as const;
export const PERSONS_ICON = 'groups' as const;
export const GROUPS_ICON = PERSONS_ICON; // TODO
export const PROJECT_ICON = 'work' as const;
export const PUBLICATION_ICON = 'menu_book' as const;
export const MENU_BOOK_ICON = 'menu_book' as const;
export const MENU_BOOK_ICON = PUBLICATION_ICON; // TODO
export const TOPIC_ICON = 'topic' as const;
export const OVERVIEW_ICON = 'visibility' as const;
export const NO_ACCOUNTS_ICON = 'no_accounts' as const;
export const PERSON_OFF_ICON = 'person_off' as const; // person off and no accounts look similar
export const ACCOUNT_BALANCE_ICON = FUNDING_ICON; // TODO
export const ACCOUNT_CIRCLE_ICON = 'account_circle' as const; //Person Icon in company-connections
export const COMPANY_CONNECTION_ICON = 'business' as const;
// ============================================================================
// 2. Navigation, Layout & Hierarchy Icons
// ============================================================================
@@ -44,7 +48,7 @@ export const MENU_ICON = 'menu' as const;
export const NETWORK_ICON = 'share' as const;
export const NORTH_EAST_ICON = 'north_east' as const;
export const OPEN_IN_NEW_ICON = 'open_in_new' as const;
export const SUBFIELD_ICON = 'folder_open' as const;
export const UNFOLD_LESS_ICON = 'unfold_less' as const;
export const UNFOLD_MORE_ICON = 'unfold_more' as const;
@@ -92,17 +96,18 @@ export const TUNE_ICON = 'tune' as const;
// ============================================================================
// 5. Status, Feedback & Indicators Icons
// ============================================================================
export const AI_GENERATED_ICON = 'auto_awesome' as const;
export const BOOKMARK_BORDER_ICON = 'bookmark_border' as const;
export const CHECK_ICON = 'check' as const;
export const CHECK_CIRCLE_ICON = 'check_circle' as const;
export const CHECK_CIRCLE_ICON = 'check_circle' as const; // similar to check but with circle
export const CIRCLE_ICON = 'circle' as const;
export const CLOUD_OFF_ICON = 'cloud_off' as const;
export const ERROR_ICON = 'error' as const;
export const ERROR_OUTLINE_ICON = 'error_outline' as const;
export const FACT_CHECK_ICON = 'fact_check' as const;
export const HELP_ICON = 'help' as const;
export const HELP_ICON = 'help' as const; // same as info but with question mark
export const INFO_ICON = 'info' as const;
export const INFO_OUTLINE_ICON = 'info_outline' as const;
export const INFO_OUTLINE_ICON = 'info_outline' as const; // same as info but inverted
export const RULE_ICON = 'rule' as const;
export const STAR_ICON = 'star' as const;
export const VERIFIED_ICON = 'verified' as const;
@@ -135,7 +140,7 @@ export const TRENDING_UP_ICON = 'trending_up' as const;
// 7. Other
// ============================================================================
export const APARTMENT_ICON = 'apartment' as const;
export const ARTICLE_ICON = 'article' as const;
export const ARTICLE_ICON = PUBLICATION_ICON; // was 'article' (TODO change in some components like dashboard)
export const ASSIGNMENT_ICON = 'assignment' as const;
export const ATTACH_MONEY_ICON = 'attach_money' as const;
export const BIOTECH_ICON = 'biotech' as const;
@@ -154,17 +159,17 @@ export const EURO_ICON = 'euro_symbol' as const;
export const FILE_PRESENT_ICON = 'file_present' as const;
export const FLAG_ICON = 'flag' as const;
export const GAVEL_ICON = 'gavel' as const;
export const GROUP_ICON = 'group' as const;
export const GROUP_ICON = PERSONS_ICON; //TODO (was 'group')
export const IMAGE_ICON = 'image' as const;
export const INSERT_DRIVE_FILE_ICON = 'insert_drive_file' as const;
export const INTERESTS_ICON = 'interests' as const;
export const LABEL_ICON = 'label' as const;
export const INTERESTS_ICON = KEYWORDS_ICON; // was 'interests'
export const LABEL_ICON = TOPIC_ICON; //TODO
export const LANGUAGE_ICON = 'language' as const;
export const LIBRARY_BOOKS_ICON = 'library_books' as const;
export const LOCATION_ICON = 'location_on' as const;
export const MORE_INFO_ICON = 'more_info' as const;
export const PAID_ICON = 'paid' as const;
export const PEOPLE_ICON = 'people' as const;
export const PEOPLE_ICON = PERSONS_ICON; //TODO (was 'people')
export const PICTURE_AS_PDF_ICON = 'picture_as_pdf' as const;
export const PUBLIC_ICON = 'public' as const;
export const SCIENCE_ICON = 'science' as const;
@@ -173,5 +178,7 @@ export const TAG_ICON = 'tag' as const;
export const TEXT_FIELDS_ICON = 'text_fields' as const;
export const TRANSLATE_ICON = 'translate' as const;
export const VOLUNTEER_ACTIVISM_ICON = 'volunteer_activism' as const;
export const WORK_ICON = 'work' as const;
export const SCHOOL_ICON = 'school' as const;
export const LOCAL_HOSPITAL_ICON = 'local_hospital' as const;
export const WORK_ICON = PROJECT_ICON; // TODO
export const WORK_OUTLINE_ICON = 'work_outline' as const;
@@ -5,9 +5,7 @@
[routerLink]="link.path"
[queryParams]="link.queryParams"
[queryParamsHandling]="link.queryParamsHandling"
routerLinkActive
#rla="routerLinkActive"
[active]="rla.isActive"
[active]="activeLink() === link"
[disabled]="link.disabled">
<div class="link-tab-nav-bar-item">
@if (link.icon) {
@@ -3,7 +3,7 @@
<mat-label>{{ label() }}</mat-label>
}
@if (icon()) {
<mat-icon matPrefix [fontIcon]="icon()"></mat-icon>
<mat-icon matPrefix>{{ icon() }}</mat-icon>
}
<mat-select
(selectionChange)="_handleSelectionChange($event)"
@@ -1,6 +1,6 @@
<mat-form-field style="width: 100%" subscriptSizing="dynamic">
@if (icon()) {
<mat-icon matPrefix [fontIcon]="icon()"></mat-icon>
<mat-icon matPrefix>{{ icon() }}</mat-icon>
}
<mat-select
canSelectNullableOptions
@@ -1,5 +1,5 @@
<mat-form-field class="source-filter-field" subscriptSizing="dynamic">
<mat-icon matPrefix [fontIcon]="FILTER_ICON"></mat-icon>
<mat-icon matPrefix>{{ FILTER_ICON }}</mat-icon>
<mat-select
[value]="value()"
(selectionChange)="valueChange.emit($event.value)">