fbreitwieser / sankeyD3

D3 Sankey Network Graphs from R
67 stars 27 forks source link

Added `NodePosY` argument to sankeyNetwork.R to control y position of nodes #21

Open atarashansky opened 4 years ago

atarashansky commented 4 years ago

It was not clear to me what form the yOrderComparator argument should take in pull request #16 so I added a NodePosY argument to sankeyNetwork to allow the user to directly specify the y position of nodes.

todd-davidson-beis commented 1 year ago

So I know this package hasn't been updated in a while, but I just wanted to recommend this PR - really useful and simple functionality (just give a value to each node and it will sort them into order - the values themselves are immaterial) for fixing the vertical order of nodes. I've found it particularly powerful if also fixing PosX when making repeatable figures for publications.

(Though installing it does not seem to work for me - I can install the package (using a zip of the repo and devtools::install_local ) which sets up all the javascript bits, but the main sankeyD3::sankeyNetwork function does not then recognise the NodePosY argument - so I had to directly source the sankeyNetwork.R script and utils.R script, unfortunately, but then it all works!)