d3-plugin-captain-sankey icon indicating copy to clipboard operation
d3-plugin-captain-sankey copied to clipboard

Sankey with variable nodeWidth

Open mizzao opened this issue 9 years ago • 2 comments

Hey @soxofaan, you look like the expert with this plugin.

I was just wondering how feasible it would be to modify it to allow for variable nodeWidths, so that each node could be a block that displayed some other information inside.

In particular, my application is a timeline where groups split and re-join, and I'd like to fix the x-axis to reflect the beginning and end of these groups (i.e. real-time) rather than fixed-width and fixed spacing. It seems like setting the .dx values to a parameter rather than a fixed value is pretty simple; I'm just wondering how much it would mess up the layout algorithm. Any thoughts would be much appreciated!

cc @ldworkin

mizzao avatar Jul 27 '15 20:07 mizzao

Here's an example of what I mean:

image

I'd like each node to be scaled according to its real time duration and have both the width and the internal contents reflect that. Currently, everything is the same width and the link regions are the same width as well. How much would the layout algorithm break if widths and x-values were pre-specified?

Thanks!

mizzao avatar Jul 28 '15 03:07 mizzao

hi @mizzao,

sorry for the delayed response

this would indeed be an interesting extension, and it should be possible (with probably some pitfalls, but nothing too big I hope)

However, I currently don't have time to work on this, but I'd happily review patches :)

soxofaan avatar Sep 08 '15 11:09 soxofaan