christophergandrud / networkD3

D3 JavaScript Network Graphs from R
http://christophergandrud.github.io/networkD3
650 stars 269 forks source link

Wish: possibility to influence sankey label alignment vs nodes #222

Open ugroempi opened 6 years ago

ugroempi commented 6 years ago

Thanks for providing networkD3!

I have been playing with displaing a sankey diagram of voter migration (similar to here). sankeyNetwork defaults to displaying the node labels inside, i.e. on top of the visualization. For this application, I would strongly prefer to have the labels in the margins, and I have not found a way to achieve that.

Did I overlook something? If not, here is my wish: it would be great if users could influence the position of the label relative to its node (e.g. similar to the pos argument in the base R text command).

Best regards, Ulrike

cjyetman commented 6 years ago

That ability is not built in, but there are a number of workarounds on Stack Overflow, e.g. https://stackoverflow.com/a/45495841/4389763

Building this in would not be trivial, but maybe someone would be willing to do it?

ugroempi commented 6 years ago

Thanks for the pointer!