Nope. It's hardcoded to work only on terminal emulators. It should be possible to provide a Windows implementation of the few commands used, though. They map fairly trivially onto the Windows console functions.
That being said, I'm now thinking about creating a PowerShell implementation of this.
Neat! I made an uglier and simpler version of this a while back (also in C) https://github.com/jzellner/tfig -- I should get off my butt and make it prettier.
Having issues on OS X also. And the shell files in examples/ won't run because they're missing a #! line. Now I'm curious what system this was tested on.
At the point where you're allowing negative values, 'histogram' is probably a misnomer. Allowing for negative values lets you track things like delta, jerk, and so on, which can in turn reveal interesting data which isn't immediately obvious otherwise.
1) In main.c the vals array is statically sized at 256 entries, but entries are put into it mod terminal width, with no guarantee that the terminal is <= 256 characters wide. That will lead to a buffer overflow.
2) INT_MIN cannot be negated -- you should check for that and just use INT_MAX instead.
24 comments
[ 3.0 ms ] story [ 65.1 ms ] threadThat being said, I'm now thinking about creating a PowerShell implementation of this.
[1] https://github.com/square/cube
So, in case of negatives you can just see it as a bar chart.
So, a negative value means whatever it means in your data.
[1] http://akkartik.name/bash.html#plot
https://github.com/SamChill/hist