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

feature request: add 'fill available' option #27

Open
ldunkum opened this issue Dec 13, 2021 · 4 comments
Open

feature request: add 'fill available' option #27

ldunkum opened this issue Dec 13, 2021 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed

Comments

@ldunkum
Copy link

ldunkum commented Dec 13, 2021

It'd be nice to have the option to automatically fill a target with the remaining value of a source.

source [500] target
target [400] rent 
target [%] savings // automatically fills to 100 and ideally refreshes when other values are changed 

I can try to do it myself, but some pointers would be nice

@JonasDoesThings JonasDoesThings added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Dec 13, 2021
@JonasDoesThings
Copy link
Member

Great idea!

Parsing the [?] value currently happens in sankey-builder.js#L248 so checking for [%] should probably also happen there.

Calculating the remaining value will be a bit tricky, but it could work by parsing the linksList list after it is fully populated with all the other links.

Sadly I currently don't have enough time on my hands to implement it by myself, but I would be happy to review any Pull Requests implementing this feature!

@jfaltis
Copy link

jfaltis commented Dec 13, 2021

I would suggest using a different string than '%' maybe even just 'fill', 'remaining' or a clever character representation. '%' could be used later on for percentage distribution if it is a wanted feature.

@JonasDoesThings
Copy link
Member

@jfaltis good objection, I have to agree with that!

@ldunkum
Copy link
Author

ldunkum commented Dec 14, 2021

@k4ds3 Thanks for the pointers, I'll take a look when I've got some time on my hands.

@jfaltis yeah, for sure, "fill" was actually my first idea too, I was just trying to simplify it to some common symbol :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants