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
This appears to have been originally forked due to the upstream maintainer not being responsive to a PR: d3/d3-sankey#19 (comment)
However, the Plotly fork is now out of date with upstream d3-sankey and missing some features, notably the ability to control the order of nodes, which has been requested in #4373.
The Plotly fork could be updated, but it appears that all the features that were added to the fork have now been added upstream or reverted, so it might be simplest to switch to using the upstream d3-sankey library directly.
plotly.js similarly uses a forked version of d3-sankey-cirular: https://github.com/plotly/d3-sankey-circular. This has been archived and is also behind its upstream library, which also has support for setting nodeSort.
Thanks for investigating this. Have you tried swapping the libraries out? If so, did things just "work"? I'm trying to understand how much work will be involved in making this change.
Yes I tested this quite a while ago and also got the nodeSort feature working, and I seem to remember that everything just worked. I will make a PR with this and see what happens.
Due to upstream d3-sankey not properly fixing the large node padding issue, I've instead made a PR against the plotly fork to update it: plotly/d3-sankey#12
Hmm good question, the plotly fork of d3-sankey-circular doesn't contain any changes that aren't in the base repo, except for the rebranding, but there are some changes in the base repo that haven't been released to npm. Eg. the change to add nodeSort (tomshanley/d3-sankey-circular#37) hasn't been released, but it looks like that might also have introduced a bug based on the comment on that PR, so we'd need to fix that.
So it's probably worth unarchiving that repo and updating it to get nodeSort support for circular graphs, as well as integrating the other unreleased improvements.
I dug into it a bit and it doesn't really seem worth the effort to update d3-sankey-circular. Some of the changes from 0.34.0 actually make rendering look worse. Let's just plan on upgrading d3-sankey.
Activity
camdecoster commentedon Jan 21, 2026
Thanks for investigating this. Have you tried swapping the libraries out? If so, did things just "work"? I'm trying to understand how much work will be involved in making this change.
adamreeve commentedon Jan 21, 2026
Yes I tested this quite a while ago and also got the
nodeSortfeature working, and I seem to remember that everything just worked. I will make a PR with this and see what happens.adamreeve commentedon Jan 22, 2026
I've opened a draft PR at #7696. This seemed to mostly work but there's a regression with the large padding test that will be a problem: https://github.com/plotly/plotly.js/pull/7696/files#r2715057996.
I guess the upstream fix in d3/d3-sankey@0fa75d8 didn't actually address the problem correctly, or maybe this regressed in more recent versions.
adamreeve commentedon Apr 8, 2026
Due to upstream d3-sankey not properly fixing the large node padding issue, I've instead made a PR against the plotly fork to update it: plotly/d3-sankey#12
camdecoster commentedon Jun 8, 2026
@adamreeve do you see value in updating the plotly/d3-sankey-circular to the latest version of the base repo?
adamreeve commentedon Jun 8, 2026
Hmm good question, the plotly fork of d3-sankey-circular doesn't contain any changes that aren't in the base repo, except for the rebranding, but there are some changes in the base repo that haven't been released to npm. Eg. the change to add
nodeSort(tomshanley/d3-sankey-circular#37) hasn't been released, but it looks like that might also have introduced a bug based on the comment on that PR, so we'd need to fix that.So it's probably worth unarchiving that repo and updating it to get
nodeSortsupport for circular graphs, as well as integrating the other unreleased improvements.camdecoster commentedon Jun 12, 2026
I dug into it a bit and it doesn't really seem worth the effort to update d3-sankey-circular. Some of the changes from 0.34.0 actually make rendering look worse. Let's just plan on upgrading d3-sankey.
[-]Use upstream d3-sankey and d3-sankey-circular[/-][+]Use upstream d3-sankey[/+]