-
Notifications
You must be signed in to change notification settings - Fork 137
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
Percentages and calculated values #32
Comments
After adding the logic for [ * ], I wasn't certain what options would be best for percentages. Like [ * ], I think that direction is not necessary, though maybe of some use as documentation and for warning checks. I can imagine sometimes wanting the percentage to be calculated on the total of the source node and sometimes as a percentage of the unallocated remainder. The syntax could potentially support both, at the expense of some additional complexity. For example:
where taxes are calculated off the total paycheck and savings and play are a weighted split of what's left. The "what's left" percentages would have to add up to 100 or be considered an error. [ * ] could also be used to fill in any remaining, so that just [ * ] would be [ 100%* ] but [ 75%* ] and [ * ] would make the star function as [ 25%* ]. The percentage-of-total [ 25% ] would likely be paired with a * to avoid having to make all the other numbers add up perfectly. I'd be interested in hearing other people's thoughts and use cases. |
I also think supporting percentages based on input and remainder would be useful. I'm not using sankey for budgets, but for information flow. It is a hurdle to rewrite the entire diagram to "align" the nodes. Would you be open for a pull request to support the above syntax? |
Wow, I haven't thought of this in years! I don't have time to work on this currently, but it would be great if someone could at least merge the old |
As @nowthis is kind of absent from his homepage, twitter I think it is fair to assume that this project is not maintained. Let's see what happens, if we can at least reach him. |
Hi folks. i do have some bandwidth to look at this now; sorry about the prolonged absence. I think I have a clue where to go with a syntax now. Thanks for the pull request, @jsstylos. I'll use that as a starting point. One consideration: in the % example above, I'll need to have some specific response from the script when you run into an unworkable combination such as:
|
I just discovered this project and want to also say: thank you for making this available. I also need to display percentages in my diagrams, so I implemented the version that I needed, in this branch. I'd be happy to submit a pull request if @nowthis is interested in merging my change, but in the meantime, folks can play around with it here: https://dossy.github.io/sankeymatic/build/index.html I added three new settings to control the display of percentages: The "calculate percentages based on [parent, total]" either calculates the percentage based on the node's immediate parents or the total inputs of the entire diagram, depending on the chosen option. Here is what the "Job Search" sample diagram looks like with each setting, first with the percentages set to "parent": And, set to "total": I haven't tested this thoroughly with all permutations of the many settings and input diagrams, but this works exactly as I needed and I figured it would be good to share in case others need this as well. |
Firstly, thanks for creating such a useful project!
It would be great to be able to use percentages of either the parent or child nodes instead of absolute values.
Could probably be indicated by the syntax Source [10%<] Destination where the arrow denotes which node the percentage is calculated on.
Also, adding onto issue #21 allow a node be the remainder of a parent or child node. i.e.
Where Remainder would be 8. Probably not the best syntax here, but just a suggestion
The text was updated successfully, but these errors were encountered: