refactor/icons #300
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)">
|
||||
|
||||
+1
-1
@@ -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)">
|
||||
|
||||
@@ -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)">
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
});
|
||||
}
|
||||
-42
@@ -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>
|
||||
-21
@@ -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 '→';
|
||||
}
|
||||
}
|
||||
@@ -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)">
|
||||
|
||||
Reference in New Issue
Block a user