loony-bean / textplots-rs

Terminal plotting library for Rust
238 stars 24 forks source link

Plans on adding a binary to the crate? #20

Closed micouy closed 3 years ago

micouy commented 4 years ago

Hi! I really like this crate. Would you consider adding a binary so that it could be used as a standalone CLI tool? It would be perfect in a situation where I want to plot something quickly. I know the implementation would require parsing math expressions, handling input/output etc. which may be beyond the scope of this crate so I understand if that's not your goal.

loony-bean commented 4 years ago

Hi @micouy! I really like this idea. In terms of user experience, do you have any suggestions on how this CLI tool should be invoked?

micouy commented 4 years ago

How about textplot 'sin(x) / x'? That itself would be useful. It might become a pain in the ass if you need to type 30+ characters BUT I'd say textplot is not the right tool if your input is 30+ characters long. I also think too many features would make the app less usable. So I wouldn't bother implementing ifs or some way of multiline input.

I'm not sure about multiple graphs at once. They might be very useful like if you need to check which output is higher or which function is steeper. It could be invoked like this: textplot 'sin(x) / x' 'x' 'sin(x)'. I think there's an issue to add colored output so you should (carefully) consider something like textplot 'x+1' --color red 'x+2' --color blue'.

It should have some useful args but, again, not too many. I hate it when I type command --help and 10 pages of text show up on my screen (see rg --help for a great example). See clap for arg parsing.