feat(indicadores): CaMa detection and result-to-diagnosis indicators wired with real payloads
CAM-01 and CAM-02 already had their KPI cards and history panels waiting for the catalog; they are now covered with the answers WebApi gives for the synthetic base, both visible (lowered suppression threshold) and suppressed (normal threshold). Once published they draw only their KPI card in the summary, as the mockup does, instead of an extra generic figure card; their evolution stays in the history. The stacked history figure now keeps a category the catalog announces even when no row carries it, so a missing category is named under the figure instead of silently disappearing. The integration specs also cover the summary and the history with CAM-01, CAM-02 and CAM-03 published.
This commit is contained in:
@@ -119,7 +119,9 @@ function conteo(data: IndicadorDatos, tema: Tema): Trazo {
|
||||
celdas.set(key, row);
|
||||
categorias.set(id, row['orden']);
|
||||
}
|
||||
const orden = [...categorias].sort(([, a], [, b]) => a - b).map(([id]) => id);
|
||||
// A category the catalog announces but no row carries is still a category: its absence is shown as a gap and
|
||||
// named under the figure, not dropped as if it did not exist, nor drawn as zero.
|
||||
const orden = [...[...categorias].sort(([, a], [, b]) => a - b).map(([id]) => id), ...Object.keys(catalogo).filter(id => !categorias.has(id))];
|
||||
const estadoDe = (periodo: string) => orden.map(id => celdas.get(JSON.stringify([id, periodo])));
|
||||
const suprimidos = periodos.filter(p => estadoDe(p).some(row => row?.['suprimido'] === 1));
|
||||
const sinDato = periodos.filter(p => !suprimidos.includes(p) && estadoDe(p).some(row => !numero(row?.['n'])));
|
||||
|
||||
Reference in New Issue
Block a user