nowthis / sankeymatic

Make Beautiful Flow Diagrams
http://sankeymatic.com/build/
ISC License
841 stars 122 forks source link

Add an option to force flows placing on TOP. #57

Closed Kokuhatsu closed 1 year ago

Kokuhatsu commented 1 year ago

I use SankeyMATIC to visualise my Home budged structured as: Income -> Budged -> Outcome Category -> Outcome SubCategory. Some of the Categories doesn't have the SubCategory.

I use a bottom end of the Budged node as a visualization how much surplus/deficit I had.

Recent change(SHA: https://github.com/nowthis/sankeymatic/commit/b00636648ea08e5df31ae685f3b0a38670fcc7e4) caused that difference was visualized on top of the Budged node.

Please add an option to pin flows on TOP of nodes.

nowthis commented 1 year ago

The new behavior is intended to support funnel-style diagrams by default. Example: 2022-11-06-3funnels

To make a flow attach to the top of its source node instead of to the bottom, you can drag the target node upwards to the point where its center is in the top half of the source node's range. (Remember that holding Shift while you drag can keep the node at a constant horizontal position so you're only changing the vertical placement.)

I may be able to add an option to customize this outcome to make the old behavior easy to restore, but I don't anticipate it will happen soon.

Kokuhatsu commented 1 year ago

I see why you did it and I understand it.

To make a flow attach to the top of its source node instead of to the bottom, you can drag the target node upwards to the point where its center is in the top half of the source node's range. (Remember that holding Shift while you drag can keep the node at a constant horizontal position so you're only changing the vertical placement.)

Unfortunately this didn't work for me(I think source/target is too wide). As a workaround I had to modify a source code in chrome.

I may be able to add an option to customize this outcome to make the old behavior easy to restore, but I don't anticipate it will happen soon.

Thank you.

nowthis commented 1 year ago

Added a new option to customize this behavior:

2023-02-12-attach-imbalanced-groups