Clarify CaCu and CaMa chart labels
This commit is contained in:
@@ -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],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user