d3-sankey
d3-sankey copied to clipboard
sourceLinks `y0` and `y1` calculated the wrong way round
I've discovered what appears to be a bug in how the y
positions are calculated in the sourceLinks here:
https://github.com/d3/d3-sankey/blob/bb7233ea0004669878d922e55fe83084ef3cb555/src/sankey.js#L39-L52
As far as I can tell, this should update y1
rather than y0
. These are referring to the top and bottom of the source link, so as it stands, y0
and y1
end up being the wrong way round.
I'd be grateful if someone could confirm that is the case before I submit a PR
@james-mckenzie-cko After a few reads through of the code snippet you linked, my initial reaction (based on vague but not confident memory of the codebase from the past) was: "the origin is in the top-left" -- but then that seemed unintuitive, and so I had to go back and search to confirm why that could be the case. It looks like for SVG-format graphics, the origin is indeed top-left (rather than bottom-left as in many diagram tools).
Might that explain the confusion here? What happens if you switch these around and render the results?