Support for user-specified y-axis range
Maybe something along the lines of optional flags such as smag --y-min=0 --y-max=12 ...?
A motivational example is graphing load average. A user might want to see the graph plotted in the context of the CPU's full capability, e.g. seeing the graph plotted in the range 0...12 (for 6-core hyperthreaded processor) instead of smag automatically shrinking the y-range from 1.25 to 2.00.
This should be easy to do. Do you have any interest in trying to add the feature yourself and opening a PR? I can point you at the areas in the code you should look at.
This should be easy to do. Do you have any interest in trying to add the feature yourself and opening a PR? I can point you at the areas in the code you should look at.
I haven't worked with Rust much beyond Hello World and a few Project Euler problems, but I'm more than happy to give it a shot.
Cool, lets give this a go!
The y-axis bounds are calculated here in DataStore: https://github.com/aantn/smag/blob/main/src/datastore.rs#L72
The command-line arguments are generated automatically from the Args struct here: https://github.com/aantn/smag/blob/main/src/main.rs#L28
I would start by modifying the y-axis bounds function to use a set hardcoded number and make sure that works OK. If it does then add command line arguments by modifying the Args struct. Lastly, you'll have to access the data from the args struct when calculating the y-bounds. You can pass that to DataStore::new here: https://github.com/aantn/smag/blob/main/src/main.rs#L78
Awesome, thanks. Will give this a shot tomorrow.