(work-classifications): add research profiles to author comparison (ranking)
This commit is contained in:
@@ -16,10 +16,11 @@ NO_STORE_PATH_PREFIXES = (
|
||||
"/api/background-jobs",
|
||||
"/api/bookmarks",
|
||||
"/api/organizations",
|
||||
"/api/dashboard",
|
||||
"/api/rank/rank-author",
|
||||
"/api/works/v2/classification/",
|
||||
)
|
||||
"/api/dashboard",
|
||||
"/api/rank/rank-author",
|
||||
"/api/rank/orientation-profiles",
|
||||
"/api/works/v2/classification/",
|
||||
)
|
||||
|
||||
NO_STORE_PATH_FRAGMENTS = (
|
||||
"/company-connections",
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
from decimal import Decimal, ROUND_HALF_UP
|
||||
from typing import Any
|
||||
|
||||
from inse.authors.v2.service import authors_currently_belong_to_institution
|
||||
from inse.integrations import elasticsearch
|
||||
from inse.model import ESIndex
|
||||
from inse.works.v2.model import WorkPrimaryCategory
|
||||
|
||||
from .model import PublicationType, Timespan
|
||||
from .orientation_profile_model import (
|
||||
AuthorOrientationProfile,
|
||||
AuthorOrientationProfileStatus,
|
||||
)
|
||||
|
||||
|
||||
MIN_ORIENTATION_SCORE_WORKS = 5
|
||||
_SCORE_FIELD = "classification.applied_orientation_score"
|
||||
_PRIMARY_CATEGORY_VALUES = {
|
||||
category.value for category in WorkPrimaryCategory
|
||||
}
|
||||
|
||||
|
||||
def _author_filter(author_ids: list[str]) -> dict[str, Any]:
|
||||
return {
|
||||
"nested": {
|
||||
"path": "authors",
|
||||
"query": {"terms": {"authors.id": author_ids}},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def _orientation_profile_query(
|
||||
author_ids: list[str],
|
||||
publication_types: list[PublicationType],
|
||||
timespan: Timespan | None,
|
||||
) -> dict[str, Any]:
|
||||
filters: list[dict[str, Any]] = [_author_filter(author_ids)]
|
||||
|
||||
if publication_types:
|
||||
filters.append(
|
||||
{
|
||||
"terms": {
|
||||
"publication_type": [
|
||||
publication_type.value
|
||||
for publication_type in publication_types
|
||||
]
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
if timespan:
|
||||
filters.append(
|
||||
{
|
||||
"range": {
|
||||
"publication_year": {
|
||||
"gte": timespan.from_year,
|
||||
"lte": timespan.to_year,
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
return {
|
||||
"size": 0,
|
||||
"query": {"bool": {"filter": filters}},
|
||||
"aggs": {
|
||||
"authors": {
|
||||
"nested": {"path": "authors"},
|
||||
"aggs": {
|
||||
"selected": {
|
||||
"filter": {"terms": {"authors.id": author_ids}},
|
||||
"aggs": {
|
||||
"by_author": {
|
||||
"terms": {
|
||||
"field": "authors.id",
|
||||
"size": len(author_ids),
|
||||
"execution_hint": "map",
|
||||
},
|
||||
"aggs": {
|
||||
"works": {
|
||||
"reverse_nested": {},
|
||||
"aggs": {
|
||||
"classified": {
|
||||
"filter": {
|
||||
"exists": {
|
||||
"field": (
|
||||
"classification."
|
||||
"primary_category"
|
||||
)
|
||||
}
|
||||
},
|
||||
"aggs": {
|
||||
"by_primary_category": {
|
||||
"terms": {
|
||||
"field": (
|
||||
"classification."
|
||||
"primary_category"
|
||||
),
|
||||
"size": len(
|
||||
WorkPrimaryCategory
|
||||
),
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
"scored": {
|
||||
"filter": {
|
||||
"exists": {
|
||||
"field": _SCORE_FIELD
|
||||
}
|
||||
},
|
||||
"aggs": {
|
||||
"average_score": {
|
||||
"avg": {
|
||||
"field": _SCORE_FIELD
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def _rounded_score(value: float) -> int:
|
||||
return int(Decimal(str(value)).quantize(Decimal("1"), rounding=ROUND_HALF_UP))
|
||||
|
||||
|
||||
def _profile_from_bucket(
|
||||
author_id: str,
|
||||
bucket: dict[str, Any] | None,
|
||||
) -> AuthorOrientationProfile:
|
||||
works = (bucket or {}).get("works", {})
|
||||
classified_count = works.get("classified", {}).get("doc_count", 0)
|
||||
category_buckets = (
|
||||
works.get("classified", {})
|
||||
.get("by_primary_category", {})
|
||||
.get("buckets", [])
|
||||
)
|
||||
category_counts = {
|
||||
WorkPrimaryCategory(category_bucket["key"]): category_bucket["doc_count"]
|
||||
for category_bucket in category_buckets
|
||||
if category_bucket.get("key") in _PRIMARY_CATEGORY_VALUES
|
||||
}
|
||||
scored = works.get("scored", {})
|
||||
scored_count = scored.get("doc_count", 0)
|
||||
average_score = scored.get("average_score", {}).get("value")
|
||||
|
||||
if classified_count == 0:
|
||||
status = AuthorOrientationProfileStatus.NO_CLASSIFIED_PUBLICATIONS
|
||||
elif scored_count == 0 or average_score is None:
|
||||
status = AuthorOrientationProfileStatus.NO_ORIENTATION_SCORE
|
||||
elif scored_count < MIN_ORIENTATION_SCORE_WORKS:
|
||||
status = (
|
||||
AuthorOrientationProfileStatus.INSUFFICIENT_SCORED_PUBLICATIONS
|
||||
)
|
||||
else:
|
||||
score = _rounded_score(average_score)
|
||||
return AuthorOrientationProfile(
|
||||
author_id=author_id,
|
||||
status=AuthorOrientationProfileStatus.AVAILABLE,
|
||||
orientation_score=score,
|
||||
primary_category_counts=category_counts,
|
||||
classified_work_count=classified_count,
|
||||
scored_work_count=scored_count,
|
||||
)
|
||||
|
||||
return AuthorOrientationProfile(
|
||||
author_id=author_id,
|
||||
status=status,
|
||||
primary_category_counts=category_counts,
|
||||
classified_work_count=classified_count,
|
||||
scored_work_count=scored_count,
|
||||
)
|
||||
|
||||
|
||||
async def orientation_profiles_for_authors(
|
||||
author_ids: list[str],
|
||||
institution_id: str | None,
|
||||
publication_types: list[PublicationType],
|
||||
timespan: Timespan | None,
|
||||
) -> list[AuthorOrientationProfile]:
|
||||
"""Return protected orientation profiles in the requested author order.
|
||||
|
||||
Institution membership is checked for all authors in one query. Only
|
||||
matching active members are included in the work-classification
|
||||
aggregation, so restricted classification data is never retrieved.
|
||||
"""
|
||||
|
||||
if not institution_id:
|
||||
allowed_author_ids: set[str] = set()
|
||||
else:
|
||||
allowed_author_ids = await authors_currently_belong_to_institution(
|
||||
author_ids,
|
||||
institution_id,
|
||||
)
|
||||
|
||||
restricted_profiles = {
|
||||
author_id: AuthorOrientationProfile(
|
||||
author_id=author_id,
|
||||
status=AuthorOrientationProfileStatus.RESTRICTED,
|
||||
)
|
||||
for author_id in author_ids
|
||||
if author_id not in allowed_author_ids
|
||||
}
|
||||
|
||||
allowed_in_request_order = [
|
||||
author_id for author_id in author_ids if author_id in allowed_author_ids
|
||||
]
|
||||
profiles_by_id: dict[str, AuthorOrientationProfile] = restricted_profiles
|
||||
|
||||
if allowed_in_request_order:
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.WORK_CLASSIFICATIONS,
|
||||
body=_orientation_profile_query(
|
||||
allowed_in_request_order,
|
||||
publication_types,
|
||||
timespan,
|
||||
),
|
||||
)
|
||||
buckets = (
|
||||
response.get("aggregations", {})
|
||||
.get("authors", {})
|
||||
.get("selected", {})
|
||||
.get("by_author", {})
|
||||
.get("buckets", [])
|
||||
)
|
||||
buckets_by_author = {
|
||||
bucket.get("key"): bucket
|
||||
for bucket in buckets
|
||||
if isinstance(bucket.get("key"), str)
|
||||
}
|
||||
for author_id in allowed_in_request_order:
|
||||
profiles_by_id[author_id] = _profile_from_bucket(
|
||||
author_id,
|
||||
buckets_by_author.get(author_id),
|
||||
)
|
||||
|
||||
return [profiles_by_id[author_id] for author_id in author_ids]
|
||||
@@ -0,0 +1,78 @@
|
||||
from enum import StrEnum
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
from inse.works.v2.model import WorkPrimaryCategory
|
||||
|
||||
from .model import PublicationType, Timespan
|
||||
|
||||
|
||||
class AuthorOrientationProfileStatus(StrEnum):
|
||||
AVAILABLE = "available"
|
||||
INSUFFICIENT_SCORED_PUBLICATIONS = "insufficient_scored_publications"
|
||||
NO_CLASSIFIED_PUBLICATIONS = "no_classified_publications"
|
||||
NO_ORIENTATION_SCORE = "no_orientation_score"
|
||||
RESTRICTED = "restricted"
|
||||
|
||||
|
||||
class AuthorOrientationProfilesRequest(BaseModel):
|
||||
"""Filters used to compare the research orientation of selected authors."""
|
||||
|
||||
author_ids: list[str] = Field(
|
||||
min_length=1,
|
||||
max_length=4,
|
||||
description="One to four unique OpenAlex author IDs.",
|
||||
)
|
||||
publication_types: list[PublicationType] = Field(
|
||||
default_factory=list,
|
||||
description="Optional publication-type filter. Empty means all types.",
|
||||
)
|
||||
timespan: Timespan | None = Field(
|
||||
default=None,
|
||||
description="Optional inclusive publication-year filter.",
|
||||
)
|
||||
|
||||
@field_validator("author_ids")
|
||||
@classmethod
|
||||
def normalize_author_ids(cls, values: list[str]) -> list[str]:
|
||||
normalized: list[str] = []
|
||||
for value in values:
|
||||
author_id = value.strip()
|
||||
if not author_id:
|
||||
raise ValueError("author IDs must not be empty")
|
||||
if not author_id.startswith("https://openalex.org/"):
|
||||
author_id = f"https://openalex.org/{author_id}"
|
||||
if author_id in normalized:
|
||||
raise ValueError("author IDs must be unique")
|
||||
normalized.append(author_id)
|
||||
return normalized
|
||||
|
||||
|
||||
class AuthorOrientationProfile(BaseModel):
|
||||
"""Aggregated research-orientation result for one selected author."""
|
||||
|
||||
author_id: str = Field(description="The full OpenAlex author ID.")
|
||||
status: AuthorOrientationProfileStatus
|
||||
orientation_score: int | None = Field(
|
||||
default=None,
|
||||
ge=0,
|
||||
le=100,
|
||||
description="Rounded mean score, available only with enough scored works.",
|
||||
)
|
||||
primary_category_counts: dict[WorkPrimaryCategory, int] | None = Field(
|
||||
default=None,
|
||||
description=(
|
||||
"Matching work counts grouped by primary category; hidden when "
|
||||
"access is restricted."
|
||||
),
|
||||
)
|
||||
classified_work_count: int | None = Field(
|
||||
default=None,
|
||||
ge=0,
|
||||
description="Matching classified works; hidden when access is restricted.",
|
||||
)
|
||||
scored_work_count: int | None = Field(
|
||||
default=None,
|
||||
ge=0,
|
||||
description="Matching works with an orientation score; hidden when restricted.",
|
||||
)
|
||||
@@ -7,6 +7,11 @@ from inse.auth.model import AccessTokenMetadata
|
||||
from inse.auth.service import CurrentUserAccessTokenPayloadDep
|
||||
from inse.tags import Tags
|
||||
from . import logic
|
||||
from .orientation_profile_logic import orientation_profiles_for_authors
|
||||
from .orientation_profile_model import (
|
||||
AuthorOrientationProfile,
|
||||
AuthorOrientationProfilesRequest,
|
||||
)
|
||||
from .model import (
|
||||
AuthorMetricsRequest,
|
||||
AuthorStaticStats,
|
||||
@@ -117,3 +122,23 @@ async def static_stats(request: AuthorMetricsRequest):
|
||||
request.author_ids,
|
||||
request.company_status,
|
||||
)
|
||||
|
||||
|
||||
@router.post(
|
||||
"/orientation-profiles",
|
||||
response_model=List[AuthorOrientationProfile],
|
||||
)
|
||||
async def orientation_profiles(
|
||||
request: AuthorOrientationProfilesRequest,
|
||||
access_token_metadata: Annotated[
|
||||
AccessTokenMetadata, CurrentUserAccessTokenPayloadDep
|
||||
],
|
||||
):
|
||||
"""Compare orientation scores for active members of the account institution."""
|
||||
|
||||
return await orientation_profiles_for_authors(
|
||||
author_ids=request.author_ids,
|
||||
institution_id=access_token_metadata.effective_institution_id,
|
||||
publication_types=request.publication_types,
|
||||
timespan=request.timespan,
|
||||
)
|
||||
|
||||
@@ -43,6 +43,9 @@ model/authorCountsByYearInner.ts
|
||||
model/authorIds.ts
|
||||
model/authorMetricsRequest.ts
|
||||
model/authorNode.ts
|
||||
model/authorOrientationProfile.ts
|
||||
model/authorOrientationProfileStatus.ts
|
||||
model/authorOrientationProfilesRequest.ts
|
||||
model/authorPage.ts
|
||||
model/authorParsedLongestName.ts
|
||||
model/authorPositionCount.ts
|
||||
|
||||
@@ -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
|
||||
@@ -9,16 +9,26 @@
|
||||
*/
|
||||
/* tslint:disable:no-unused-variable member-ordering */
|
||||
|
||||
import { Inject, Injectable, Optional } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders, HttpParams,
|
||||
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
|
||||
} from '@angular/common/http';
|
||||
import { CustomHttpParameterCodec } from '../encoder';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Inject, Injectable, Optional } from '@angular/core';
|
||||
import {
|
||||
HttpClient,
|
||||
HttpHeaders,
|
||||
HttpParams,
|
||||
HttpResponse,
|
||||
HttpEvent,
|
||||
HttpParameterCodec,
|
||||
HttpContext,
|
||||
} from '@angular/common/http';
|
||||
import { CustomHttpParameterCodec } from '../encoder';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
// @ts-ignore
|
||||
import { AuthorMetricsRequest } from '../model/authorMetricsRequest';
|
||||
// @ts-ignore
|
||||
import { AuthorOrientationProfile } from '../model/authorOrientationProfile';
|
||||
// @ts-ignore
|
||||
import { AuthorOrientationProfilesRequest } from '../model/authorOrientationProfilesRequest';
|
||||
// @ts-ignore
|
||||
import { AuthorStaticStats } from '../model/authorStaticStats';
|
||||
// @ts-ignore
|
||||
import { AuthorTopicProfile } from '../model/authorTopicProfile';
|
||||
@@ -34,283 +44,628 @@ import { RankedAuthor } from '../model/rankedAuthor';
|
||||
import { SelectedAuthorsRequest } from '../model/selectedAuthorsRequest';
|
||||
|
||||
// @ts-ignore
|
||||
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
||||
import { Configuration } from '../configuration';
|
||||
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
||||
import { Configuration } from '../configuration';
|
||||
import { BaseService } from '../api.base.service';
|
||||
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class RankingService extends BaseService {
|
||||
constructor(
|
||||
protected httpClient: HttpClient,
|
||||
@Optional() @Inject(BASE_PATH) basePath: string | string[],
|
||||
@Optional() configuration?: Configuration,
|
||||
) {
|
||||
super(basePath, configuration);
|
||||
}
|
||||
|
||||
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
|
||||
super(basePath, configuration);
|
||||
/**
|
||||
* Orientation Profiles
|
||||
* Compare orientation scores for active members of the account institution.
|
||||
* @endpoint post /api/rank/orientation-profiles
|
||||
* @param authorOrientationProfilesRequest
|
||||
* @param secureFgpAcc
|
||||
* @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 orientationProfilesApiRankOrientationProfilesPost(
|
||||
authorOrientationProfilesRequest: AuthorOrientationProfilesRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<Array<AuthorOrientationProfile>>;
|
||||
public orientationProfilesApiRankOrientationProfilesPost(
|
||||
authorOrientationProfilesRequest: AuthorOrientationProfilesRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<Array<AuthorOrientationProfile>>>;
|
||||
public orientationProfilesApiRankOrientationProfilesPost(
|
||||
authorOrientationProfilesRequest: AuthorOrientationProfilesRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<Array<AuthorOrientationProfile>>>;
|
||||
public orientationProfilesApiRankOrientationProfilesPost(
|
||||
authorOrientationProfilesRequest: AuthorOrientationProfilesRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (
|
||||
authorOrientationProfilesRequest === null ||
|
||||
authorOrientationProfilesRequest === undefined
|
||||
) {
|
||||
throw new Error(
|
||||
'Required parameter authorOrientationProfilesRequest was null or undefined when calling orientationProfilesApiRankOrientationProfilesPost.',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rank Author
|
||||
* @endpoint post /api/rank/rank-author
|
||||
* @param keywordToAuthorRequest
|
||||
* @param secureFgpAcc
|
||||
* @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 rankAuthorApiRankRankAuthorPost(keywordToAuthorRequest: KeywordToAuthorRequest, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<RankedAuthor>>;
|
||||
public rankAuthorApiRankRankAuthorPost(keywordToAuthorRequest: KeywordToAuthorRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<RankedAuthor>>>;
|
||||
public rankAuthorApiRankRankAuthorPost(keywordToAuthorRequest: KeywordToAuthorRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<RankedAuthor>>>;
|
||||
public rankAuthorApiRankRankAuthorPost(keywordToAuthorRequest: KeywordToAuthorRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (keywordToAuthorRequest === null || keywordToAuthorRequest === undefined) {
|
||||
throw new Error('Required parameter keywordToAuthorRequest was null or undefined when calling rankAuthorApiRankRankAuthorPost.');
|
||||
}
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
// authentication (HTTPBearer) required
|
||||
localVarHeaders = this.configuration.addCredentialToHeaders(
|
||||
'HTTPBearer',
|
||||
'Authorization',
|
||||
localVarHeaders,
|
||||
'Bearer ',
|
||||
);
|
||||
|
||||
// authentication (HTTPBearer) required
|
||||
localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer ');
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
|
||||
'application/json'
|
||||
]);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [
|
||||
'application/json'
|
||||
];
|
||||
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
||||
}
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
if (localVarHttpHeaderAcceptSelected) {
|
||||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
||||
responseType_ = 'text';
|
||||
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
||||
responseType_ = 'json';
|
||||
} else {
|
||||
responseType_ = 'blob';
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/api/rank/rank-author`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Array<RankedAuthor>>('post', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: keywordToAuthorRequest,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined =
|
||||
options?.httpHeaderAccept ??
|
||||
this.configuration.selectHeaderAccept(['application/json']);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Accept',
|
||||
localVarHttpHeaderAcceptSelected,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static Stats
|
||||
* @endpoint post /api/rank/static-stats
|
||||
* @param authorMetricsRequest
|
||||
* @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 staticStatsApiRankStaticStatsPost(authorMetricsRequest: AuthorMetricsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<AuthorStaticStats>>;
|
||||
public staticStatsApiRankStaticStatsPost(authorMetricsRequest: AuthorMetricsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<AuthorStaticStats>>>;
|
||||
public staticStatsApiRankStaticStatsPost(authorMetricsRequest: AuthorMetricsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<AuthorStaticStats>>>;
|
||||
public staticStatsApiRankStaticStatsPost(authorMetricsRequest: AuthorMetricsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (authorMetricsRequest === null || authorMetricsRequest === undefined) {
|
||||
throw new Error('Required parameter authorMetricsRequest was null or undefined when calling staticStatsApiRankStaticStatsPost.');
|
||||
}
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
|
||||
'application/json'
|
||||
]);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [
|
||||
'application/json'
|
||||
];
|
||||
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
||||
}
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
if (localVarHttpHeaderAcceptSelected) {
|
||||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
||||
responseType_ = 'text';
|
||||
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
||||
responseType_ = 'json';
|
||||
} else {
|
||||
responseType_ = 'blob';
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/api/rank/static-stats`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Array<AuthorStaticStats>>('post', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: authorMetricsRequest,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = ['application/json'];
|
||||
const httpContentTypeSelected: string | undefined =
|
||||
this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Content-Type',
|
||||
httpContentTypeSelected,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Topic Profile
|
||||
* @endpoint post /api/rank/topic-profile
|
||||
* @param selectedAuthorsRequest
|
||||
* @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 topicProfileApiRankTopicProfilePost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<AuthorTopicProfile>>;
|
||||
public topicProfileApiRankTopicProfilePost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<AuthorTopicProfile>>>;
|
||||
public topicProfileApiRankTopicProfilePost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<AuthorTopicProfile>>>;
|
||||
public topicProfileApiRankTopicProfilePost(selectedAuthorsRequest: SelectedAuthorsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (selectedAuthorsRequest === null || selectedAuthorsRequest === undefined) {
|
||||
throw new Error('Required parameter selectedAuthorsRequest was null or undefined when calling topicProfileApiRankTopicProfilePost.');
|
||||
}
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
|
||||
'application/json'
|
||||
]);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [
|
||||
'application/json'
|
||||
];
|
||||
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
||||
}
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
if (localVarHttpHeaderAcceptSelected) {
|
||||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
||||
responseType_ = 'text';
|
||||
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
||||
responseType_ = 'json';
|
||||
} else {
|
||||
responseType_ = 'blob';
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/api/rank/topic-profile`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Array<AuthorTopicProfile>>('post', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: selectedAuthorsRequest,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
if (localVarHttpHeaderAcceptSelected) {
|
||||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
||||
responseType_ = 'text';
|
||||
} else if (
|
||||
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
|
||||
) {
|
||||
responseType_ = 'json';
|
||||
} else {
|
||||
responseType_ = 'blob';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Topic Stats
|
||||
* @endpoint post /api/rank/topic-stats
|
||||
* @param selectedAuthorsRequest
|
||||
* @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 topicStatsApiRankTopicStatsPost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<AuthorTopicStats>>;
|
||||
public topicStatsApiRankTopicStatsPost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<AuthorTopicStats>>>;
|
||||
public topicStatsApiRankTopicStatsPost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<AuthorTopicStats>>>;
|
||||
public topicStatsApiRankTopicStatsPost(selectedAuthorsRequest: SelectedAuthorsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (selectedAuthorsRequest === null || selectedAuthorsRequest === undefined) {
|
||||
throw new Error('Required parameter selectedAuthorsRequest was null or undefined when calling topicStatsApiRankTopicStatsPost.');
|
||||
}
|
||||
let localVarPath = `/api/rank/orientation-profiles`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Array<AuthorOrientationProfile>>(
|
||||
'post',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: authorOrientationProfilesRequest,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
|
||||
'application/json'
|
||||
]);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [
|
||||
'application/json'
|
||||
];
|
||||
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
||||
}
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
if (localVarHttpHeaderAcceptSelected) {
|
||||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
||||
responseType_ = 'text';
|
||||
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
||||
responseType_ = 'json';
|
||||
} else {
|
||||
responseType_ = 'blob';
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/api/rank/topic-stats`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Array<AuthorTopicStats>>('post', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: selectedAuthorsRequest,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
/**
|
||||
* Rank Author
|
||||
* @endpoint post /api/rank/rank-author
|
||||
* @param keywordToAuthorRequest
|
||||
* @param secureFgpAcc
|
||||
* @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 rankAuthorApiRankRankAuthorPost(
|
||||
keywordToAuthorRequest: KeywordToAuthorRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<Array<RankedAuthor>>;
|
||||
public rankAuthorApiRankRankAuthorPost(
|
||||
keywordToAuthorRequest: KeywordToAuthorRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<Array<RankedAuthor>>>;
|
||||
public rankAuthorApiRankRankAuthorPost(
|
||||
keywordToAuthorRequest: KeywordToAuthorRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<Array<RankedAuthor>>>;
|
||||
public rankAuthorApiRankRankAuthorPost(
|
||||
keywordToAuthorRequest: KeywordToAuthorRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (
|
||||
keywordToAuthorRequest === null ||
|
||||
keywordToAuthorRequest === undefined
|
||||
) {
|
||||
throw new Error(
|
||||
'Required parameter keywordToAuthorRequest was null or undefined when calling rankAuthorApiRankRankAuthorPost.',
|
||||
);
|
||||
}
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
// authentication (HTTPBearer) required
|
||||
localVarHeaders = this.configuration.addCredentialToHeaders(
|
||||
'HTTPBearer',
|
||||
'Authorization',
|
||||
localVarHeaders,
|
||||
'Bearer ',
|
||||
);
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined =
|
||||
options?.httpHeaderAccept ??
|
||||
this.configuration.selectHeaderAccept(['application/json']);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Accept',
|
||||
localVarHttpHeaderAcceptSelected,
|
||||
);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = ['application/json'];
|
||||
const httpContentTypeSelected: string | undefined =
|
||||
this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Content-Type',
|
||||
httpContentTypeSelected,
|
||||
);
|
||||
}
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
if (localVarHttpHeaderAcceptSelected) {
|
||||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
||||
responseType_ = 'text';
|
||||
} else if (
|
||||
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
|
||||
) {
|
||||
responseType_ = 'json';
|
||||
} else {
|
||||
responseType_ = 'blob';
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/api/rank/rank-author`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Array<RankedAuthor>>(
|
||||
'post',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: keywordToAuthorRequest,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static Stats
|
||||
* @endpoint post /api/rank/static-stats
|
||||
* @param authorMetricsRequest
|
||||
* @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 staticStatsApiRankStaticStatsPost(
|
||||
authorMetricsRequest: AuthorMetricsRequest,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<Array<AuthorStaticStats>>;
|
||||
public staticStatsApiRankStaticStatsPost(
|
||||
authorMetricsRequest: AuthorMetricsRequest,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<Array<AuthorStaticStats>>>;
|
||||
public staticStatsApiRankStaticStatsPost(
|
||||
authorMetricsRequest: AuthorMetricsRequest,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<Array<AuthorStaticStats>>>;
|
||||
public staticStatsApiRankStaticStatsPost(
|
||||
authorMetricsRequest: AuthorMetricsRequest,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (authorMetricsRequest === null || authorMetricsRequest === undefined) {
|
||||
throw new Error(
|
||||
'Required parameter authorMetricsRequest was null or undefined when calling staticStatsApiRankStaticStatsPost.',
|
||||
);
|
||||
}
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined =
|
||||
options?.httpHeaderAccept ??
|
||||
this.configuration.selectHeaderAccept(['application/json']);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Accept',
|
||||
localVarHttpHeaderAcceptSelected,
|
||||
);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = ['application/json'];
|
||||
const httpContentTypeSelected: string | undefined =
|
||||
this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Content-Type',
|
||||
httpContentTypeSelected,
|
||||
);
|
||||
}
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
if (localVarHttpHeaderAcceptSelected) {
|
||||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
||||
responseType_ = 'text';
|
||||
} else if (
|
||||
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
|
||||
) {
|
||||
responseType_ = 'json';
|
||||
} else {
|
||||
responseType_ = 'blob';
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/api/rank/static-stats`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Array<AuthorStaticStats>>(
|
||||
'post',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: authorMetricsRequest,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Topic Profile
|
||||
* @endpoint post /api/rank/topic-profile
|
||||
* @param selectedAuthorsRequest
|
||||
* @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 topicProfileApiRankTopicProfilePost(
|
||||
selectedAuthorsRequest: SelectedAuthorsRequest,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<Array<AuthorTopicProfile>>;
|
||||
public topicProfileApiRankTopicProfilePost(
|
||||
selectedAuthorsRequest: SelectedAuthorsRequest,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<Array<AuthorTopicProfile>>>;
|
||||
public topicProfileApiRankTopicProfilePost(
|
||||
selectedAuthorsRequest: SelectedAuthorsRequest,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<Array<AuthorTopicProfile>>>;
|
||||
public topicProfileApiRankTopicProfilePost(
|
||||
selectedAuthorsRequest: SelectedAuthorsRequest,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (
|
||||
selectedAuthorsRequest === null ||
|
||||
selectedAuthorsRequest === undefined
|
||||
) {
|
||||
throw new Error(
|
||||
'Required parameter selectedAuthorsRequest was null or undefined when calling topicProfileApiRankTopicProfilePost.',
|
||||
);
|
||||
}
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined =
|
||||
options?.httpHeaderAccept ??
|
||||
this.configuration.selectHeaderAccept(['application/json']);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Accept',
|
||||
localVarHttpHeaderAcceptSelected,
|
||||
);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = ['application/json'];
|
||||
const httpContentTypeSelected: string | undefined =
|
||||
this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Content-Type',
|
||||
httpContentTypeSelected,
|
||||
);
|
||||
}
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
if (localVarHttpHeaderAcceptSelected) {
|
||||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
||||
responseType_ = 'text';
|
||||
} else if (
|
||||
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
|
||||
) {
|
||||
responseType_ = 'json';
|
||||
} else {
|
||||
responseType_ = 'blob';
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/api/rank/topic-profile`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Array<AuthorTopicProfile>>(
|
||||
'post',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: selectedAuthorsRequest,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Topic Stats
|
||||
* @endpoint post /api/rank/topic-stats
|
||||
* @param selectedAuthorsRequest
|
||||
* @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 topicStatsApiRankTopicStatsPost(
|
||||
selectedAuthorsRequest: SelectedAuthorsRequest,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<Array<AuthorTopicStats>>;
|
||||
public topicStatsApiRankTopicStatsPost(
|
||||
selectedAuthorsRequest: SelectedAuthorsRequest,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<Array<AuthorTopicStats>>>;
|
||||
public topicStatsApiRankTopicStatsPost(
|
||||
selectedAuthorsRequest: SelectedAuthorsRequest,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<Array<AuthorTopicStats>>>;
|
||||
public topicStatsApiRankTopicStatsPost(
|
||||
selectedAuthorsRequest: SelectedAuthorsRequest,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (
|
||||
selectedAuthorsRequest === null ||
|
||||
selectedAuthorsRequest === undefined
|
||||
) {
|
||||
throw new Error(
|
||||
'Required parameter selectedAuthorsRequest was null or undefined when calling topicStatsApiRankTopicStatsPost.',
|
||||
);
|
||||
}
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined =
|
||||
options?.httpHeaderAccept ??
|
||||
this.configuration.selectHeaderAccept(['application/json']);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Accept',
|
||||
localVarHttpHeaderAcceptSelected,
|
||||
);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = ['application/json'];
|
||||
const httpContentTypeSelected: string | undefined =
|
||||
this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Content-Type',
|
||||
httpContentTypeSelected,
|
||||
);
|
||||
}
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
if (localVarHttpHeaderAcceptSelected) {
|
||||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
||||
responseType_ = 'text';
|
||||
} else if (
|
||||
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
|
||||
) {
|
||||
responseType_ = 'json';
|
||||
} else {
|
||||
responseType_ = 'blob';
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/api/rank/topic-stats`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Array<AuthorTopicStats>>(
|
||||
'post',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: selectedAuthorsRequest,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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 { AuthorOrientationProfileStatus } from './authorOrientationProfileStatus';
|
||||
import { WorkPrimaryCategory } from './workPrimaryCategory';
|
||||
|
||||
/**
|
||||
* Aggregated research-orientation result for one selected author.
|
||||
*/
|
||||
export interface AuthorOrientationProfile {
|
||||
/**
|
||||
* The full OpenAlex author ID.
|
||||
*/
|
||||
author_id: string;
|
||||
status: AuthorOrientationProfileStatus;
|
||||
orientation_score?: number | null;
|
||||
primary_category_counts?: Partial<Record<WorkPrimaryCategory, number>> | null;
|
||||
classified_work_count?: number | null;
|
||||
scored_work_count?: number | null;
|
||||
}
|
||||
export namespace AuthorOrientationProfile {}
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* 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 AuthorOrientationProfileStatus = {
|
||||
available: 'available',
|
||||
insufficient_scored_publications: 'insufficient_scored_publications',
|
||||
no_classified_publications: 'no_classified_publications',
|
||||
no_orientation_score: 'no_orientation_score',
|
||||
restricted: 'restricted',
|
||||
} as const;
|
||||
export type AuthorOrientationProfileStatus =
|
||||
(typeof AuthorOrientationProfileStatus)[keyof typeof AuthorOrientationProfileStatus];
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 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 { PublicationType } from './publicationType';
|
||||
|
||||
/**
|
||||
* Filters used to compare the research orientation of selected authors.
|
||||
*/
|
||||
export interface AuthorOrientationProfilesRequest {
|
||||
/**
|
||||
* One to four unique OpenAlex author IDs.
|
||||
*/
|
||||
author_ids: Array<string>;
|
||||
/**
|
||||
* Optional publication-type filter. Empty means all types.
|
||||
*/
|
||||
publication_types?: Array<PublicationType>;
|
||||
timespan?: Timespan | null;
|
||||
}
|
||||
@@ -9,6 +9,9 @@ export * from './authorCountsByYearInner';
|
||||
export * from './authorIds';
|
||||
export * from './authorMetricsRequest';
|
||||
export * from './authorNode';
|
||||
export * from './authorOrientationProfile';
|
||||
export * from './authorOrientationProfileStatus';
|
||||
export * from './authorOrientationProfilesRequest';
|
||||
export * from './authorPage';
|
||||
export * from './authorParsedLongestName';
|
||||
export * from './authorPositionCount';
|
||||
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
import { Component, computed, input } from '@angular/core';
|
||||
import { EChartsOption } from 'echarts';
|
||||
import { NgxEchartsDirective } from 'ngx-echarts';
|
||||
import { WorkPrimaryCategory } from '../../../api';
|
||||
import { SUBFIELD_COLORS } from '../compare-authors-colors';
|
||||
|
||||
export interface AuthorCategoryLegendItem {
|
||||
category: WorkPrimaryCategory;
|
||||
label: string;
|
||||
color: string;
|
||||
}
|
||||
|
||||
const categoryLegendItem = (
|
||||
category: WorkPrimaryCategory,
|
||||
label: string,
|
||||
color: string,
|
||||
): AuthorCategoryLegendItem => ({
|
||||
category,
|
||||
label,
|
||||
color,
|
||||
});
|
||||
|
||||
export const AUTHOR_CATEGORY_LEGEND: readonly AuthorCategoryLegendItem[] = [
|
||||
categoryLegendItem(
|
||||
WorkPrimaryCategory.BasicResearch,
|
||||
'Grundlagenforschung',
|
||||
SUBFIELD_COLORS[0],
|
||||
),
|
||||
categoryLegendItem(
|
||||
WorkPrimaryCategory.AppliedResearch,
|
||||
'Anwendungsbasierte Forschung',
|
||||
SUBFIELD_COLORS[1],
|
||||
),
|
||||
categoryLegendItem(
|
||||
WorkPrimaryCategory.ExperimentalDevelopment,
|
||||
'Experimentelle Entwicklung',
|
||||
SUBFIELD_COLORS[2],
|
||||
),
|
||||
categoryLegendItem(
|
||||
WorkPrimaryCategory.NonResearch,
|
||||
'Nicht-forschende Tätigkeit',
|
||||
SUBFIELD_COLORS[3],
|
||||
),
|
||||
categoryLegendItem(
|
||||
WorkPrimaryCategory.NotClassified,
|
||||
'Nicht klassifiziert',
|
||||
SUBFIELD_COLORS[4],
|
||||
),
|
||||
];
|
||||
|
||||
@Component({
|
||||
selector: 'app-author-category-pie',
|
||||
standalone: true,
|
||||
imports: [NgxEchartsDirective],
|
||||
template: '<div echarts class="category-chart" [options]="options()"></div>',
|
||||
styles: `
|
||||
:host {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 240px;
|
||||
}
|
||||
|
||||
.category-chart {
|
||||
width: 100%;
|
||||
height: 220px;
|
||||
}
|
||||
`,
|
||||
})
|
||||
export class AuthorCategoryPieComponent {
|
||||
counts = input<Partial<Record<WorkPrimaryCategory, number>> | null>(null);
|
||||
|
||||
readonly total = computed(() =>
|
||||
Object.values(this.counts() ?? {}).reduce(
|
||||
(sum, count) => sum + Math.max(0, count),
|
||||
0,
|
||||
),
|
||||
);
|
||||
|
||||
readonly options = computed<EChartsOption>(() => {
|
||||
const counts = this.counts() ?? {};
|
||||
const total = this.total();
|
||||
const textColor = this.cssColor('--sg-text', '#0f172a');
|
||||
const mutedColor = this.cssColor('--sg-text-muted', '#64748b');
|
||||
|
||||
return {
|
||||
animation: false,
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b}: {c} Publikationen ({d} %)',
|
||||
},
|
||||
graphic: {
|
||||
type: 'text',
|
||||
left: 'center',
|
||||
top: 'middle',
|
||||
silent: true,
|
||||
style: {
|
||||
text: `{value|${total}}\n{label|klassifiziert}`,
|
||||
textAlign: 'center',
|
||||
textVerticalAlign: 'middle',
|
||||
rich: {
|
||||
value: {
|
||||
fill: textColor,
|
||||
fontSize: 22,
|
||||
fontWeight: 700,
|
||||
lineHeight: 23,
|
||||
},
|
||||
label: {
|
||||
fill: mutedColor,
|
||||
fontSize: 11,
|
||||
fontWeight: 600,
|
||||
lineHeight: 12,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
center: ['50%', '50%'],
|
||||
avoidLabelOverlap: true,
|
||||
silent: false,
|
||||
selectedMode: false,
|
||||
padAngle: 1,
|
||||
itemStyle: {
|
||||
borderRadius: 2,
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
labelLine: { show: false },
|
||||
emphasis: {
|
||||
scale: true,
|
||||
scaleSize: 6,
|
||||
},
|
||||
data: AUTHOR_CATEGORY_LEGEND.map((item) => ({
|
||||
name: item.label,
|
||||
value: Math.max(0, counts[item.category] ?? 0),
|
||||
itemStyle: { color: item.color },
|
||||
})).filter((item) => item.value > 0),
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
|
||||
private cssColor(variable: string, fallback: string): string {
|
||||
if (typeof getComputedStyle !== 'function') {
|
||||
return fallback;
|
||||
}
|
||||
return (
|
||||
getComputedStyle(document.documentElement)
|
||||
.getPropertyValue(variable)
|
||||
.trim() || fallback
|
||||
);
|
||||
}
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
@if (visible()) {
|
||||
<mat-card appearance="outlined" class="research-profile-card">
|
||||
<mat-card-header class="profile-header">
|
||||
<mat-icon class="profile-icon">science</mat-icon>
|
||||
<div class="profile-heading">
|
||||
<mat-card-title>Forschungsprofil</mat-card-title>
|
||||
<mat-card-subtitle>
|
||||
Vergleich der Forschungsorientierung
|
||||
</mat-card-subtitle>
|
||||
</div>
|
||||
</mat-card-header>
|
||||
|
||||
<mat-card-content>
|
||||
<section aria-labelledby="category-distribution-title">
|
||||
<h3 id="category-distribution-title" class="section-title">
|
||||
Verteilung der Forschungskategorien
|
||||
</h3>
|
||||
|
||||
<div class="author-grid">
|
||||
@for (view of views(); track view.author.authorId) {
|
||||
<mat-card appearance="outlined" class="author-card">
|
||||
<mat-card-header class="author-header">
|
||||
<div class="author-heading">
|
||||
<span
|
||||
class="author-color"
|
||||
[style.background]="view.author.color"></span>
|
||||
<mat-card-title>{{ view.author.name }}</mat-card-title>
|
||||
</div>
|
||||
</mat-card-header>
|
||||
|
||||
<mat-card-content class="distribution-content">
|
||||
@if (hasCategoryData(view.profile)) {
|
||||
<app-author-category-pie
|
||||
[counts]="view.profile.primary_category_counts ?? null" />
|
||||
} @else {
|
||||
<p class="status-label distribution-status">
|
||||
{{ categoryStatusLabel(view.profile) }}
|
||||
</p>
|
||||
}
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
}
|
||||
</div>
|
||||
|
||||
<mat-chip-set class="category-legend" aria-label="Forschungskategorien">
|
||||
@for (item of categoryLegend; track item.category) {
|
||||
<mat-chip class="legend-chip" [style.--legend-color]="item.color">
|
||||
<span class="legend-color" [style.background]="item.color"></span>
|
||||
{{ item.label }}
|
||||
</mat-chip>
|
||||
}
|
||||
</mat-chip-set>
|
||||
</section>
|
||||
|
||||
<mat-divider class="section-divider"></mat-divider>
|
||||
|
||||
<section aria-labelledby="average-score-title">
|
||||
<h3 id="average-score-title" class="section-title">
|
||||
Durchschnittlicher Orientierungsscore
|
||||
</h3>
|
||||
|
||||
<div class="author-grid">
|
||||
@for (view of views(); track view.author.authorId) {
|
||||
<mat-card appearance="outlined" class="author-card">
|
||||
<mat-card-header class="author-header">
|
||||
<div class="author-heading">
|
||||
<span
|
||||
class="author-color"
|
||||
[style.background]="view.author.color"></span>
|
||||
<mat-card-title>{{ view.author.name }}</mat-card-title>
|
||||
</div>
|
||||
</mat-card-header>
|
||||
|
||||
<mat-card-content class="score-content">
|
||||
<app-orientation-gauge
|
||||
[score]="view.profile.orientation_score ?? null" />
|
||||
|
||||
@if (!isAvailable(view.profile)) {
|
||||
<p class="status-label">
|
||||
{{ statusLabel(view.profile.status) }}
|
||||
</p>
|
||||
}
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
}
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.research-profile-card {
|
||||
border-color: var(--sg-border);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 8px 24px rgb(15 23 42 / 4%);
|
||||
}
|
||||
|
||||
.profile-header {
|
||||
align-items: center;
|
||||
padding: 20px 22px 16px;
|
||||
}
|
||||
|
||||
.profile-icon {
|
||||
flex: 0 0 30px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 0 12px 0 0;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.profile-heading {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
mat-card-title {
|
||||
color: var(--sg-text);
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
mat-card-subtitle {
|
||||
margin: 0;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 13px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.research-profile-card > mat-card-content {
|
||||
padding: 10px 22px 22px;
|
||||
}
|
||||
|
||||
section {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
margin: 8px 0 12px;
|
||||
color: var(--sg-text);
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.author-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.author-card {
|
||||
min-width: 0;
|
||||
border-color: var(--sg-border);
|
||||
background: var(--sg-surface);
|
||||
}
|
||||
|
||||
.author-header {
|
||||
align-items: center;
|
||||
min-height: 52px;
|
||||
padding: 14px 16px 4px;
|
||||
}
|
||||
|
||||
.author-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.author-heading mat-card-title {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.author-color {
|
||||
flex: 0 0 auto;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.distribution-content,
|
||||
.score-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 16px 16px;
|
||||
}
|
||||
|
||||
.distribution-content {
|
||||
justify-content: center;
|
||||
min-height: 232px;
|
||||
}
|
||||
|
||||
.score-content {
|
||||
min-height: 220px;
|
||||
}
|
||||
|
||||
.score-content app-orientation-gauge {
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
.category-legend {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.legend-chip {
|
||||
--mdc-chip-elevated-container-color: color-mix(
|
||||
in srgb,
|
||||
var(--legend-color) 10%,
|
||||
var(--sg-surface)
|
||||
);
|
||||
--mdc-chip-label-text-color: var(--legend-color);
|
||||
--mdc-chip-outline-color: color-mix(
|
||||
in srgb,
|
||||
var(--legend-color) 28%,
|
||||
transparent
|
||||
);
|
||||
|
||||
border: 1px solid color-mix(in srgb, var(--legend-color) 28%, transparent);
|
||||
}
|
||||
|
||||
.legend-color {
|
||||
display: inline-block;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
margin-right: 6px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.section-divider {
|
||||
margin: 22px 0 18px;
|
||||
}
|
||||
|
||||
.status-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 34px;
|
||||
margin: 20px 0 0;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.distribution-status {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.research-profile-card > mat-card-header,
|
||||
.research-profile-card > mat-card-content {
|
||||
padding-right: 16px;
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
.author-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
import { Component, computed, input } from '@angular/core';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import {
|
||||
AuthorOrientationProfile,
|
||||
AuthorOrientationProfileStatus,
|
||||
} from '../../../api';
|
||||
import { OrientationGaugeComponent } from '../../../shared/ui/orientation-gauge/orientation-gauge.component';
|
||||
import {
|
||||
AUTHOR_CATEGORY_LEGEND,
|
||||
AuthorCategoryPieComponent,
|
||||
} from './author-category-pie.component';
|
||||
|
||||
export interface ResearchProfileAuthor {
|
||||
authorId: string;
|
||||
name: string;
|
||||
color: string;
|
||||
}
|
||||
|
||||
interface AuthorOrientationView {
|
||||
author: ResearchProfileAuthor;
|
||||
profile: AuthorOrientationProfile;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-author-research-profile',
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatCardModule,
|
||||
MatChipsModule,
|
||||
MatDividerModule,
|
||||
MatIconModule,
|
||||
AuthorCategoryPieComponent,
|
||||
OrientationGaugeComponent,
|
||||
],
|
||||
templateUrl: './author-research-profile.component.html',
|
||||
styleUrl: './author-research-profile.component.scss',
|
||||
})
|
||||
export class AuthorResearchProfileComponent {
|
||||
authors = input.required<ResearchProfileAuthor[]>();
|
||||
profiles = input.required<AuthorOrientationProfile[]>();
|
||||
loading = input(false);
|
||||
readonly categoryLegend = AUTHOR_CATEGORY_LEGEND;
|
||||
|
||||
readonly views = computed<AuthorOrientationView[]>(() => {
|
||||
const profilesById = new Map(
|
||||
this.profiles().map((profile) => [profile.author_id, profile]),
|
||||
);
|
||||
return this.authors()
|
||||
.map((author) => {
|
||||
const profile = profilesById.get(author.authorId);
|
||||
return profile ? { author, profile } : null;
|
||||
})
|
||||
.filter((view): view is AuthorOrientationView => view !== null);
|
||||
});
|
||||
|
||||
readonly visible = computed(
|
||||
() =>
|
||||
!this.loading() &&
|
||||
this.profiles().filter(
|
||||
(profile) =>
|
||||
profile.status === AuthorOrientationProfileStatus.available,
|
||||
).length >= 2,
|
||||
);
|
||||
|
||||
statusLabel(status: AuthorOrientationProfileStatus): string {
|
||||
switch (status) {
|
||||
case AuthorOrientationProfileStatus.insufficient_scored_publications:
|
||||
return 'Zu wenige Publikationen für einen Orientierungsscore';
|
||||
case AuthorOrientationProfileStatus.no_classified_publications:
|
||||
return 'Keine klassifizierten Publikationen';
|
||||
case AuthorOrientationProfileStatus.no_orientation_score:
|
||||
return 'Kein Orientierungsscore verfügbar';
|
||||
case AuthorOrientationProfileStatus.restricted:
|
||||
return 'Orientierungsscore nicht verfügbar';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
isAvailable(profile: AuthorOrientationProfile): boolean {
|
||||
return profile.status === AuthorOrientationProfileStatus.available;
|
||||
}
|
||||
|
||||
hasCategoryData(profile: AuthorOrientationProfile): boolean {
|
||||
return Object.values(profile.primary_category_counts ?? {}).some(
|
||||
(count) => count > 0,
|
||||
);
|
||||
}
|
||||
|
||||
categoryStatusLabel(profile: AuthorOrientationProfile): string {
|
||||
if (profile.status === AuthorOrientationProfileStatus.restricted) {
|
||||
return 'Forschungsprofil nicht verfügbar';
|
||||
}
|
||||
if (
|
||||
profile.status ===
|
||||
AuthorOrientationProfileStatus.no_classified_publications
|
||||
) {
|
||||
return 'Keine klassifizierten Publikationen';
|
||||
}
|
||||
return 'Keine Kategoriedaten verfügbar';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
export const AUTHOR_COLORS = ['#1565c0', '#e6550d', '#2ca02c', '#9467bd'];
|
||||
|
||||
export const SUBFIELD_COLORS = [
|
||||
'#2563eb',
|
||||
'#16a34a',
|
||||
'#d97706',
|
||||
'#7c3aed',
|
||||
'#0891b2',
|
||||
'#db2777',
|
||||
'#65a30d',
|
||||
'#b45309',
|
||||
];
|
||||
|
||||
export const OTHER_COLOR = '#9ca3af';
|
||||
@@ -97,6 +97,11 @@
|
||||
<p class="compare-hint">Keine Daten für das Themenprofil.</p>
|
||||
}
|
||||
</section>
|
||||
|
||||
<app-author-research-profile
|
||||
[authors]="researchProfileAuthors()"
|
||||
[profiles]="orientationProfiles()"
|
||||
[loading]="orientationProfilesLoading()" />
|
||||
}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ import { EChartsOption } from 'echarts';
|
||||
import { NgxEchartsDirective } from 'ngx-echarts';
|
||||
|
||||
import {
|
||||
AuthorOrientationProfile,
|
||||
AuthorOrientationProfilesRequest,
|
||||
AuthorStaticStats,
|
||||
AuthorTopicProfile,
|
||||
AuthorTopicStats,
|
||||
@@ -13,19 +15,16 @@ import {
|
||||
RankingService,
|
||||
SelectedAuthorsRequest,
|
||||
} from '../../api';
|
||||
import {
|
||||
AuthorResearchProfileComponent,
|
||||
ResearchProfileAuthor,
|
||||
} from './author-research-profile/author-research-profile.component';
|
||||
import {
|
||||
AUTHOR_COLORS,
|
||||
OTHER_COLOR,
|
||||
SUBFIELD_COLORS,
|
||||
} from './compare-authors-colors';
|
||||
|
||||
const AUTHOR_COLORS = ['#1565c0', '#e6550d', '#2ca02c', '#9467bd'];
|
||||
const SUBFIELD_COLORS = [
|
||||
'#2563eb',
|
||||
'#16a34a',
|
||||
'#d97706',
|
||||
'#7c3aed',
|
||||
'#0891b2',
|
||||
'#db2777',
|
||||
'#65a30d',
|
||||
'#b45309',
|
||||
];
|
||||
const OTHER_COLOR = '#9ca3af';
|
||||
const SUBFIELD_LIMIT = 5;
|
||||
|
||||
interface AuthorSummary {
|
||||
@@ -110,7 +109,13 @@ interface SegmentDef {
|
||||
@Component({
|
||||
selector: 'app-compare-authors',
|
||||
standalone: true,
|
||||
imports: [DecimalPipe, NgTemplateOutlet, MatIconModule, NgxEchartsDirective],
|
||||
imports: [
|
||||
DecimalPipe,
|
||||
NgTemplateOutlet,
|
||||
MatIconModule,
|
||||
NgxEchartsDirective,
|
||||
AuthorResearchProfileComponent,
|
||||
],
|
||||
templateUrl: './compare-authors.component.html',
|
||||
styleUrl: './compare-authors.component.scss',
|
||||
})
|
||||
@@ -129,7 +134,9 @@ export class CompareAuthorsComponent implements OnInit {
|
||||
readonly staticStats = signal<AuthorStaticStats[]>([]);
|
||||
// section 3: topic profile over ALL works of each author
|
||||
readonly profile = signal<AuthorTopicProfile[]>([]);
|
||||
readonly orientationProfiles = signal<AuthorOrientationProfile[]>([]);
|
||||
readonly profileLoading = signal(false);
|
||||
readonly orientationProfilesLoading = signal(false);
|
||||
readonly loading = signal(false);
|
||||
|
||||
// maps both sections onto one row per author, in the requested order
|
||||
@@ -357,6 +364,14 @@ export class CompareAuthorsComponent implements OnInit {
|
||||
.filter((p): p is AuthorTopicProfile => p !== undefined);
|
||||
});
|
||||
|
||||
readonly researchProfileAuthors = computed<ResearchProfileAuthor[]>(() => {
|
||||
return this.summary().map((author) => ({
|
||||
authorId: author.authorId,
|
||||
name: author.name,
|
||||
color: author.color,
|
||||
}));
|
||||
});
|
||||
|
||||
// colours the author names on the chart axes like the legend chips
|
||||
private authorAxisLabel(profiles: AuthorTopicProfile[]) {
|
||||
const rich: Record<string, { color: string; fontWeight: number }> = {};
|
||||
@@ -657,6 +672,11 @@ export class CompareAuthorsComponent implements OnInit {
|
||||
publication_types: publication_types,
|
||||
timespan: timespan,
|
||||
};
|
||||
const orientationRequest: AuthorOrientationProfilesRequest = {
|
||||
author_ids: fullIds,
|
||||
publication_types: publication_types,
|
||||
timespan: timespan,
|
||||
};
|
||||
|
||||
// section 1: topic-filtered works stats
|
||||
this.loading.set(true);
|
||||
@@ -698,6 +718,23 @@ export class CompareAuthorsComponent implements OnInit {
|
||||
this.staticStats.set([]);
|
||||
},
|
||||
});
|
||||
|
||||
if (fullIds.length >= 2) {
|
||||
this.orientationProfilesLoading.set(true);
|
||||
this.rankingService
|
||||
.orientationProfilesApiRankOrientationProfilesPost(orientationRequest)
|
||||
.subscribe({
|
||||
next: (results) => {
|
||||
this.orientationProfiles.set(results);
|
||||
this.orientationProfilesLoading.set(false);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error(error);
|
||||
this.orientationProfiles.set([]);
|
||||
this.orientationProfilesLoading.set(false);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private parseList(raw: string): string[] {
|
||||
|
||||
+2
-5
@@ -32,11 +32,8 @@
|
||||
Orientierungsscore
|
||||
</h3>
|
||||
<div class="score-content">
|
||||
<div echarts class="score-chart" [options]="scoreOptions()"></div>
|
||||
<div class="score-labels" aria-hidden="true">
|
||||
<span>Grundlagenorientiert</span>
|
||||
<span>Anwendungsorientiert</span>
|
||||
</div>
|
||||
<app-orientation-gauge
|
||||
[score]="profile.applied_orientation_score ?? null" />
|
||||
@if (profile.primary_category; as category) {
|
||||
<app-topic-chip
|
||||
[label]="category | workPrimaryCategory"
|
||||
|
||||
+7
-23
@@ -10,18 +10,18 @@
|
||||
}
|
||||
|
||||
.profile-header {
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
padding: 22px 24px 12px;
|
||||
}
|
||||
|
||||
.profile-icon {
|
||||
flex: 0 0 24px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin: 1px 12px 0 0;
|
||||
flex: 0 0 30px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 0 12px 0 0;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 24px;
|
||||
line-height: 24px;
|
||||
font-size: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.profile-heading {
|
||||
@@ -97,22 +97,6 @@ mat-card-content {
|
||||
padding-bottom: 22px;
|
||||
}
|
||||
|
||||
.score-chart {
|
||||
width: 100%;
|
||||
max-width: 280px;
|
||||
height: 180px;
|
||||
}
|
||||
|
||||
.score-labels {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: min(100%, 280px);
|
||||
margin-top: -36px;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.score-content app-topic-chip {
|
||||
margin-top: 24px;
|
||||
max-width: 100%;
|
||||
|
||||
+2
-46
@@ -18,6 +18,7 @@ import {
|
||||
WorkPrimaryCategory,
|
||||
} from '../../../api';
|
||||
import { WorkPrimaryCategoryPipe } from '../../../shared/pipes/work-primary-category.pipe';
|
||||
import { OrientationGaugeComponent } from '../../../shared/ui/orientation-gauge/orientation-gauge.component';
|
||||
import {
|
||||
TopicChipComponent,
|
||||
TopicChipPaletteColor,
|
||||
@@ -81,6 +82,7 @@ const LOW_CONFIDENCE_TOKENS = topicChipColorTokens('pink');
|
||||
MatIconModule,
|
||||
MatTooltipModule,
|
||||
NgxEchartsDirective,
|
||||
OrientationGaugeComponent,
|
||||
TopicChipComponent,
|
||||
WorkPrimaryCategoryPipe,
|
||||
],
|
||||
@@ -110,10 +112,6 @@ export class ResearchProfileComponent {
|
||||
this.buildQuadrantOptions(this.details()?.pasteur_quadrant),
|
||||
);
|
||||
|
||||
scoreOptions = computed<EChartsOption>(() =>
|
||||
this.buildScoreOptions(this.details()?.applied_orientation_score ?? 0),
|
||||
);
|
||||
|
||||
primaryCategoryChipColor = computed<TopicChipPaletteColor>(() => {
|
||||
switch (this.details()?.primary_category) {
|
||||
case WorkPrimaryCategory.BasicResearch:
|
||||
@@ -367,48 +365,6 @@ export class ResearchProfileComponent {
|
||||
};
|
||||
}
|
||||
|
||||
private buildScoreOptions(score: number): EChartsOption {
|
||||
const boundedScore = Math.max(0, Math.min(100, score));
|
||||
const textColor = this.cssColor('--sg-text', BLUE_TOKENS.color);
|
||||
return {
|
||||
animation: false,
|
||||
series: [
|
||||
{
|
||||
type: 'gauge',
|
||||
min: 0,
|
||||
max: 100,
|
||||
startAngle: 180,
|
||||
endAngle: 0,
|
||||
center: ['50%', '70%'],
|
||||
radius: '92%',
|
||||
progress: {
|
||||
show: true,
|
||||
width: 13,
|
||||
itemStyle: { color: BLUE_TOKENS.color },
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: { width: 13, color: [[1, BLUE_TOKENS.background]] },
|
||||
},
|
||||
pointer: { show: false },
|
||||
axisTick: { show: false },
|
||||
splitLine: { show: false },
|
||||
axisLabel: { show: false },
|
||||
anchor: { show: false },
|
||||
title: { show: false },
|
||||
detail: {
|
||||
valueAnimation: false,
|
||||
offsetCenter: [0, '-8%'],
|
||||
color: textColor,
|
||||
fontSize: 25,
|
||||
fontWeight: 700,
|
||||
formatter: '{value}',
|
||||
},
|
||||
data: [{ value: boundedScore }],
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
private cssColor(variable: string, fallback: string): string {
|
||||
if (typeof getComputedStyle !== 'function') {
|
||||
return fallback;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<div echarts class="gauge-chart" [options]="options()"></div>
|
||||
<div class="gauge-labels" aria-hidden="true">
|
||||
<span>Grundlagenorientiert</span>
|
||||
<span class="gauge-label-divider"></span>
|
||||
<span>Anwendungsorientiert</span>
|
||||
</div>
|
||||
@@ -0,0 +1,36 @@
|
||||
:host {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 280px;
|
||||
}
|
||||
|
||||
.gauge-chart {
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
}
|
||||
|
||||
.gauge-labels {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: 9px;
|
||||
width: 100%;
|
||||
margin-top: -36px;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.gauge-labels > span:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.gauge-labels > span:last-child {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.gauge-label-divider {
|
||||
width: 1px;
|
||||
height: 13px;
|
||||
background: var(--sg-border);
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import { Component, computed, input } from '@angular/core';
|
||||
import { EChartsOption } from 'echarts';
|
||||
import { NgxEchartsDirective } from 'ngx-echarts';
|
||||
import { topicChipColorTokens } from '../topic-chip/topic-chip.component';
|
||||
|
||||
const BLUE_TOKENS = topicChipColorTokens('blue');
|
||||
|
||||
@Component({
|
||||
selector: 'app-orientation-gauge',
|
||||
standalone: true,
|
||||
imports: [NgxEchartsDirective],
|
||||
templateUrl: './orientation-gauge.component.html',
|
||||
styleUrl: './orientation-gauge.component.scss',
|
||||
})
|
||||
export class OrientationGaugeComponent {
|
||||
score = input<number | null>(null);
|
||||
|
||||
readonly options = computed<EChartsOption>(() => {
|
||||
const score = this.score();
|
||||
const boundedScore = score === null ? 0 : Math.max(0, Math.min(100, score));
|
||||
const textColor = this.cssColor('--sg-text', BLUE_TOKENS.color);
|
||||
const trackColor =
|
||||
score === null
|
||||
? this.cssColor('--sg-surface-muted', BLUE_TOKENS.background)
|
||||
: BLUE_TOKENS.background;
|
||||
|
||||
return {
|
||||
animation: false,
|
||||
series: [
|
||||
{
|
||||
type: 'gauge',
|
||||
min: 0,
|
||||
max: 100,
|
||||
startAngle: 180,
|
||||
endAngle: 0,
|
||||
center: ['50%', '70%'],
|
||||
radius: '92%',
|
||||
progress: {
|
||||
show: score !== null,
|
||||
width: 13,
|
||||
itemStyle: { color: BLUE_TOKENS.color },
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: { width: 13, color: [[1, trackColor]] },
|
||||
},
|
||||
pointer: { show: false },
|
||||
axisTick: { show: false },
|
||||
splitLine: { show: false },
|
||||
axisLabel: { show: false },
|
||||
anchor: { show: false },
|
||||
title: { show: false },
|
||||
detail: {
|
||||
valueAnimation: false,
|
||||
offsetCenter: [0, '-8%'],
|
||||
color: textColor,
|
||||
fontSize: 25,
|
||||
fontWeight: 700,
|
||||
formatter: score === null ? '–' : '{value}',
|
||||
},
|
||||
data: [{ value: boundedScore }],
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
|
||||
private cssColor(variable: string, fallback: string): string {
|
||||
if (typeof getComputedStyle !== 'function') {
|
||||
return fallback;
|
||||
}
|
||||
return (
|
||||
getComputedStyle(document.documentElement)
|
||||
.getPropertyValue(variable)
|
||||
.trim() || fallback
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user