Skip to content

Several Sankey enhancements #151

@fbreitwieser

Description

@fbreitwieser

Hi,

I put this issue up for discussion. In my fork of networkD3 (https://github.com/fbreitwieser/networkD3/commits/master) I have implemented several ideas for the Sankey plot.

  • Allow specifying depth/breadth of nodes (~ x-position)
    • this required to modify the conflict resolution by adding pseudo nodes, as otherwise the link between distant node is often used for placement of intermediary nodes
  • Make distance between node depths dependent on the maximum string length at that level
    • the implementation is currently rather ad-hoc, multiplying a constant with the string length. A better implementation would be el.getBoundingClientRect() as done by @timelyportfolio in sunburstR's sunburst.js
  • Add zooming functionality + still allow dragging of nodes
  • Use \r\n instead of <br> in tooltips
  • Return a ITEM_clicked event to the Shiny server
  • Sort nodes according to their path: I only layout trees, which means there are and should be no intersections. However, no matter the iterations, there would be in the previous implementation
  • Option to connect nodes by trapezoids instead of bezier curves. While the bezier curves look nice, they have glitches when the link size is big
  • Allow specifying node values (instead of setting node values as the maximum of the sum of incoming versus outgoing nodes)

Let me know which of those changes are of interest to you.

image

Best,
Florian

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions