feat(cama): histopathological confirmation drawn like CaCu's, by BI-RADS category
How: CaCu's confirmation view (rates per row with their horizontal Wilson interval, and a donut of biopsy results whose buttons choose what the rates count) takes a VistaConfirmacion: indicator id, stratum, fixed rows (most severe on top), the grade whose group is the base view, the grade read as a false positive, and its words. CONFIRMACION_CACU reproduces the previous behaviour exactly; CONFIRMACION_CAMA reads cama_histopatologia_birads by BI-RADS 6, 5, 4C, 4B and 4A, with "Maligno" (the group of INVASOR) as the base, so the base rate is the cancer detection rate, and "Benigno" alone reads as false positives. The catalog card chooses the view with vistaConfirmacion(dominio, indicador). Implications: the backend must publish cama_histopatologia_birads stratified by `birads`, with exactly two groups of results (plus SIN_DATO/SIN_BIOPSIA kept apart), as cacu_confirmacion_citologia is. The EU7-style view stays available through the catalog's `escenario` field but no CaMa indicator uses it now.
This commit is contained in:
@@ -18,7 +18,7 @@ import { IndicadorEu7Escenario } from './indicador-eu7-escenario';
|
|||||||
import { vistaEscenario } from './indicadores-eu7-escenario';
|
import { vistaEscenario } from './indicadores-eu7-escenario';
|
||||||
import { IndicadorTiemposPareados } from './indicador-tiempos-pareados';
|
import { IndicadorTiemposPareados } from './indicador-tiempos-pareados';
|
||||||
import { IndicadorConfirmacionCitologia } from './indicador-confirmacion-citologia';
|
import { IndicadorConfirmacionCitologia } from './indicador-confirmacion-citologia';
|
||||||
import { ID_CONFIRMACION } from './indicadores-confirmacion-citologia';
|
import { vistaConfirmacion } from './indicadores-confirmacion-citologia';
|
||||||
import { parTiempos } from './indicadores-tiempos-pareados';
|
import { parTiempos } from './indicadores-tiempos-pareados';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -122,7 +122,7 @@ export class IndicadorCatalogCard implements OnChanges, OnDestroy {
|
|||||||
}
|
}
|
||||||
get pair() { return dualFigures(this.indicador); }
|
get pair() { return dualFigures(this.indicador); }
|
||||||
get isEu7() { return !!vistaEscenario(this.dominio, this.indicador); }
|
get isEu7() { return !!vistaEscenario(this.dominio, this.indicador); }
|
||||||
get isConfirmacion() { return this.dominio === 'cacu' && this.indicador.id === ID_CONFIRMACION; }
|
get isConfirmacion() { return !!vistaConfirmacion(this.dominio, this.indicador); }
|
||||||
// Connected time pairs replace the diagnosis card with one coordinated box plot.
|
// Connected time pairs replace the diagnosis card with one coordinated box plot.
|
||||||
get tiempos() { return parTiempos(this.dominio, this.indicador.id); }
|
get tiempos() { return parTiempos(this.dominio, this.indicador.id); }
|
||||||
get isDual() { return this.pair.includes(this.selectedFigure ?? ''); }
|
get isDual() { return this.pair.includes(this.selectedFigure ?? ''); }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<section class="confirmacion" aria-label="Confirmación histopatológica por resultado de la citología">
|
<section class="confirmacion" [attr.aria-label]="'Confirmación histopatológica, ' + vista.textos.filas.toLowerCase()">
|
||||||
<p class="applied-summary">Filtro general aplicado: {{ appliedSummary }}</p>
|
<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>
|
<button mat-button type="button" class="methodology-toggle" [attr.aria-expanded]="helpOpen" (click)="toggleHelp()">Cómo leer</button>
|
||||||
@if (helpOpen) {
|
@if (helpOpen) {
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
@switch (status()) {
|
@switch (status()) {
|
||||||
@case ('deferred') { <p role="status">La vista se cargará al acercarse a esta región.</p> }
|
@case ('deferred') { <p role="status">La vista se cargará al acercarse a esta región.</p> }
|
||||||
@case ('loading') { <mat-progress-bar mode="indeterminate" aria-label="Cargando citologías y biopsias" /><p role="status">Cargando el mismo periodo para tasas y dona…</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 ('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> }
|
@case ('incompatible') { <div role="alert"><p>Respuesta incompatible: {{ message }}</p><button mat-stroked-button type="button" (click)="retry()">Reintentar</button></div> }
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
@if (model; as m) {
|
@if (model; as m) {
|
||||||
<p class="selection-status" role="status" aria-live="polite">{{ m.periodo }}, selección: {{ selectionLabel }}. {{ reading }}</p>
|
<p class="selection-status" role="status" aria-live="polite">{{ m.periodo }}, selección: {{ selectionLabel }}. {{ reading }}</p>
|
||||||
@if (status() === 'empty') { <p role="status">No hay citologías de alto grado publicadas para este periodo.</p> }
|
@if (status() === 'empty') { <p role="status">{{ vista.textos.vacio }}</p> }
|
||||||
@else {
|
@else {
|
||||||
<div class="legend" role="group" aria-label="Seleccionar resultado de biopsia">
|
<div class="legend" 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>
|
<button type="button" (click)="select('centro')" [disabled]="isBase" aria-label="Volver a la vista base de la confirmación">Volver</button>
|
||||||
@@ -46,9 +46,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="figures">
|
<div class="figures">
|
||||||
<section class="figure rates"><h3>Por resultado de la citología, {{ m.periodo }}</h3>
|
<section class="figure rates"><h3>{{ vista.textos.filas }}, {{ m.periodo }}</h3>
|
||||||
@if (ratesFigure) {
|
@if (ratesFigure) {
|
||||||
<app-plotly-chart [figure]="ratesFigure" [showNotes]="false" [label]="'Confirmación, tasas por citología, ' + m.periodo + ', ' + selectionLabel" />
|
<app-plotly-chart [figure]="ratesFigure" [showNotes]="false" [label]="'Confirmación, tasas ' + vista.textos.filas.toLowerCase() + ', ' + m.periodo + ', ' + selectionLabel" />
|
||||||
}
|
}
|
||||||
<ul class="rate-states">
|
<ul class="rate-states">
|
||||||
@for (t of rates; track t.fila.id) { @if (t.k === null) { <li>{{ t.fila.etiqueta }}: {{ estadoTasa(t) }}</li> } }
|
@for (t of rates; track t.fila.id) { @if (t.k === null) { <li>{{ t.fila.etiqueta }}: {{ estadoTasa(t) }}</li> } }
|
||||||
@@ -57,15 +57,15 @@
|
|||||||
<section class="figure donut"><h3>Resultado de la biopsia, {{ m.periodo }}</h3>
|
<section class="figure donut"><h3>Resultado de la biopsia, {{ m.periodo }}</h3>
|
||||||
@if (m.conBiopsia !== null && m.conBiopsia > 0 && donutFigure) {
|
@if (m.conBiopsia !== null && m.conBiopsia > 0 && donutFigure) {
|
||||||
<app-plotly-chart [figure]="donutFigure" [showNotes]="false" [label]="'Confirmación, dona de grados de biopsia, ' + m.periodo + ', ' + selectionLabel" (plotClick)="plotClicked($event)" />
|
<app-plotly-chart [figure]="donutFigure" [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 mujeres con biopsia en el periodo.' }}</p> }
|
} @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>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@for (note of m.notas; track $index) { <p class="note">{{ note }}</p> }
|
@for (note of m.notas; track $index) { <p class="note">{{ note }}</p> }
|
||||||
<details class="published-values"><summary>Valores publicados</summary>
|
<details class="published-values"><summary>Valores publicados</summary>
|
||||||
<div class="table-scroll" role="region" aria-label="Tabla de contingencia de citología y biopsia" tabindex="0">
|
<div class="table-scroll" role="region" [attr.aria-label]="'Tabla de contingencia, ' + indicador.titulo" tabindex="0">
|
||||||
<table><caption>Tabla de contingencia de mujeres, {{ m.periodo }}</caption>
|
<table><caption>Tabla de contingencia de {{ vista.textos.sujetos }}, {{ m.periodo }}</caption>
|
||||||
<thead><tr><th scope="col">Citología</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>
|
<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) {
|
<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>
|
<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>
|
}</tbody>
|
||||||
|
|||||||
@@ -8,12 +8,9 @@ import { Dominio, Indicador, IndicadorMetadatos, PlotlyFigure, Tema } from './in
|
|||||||
import { describePeriods, filterCompatibility, GlobalApplied } from './indicadores-memory';
|
import { describePeriods, filterCompatibility, GlobalApplied } from './indicadores-memory';
|
||||||
import { IndicadoresSnapshots, snapshotKey } from './indicadores-snapshots';
|
import { IndicadoresSnapshots, snapshotKey } from './indicadores-snapshots';
|
||||||
import { httpMessage } from './indicadores-http';
|
import { httpMessage } from './indicadores-http';
|
||||||
import { clicConfirmacion, ConfirmacionIncompatible, donaConfirmacion, ESTRATO_CITOLOGIA, estadoTasa, figuraTasas, ID_CONFIRMACION,
|
import { clicConfirmacion, ConfirmacionIncompatible, CONFIRMACION_CACU, donaConfirmacion, estadoTasa, figuraTasas,
|
||||||
lectura, ModeloConfirmacion, modeloConfirmacion, periodosConfirmacion, SeleccionConfirmacion, seleccionBase, seleccionEtiqueta,
|
lectura, ModeloConfirmacion, modeloConfirmacion, periodosConfirmacion, SeleccionConfirmacion, seleccionBase, seleccionEtiqueta,
|
||||||
Celda, tasas } from './indicadores-confirmacion-citologia';
|
Celda, Tasa, tasas, vistaConfirmacion } from './indicadores-confirmacion-citologia';
|
||||||
|
|
||||||
// Figures of the kit whose "Cómo leer" describes this coordinated view.
|
|
||||||
const FIGURAS = [['fig_c2_donas', 'Dona de grados de biopsia'], ['fig_c2_barras', 'Tasas por resultado de la citología']] as const;
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-indicador-confirmacion-citologia',
|
selector: 'app-indicador-confirmacion-citologia',
|
||||||
@@ -50,12 +47,16 @@ export class IndicadorConfirmacionCitologia implements OnChanges, OnDestroy {
|
|||||||
get reading() { return this.model && this.selection ? lectura(this.model, this.selection) : ''; }
|
get reading() { return this.model && this.selection ? lectura(this.model, this.selection) : ''; }
|
||||||
get isBase() { return !!this.model && !!this.selection && !this.selection.categoria && this.selection.grupo === this.model.base; }
|
get isBase() { return !!this.model && !!this.selection && !this.selection.categoria && this.selection.grupo === this.model.base; }
|
||||||
get rates() { return this.model && this.selection ? tasas(this.model, this.selection) : []; }
|
get rates() { return this.model && this.selection ? tasas(this.model, this.selection) : []; }
|
||||||
readonly estadoTasa = estadoTasa;
|
// CaCu's words when the catalog doesn't name this indicator, so the messages still read.
|
||||||
|
get vista() { return vistaConfirmacion(this.dominio, this.indicador) ?? CONFIRMACION_CACU; }
|
||||||
|
estadoTasa(t: Tasa) { return estadoTasa(t, this.vista.textos.sujetos); }
|
||||||
cellText(cell: Celda) { return cell.n === null ? cell.estado : cell.n.toLocaleString('es-MX'); }
|
cellText(cell: Celda) { return cell.n === null ? cell.estado : cell.n.toLocaleString('es-MX'); }
|
||||||
denText(den: number | null, estado: string) { return den === null ? estado : den.toLocaleString('es-MX'); }
|
denText(den: number | null, estado: string) { return den === null ? estado : den.toLocaleString('es-MX'); }
|
||||||
get readingGuide() {
|
get readingGuide() {
|
||||||
const details = this.metadata?.figuras_detalle ?? [];
|
const details = this.metadata?.figuras_detalle ?? [];
|
||||||
return FIGURAS.flatMap(([figura, nombre]) => {
|
// Figures of the kit whose "Cómo leer" describes this coordinated view.
|
||||||
|
const figuras = [['fig_c2_donas', 'Dona de resultados de biopsia'], ['fig_c2_barras', 'Tasas ' + this.vista.textos.filas.toLowerCase()]] as const;
|
||||||
|
return figuras.flatMap(([figura, nombre]) => {
|
||||||
const detail = details.find(item => item.figura === figura);
|
const detail = details.find(item => item.figura === figura);
|
||||||
const descripcion = detail?.descripcion?.trim() ?? '';
|
const descripcion = detail?.descripcion?.trim() ?? '';
|
||||||
const como_leer = (detail?.como_leer ?? []).filter(line => line.trim().length > 0);
|
const como_leer = (detail?.como_leer ?? []).filter(line => line.trim().length > 0);
|
||||||
@@ -65,7 +66,7 @@ export class IndicadorConfirmacionCitologia implements OnChanges, OnDestroy {
|
|||||||
toggleHelp() { this.helpOpen = !this.helpOpen; if (this.helpOpen) this.metadataRequested.emit(); }
|
toggleHelp() { this.helpOpen = !this.helpOpen; if (this.helpOpen) this.metadataRequested.emit(); }
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
const key = snapshotKey(this.dominio, this.indicador, this.applied, { estrato: ESTRATO_CITOLOGIA })
|
const key = snapshotKey(this.dominio, this.indicador, this.applied, { estrato: this.vista.estrato })
|
||||||
+ JSON.stringify([this.indicador.contrato, this.indicador.tipos_periodo, this.indicador.figuras]);
|
+ JSON.stringify([this.indicador.contrato, this.indicador.tipos_periodo, this.indicador.figuras]);
|
||||||
if (key !== this.key) {
|
if (key !== this.key) {
|
||||||
this.subscription?.unsubscribe(); this.key = key; this.loaded = false;
|
this.subscription?.unsubscribe(); this.key = key; this.loaded = false;
|
||||||
@@ -84,7 +85,8 @@ export class IndicadorConfirmacionCitologia implements OnChanges, OnDestroy {
|
|||||||
this.subscription?.unsubscribe();
|
this.subscription?.unsubscribe();
|
||||||
this.loaded = true; this.clear();
|
this.loaded = true; this.clear();
|
||||||
const compatibility = filterCompatibility(this.applied, this.indicador.tipos_periodo);
|
const compatibility = filterCompatibility(this.applied, this.indicador.tipos_periodo);
|
||||||
if (this.dominio !== 'cacu' || this.indicador.id !== ID_CONFIRMACION || this.indicador.contrato !== 'C2' || !compatibility.compatible) {
|
const vista = vistaConfirmacion(this.dominio, this.indicador);
|
||||||
|
if (!vista || this.indicador.contrato !== 'C2' || !compatibility.compatible) {
|
||||||
this.message = !compatibility.compatible ? compatibility.reason : 'El catálogo no publica las capacidades necesarias para esta vista.';
|
this.message = !compatibility.compatible ? compatibility.reason : 'El catálogo no publica las capacidades necesarias para esta vista.';
|
||||||
this.status.set('incompatible'); return;
|
this.status.set('incompatible'); return;
|
||||||
}
|
}
|
||||||
@@ -92,12 +94,12 @@ export class IndicadorConfirmacionCitologia implements OnChanges, OnDestroy {
|
|||||||
const periods = this.applied.selection.mode === 'explicit' ? [...this.applied.selection.periodos] : undefined;
|
const periods = this.applied.selection.mode === 'explicit' ? [...this.applied.selection.periodos] : undefined;
|
||||||
this.status.set('loading');
|
this.status.set('loading');
|
||||||
this.subscription = this.snapshots.datos(this.dominio, this.indicador.id, this.applied.tipo, periods, this.indicador.version,
|
this.subscription = this.snapshots.datos(this.dominio, this.indicador.id, this.applied.tipo, periods, this.indicador.version,
|
||||||
{ estrato: ESTRATO_CITOLOGIA }).pipe(timeout({ first: 40000 })).subscribe({
|
{ estrato: vista.estrato }).pipe(timeout({ first: 40000 })).subscribe({
|
||||||
next: datos => {
|
next: datos => {
|
||||||
if (key !== this.key) return;
|
if (key !== this.key) return;
|
||||||
try {
|
try {
|
||||||
this.periods = periodosConfirmacion(datos, this.applied.tipo, periods);
|
this.periods = periodosConfirmacion(datos, this.applied.tipo, periods, vista);
|
||||||
this.pages = this.periods.map(p => modeloConfirmacion(datos, p));
|
this.pages = this.periods.map(p => modeloConfirmacion(datos, p, vista));
|
||||||
// The most recent period first, as the prototype; navigation goes back.
|
// The most recent period first, as the prototype; navigation goes back.
|
||||||
this.periodIndex = Math.max(0, this.periods.length - 1); this.activatePeriod();
|
this.periodIndex = Math.max(0, this.periods.length - 1); this.activatePeriod();
|
||||||
} catch (error) { this.failure(error); }
|
} catch (error) { this.failure(error); }
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import { IndicadorFigurePanel } from './indicador-figure-panel';
|
|||||||
import { PlotlyChart } from '../../shared/plotly/plotly-chart';
|
import { PlotlyChart } from '../../shared/plotly/plotly-chart';
|
||||||
import { GlobalApplied } from './indicadores-memory';
|
import { GlobalApplied } from './indicadores-memory';
|
||||||
import { Indicador, IndicadorDatos } from './indicadores.models';
|
import { Indicador, IndicadorDatos } from './indicadores.models';
|
||||||
import { clicConfirmacion, ConfirmacionIncompatible, donaConfirmacion, estadoTasa, figuraTasas, lectura, modeloConfirmacion,
|
import { clicConfirmacion, ConfirmacionIncompatible, CONFIRMACION_CAMA, donaConfirmacion, estadoTasa, figuraTasas, lectura, modeloConfirmacion,
|
||||||
periodosConfirmacion, rangoTasas, seleccionBase, tasas, wilson } from './indicadores-confirmacion-citologia';
|
periodosConfirmacion, rangoTasas, seleccionBase, tasas, vistaConfirmacion, wilson } from './indicadores-confirmacion-citologia';
|
||||||
|
|
||||||
@Component({ selector: 'app-plotly-chart', template: '' })
|
@Component({ selector: 'app-plotly-chart', template: '' })
|
||||||
class ChartStub { figure = input<unknown>(); label = input<string>(); showNotes = input<boolean>(); plotClick = output<unknown>(); }
|
class ChartStub { figure = input<unknown>(); label = input<string>(); showNotes = input<boolean>(); plotClick = output<unknown>(); }
|
||||||
@@ -62,7 +62,7 @@ describe('Confirmación histopatológica: modelo', () => {
|
|||||||
const d = respuesta(['2026-S2'], { LIEAG: CONTEOS['LIEAG'] });
|
const d = respuesta(['2026-S2'], { LIEAG: CONTEOS['LIEAG'] });
|
||||||
const m = modeloConfirmacion(d, '2026-S2');
|
const m = modeloConfirmacion(d, '2026-S2');
|
||||||
expect(m.filas.map(f => f.den)).toEqual([0, 58, 0]);
|
expect(m.filas.map(f => f.den)).toEqual([0, 58, 0]);
|
||||||
expect(tasas(m, seleccionBase(m)).map(estadoTasa)).toEqual(['Sin mujeres con biopsia', '', 'Sin mujeres con biopsia']);
|
expect(tasas(m, seleccionBase(m)).map(t => estadoTasa(t))).toEqual(['Sin mujeres con biopsia', '', 'Sin mujeres con biopsia']);
|
||||||
expect(m.filas[0].etiqueta).toBe('Carcinoma in situ');
|
expect(m.filas[0].etiqueta).toBe('Carcinoma in situ');
|
||||||
(d['totales_estrato'] as Record<string, unknown>[])[0]['suprimido'] = 1;
|
(d['totales_estrato'] as Record<string, unknown>[])[0]['suprimido'] = 1;
|
||||||
const s = modeloConfirmacion(d, '2026-S2');
|
const s = modeloConfirmacion(d, '2026-S2');
|
||||||
@@ -223,3 +223,38 @@ describe('Confirmación histopatológica: componente', () => {
|
|||||||
card.destroy(); http.expectNone(() => true);
|
card.destroy(); http.expectNone(() => true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Cáncer de mama's configuration of the same view. Fixture: a one-period answer of cama_histopatologia_birads
|
||||||
|
// built below, with two BI-RADS categories published and biopsies without a result kept apart.
|
||||||
|
describe('Confirmación histopatológica de cáncer de mama', () => {
|
||||||
|
const categorias = {
|
||||||
|
BENIGNO: { etiqueta: 'Benigno', color: '#9DBFE3', grupo: 'NO_MALIGNO' }, RIESGO_B3: { etiqueta: 'Lesión de riesgo (B3)', color: '#2F6DB3', grupo: 'NO_MALIGNO' },
|
||||||
|
IN_SITU: { etiqueta: 'Carcinoma in situ', color: '#D9822B', grupo: 'MALIGNO' }, INVASOR: { etiqueta: 'Carcinoma invasor', color: '#B5482E', grupo: 'MALIGNO' },
|
||||||
|
SIN_DATO: { etiqueta: 'Sin resultado histopatológico', color: '#BDBDBD', grupo: 'SIN_DATO' },
|
||||||
|
};
|
||||||
|
const n: Record<string, Record<string, number>> = {
|
||||||
|
BIRADS_5: { BENIGNO: 3, RIESGO_B3: 0, IN_SITU: 11, INVASOR: 38, SIN_DATO: 3 },
|
||||||
|
BIRADS_4A: { BENIGNO: 91, RIESGO_B3: 15, IN_SITU: 1, INVASOR: 7, SIN_DATO: 9 },
|
||||||
|
};
|
||||||
|
const datos = () => ({ id: 'cama_histopatologia_birads', contrato: 'C2', tipo_periodo: 'semestre', periodos: ['2025-S2'], estrato: 'birads',
|
||||||
|
valores_estrato: Object.keys(n), categorias, grupos_de_categoria: { NO_MALIGNO: 'No maligno', MALIGNO: 'Maligno', SIN_DATO: 'Sin dato' },
|
||||||
|
filas: Object.entries(n).flatMap(([estrato, c]) => Object.entries(c).map(([categoria, v]) =>
|
||||||
|
({ periodo: '2025-S2', grupo: 'TOTAL', estrato, categoria, n: v, suprimido: 0 }))) }) as IndicadorDatos;
|
||||||
|
|
||||||
|
it('la elige el dominio y el indicador', () => {
|
||||||
|
// Fails if the view stops being found for cáncer de mama, or leaks to another indicator.
|
||||||
|
expect(vistaConfirmacion('cama', { id: 'cama_histopatologia_birads' })).toBe(CONFIRMACION_CAMA);
|
||||||
|
expect(vistaConfirmacion('cama', { id: 'cacu_confirmacion_citologia' })).toBeUndefined();
|
||||||
|
});
|
||||||
|
it('filas BI-RADS de la más grave a la menor, base maligna y sin resultado aparte', () => {
|
||||||
|
// Fails if the rows don't follow the configuration, the base isn't malignancy or «Sin dato» enters the rate.
|
||||||
|
const m = modeloConfirmacion(datos(), '2025-S2', CONFIRMACION_CAMA), base = seleccionBase(m);
|
||||||
|
expect(m.filas.map(f => f.id)).toEqual(['BIRADS_6', 'BIRADS_5', 'BIRADS_4C', 'BIRADS_4B', 'BIRADS_4A']);
|
||||||
|
expect(base).toEqual({ grupo: 'MALIGNO' });
|
||||||
|
expect(lectura(m, base)).toBe('Detección de cáncer (valor predictivo positivo)');
|
||||||
|
const t = tasas(m, base);
|
||||||
|
expect(t[1].k).toBe(49); expect(t[1].fila.den).toBe(52);
|
||||||
|
expect(t[4].k).toBe(8); expect(t[4].fila.den).toBe(114);
|
||||||
|
expect(estadoTasa(t[0], m.vista.textos.sujetos)).toBe('Sin pacientes con biopsia');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { IndicadorDatos, PlotlyFigure, Tema } from './indicadores.models';
|
import { DimensionEstrato, Dominio, Indicador, IndicadorDatos, PlotlyFigure, Tema } from './indicadores.models';
|
||||||
import { c2Theme } from './indicadores-c2-palette';
|
import { c2Theme } from './indicadores-c2-palette';
|
||||||
import { percentNumber, shareText } from './indicadores-format';
|
import { percentNumber, shareText } from './indicadores-format';
|
||||||
|
|
||||||
@@ -24,6 +24,34 @@ export const FILAS_CITOLOGIA = [
|
|||||||
] as const;
|
] as const;
|
||||||
export const Z95 = 1.959963984540054;
|
export const Z95 = 1.959963984540054;
|
||||||
|
|
||||||
|
// One confirmation view: which indicator and stratum, its fixed rows (most severe on top), the grade whose group is
|
||||||
|
// the base view (the true positives), the grade read as a false positive, and the words the view uses.
|
||||||
|
export interface VistaConfirmacion {
|
||||||
|
id: string; estrato: DimensionEstrato; filas: readonly { id: string; etiqueta: string }[];
|
||||||
|
base: string; falsoPositivo: string;
|
||||||
|
textos: { base: string; falsoPositivo: string; sinConfirmacion: string; filas: string; encabezado: string; sujetos: string; vacio: string };
|
||||||
|
}
|
||||||
|
export const CONFIRMACION_CACU: VistaConfirmacion = {
|
||||||
|
id: ID_CONFIRMACION, estrato: ESTRATO_CITOLOGIA, filas: FILAS_CITOLOGIA, base: 'LIEAG', falsoPositivo: 'NORMAL',
|
||||||
|
textos: { base: 'Verdaderos positivos (valor predictivo positivo)', falsoPositivo: 'Falsos positivos: la biopsia no confirmó lesión',
|
||||||
|
sinConfirmacion: 'Sin confirmación de alto grado', filas: 'Por resultado de la citología', encabezado: 'Citología', sujetos: 'mujeres',
|
||||||
|
vacio: 'No hay citologías de alto grado publicadas para este periodo.' },
|
||||||
|
};
|
||||||
|
// Cáncer de mama: the biopsies by the BI-RADS of the mammogram that led to them; the base is malignancy.
|
||||||
|
export const CONFIRMACION_CAMA: VistaConfirmacion = {
|
||||||
|
id: 'cama_histopatologia_birads', estrato: 'birads', base: 'INVASOR', falsoPositivo: 'BENIGNO',
|
||||||
|
filas: [{ id: 'BIRADS_6', etiqueta: 'BI-RADS 6' }, { id: 'BIRADS_5', etiqueta: 'BI-RADS 5' }, { id: 'BIRADS_4C', etiqueta: 'BI-RADS 4C' },
|
||||||
|
{ id: 'BIRADS_4B', etiqueta: 'BI-RADS 4B' }, { id: 'BIRADS_4A', etiqueta: 'BI-RADS 4A' }],
|
||||||
|
textos: { base: 'Detección de cáncer (valor predictivo positivo)', falsoPositivo: 'Falsos positivos: la biopsia resultó benigna',
|
||||||
|
sinConfirmacion: 'Sin malignidad', filas: 'Por categoría BI-RADS', encabezado: 'BI-RADS', sujetos: 'pacientes',
|
||||||
|
vacio: 'No hay biopsias publicadas para este periodo.' },
|
||||||
|
};
|
||||||
|
const VISTAS_CONFIRMACION: Readonly<Partial<Record<Dominio, VistaConfirmacion>>> = { cacu: CONFIRMACION_CACU, cama: CONFIRMACION_CAMA };
|
||||||
|
export function vistaConfirmacion(dominio: Dominio, indicador: Pick<Indicador, 'id'>): VistaConfirmacion | undefined {
|
||||||
|
const vista = VISTAS_CONFIRMACION[dominio];
|
||||||
|
return vista?.id === indicador.id ? vista : undefined;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Celda { n: number | null; estado: 'Publicado' | 'Suprimido' | 'No disponible'; }
|
export interface Celda { n: number | null; estado: 'Publicado' | 'Suprimido' | 'No disponible'; }
|
||||||
export interface Grado { id: string; etiqueta: string; color: string; grupo: string; }
|
export interface Grado { id: string; etiqueta: string; color: string; grupo: string; }
|
||||||
export interface GrupoGrados { id: string; etiqueta: string; color: string; grados: string[]; }
|
export interface GrupoGrados { id: string; etiqueta: string; color: string; grados: string[]; }
|
||||||
@@ -37,7 +65,7 @@ export interface FilaCitologia {
|
|||||||
export interface ModeloConfirmacion {
|
export interface ModeloConfirmacion {
|
||||||
periodo: string; grados: Grado[]; grupos: GrupoGrados[]; base: string;
|
periodo: string; grados: Grado[]; grupos: GrupoGrados[]; base: string;
|
||||||
filas: FilaCitologia[]; totales: Record<string, number | null>; conBiopsia: number | null;
|
filas: FilaCitologia[]; totales: Record<string, number | null>; conBiopsia: number | null;
|
||||||
aparte: { id: string; etiqueta: string }[]; vacio: boolean; notas: string[];
|
aparte: { id: string; etiqueta: string }[]; vacio: boolean; notas: string[]; vista: VistaConfirmacion;
|
||||||
}
|
}
|
||||||
export interface SeleccionConfirmacion { grupo: string; categoria?: string; }
|
export interface SeleccionConfirmacion { grupo: string; categoria?: string; }
|
||||||
export interface Tasa { fila: FilaCitologia; k: number | null; valor: number | null; bajo: number | null; alto: number | null; }
|
export interface Tasa { fila: FilaCitologia; k: number | null; valor: number | null; bajo: number | null; alto: number | null; }
|
||||||
@@ -81,8 +109,8 @@ function rgba(hex: string, alfa: number): string {
|
|||||||
const etiquetaGrupo = (v: unknown) => texto(v) ? v : registro(v) && texto(v['etiqueta']) ? v['etiqueta'] : undefined;
|
const etiquetaGrupo = (v: unknown) => texto(v) ? v : registro(v) && texto(v['etiqueta']) ? v['etiqueta'] : undefined;
|
||||||
|
|
||||||
/** Validated periods of one stratified response, in request order or sorted. */
|
/** Validated periods of one stratified response, in request order or sorted. */
|
||||||
export function periodosConfirmacion(datos: IndicadorDatos, tipo: string, solicitados?: readonly string[]): string[] {
|
export function periodosConfirmacion(datos: IndicadorDatos, tipo: string, solicitados?: readonly string[], vista = CONFIRMACION_CACU): string[] {
|
||||||
if (datos.id !== ID_CONFIRMACION || datos.contrato !== 'C2' || datos.tipo_periodo !== tipo || datos['estrato'] !== ESTRATO_CITOLOGIA
|
if (datos.id !== vista.id || datos.contrato !== 'C2' || datos.tipo_periodo !== tipo || datos['estrato'] !== vista.estrato
|
||||||
|| !Array.isArray(datos.periodos) || new Set(datos.periodos).size !== datos.periodos.length
|
|| !Array.isArray(datos.periodos) || new Set(datos.periodos).size !== datos.periodos.length
|
||||||
|| datos.periodos.some(p => typeof p !== 'string' || !(tipo === 'semestre' ? /^[0-9]{4}-S[12]$/ : /^[0-9]{4}-(0[1-9]|1[0-2])$/).test(p))
|
|| datos.periodos.some(p => typeof p !== 'string' || !(tipo === 'semestre' ? /^[0-9]{4}-S[12]$/ : /^[0-9]{4}-(0[1-9]|1[0-2])$/).test(p))
|
||||||
|| (solicitados && datos.periodos.some(p => !solicitados.includes(p)))
|
|| (solicitados && datos.periodos.some(p => !solicitados.includes(p)))
|
||||||
@@ -93,8 +121,8 @@ export function periodosConfirmacion(datos: IndicadorDatos, tipo: string, solici
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** One /datos payload -> the contingency table of a single period. */
|
/** One /datos payload -> the contingency table of a single period. */
|
||||||
export function modeloConfirmacion(datos: IndicadorDatos, periodo: string): ModeloConfirmacion {
|
export function modeloConfirmacion(datos: IndicadorDatos, periodo: string, vista = CONFIRMACION_CACU): ModeloConfirmacion {
|
||||||
periodosConfirmacion(datos, datos.tipo_periodo);
|
periodosConfirmacion(datos, datos.tipo_periodo, undefined, vista);
|
||||||
const cats = datos['categorias'], nombres = datos['grupos_de_categoria'];
|
const cats = datos['categorias'], nombres = datos['grupos_de_categoria'];
|
||||||
if (!registro(cats) || !registro(nombres)) return fail('Catálogo de grados incompleto.');
|
if (!registro(cats) || !registro(nombres)) return fail('Catálogo de grados incompleto.');
|
||||||
const aparte = APARTE.filter(a => Object.hasOwn(cats, a.id)).map(a => {
|
const aparte = APARTE.filter(a => Object.hasOwn(cats, a.id)).map(a => {
|
||||||
@@ -112,8 +140,8 @@ export function modeloConfirmacion(datos: IndicadorDatos, periodo: string): Mode
|
|||||||
return { id, etiqueta: etiquetaGrupo(nombres[id])!, color: promedio((publicados.length ? publicados : propios).map(g => g.color)),
|
return { id, etiqueta: etiquetaGrupo(nombres[id])!, color: promedio((publicados.length ? publicados : propios).map(g => g.color)),
|
||||||
grados: propios.map(g => g.id) };
|
grados: propios.map(g => g.id) };
|
||||||
});
|
});
|
||||||
// The base view is the group of LIEAG ("LIEAG o más"): the true positives.
|
// The base view is the group of the view's base grade (CaCu: "LIEAG o más"): the true positives.
|
||||||
const base = grados.find(g => g.id === 'LIEAG')?.grupo ?? fail('El catálogo no publica el grado LIEAG.');
|
const base = grados.find(g => g.id === vista.base)?.grupo ?? fail(`El catálogo no publica el grado ${vista.base}.`);
|
||||||
if (grupos.length !== 2) fail('Se esperaban dos grupos de grados.');
|
if (grupos.length !== 2) fail('Se esperaban dos grupos de grados.');
|
||||||
const index = new Map<string, Record<string, unknown>>();
|
const index = new Map<string, Record<string, unknown>>();
|
||||||
for (const row of datos.filas.filter(f => f['periodo'] === periodo)) {
|
for (const row of datos.filas.filter(f => f['periodo'] === periodo)) {
|
||||||
@@ -128,11 +156,11 @@ export function modeloConfirmacion(datos: IndicadorDatos, periodo: string): Mode
|
|||||||
}
|
}
|
||||||
// valores_estrato may list only the strata with data; a fixed row absent from it has no women.
|
// valores_estrato may list only the strata with data; a fixed row absent from it has no women.
|
||||||
const publicados = Array.isArray(datos['valores_estrato']) ? (datos['valores_estrato'] as unknown[]) : undefined;
|
const publicados = Array.isArray(datos['valores_estrato']) ? (datos['valores_estrato'] as unknown[]) : undefined;
|
||||||
if (publicados && !publicados.every(v => typeof v === 'string')) fail('Estratos de citología inválidos.');
|
if (publicados && !publicados.every(v => typeof v === 'string')) fail('Estratos inválidos.');
|
||||||
const etiquetas = registro(datos['etiquetas_estrato']) ? datos['etiquetas_estrato'] : {};
|
const etiquetas = registro(datos['etiquetas_estrato']) ? datos['etiquetas_estrato'] : {};
|
||||||
const totales = Array.isArray(datos['totales_estrato']) ? (datos['totales_estrato'] as unknown[]) : [];
|
const totales = Array.isArray(datos['totales_estrato']) ? (datos['totales_estrato'] as unknown[]) : [];
|
||||||
if (!totales.every(registro)) fail('Totales de citología inválidos.');
|
if (!totales.every(registro)) fail('Totales por estrato inválidos.');
|
||||||
const filas = FILAS_CITOLOGIA.map(({ id, etiqueta }) => {
|
const filas = vista.filas.map(({ id, etiqueta }) => {
|
||||||
const rotulo = texto(etiquetas[id]) ? etiquetas[id] : registro(cats[id]) && texto(cats[id]['etiqueta']) ? cats[id]['etiqueta'] : etiqueta;
|
const rotulo = texto(etiquetas[id]) ? etiquetas[id] : registro(cats[id]) && texto(cats[id]['etiqueta']) ? cats[id]['etiqueta'] : etiqueta;
|
||||||
const tieneFilas = [...index.keys()].some(k => JSON.parse(k)[0] === id);
|
const tieneFilas = [...index.keys()].some(k => JSON.parse(k)[0] === id);
|
||||||
const ausente = !tieneFilas && (!publicados || !publicados.includes(id));
|
const ausente = !tieneFilas && (!publicados || !publicados.includes(id));
|
||||||
@@ -148,7 +176,7 @@ export function modeloConfirmacion(datos: IndicadorDatos, periodo: string): Mode
|
|||||||
const porGrado = Object.fromEntries(grados.map(g => [g.id, filas.some(f => f.den === null) ? null : suma(filas.map(f => f.celdas[g.id]))]));
|
const porGrado = Object.fromEntries(grados.map(g => [g.id, filas.some(f => f.den === null) ? null : suma(filas.map(f => f.celdas[g.id]))]));
|
||||||
return { periodo, grados, grupos, base, filas, totales: porGrado,
|
return { periodo, grados, grupos, base, filas, totales: porGrado,
|
||||||
conBiopsia: suma(grados.map(g => ({ n: porGrado[g.id], estado: 'Publicado' as const }))),
|
conBiopsia: suma(grados.map(g => ({ n: porGrado[g.id], estado: 'Publicado' as const }))),
|
||||||
aparte, vacio: index.size === 0, notas: [...new Set(datos.notas ?? [])] };
|
aparte, vacio: index.size === 0, notas: [...new Set(datos.notas ?? [])], vista };
|
||||||
}
|
}
|
||||||
|
|
||||||
export function seleccionBase(m: ModeloConfirmacion): SeleccionConfirmacion { return { grupo: m.base }; }
|
export function seleccionBase(m: ModeloConfirmacion): SeleccionConfirmacion { return { grupo: m.base }; }
|
||||||
@@ -169,9 +197,9 @@ export function clicConfirmacion(m: ModeloConfirmacion, sel: SeleccionConfirmaci
|
|||||||
}
|
}
|
||||||
/** The axis title says what the rate reads. */
|
/** The axis title says what the rate reads. */
|
||||||
export function lectura(m: ModeloConfirmacion, sel: SeleccionConfirmacion): string {
|
export function lectura(m: ModeloConfirmacion, sel: SeleccionConfirmacion): string {
|
||||||
if (!sel.categoria && sel.grupo === m.base) return 'Verdaderos positivos (valor predictivo positivo)';
|
if (!sel.categoria && sel.grupo === m.base) return m.vista.textos.base;
|
||||||
if (sel.categoria === 'NORMAL') return 'Falsos positivos: la biopsia no confirmó lesión';
|
if (sel.categoria === m.vista.falsoPositivo) return m.vista.textos.falsoPositivo;
|
||||||
if (!sel.categoria) return 'Sin confirmación de alto grado';
|
if (!sel.categoria) return m.vista.textos.sinConfirmacion;
|
||||||
return 'Proporción con biopsia ' + seleccionEtiqueta(m, sel);
|
return 'Proporción con biopsia ' + seleccionEtiqueta(m, sel);
|
||||||
}
|
}
|
||||||
/** Per cytology: selected grades over women with a biopsy. "No biopsy yet" never enters. */
|
/** Per cytology: selected grades over women with a biopsy. "No biopsy yet" never enters. */
|
||||||
@@ -184,8 +212,8 @@ export function tasas(m: ModeloConfirmacion, sel: SeleccionConfirmacion): Tasa[]
|
|||||||
return { fila, k, valor: 100 * k / fila.den, bajo, alto };
|
return { fila, k, valor: 100 * k / fila.den, bajo, alto };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
export function estadoTasa(t: Tasa): string {
|
export function estadoTasa(t: Tasa, sujetos = 'mujeres'): string {
|
||||||
return t.fila.den === 0 ? 'Sin mujeres con biopsia' : t.fila.estado === 'Publicado' ? '' : t.fila.estado;
|
return t.fila.den === 0 ? `Sin ${sujetos} con biopsia` : t.fila.estado === 'Publicado' ? '' : t.fila.estado;
|
||||||
}
|
}
|
||||||
/** Axis bounded to what is shown: 5-point margin, multiples of 5, within 0-100. */
|
/** Axis bounded to what is shown: 5-point margin, multiples of 5, within 0-100. */
|
||||||
export function rangoTasas(valores: Tasa[]): [number, number] {
|
export function rangoTasas(valores: Tasa[]): [number, number] {
|
||||||
@@ -206,7 +234,7 @@ export function figuraTasas(m: ModeloConfirmacion, sel: SeleccionConfirmacion, t
|
|||||||
marker: { size: 12, color }, cliponaxis: false,
|
marker: { size: 12, color }, cliponaxis: false,
|
||||||
error_x: { type: 'data', symmetric: false, color, thickness: 2, width: 6,
|
error_x: { type: 'data', symmetric: false, color, thickness: 2, width: 6,
|
||||||
array: valores.map(t => t.valor === null ? 0 : t.alto! - t.valor), arrayminus: valores.map(t => t.valor === null ? 0 : t.valor - t.bajo!) },
|
array: valores.map(t => t.valor === null ? 0 : t.alto! - t.valor), arrayminus: valores.map(t => t.valor === null ? 0 : t.valor - t.bajo!) },
|
||||||
customdata: valores.map(t => t.k === null ? [estadoTasa(t), '', '', '', ''] : [shareText(t.k, t.fila.den!), t.k, t.fila.den, percentNumber(t.bajo!), percentNumber(t.alto!)]),
|
customdata: valores.map(t => t.k === null ? [estadoTasa(t, m.vista.textos.sujetos), '', '', '', ''] : [shareText(t.k, t.fila.den!), t.k, t.fila.den, percentNumber(t.bajo!), percentNumber(t.alto!)]),
|
||||||
hovertemplate: '%{y}<br><b>%{customdata[0]}</b> (%{customdata[1]}/%{customdata[2]})<br>IC 95 %: %{customdata[3]}–%{customdata[4]} %<extra></extra>',
|
hovertemplate: '%{y}<br><b>%{customdata[0]}</b> (%{customdata[1]}/%{customdata[2]})<br>IC 95 %: %{customdata[3]}–%{customdata[4]} %<extra></extra>',
|
||||||
}], layout: {
|
}], layout: {
|
||||||
autosize: true, height: 360, showlegend: false, paper_bgcolor: p.background, plot_bgcolor: p.background, font: { color: p.text },
|
autosize: true, height: 360, showlegend: false, paper_bgcolor: p.background, plot_bgcolor: p.background, font: { color: p.text },
|
||||||
@@ -215,7 +243,7 @@ export function figuraTasas(m: ModeloConfirmacion, sel: SeleccionConfirmacion, t
|
|||||||
xaxis: { range: rangoTasas(valores), ticksuffix: ' %', gridcolor: p.grid, zeroline: false, fixedrange: true, title: { text: lectura(m, sel) } },
|
xaxis: { range: rangoTasas(valores), ticksuffix: ' %', gridcolor: p.grid, zeroline: false, fixedrange: true, title: { text: lectura(m, sel) } },
|
||||||
annotations: valores.map(t => ({ x: 1, xref: 'paper', xanchor: 'left', xshift: 8, y: t.fila.etiqueta, yref: 'y', showarrow: false, align: 'left',
|
annotations: valores.map(t => ({ x: 1, xref: 'paper', xanchor: 'left', xshift: 8, y: t.fila.etiqueta, yref: 'y', showarrow: false, align: 'left',
|
||||||
font: { size: 12, color: p.text },
|
font: { size: 12, color: p.text },
|
||||||
text: t.k === null ? estadoTasa(t) : `<b>${shareText(t.k, t.fila.den!)}</b><br>${t.k}/${t.fila.den}` })),
|
text: t.k === null ? estadoTasa(t, m.vista.textos.sujetos) : `<b>${shareText(t.k, t.fila.den!)}</b><br>${t.k}/${t.fila.den}` })),
|
||||||
}, config: { displayModeBar: false } };
|
}, config: { displayModeBar: false } };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,7 +255,7 @@ export function donaConfirmacion(m: ModeloConfirmacion, sel: SeleccionConfirmaci
|
|||||||
const interior = m.grupos.map(g => g.grados.reduce((s, c) => s + m.totales[c]!, 0));
|
const interior = m.grupos.map(g => g.grados.reduce((s, c) => s + m.totales[c]!, 0));
|
||||||
const exterior = m.grados.map(g => m.totales[g.id]!);
|
const exterior = m.grados.map(g => m.totales[g.id]!);
|
||||||
const comun = { type: 'pie', sort: false, direction: 'clockwise', rotation: 0, showlegend: false, textinfo: 'none' };
|
const comun = { type: 'pie', sort: false, direction: 'clockwise', rotation: 0, showlegend: false, textinfo: 'none' };
|
||||||
const hover = { hovertemplate: '%{label}<br>%{customdata[0]} mujeres con biopsia, %{customdata[1]}<extra></extra>' };
|
const hover = { hovertemplate: `%{label}<br>%{customdata[0]} ${m.vista.textos.sujetos} con biopsia, %{customdata[1]}<extra></extra>` };
|
||||||
const custom = (values: number[]) => values.map(n => [miles(n), shareText(n, total)]);
|
const custom = (values: number[]) => values.map(n => [miles(n), shareText(n, total)]);
|
||||||
return { data: [
|
return { data: [
|
||||||
{ ...comun, name: 'centro', values: [1], labels: ['centro'], domain: { x: [.32, .68], y: [.32, .68] }, textinfo: 'text', textposition: 'inside',
|
{ ...comun, name: 'centro', values: [1], labels: ['centro'], domain: { x: [.32, .68], y: [.32, .68] }, textinfo: 'text', textposition: 'inside',
|
||||||
|
|||||||
Reference in New Issue
Block a user