Clarify CaCu and CaMa chart labels

This commit is contained in:
Angel Capetillo Zavala
2026-12-03 15:18:22 -06:00
parent d38c795c8a
commit 63f6e16d19
13 changed files with 122 additions and 51 deletions
+6 -1
View File
@@ -54,7 +54,7 @@ import { Reading } from './measures';
@for (group of g.groups; track group.code) {
<section class="group" [attr.data-group]="group.code" [attr.aria-label]="group.label">
<h4>
{{ group.label }} <span class="n">n = {{ group.total }}</span>
{{ group.label }} <span class="n">{{ countUnit() }}: {{ group.total }}</span>
@if (group.hint) {
<span class="hint">{{ group.hint }}</span>
}
@@ -364,6 +364,11 @@ export class Readings {
readonly draw = input.required<(mode: Mode) => Figure | undefined>();
protected readonly chosen = signal('');
protected readonly countUnit = computed(() => {
const mode = this.mode();
const unit = mode.kind === 'grouped' ? mode.unit : 'pacientes';
return unit[0].toUpperCase() + unit.slice(1);
});
protected readonly mode = computed(
() => this.modes().find((m) => m.label === (this.view() || this.chosen())) ?? this.modes()[0],
);