5 ms·
Histo.c – histograms in the terminal for static or streaming data
- bliker 14y agoIs this functional on windows?
- ygra 14y agoNope. 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.
- babarock 14y agoFor what it's worth, it won't work on my Linux Debian box either...
- IWentToTheWoods 14y agoI think you could use something like https://github.com/adoxa/ansicon https://github.com/adoxa/ansicon to get it up and running pretty easily.
- hagios 14y agoThis is pretty nifty; I'll be tinkering with this a bit for sure! Nice work.
- nwh 14y agoNow that's impressive. Piped some stats to it, and it looks amazing.
- lttlrck 14y agoI've been itching to display data from Cube [1] in the Terminal. This might be a way in. [1] https://github.com/square/cube https://github.com/square/cube
- djbender 14y agoThere was a tool that prints out one line graphs using utf8 characters. I can't remember what it's called off the top of my head unfortunately.
- imsofuture 14y agoNeat! I made an uglier and simpler version of this a while back (also in C) https://github.com/jzellner/tfig https://github.com/jzellner/tfig -- I should get off my butt and make it prettier.
- moe 14y agoSadly doesn't work on linux, uses some weird escape sequences that I've never seen before (\e[1;2;f instead of \e[1;2H).
- delinka 14y agoHaving 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.
- Textarcana 14y agoOn OSX it works for me using the default terminal. But in iTerm it didn't display properly :(
- k2enemy 14y agoSorry if I am just being slow this morning, but how can a histogram have a negative value?
- pretoriusB 14y agoWhat they made is not a histogram, since it's value agnostic. It's just a way to present values, nothing like bins and such is necessary for using it. So, in case of negatives you can just see it as a bar chart.
- hagios 14y agoAt 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.
- morpher 14y agoIt looks like this tool doesn't actually calculate a histogram of the data, but simply plots a bar plot of integral data. So, a negative value means whatever it means in your data.
- lsiebert 14y agohmm, the interesting thing for me is there is apparently a c package manager. Though if this won't run on linux, I'd be worried about cpm.
- Toenex 14y agoGnuplot [http://www.gnuplot.info/ http://www.gnuplot.info/] can plot histograms and supports terminal output. In fact here is an example of it being used to show live memory useage on a console [http://filipivianna.blogspot.co.uk/2011/11/plotting-memory-usage-on-console.html http://filipivianna.blogspot.co.uk/2011/11/plotting-memory-u...].
- akkartik 14y agoI've somehow gone through life[1] without knowing about: set terminal dumb Thanks! [1] http://akkartik.name/bash.html#plot http://akkartik.name/bash.html#plot
- montecarl 14y agoI wrote a simple histogram tool for the command line that can be visualized by piping its output to gnuplot. https://github.com/SamChill/hist https://github.com/SamChill/hist
- crisnoble 14y agoMy favorite part is how it will scale to the terminal size. First responsive design for terminal?
- elbee 14y ago1) 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.