annacrombie / plot Goto Github PK
View Code? Open in Web Editor NEWplot on the command line
License: MIT License
plot on the command line
License: MIT License
(copied/editied from second half of #13)
Many counters exposed to userspace by the linux kernel are exported as a file that is not simply a file with a number in it, but has either 1. multiple counters or 2 with surrounding text. Many files exposed via /proc/
are examples of this.
Presently plot
expects the input value that it receives (stdout or file) to be a number represented as a string that can be converted to a double via strtod().
It would be really nice if plot
supported a generic parsing functionality for extracting numbers from text. What I have in mind is adding an option
where one could specify a name for a parser in C that is either provided, or custom-written.
The docs say:
-d [width]:[height] - set plot dimensions
Actually, it seems to be
-d [height]:[width] - set plot dimensions
Hello there,
I've just come across your porting and it seems really interesting!
I need a few time to check your code and see if it can fit my needs, but I'd like to know first if it is possible to integrate a plot like this inside a ncurses
window interface.
For example something like some text and a data table at the top of the window and the plot with the flowing data at the bottom.
Many thanks for your time!
Hello! I love what I'm seeing of plot so far, but I do not see a license. Has this project been released under any particular license?
~/Downloads/plot-master/src> { seq 1 5; seq 1 4 | tac } | plot -d5
>
~/Downloads/plot-master/src> seq 1 5; seq 1 4 | tac | ./plot -d5
1
2
3
4
5
4.00 ┼╮
3.25 ┤╰╮
2.50 ┤ │
1.75 ┤ ╰╮
1.00 ┤ ╰─
I have a question regarding intended scope and extensibility of plot
.
the example script for plotting tx/rx counters is but one example of this
Plotting counters of various types is a common activity that I see myself using plot
for. However, it currently doesn't provide the ability to handle rate of change - the burden of calculating rate of change presently depends on some external program that usually does something like the monitor()
function in the example script.
Since this seems (at least to me) like a common use case, it would be nice to add an option such as:
-r plot rate of change
which maybe does something like:
(val - old_val) / sleep_time
to get a unit of "counters per second"
Presently plot
expects the input value that it receives (stdout or file) to be a number represented as a string that can be converted to a double via strtod() (input.c:39).
Many counters exposed to userspace by the linux kernel are exported as a file that is not simply a file with a number in it, but has either 1. multiple counters or 2. surrounding text. Many files exposed via /proc/
are examples of this.
It would be really nice if plot
supported a generic parsing functionality for extracting numbers from text. What I have in mind is:
-p regex:parse-string|<custom parser name>
where one could pass in PCRE regex to specify an extraction or optionally a name for a parser in C that they manually write
First of all, I am very glad I found this wonderful tool.
I fail to make plot
draw graphs as values come in at stdin while it does work if I use files. For instance, in Bash for i in {0..9}; do echo $i ; sleep .5; done| plot
will show the graph only after 5s. If I write the sequence of numbers to a file in the background plot -f -i file
works as expected. plot starts showing and updating the graph as the first number is written to the file. Did I miss something in the docs?
plot 0.5.1, Kernel 5.10.0, Bash 5.1.4
Within a recent project, I required a simple solution to plot data into the shell. Plot does offer exactly this functionality in a reasonable and good way. However, my intended application will not easily allow to integrate and run plot as a standalone executable. Therefore, I would like to adapt the build-system of plot to such needs and make it a shared-library which can be linked into other executables.
This issue is about asking if this application and approach may be relevant for others as well and should be implemented to plot at all.
The intention of these changes is to not affect the functionality of the plot-executable at all. Also, I have currently not the intention to add further functionality or extend interfaces of the project. My request is really just limited to offer the fundamental functionalities of plot, as a standalone shared library.
Specifically, the functions and types that should be exported by the library are defined in the following headers:
display.h
follow.h
input.h
plot.h
util.h
I know that introducing fundamental requirements into a project is typically not welcomed, for good reason. Therefore, I would have no problem to just apply the changes on a fork of plot. By doing so, the original scope and functionality of plot would be entirely unaffected.
library
-target into the build-systemI.e. if I have 20 data points, the plot is 20 characters max in width and increasing that does nothing to the graph, decreasing just limits the maximum amount of rendered characters. Whereas de/increasing height stretches and compress on the Y-Axis, why the difference and would it be possible to have width behave the same as heights?
P.S.
I looked at plot_fill_canvas
and answered part of my question, there is no easy way, at least not for me :-) I think it would be nice to have ratio work on both axis if you ever get around to it. For now I'll figure out how I can "pad" my data to get at least terminal wide graphs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.