F1: Sankey stopped nodes in the rightmost column
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user