feat(ui): incorporar selector de figuras KPI y fijacion de indicadores

This commit is contained in:
Angel Capetillo Zavala
2026-10-13 22:34:57 -06:00
parent c4faa7d9f6
commit 9fcc65d84f
26 changed files with 723 additions and 85 deletions
@@ -43,3 +43,17 @@ it('acepta extremos canónicos de año', () => {
expect(parsePeriodos('0001-S1,9999-S2')).toEqual(['0001-S1', '9999-S2']);
expect(parsePeriodos('0001-01,9999-12', 'mes')).toEqual(['0001-01', '9999-12']);
});
it.each([
[{ type: 'bar', orientation: 'h', x: [null], y: ['grupo'] }, true],
[{ type: 'bar', orientation: 'h', x: [0], y: ['grupo'] }, false],
[{ type: 'bar', y: [null], x: ['grupo'] }, true],
[{ type: 'bar', y: [0] }, false],
[{ type: 'pie', values: [null] }, true],
[{ type: 'pie', values: [0] }, false],
[{ type: 'pie', values: { bdata: 'AAAA' } }, false],
[{ type: 'bar', orientation: 'unknown', y: [null] }, false],
[{ type: 'bar', y: ['unknown'] }, false],
])('interpreta magnitudes de forma conservadora %j', (trace, empty) => {
expect(hasNoVisibleValues({ data: [trace as Record<string, unknown>], layout: {} })).toBe(empty);
});