67cde017fa
How: VistaConfirmacion gains `botones`. Without them (cáncer de mama), the donut works like CaCu's interactive one: a click on the inner ring chooses a group, on the outer ring a result, on the centre goes back to the base; the centre names the choice under its count; the donut and the rates animate between choices; a one-line hint says how. The buttons stay in the page for the keyboard, visually hidden until one of them has the focus. CaCu keeps `botones: true` and is unchanged. Implications: on cáncer de mama the choice is made on the chart; a keyboard user tabs into the hidden buttons, which then show. A view whose centre would overflow with long labels needs shorter category names in the catalog.
82 lines
6.1 KiB
HTML
82 lines
6.1 KiB
HTML
<section class="confirmacion" [attr.aria-label]="'Confirmación histopatológica, ' + vista.textos.filas.toLowerCase()">
|
||
<p class="applied-summary">Filtro general aplicado: {{ appliedSummary }}</p>
|
||
<button mat-button type="button" class="methodology-toggle" [attr.aria-expanded]="helpOpen" (click)="toggleHelp()">Cómo leer</button>
|
||
@if (helpOpen) {
|
||
<div class="methodology">
|
||
@if (metadata) {
|
||
@for (guide of readingGuide; track guide.figura) {
|
||
<section class="reading-guide" [attr.aria-label]="'Cómo leer: ' + guide.nombre">
|
||
<h3>{{ guide.nombre }}</h3>
|
||
@if (guide.descripcion) { <p>{{ guide.descripcion }}</p> }
|
||
@if (guide.como_leer.length) { <ul>@for (line of guide.como_leer; track $index) { <li>{{ line }}</li> }</ul> }
|
||
</section>
|
||
} @empty { <p>El servicio no publica instrucciones de lectura para estas figuras.</p> }
|
||
} @else { <p>Metadatos publicados pendientes. Vuelve a abrir «Cómo leer» para reintentar su consulta.</p> }
|
||
</div>
|
||
}
|
||
@switch (status()) {
|
||
@case ('deferred') { <p role="status">La vista se cargará al acercarse a esta región.</p> }
|
||
@case ('loading') { <mat-progress-bar mode="indeterminate" [attr.aria-label]="'Cargando ' + indicador.titulo" /><p role="status">Cargando el mismo periodo para tasas y dona…</p> }
|
||
@case ('error') { <div role="alert"><p>{{ message }}</p><button mat-stroked-button type="button" (click)="retry()">Reintentar</button></div> }
|
||
@case ('incompatible') { <div role="alert"><p>Respuesta incompatible: {{ message }}</p><button mat-stroked-button type="button" (click)="retry()">Reintentar</button></div> }
|
||
}
|
||
@if (status() === 'ready' || status() === 'empty') {
|
||
@if (periods.length > 1) {
|
||
<nav class="periods" aria-label="Periodos de la confirmación histopatológica">
|
||
<button type="button" aria-label="Periodo anterior de la confirmación" [disabled]="periodIndex === 0" (click)="changePeriod(-1)">‹</button>
|
||
<span role="status">{{ periods[periodIndex] }}, {{ periodIndex + 1 }} de {{ periods.length }}</span>
|
||
<button type="button" aria-label="Periodo siguiente de la confirmación" [disabled]="periodIndex === periods.length - 1" (click)="changePeriod(1)">›</button>
|
||
</nav>
|
||
}
|
||
@if (model; as m) {
|
||
<p class="selection-status" role="status" aria-live="polite">{{ m.periodo }}, selección: {{ selectionLabel }}. {{ reading }}</p>
|
||
@if (status() === 'empty') { <p role="status">{{ vista.textos.vacio }}</p> }
|
||
@else {
|
||
@if (!vista.botones) {
|
||
<p class="hint">Haz clic en un anillo de la dona para elegir un grupo o un resultado; el centro vuelve a «{{ etiquetaBase }}».</p>
|
||
}
|
||
<!-- Without visible buttons they stay for the keyboard, shown while one has the focus. -->
|
||
<div class="legend" [class.solo-teclado]="!vista.botones" role="group" aria-label="Seleccionar resultado de biopsia">
|
||
<button type="button" (click)="select('centro')" [disabled]="isBase" aria-label="Volver a la vista base de la confirmación">Volver</button>
|
||
<div class="keys" role="group" aria-label="Grupos del anillo interior">
|
||
@for (g of m.grupos; track g.id; let i = $index) {
|
||
<button type="button" [attr.aria-pressed]="!selection?.categoria && selection?.grupo === g.id" (click)="select('grupos', i)"><span class="swatch" [style.background]="g.color" aria-hidden="true"></span>{{ g.etiqueta }}</button>
|
||
}
|
||
</div>
|
||
<div class="keys" role="group" aria-label="Grados del anillo exterior">
|
||
@for (c of m.grados; track c.id; let i = $index) {
|
||
<button type="button" [attr.aria-pressed]="selection?.categoria === c.id" (click)="select('categorias', i)"><span class="swatch" [style.background]="c.color" aria-hidden="true"></span>{{ c.etiqueta }}</button>
|
||
}
|
||
</div>
|
||
</div>
|
||
<div class="figures">
|
||
<section class="figure rates"><h3>{{ vista.textos.filas }}, {{ m.periodo }}</h3>
|
||
@if (ratesFigure) {
|
||
<app-plotly-chart [figure]="ratesFigure" [animated]="!vista.botones" [showNotes]="false" [label]="'Confirmación, tasas ' + vista.textos.filas.toLowerCase() + ', ' + m.periodo + ', ' + selectionLabel" />
|
||
}
|
||
<ul class="rate-states">
|
||
@for (t of rates; track t.fila.id) { @if (t.k === null) { <li>{{ t.fila.etiqueta }}: {{ estadoTasa(t) }}</li> } }
|
||
</ul>
|
||
</section>
|
||
<section class="figure donut"><h3>Resultado de la biopsia, {{ m.periodo }}</h3>
|
||
@if (m.conBiopsia !== null && m.conBiopsia > 0 && donutFigure) {
|
||
<app-plotly-chart [figure]="donutFigure" [animated]="!vista.botones" [showNotes]="false" [label]="'Confirmación, dona de grados de biopsia, ' + m.periodo + ', ' + selectionLabel" (plotClick)="plotClicked($event)" />
|
||
} @else { <p role="status">{{ m.conBiopsia === null ? 'Dona no disponible: hay celdas suprimidas o datos incompletos. No se calcula un total parcial.' : 'Sin ' + vista.textos.sujetos + ' con biopsia en el periodo.' }}</p> }
|
||
</section>
|
||
</div>
|
||
}
|
||
@for (note of m.notas; track $index) { <p class="note">{{ note }}</p> }
|
||
<details class="published-values"><summary>Valores publicados</summary>
|
||
<div class="table-scroll" role="region" [attr.aria-label]="'Tabla de contingencia, ' + indicador.titulo" tabindex="0">
|
||
<table><caption>Tabla de contingencia de {{ vista.textos.sujetos }}, {{ m.periodo }}</caption>
|
||
<thead><tr><th scope="col">{{ vista.textos.encabezado }}</th>@for (g of m.grados; track g.id) { <th scope="col">{{ g.etiqueta }}</th> }<th scope="col">Con biopsia</th>@for (a of m.aparte; track a.id) { <th scope="col">{{ a.etiqueta }}</th> }</tr></thead>
|
||
<tbody>@for (fila of m.filas; track fila.id) {
|
||
<tr><th scope="row">{{ fila.etiqueta }}</th>@for (g of m.grados; track g.id) { <td>{{ cellText(fila.celdas[g.id]) }}</td> }<td>{{ denText(fila.den, fila.estado) }}</td>@for (a of m.aparte; track a.id) { <td>{{ cellText(fila.aparte[a.id]) }}</td> }</tr>
|
||
}</tbody>
|
||
</table>
|
||
</div>
|
||
</details>
|
||
}
|
||
}
|
||
</section>
|