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.
This commit is contained in:
rockdrigo
2026-11-09 20:26:23 -06:00
parent 59ce79d1a2
commit 8b7dd6ec19
@@ -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) + '<br>' + 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 } };
}