enhance metadata display and integrate chip component
This commit is contained in:
@@ -4,31 +4,41 @@
|
||||
|
||||
<div class="compare-meta">
|
||||
@if (keywords().length > 0) {
|
||||
<span class="meta-chip">
|
||||
<mat-icon>topic</mat-icon>
|
||||
{{ keywords().join(', ') }}
|
||||
</span>
|
||||
<div class="meta-row">
|
||||
<span class="meta-label">Betrachtete Topics:</span>
|
||||
<div class="meta-chip-group">
|
||||
@for (keyword of keywords(); track keyword) {
|
||||
<app-chip color="secondary">
|
||||
<mat-icon>topic</mat-icon>
|
||||
{{ keyword }}
|
||||
</app-chip>
|
||||
}
|
||||
</div>
|
||||
<span class="meta-operator"
|
||||
>Verknüpfungsoperator: {{ operatorLabel() }}</span
|
||||
>
|
||||
</div>
|
||||
}
|
||||
@if (timespan(); as span) {
|
||||
<span class="meta-chip">
|
||||
<mat-icon>date_range</mat-icon>
|
||||
{{ span.from }}–{{ span.to }}
|
||||
</span>
|
||||
<div class="meta-row">
|
||||
<span class="meta-label">Betrachteter Zeitraum:</span>
|
||||
<app-chip color="secondary">
|
||||
<mat-icon>date_range</mat-icon>
|
||||
{{ span.from }}–{{ span.to }}
|
||||
</app-chip>
|
||||
</div>
|
||||
}
|
||||
@if (hasData()) {
|
||||
<div class="meta-row">
|
||||
<span class="meta-label">Betrachtete Personen:</span>
|
||||
<div class="meta-chip-group">
|
||||
@for (author of summary(); track author.authorId) {
|
||||
<app-chip [color]="author.color">{{ author.name }}</app-chip>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (hasData()) {
|
||||
<ul class="author-legend">
|
||||
@for (author of summary(); track author.authorId) {
|
||||
<li class="legend-item">
|
||||
<span
|
||||
class="legend-swatch"
|
||||
[style.background]="author.color"></span>
|
||||
<span class="legend-name">{{ author.name }}</span>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</header>
|
||||
|
||||
@if (loading()) {
|
||||
|
||||
@@ -24,45 +24,40 @@
|
||||
|
||||
.compare-meta {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.meta-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.meta-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 4px 12px;
|
||||
border-radius: 999px;
|
||||
background: var(--sg-surface-muted, #f7f9ff);
|
||||
border: 1px solid var(--sg-border, #dde5f2);
|
||||
color: var(--sg-text-muted, #64708f);
|
||||
.meta-label {
|
||||
font-size: 13px;
|
||||
|
||||
mat-icon {
|
||||
font-size: 16px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
color: var(--sg-text-soft, #8a95b3);
|
||||
}
|
||||
font-weight: 600;
|
||||
color: var(--sg-text-muted, #64708f);
|
||||
}
|
||||
|
||||
.author-legend {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
.meta-operator {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--sg-text-muted, #64708f);
|
||||
}
|
||||
|
||||
.meta-chip-group {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px 18px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.legend-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--sg-text, #101a3d);
|
||||
app-chip mat-icon {
|
||||
font-size: 16px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.legend-swatch {
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
TopicTreemapComponent,
|
||||
TreemapNode,
|
||||
} from '../../shared/ui/topic-treemap/topic-treemap.component';
|
||||
import { ChipComponent } from '../../shared/ui/chip/chip.component';
|
||||
|
||||
const AUTHOR_COLORS = ['#1565c0', '#e6550d', '#2ca02c', '#9467bd'];
|
||||
const SUBFIELD_COLORS = [
|
||||
@@ -119,6 +120,7 @@ interface SegmentDef {
|
||||
MatIconModule,
|
||||
NgxEchartsDirective,
|
||||
TopicTreemapComponent,
|
||||
ChipComponent,
|
||||
],
|
||||
templateUrl: './compare-authors.component.html',
|
||||
styleUrl: './compare-authors.component.scss',
|
||||
@@ -128,6 +130,10 @@ export class CompareAuthorsComponent implements OnInit {
|
||||
private readonly rankingService = inject(RankingService);
|
||||
|
||||
readonly keywords = signal<string[]>([]);
|
||||
readonly operator = signal<'and' | 'or'>('or');
|
||||
readonly operatorLabel = computed(() =>
|
||||
this.operator() === 'and' ? 'UND' : 'ODER',
|
||||
);
|
||||
readonly timespan = signal<{ from: number; to: number } | null>(null);
|
||||
// full OpenAlex ids in the requested order — the source of truth for colour + order
|
||||
readonly authorIds = signal<string[]>([]);
|
||||
@@ -692,6 +698,7 @@ export class CompareAuthorsComponent implements OnInit {
|
||||
}
|
||||
|
||||
const operator = rawOperator === 'and' ? 'and' : 'or';
|
||||
this.operator.set(operator);
|
||||
const publication_types = rawPubType
|
||||
? this.parseList(rawPubType)
|
||||
: undefined;
|
||||
|
||||
Reference in New Issue
Block a user