Cosmetic pass: legends above plots, readable hovers and ticks, KPI qualifiers, a header that never wraps

This commit is contained in:
Roberto Treviño
2026-11-29 12:39:07 -06:00
parent 979b7cf34d
commit a93cd71126
8 changed files with 116 additions and 13 deletions
+4 -2
View File
@@ -108,6 +108,8 @@ export function nestedDonut(r: Reading, catalog: Catalog, center: string): Figur
labels: catalog.categories.map((c) => c.label),
hole: 0.74,
domain: { x: [0, 1], y: [0, 1] },
// along the thin ring, so a label fits its slice
insidetextorientation: 'tangential',
text: values.map((n, i) => (total && n / total >= 0.05 ? catalog.categories[i].label : '')),
marker: {
colors: catalog.categories.map((c) => rgba(c.color, faded.has(c.code) ? 0.3 : 1)),
@@ -150,7 +152,8 @@ export function scenarioBars(
xaxis: {
title: { text: '% de pacientes del escenario con resultado' },
ticksuffix: ' %',
range: [0, 100],
range: [0, 100.5],
dtick: 20,
},
yaxis: {
type: 'category',
@@ -159,7 +162,6 @@ export function scenarioBars(
categoryarray: y,
automargin: true,
},
legend: { orientation: 'h', y: -0.25 },
},
};
}
+14 -2
View File
@@ -53,7 +53,13 @@
@if (reports.isLoading() && k.measure) {
<app-loading [what]="k.title.toLowerCase()" />
} @else {
<div class="kpi-value" [class.pending]="!k.measure">{{ kpiValue(k) }}</div>
<div class="kpi-value" [class.pending]="!k.measure">
@let v = kpiParts(kpiValue(k));
{{ v[0] }}
@if (v[1]) {
<span class="kpi-qualifier">{{ v[1] }}</span>
}
</div>
<div class="kpi-detail">{{ kpiNote(k) }}</div>
}
</mat-card-content>
@@ -177,7 +183,13 @@
<mat-card appearance="outlined" class="kpi closing" [attr.data-measure]="section.measure">
<mat-card-content>
<h3 class="kpi-title">{{ section.title }}</h3>
<div class="kpi-value">{{ kpiValue(section) }}</div>
<div class="kpi-value">
@let w = kpiParts(kpiValue(section));
{{ w[0] }}
@if (w[1]) {
<span class="kpi-qualifier">{{ w[1] }}</span>
}
</div>
<div class="kpi-detail">{{ kpiNote(section) }}</div>
</mat-card-content>
</mat-card>
+8
View File
@@ -61,6 +61,14 @@ h2 {
font-size: 2rem;
font-weight: 500;
margin: var(--space-2) 0;
line-height: 1.15;
}
.kpi-qualifier {
display: block;
font-size: 14px;
font-weight: 400;
color: var(--color-text-secondary);
}
.kpi-detail {
+6
View File
@@ -202,6 +202,12 @@ export class TabIndicadores {
return this.byName().get(code);
}
/** A card's value and note, from its templates (a card with no measure: its words). */
/** "27 días (mediana)" as the value and its qualifier, shown smaller beneath it. */
protected kpiParts(text: string): [string, string] {
const found = /^(.*?)\s*(\([^)]*\))$/.exec(text);
return found ? [found[1], found[2]] : [text, ''];
}
protected kpiValue(k: Kpi): string {
if (!k.measure) return k.value ?? '';
const r = this.rd(k.measure);
+6
View File
@@ -10,6 +10,11 @@
margin-bottom: var(--space-4);
}
// a field as wide as its label ("Horizonte de la probabilidad")
.filters mat-form-field {
min-width: 14.5rem;
}
.table-wrap {
overflow-x: auto;
padding: 0;
@@ -43,6 +48,7 @@ a {
.worklist td small {
display: block;
white-space: nowrap;
color: var(--mat-sys-on-surface-variant);
font-size: 0.8em;
}