F1: Sankey laid out by Plotly's own columns, with no hand-set x/y

Root cause of the crossing bands and overlap: with explicit node x/y Plotly keeps the nodes where they are set but orders the links leaving a node on its own, so a stopped band could leave the top of a node while its target sat at the bottom (bands crossed), zero-flow nodes stayed in the figure and tiny nodes landed on one another, and long one-line labels ran into the next column's labels. Now the stopped nodes are plain sinks that Plotly justifies to the right column, ordered neuropediátrica, psicológica, M-CHAT from top to bottom so bands never cross; nodes without flow are dropped; labels break in two lines; the padding keeps two-line labels apart. The card spans the whole row. Checked by screenshots of the live page across monthly and semester periods.
This commit is contained in:
2026-12-01 14:36:30 -06:00
parent 2404a3a66b
commit 4118b050b8
3 changed files with 39 additions and 29 deletions
+1 -1
View File
@@ -369,7 +369,7 @@ describe('TEA clinical figures', () => {
});
expect(figure.data[0]).toMatchObject({
type: 'sankey',
link: { source: [0, 0, 1, 2, 2], target: [1, 4, 2, 3, 6], value: [7, 2, 7, 4, 3] },
link: { source: [0, 0, 1, 2, 2], target: [1, 5, 2, 3, 4], value: [7, 2, 7, 4, 3] },
});
});