fbreitwieser / sankeyD3

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

Some suggestion from a medical researcher #2

Open sverriss opened 8 years ago

sverriss commented 8 years ago
timelyportfolio commented 8 years ago

some reference pieces for sorting/order/y-axis (mostly dealing with d3v3). I am pretty sure @fbreitwieser has already made improvements here that could potentially be resolved by additional examples.

fbreitwieser commented 8 years ago

Thanks for the suggestions. For nodes there is the option nodeStrokeWidth, but not yet for links. While it is not what you asked for, in the next release I'll add the option to display node values above them (and rounded corners).

image

fbreitwieser commented 8 years ago

Regarding the y positioning - What do you think of? Just the vertical order, and let the layout algorithm decide the actual position, or do you want to provide the fixed positions?

sverriss commented 8 years ago

The vertical order, preferrably. Per link, or rather, per connection to the node. The point of wanting to choose the order of the links (and node, which is already possible (?)) is that I am visualising the results from a longitudinal study with three times of measure, and the outcome is dichotom. Hence, there are eight ways the respondents can "flow" through the diagram," 111, 110, 100, 101, 000, 001, 011, 010. This should be reflected in the diagram by allowing the link from year 1 to 2 meet the corresponding link (same group) from year 2 to 3. I will attach a Stanley diagram i made from wikibudgets. It was drag and drop, so you could manually choose insertion and exit point of the links through the nodes. wikibudget sankey

sverriss commented 8 years ago

Alternatively, I could make 24 nodes instead of 6, and keep the 16 links. Each two links will then connect to three unique nodes, and as long as I can force the y-position of the nodes, I will achieve the layout I want. If that is the way it is done, I have some other layout suggestions (see attached pic (grey colour is what I want, coloured text are suggestions):

Longitudinal research is a BIG field, and I think this striking way of visualising the results from longitudinal studies is under communicated in the (medical) scientific community. Maybe it's coming. I think if you would succeed in making a package that is simple yet very customisable, you would have lots of glory ;) img_0006