-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamically calculate flow sizes when using ">" or "<" as an amount #77
Conversation
Flows with "<" as an amount will fill the remaining space from their source. Flows with ">" as an amount will be the sum of their targets.
Thanks @Ivoah. This is a good start. I've run some scenarios with it and there are some edge cases I'm working on resolving. Some examples:
No need to make any changes on your end, I think I've got it from here. I expect to ship a revised version of this that handles all the edge cases I can think of in the next few weeks. |
Well here goes: I agree with your intuition. The entire diagram description is about the flow.
If I put
my immediate interpretation is that Whereas, if I read
I basically stumble over it when reading it. I know that something more complicated is happening. Something is going from However, swapping the symbols doesn't help with that. In fact, for me, it makes both scenarios more difficult to reason. Another alternative could be to use a different symbol for
The closest of those, I think, would be |
I think the use of angle brackets only works if they aren't considered arrows. For me they indicate a branching flow. So conceptually they would "point" towards the source, or collective element. This seemed to work well with:
Budget to savings doesn't seem quite as natural as there's only one flow, but the children of savings make a lot of intuitive sense to me. That said, angle brackets can read as arrows, so I agree with Anthchirp that this can feel "backwards" to the flow of the diagram and cause stumble. Use of alternate symbols seems reasonable. Is a blank appropriate ( Obviously a symbol is brief but would a word work instead?
A quick thought on the remainder splitting. I like the thinking above, especially the provision to allow for weighted calculated pots. However, fractional remainders and the increasing of precision felt uncomfortable to me. It seems a simple solution and one that is far from wrong but left me glitching on things that just don't split below 1 well (people, for example). I don't have a better solution but my first thought was to let the precision stand and assign remainder based on order - leaving unequal sets.
Resulting in Like I say, it's not a better solution but maybe a toggleable option at some point so you can choose 'accuracy' vs 'display precision' primacy. |
I'm thinking of changing tack since (as just demonstrated) people's intuitive interpretations about My current thought is Also, from another perspective, on software-based keyboards (like tablets and phones), In the old pull request #41, the symbol
So if I was thinking of Then I took a step back and thought about it this way: Imagine a person encountering
...I think that even if a person is brand new to these diagrams, they would fairly quickly be able to interpret that If
Here's how that would look in the above 'Fill in Missing Inputs' example:
Also, design-wise, I am taking care to define these symbols in only one place in the code, so that if someone does wish to use different symbols in their own fork, it will be trivial to change either or both of them. |
Side note – keying off of @duffry's comment about how a blank flow like The user experience I'm anticipating there is that one can then just cut/delete the amount from between the brackets to see the diagram without that flow, then Cmd-Z/Ctrl-Z to see it put back. I think that'll be slightly more convenient than going to the start of the line and typing |
On tweaking the splitting mechanism -
...though I can recognize that approach might not be ideal because you could only decide those percentages when you already know the size of I guess an alternative would be to add a toggle which basically requires that whole numbers in remainders would never be split. In my theoretical example of a node of size 1 getting split into 3, that would mean that the first consumer of the remainder here (
That seems like it might be practical. I would likely have it off by default though. (P.S. If anyone is wondering why |
When actually merging this and marshaling the other 10+ commits that followed it (from 6282e91 to b1af9c2), I came to a couple of revised conclusions in the cold light of day:
The changes are here on GitHub but are not yet promoted to sankeymatic.com. The site should get these changes applied in the next day or two. |
is this already live - I assume it would be available at https://www.sankeymatic.com/build-next/ ? Thanks, Andre |
@andre68723 I had found a couple more issues that I needed to resolve - some flows with colors were not included in calculations, and when a graph is reversed, the calculations were not flipped accordingly. See the 4 newest commits from May 28 (84209af) through June 2 (e81503a) for those fixes. All of these changes are live on sankeymatic.com/build/ as of right now. There's more to do in terms of:
but yes, you can now use P.S. /build-next/ is inactive for the moment, there's no major layout-change-in-progress to preview at this time. |
Flows with "<" as an amount will fill the remaining space from their source.
Flows with ">" as an amount will be the sum of their targets.