F1: Sankey stopped nodes in the rightmost column

This commit is contained in:
2026-12-01 14:14:00 -06:00
parent 6a6691bdd5
commit 58fdfd53d7
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -512,8 +512,8 @@ export function sexCountBars(r: Reading, catalog: Catalog, axis: string, period:
};
}
export const SANKEY_X = [0.22, 0.5, 0.78, 0.999, 0.001, 0.001, 0.001];
export const SANKEY_Y = [0.2, 0.2, 0.2, 0.2, 0.5, 0.75, 0.999];
export const SANKEY_X = [0.001, 0.25, 0.5, 0.75, 0.999, 0.999, 0.999];
export const SANKEY_Y = [0.2, 0.2, 0.2, 0.2, 0.45, 0.7, 0.95];
export function teaSankey(r: Reading): Figure {
const [mchat, psychology, neuro, eeg] = [
+3 -3
View File
@@ -373,7 +373,7 @@ describe('TEA clinical figures', () => {
});
});
it('places the stopped nodes at the left and gives every node its own position', () => {
it('places the stopped nodes at the right and gives every node its own position', () => {
const node = teaSankey({ populations: {}, strata: {} }).data[0] as unknown as {
node: { label: string[]; x: number[]; y: number[] };
};
@@ -381,8 +381,8 @@ describe('TEA clinical figures', () => {
label.startsWith('Se quedó en') ? [index] : [],
);
expect(stopped).toHaveLength(3);
expect(Math.max(...stopped.map((index) => node.node.x[index]))).toBeLessThan(
Math.min(...node.node.x.filter((_, index) => !stopped.includes(index))),
expect(Math.min(...stopped.map((index) => node.node.x[index]))).toBeGreaterThan(
Math.max(...node.node.x.filter((_, index) => !stopped.includes(index))),
);
const places = node.node.x.map((x, index) => `${x}|${node.node.y[index]}`);
expect(new Set(places).size).toBe(places.length);