You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: sankey: node.x / node.y of 0 is ignored #8150
Note that the center of a is not in the top left corner of the plot
Notes
This issue stems from the fact that the "Force node position" loop in src/traces/sankey/render.js uses a truthy test (if(trace.node.x[p] && trace.node.y[p])), and 0 is falsy
The fix is to change the test for missing values to != null
The mock sankey_x_y_with_arrows.json sets y: [0, 0, 0], so the fix changes its baseline
Hi @camdecoster, I'd like to take this one. I reproduced it on main with your snippet: a is placed automatically instead of at the top-left corner.
I have a branch that switches the force-node-position check in render.js to != null. It also adds a jasmine test that places nodes at x = 0 and y = 0. The sankey jasmine suite passes locally (92/92). As you noted, sankey_x_y_with_arrows is the only mock with a 0 coordinate, so it's the only baseline that should change, and I'll take the new image from the CI artifact.
Activity
adimalkar commentedon Oct 31, 2026
Hi @camdecoster, I'd like to take this one. I reproduced it on main with your snippet: a is placed automatically instead of at the top-left corner.
I have a branch that switches the force-node-position check in render.js to != null. It also adds a jasmine test that places nodes at x = 0 and y = 0. The sankey jasmine suite passes locally (92/92). As you noted, sankey_x_y_with_arrows is the only mock with a 0 coordinate, so it's the only baseline that should change, and I'll take the new image from the CI artifact.
I'll open a PR for it shortly.