christophergandrud / christophergandrud/networkD3
Several Sankey enhancements
- Dominant language
- R
- Stars
- 659
- Forks
- 259
- PR merge metrics
- No merged PRs in 30d
Description
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 `
` 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.

Best,
Florian
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the linked fork's commit history and the Sankey plot implementation, then compare the sizing approach with sunburst.js as suggested. Separate the listed enhancements into scoped proposals and check which, if any, are still wanted; the issue currently does not define a single completion condition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- d3js, javascript, r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100