ricklupton / floweaver

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

Set minimum width for flow #100

Open andrewSharo opened 3 years ago

andrewSharo commented 3 years ago

Fantastic work on this tool! I have found it very helpful and plan to cite it in an upcoming publication. I have one quick question.

I believe there was a design choice made so that each flow has a minimum width in the sankey diagram. I understand this can improve legibility, so that even flows with very small values are easily visible. For example, I have found that if I have one very large flow, with value 10,000 and several smaller flows, with values 100, 10, and 1, the three smaller plots will all have the same width in the diagram even though they are different values (because they are all so much smaller than the 10,000 value flow). The main issue is that this is misleading, but it also leads to a mismatch between the width of the flows and the length of the black bars that represent each source/target. Is there some way to adjust this minimum flow width? I'm happy to upload some screen shots if this is unclear.

Best, Andrew

ricklupton commented 3 years ago

@andrewSharo thanks, glad you're finding it helpful!

That's right, there is a minimum link width to keep thin lines visible. It's customizable in the underlying Javascript Sankey diagram library (https://github.com/ricklupton/d3-sankey-diagram#linkMinWidth) but unfortunately not from Python at the moment -- we should add an option for this.

Are you seeing a mismatch with the length of the black bars just on very thin flows if you look closely? I wouldn't have thought this would be very visible since everything is thin anyway; but if the node lines aren't being held to the same minimum height then that should be fixed too.

andrewSharo commented 3 years ago

@ricklupton

This is several months old, but I am working on this project again and wanted to reply. Yes, the length of the black bars doesn't seem to match up with the length of the flows for some cases (see attached image). You can only see it if you look closely, though. Let me know if you are able to add a minimum link width to the python version. That would allow me to make some subtler points with the figure.

image