ricklupton / floweaver

View flow data as Sankey diagrams
https://floweaver.readthedocs.io
MIT License
448 stars 89 forks source link

Adjusting Bundle's Length #84

Open verina09 opened 5 years ago

verina09 commented 5 years ago

Hi, I am just wondering if it is possible to adjust the length of each bundle, as currently all bundles have the same length. I'm asking this because I'm wondering if I could use the length variable to represent duration of the process. Many thanks!

ricklupton commented 5 years ago

Hi, sounds like an interesting idea but I’m not sure exactly what you mean. Can you give a simple sketch or example that shows how this would work?

verina09 commented 5 years ago

Hi, thankyou for reply, below is the simple sketch I was thinking about, hope it clarifies and it makes sense (pardon the ugly stretch)

sampleBundleFloweaver 001

alexbovet commented 3 years ago

I have more or less the same question: Is it possible to manually adjust the x position of nodes?

If I understand correctly, the x posiion of nodes is computed in d3-sankey-diagram, which has a nodePosition function. Is there a way to have this function read parameters from a sankey diagram made with floweaver?

ricklupton commented 3 years ago

Hi @verina09 (if you're still interested, sorry for the long delay!) and @alexbovet,

The best way of setting node positions at the moment would be to save the data from floweaver as JSON (using weave(...).to_json(), edit the JSON to add your desired node positions, and then render it using svg-sankey. Specifially setting the --position argument to indicate which node attributes to access to set the position.

At the moment it's all or nothing -- there's no easy way to set x-positions but keep the automatic y-positions.

It would be nice to have better integration for customising this within floweaver.