Skip to content
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

Addition to Sankey method: read from data file #90

Merged
merged 2 commits into from
Jan 27, 2021

Conversation

jakewilliami
Copy link
Contributor

@jakewilliami jakewilliami commented Jan 26, 2021

Still to do:

  • It would be very nice to have an option for the Sankey diagram to look like this
    1
    Instead of this:

2

  • Option to ignore zero values (i.e., do not print those whose values are 0)

Using the second method mentioned above--as per http://sankeymatic.com/build/'s convention--you can have a datafile (call it `input.txt`), where each line has the information
```
SOURCE [AMOUNT] TARGET
```
In this case.  `SOURCE` and `TARGET` are both `String`s, where `AMOUNT` is a `Real`.  For example:
```
Wages [2000] Budget
Interest [25] Budget
Budget [500] Taxes
Budget [450] Housing
Budget [310] Food
Budget [205] Transportation
Budget [400] Health Care
Budget [160] Other Necessities
```
And simply run
```julia
s = sankey("input.txt")
```
Copy link
Owner

@randyzwitch randyzwitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for submitting!

@randyzwitch randyzwitch merged commit 914af47 into randyzwitch:master Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants