Files
smartguide/webapp/src/app/modules/compare-authors/compare-authors.component.html
T
Steven Tischer 97b7fe6a6f
LocationBasedServices/smartguide/pipeline/head This commit looks good
add topic treemap component and integrate into author comparison view
2026-07-23 14:03:21 +02:00

212 lines
7.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div class="compare-layout">
<header class="compare-header">
<h1>Autoren-Vergleich</h1>
<div class="compare-meta">
@if (keywords().length > 0) {
<span class="meta-chip">
<mat-icon>topic</mat-icon>
{{ keywords().join(', ') }}
</span>
}
@if (timespan(); as span) {
<span class="meta-chip">
<mat-icon>date_range</mat-icon>
{{ span.from }}–{{ span.to }}
</span>
}
</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()) {
<p class="compare-hint">Lädt…</p>
} @else if (!hasData()) {
<p class="compare-hint">Keine Daten für die ausgewählten Autoren.</p>
} @else {
<!-- section 1: stats over the topic-filtered works -->
<section class="card">
<h2 class="card-title">Kennzahlen zu den Keywords</h2>
<p class="card-sub">
Bester Wert je Zeile ist hervorgehoben. „–“ bedeutet, dass der Wert für
diese:n Autor:in nicht vorliegt.
</p>
<ng-container
[ngTemplateOutlet]="statsTable"
[ngTemplateOutletContext]="{ rows: topicRows() }" />
</section>
<!-- section 2: author-level stats, independent of the keywords and time -->
<section class="card">
<h2 class="card-title">Kennzahlen zur Person</h2>
<p class="card-sub">Unabhängig von den Keywords und Zeitraum.</p>
<ng-container
[ngTemplateOutlet]="statsTable"
[ngTemplateOutletContext]="{ rows: staticRows() }" />
</section>
<!-- section 3: topic profile over ALL works of each author -->
<section class="card">
<h2 class="card-title">Themenprofil</h2>
<p class="card-sub">"Topic-Analyse"</p>
@if (profileLoading()) {
<p class="compare-hint">Lädt…</p>
} @else if (orderedProfiles().length > 0) {
<h3 class="chart-title">Themenverteilung nach Subfield</h3>
<p class="chart-hint">
Von allen Arbeiten der Autor:innen im Zeitraum: der Anteil je
Subfield, bestimmt über das Primärthema jeder Arbeit. (Top 5)
</p>
<div
echarts
[options]="subfieldChart()"
class="profile-chart profile-chart-wide"></div>
<div class="chart-grid">
<div class="chart-box">
<h3 class="chart-title">Themen-Fokus</h3>
<p class="chart-hint">
Anzahl der Werke zum Suchthema im Verhältnis zum Gesamtwerk – und
wie viele davon das Suchthema als Primärthema tragen.
</p>
<div echarts [options]="focusChart()" class="profile-chart"></div>
</div>
<div class="chart-box">
<h3 class="chart-title">Themenbreite</h3>
<p class="chart-hint">
Einzigartige Primärthemen, Subfields und Fields im Gesamtwerk
(Primary Topic)
</p>
<div echarts [options]="breadthChart()" class="profile-chart"></div>
</div>
</div>
<h3 class="chart-title">Themenlandschaft</h3>
<p class="chart-hint">Field → Subfield → Thema</p>
<div class="treemap-author-tabs" role="tablist" aria-label="Autor:in">
@for (
author of orderedProfiles();
track author.author_id;
let i = $index
) {
<button
type="button"
role="tab"
class="treemap-author-tab"
[class.active]="treemapProfile()?.author_id === author.author_id"
[attr.aria-selected]="
treemapProfile()?.author_id === author.author_id
"
(click)="selectTreemapAuthor(i)">
<span
class="legend-swatch"
[style.background]="authorColor(author.author_id)"></span>
{{ author.display_name }}
</button>
}
</div>
<app-topic-treemap
[nodes]="treemapNodes()"
seriesName="Themen"
colorMappingBy="id"
height="420px"
emptyText="Keine Themendaten für diese:n Autor:in."
[tooltipFormatter]="treemapTooltip"></app-topic-treemap>
} @else {
<p class="compare-hint">Keine Daten für das Themenprofil.</p>
}
</section>
}
</div>
<ng-template #statsTable let-rows="rows">
<div class="table-scroll">
<table class="compare-table">
<thead>
<tr>
<th class="metric-col">Kennzahl</th>
@for (author of summary(); track author.authorId) {
<th class="author-col">
<span class="th-name">
<span
class="legend-swatch"
[style.background]="author.color"></span>
{{ author.name }}
</span>
</th>
}
</tr>
</thead>
<tbody>
@for (row of rows; track row.label) {
<tr>
<th scope="row" class="metric-col">
<span class="metric-label">{{ row.label }}</span>
<span class="metric-hint">{{ row.hint }}</span>
@if (row.kind === 'group') {
<span class="position-legend">
@for (seg of row.segments; track $index; let i = $index) {
@if (i > 0) {
<span class="pos-sep">|</span>
}
<span class="pos {{ seg.colorClass }}">{{
seg.label
}}</span>
}
</span>
}
</th>
@if (row.kind === 'group') {
@for (gc of row.groupCells; track $index) {
<td class="value-cell position-cell">
@for (v of gc.values; track $index; let i = $index) {
@if (i > 0) {
<span class="pos-sep">|</span>
}
<span class="pos {{ row.segments[i].colorClass }}">
{{
v === null
? '–'
: row.segments[i].plain
? v
: row.segments[i].decimals
? (v | number: '1.2-2')
: (v | number)
}}
</span>
}
</td>
}
} @else {
@for (cell of row.cells; track $index) {
<td class="value-cell" [class.best]="cell.best">
@if (cell.raw === null) {
<span class="value-empty">–</span>
} @else if (row.decimals) {
{{ cell.raw | number: '1.2-2' }}
} @else {
{{ cell.raw | number }}
}
</td>
}
}
</tr>
}
</tbody>
</table>
</div>
</ng-template>