From 8b7dd6ec194b01b886318209f87a64a82264174d Mon Sep 17 00:00:00 2001 From: rockdrigo Date: Mon, 9 Nov 2026 20:26:23 -0600 Subject: [PATCH] style(cama): the confirmation donut's result labels outside the ring How: in donaExpandible the outer ring's labels (result and share) use textposition 'outside' with automargin, at 12px in the text colour, so they no longer shrink to fit their slices; every result with patients is labelled, including small ones. The figure is 440px tall with a 30px margin; automargin widens the margins as the labels need and the three rings shrink together, so they stay concentric. The group labels stay inside the inner ring. Implications: on a narrow card the rings get smaller to leave room for the labels. CaCu's confirmation donut (with buttons) is unchanged. --- .../indicadores/indicadores-confirmacion-citologia.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/features/indicadores/indicadores-confirmacion-citologia.ts b/src/app/features/indicadores/indicadores-confirmacion-citologia.ts index 1cbe087..824db95 100644 --- a/src/app/features/indicadores/indicadores-confirmacion-citologia.ts +++ b/src/app/features/indicadores/indicadores-confirmacion-citologia.ts @@ -312,10 +312,13 @@ export function donaExpandible(m: ModeloConfirmacion, sel: SeleccionConfirmacion labels: m.grupos.map(g => escapar(g.etiqueta)), text: rotulos(interior, m.grupos.map(g => g.etiqueta), false), textfont: { color: '#FFFFFF' }, customdata: custom(interior), marker: { colors: m.grupos.map(g => rgba(g.color, sel.categoria ? .3 : 1)), line: { color: p.background, width: 2 } } }, + // Outer labels go outside the ring with a leader line, at full size; automargin makes room for them and + // shrinks the three rings together, so they stay concentric. { ...comun, ...hover, name: 'categorias', values: exterior, hole: .74, domain: { x: [0, 1], y: [0, 1] }, - labels: m.grados.map(g => escapar(g.etiqueta)), text: rotulos(exterior, m.grados.map(g => g.etiqueta), true), - textfont: { size: 11 }, customdata: custom(exterior), + labels: m.grados.map(g => escapar(g.etiqueta)), textposition: 'outside', automargin: true, + text: exterior.map((v, i) => v ? escapar(m.grados[i].etiqueta) + '
' + shareText(v, exterior.reduce((s, n) => s + n, 0)) : ''), + textfont: { size: 12, color: p.text }, customdata: custom(exterior), marker: { colors: m.grados.map(g => rgba(g.color, sel.categoria && g.id !== sel.categoria ? .3 : 1)), line: { color: p.background, width: 2 } } }, - ], layout: { autosize: true, height: 400, margin: { t: 10, l: 10, r: 10, b: 10 }, paper_bgcolor: p.background, font: { color: p.text } }, + ], layout: { autosize: true, height: 440, margin: { t: 30, l: 30, r: 30, b: 30 }, paper_bgcolor: p.background, font: { color: p.text } }, config: { displayModeBar: false } }; }