CaCu indicators: one selector for the cytology and HPV genotype views, grouped bars and genotype labels

This commit is contained in:
Angel Capetillo Zavala
2026-12-01 17:15:10 -06:00
parent 81894a3777
commit e1e8da6093
12 changed files with 785 additions and 215 deletions
+28 -2
View File
@@ -30,6 +30,7 @@ type Shown = Extract<Section, { kind: 'readings' | 'columns' | 'choice' }>;
[headline]="headline()"
[note]="s.note ?? ''"
[modes]="s.modes"
[view]="view()"
[loading]="of().loading"
[read]="of().reading"
[draw]="draw()"
@@ -39,9 +40,25 @@ type Shown = Extract<Section, { kind: 'readings' | 'columns' | 'choice' }>;
} @else {
<h2>{{ s.title }}</h2>
@if (s.kind === 'columns') {
@if (s.views) {
<mat-button-toggle-group
class="views"
[attr.aria-label]="s.viewsLabel ?? s.title"
[value]="picked() || s.views[0]"
(change)="picked.set($event.value)"
>
@for (v of s.views; track v) {
<mat-button-toggle [value]="v">{{ v }}</mat-button-toggle>
}
</mat-button-toggle-group>
}
<div class="columns">
@for (inner of s.sections; track $index) {
<app-section [section]="inner" [of]="of()" />
<app-section
[section]="inner"
[of]="of()"
[view]="inner.follows ? picked() || s.views?.[0] : undefined"
/>
}
</div>
} @else {
@@ -69,6 +86,10 @@ type Shown = Extract<Section, { kind: 'readings' | 'columns' | 'choice' }>;
margin-top: 16px;
min-width: 0;
}
.views {
flex-wrap: wrap;
margin: 4px 0 8px;
}
.columns {
display: grid;
column-gap: 16px;
@@ -82,6 +103,10 @@ type Shown = Extract<Section, { kind: 'readings' | 'columns' | 'choice' }>;
export class ReadingsSection {
readonly section = input.required<Shown>();
readonly of = input.required<Source>();
/** The mode a card of a `columns` section takes from the section's selector (its label). */
readonly view = input<string>();
/** The view a columns section's selector has chosen. */
protected readonly picked = signal('');
protected readonly chosen = signal('');
protected readonly headline = computed(() => {
@@ -105,7 +130,8 @@ export class ReadingsSection {
{ groups: [], categories },
mode.stratum ?? 'follow_up_status',
name,
mode.complete ? mode.order : undefined,
mode.order,
{ fill: mode.complete, ofAll: mode.ofAll },
);
});
}