Giter Club home page Giter Club logo

datadash's Introduction

DataDash

A data visualization tool for the terminal.

Input streaming or tabular data inside the terminal via pipe or file, and an interactive graph will be generated.

Chart types

datadash currently supports following chart types:

  • Line
  • Plot tabular or streaming data as line graph
  • Line graph supports zooming with the scroll wheel or trackpad
  • Supports X-Axis Auto scaling
  • Displays the average value with the -a option (customize how many values to consider using -z)
  • Different color lines for each graph
  • Supports scrolling for streaming data applications (disable with the --no-scroll option)
  • Displays up to five graphs simultaneously
  • Displays Min, Mean, Max, and Outliers
  • Customize the screen redraw interval and input seek interval for high latency or low bandwidth environments
  • No dependencies, only one file is required
  • Sample datasets included
  • Bar
  • Support for Bar Graphs (Beta)
  • SparkLine
  • Support for SparkLine Graphs (Beta)

Streaming Data: (Linechart)

1col-scrolling.gif

Streaming Data: (Barchart)

4col-scrolling.gif

Streaming Data: (SparkLines)

4col-sparkline.gif

Demo (Streaming data):

This will continue scrolling to the right, displaying the most recent data first and removing the older data to the left.

seq 4000 | awk 'BEGIN{OFS="\t"; print "x"}{x=$1/10; print cos(x) system("sleep 0.01")}' | ./datadash --label-mode time --scroll

Tabular Data:

4col-scrolling.gif

Demo: (2 columns of data):
seq 4000 | awk 'BEGIN{OFS="\t"; print "x","sin(x)"}{x=$1/10; print x,sin(x); system("sleep 0.02")}'  | ./datadash --label-mode time
Line graph Demo: (6 columns of data) w/ grey average line:
seq 4000 | awk 'BEGIN{OFS="\t"; print "x","sin(x)","cos(x)", "rand(x)", "rand(x)", "rand(x)"}{x=$1/10; print x,sin(x),cos(x),rand(x),rand(x),rand(x); system("sleep 0.02")}'  | ./datadash -a

Installation (and demo)

go get -u github.com/keithknott26/datadash
go build cmd/datadash.go
./datadash tools/sampledata/5col-errors

datadash can accept tabular data like CSV, TSV, or you can use a custom delimiter with the -d option. The default delimiter is tab.

Input Methods

Input data from stdin or file.

$ cat data.txt | datadash
$ datadash data.txt

Data Structure

Below are examples of the accepted data structure. More examples can be found under /tools/sampledata

Streaming Data (1 graph):
50
60
70
3 Columns (2 graphs): (\t is the tab charachter)
time\tRowLabel1\tRowLabel2
00:00\t50\t100
00:01\t60\t90
00:02\t70\t80
00:08\t80\t70
23:50\t10\t10

Arguments

$ usage: datadash [<flags>] [<input file>]

Flags:
--help  Show context-sensitive help (also try --help-long and --help-man).
--debug Enable Debug Mode
-d, --delimiter="\t"  Record Delimiter:
-m, --label-mode="first"  X-Axis Labels: 'first' (use the first record in the column) or 'time' (use the current time)
-s, --scroll  Whether or not to scroll chart data
-a, --average-line  Enables the line representing the average of values
-z, --average-seek=500  The number of values to consider when displaying the average line: (50,100,500...)
-r, --redraw-interval=10ms  The interval at which objects on the screen are redrawn: (100ms,250ms,1s,5s..)
-l, --seek-interval=20ms  The interval at which records (lines) are read from the datasource: (100ms,250ms,1s,5s..)

Args:

[<input file>]  A file containing a label header, and data in columns separated by a delimiter 'd'. Data piped from Stdin uses the same format
A graphing application written in go using termdash, inspired by termeter.

License

MIT

datadash's People

Contributors

keithknott26 avatar spacelatte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datadash's Issues

it always panic

it always panic

$ seq 4000 | awk 'BEGIN{OFS="\t"; print "x","sin(x)","cos(x)", "rand(x)", "rand(x)", "rand(x)"}{x=$1/10; print x,sin(x),cos(x),rand(x),rand(x),rand(x); system("sleep 0.02")}'  | ./datadash
$ seq 4000 | awk 'BEGIN{OFS="\t"; print "x","sin(x)"}{x=$1/10; print x,sin(x); system("sleep 0.02")}'  | ./datadash --label-mode time
goroutine 65 [running]:
github.com/keithknott26/datadash.periodic(0x12fd8c0, 0xc00010e0c0, 0x2625a00, 0xc0001904e0)
	/Users/eric/go/src/github.com/keithknott26/datadash/row.go:589 +0x17b
created by github.com/keithknott26/datadash.(*Row).createSparkLine
	/Users/eric/go/src/github.com/keithknott26/datadash/row.go:392 +0x12e

Just a static chart?

I'm probably missing something but can datadash produce just a simple static chart from some non-updating data? I mean, with no refresh, no stream, just drew a line given two columns of data? :)

how do i get the datadash binary

Hi. Sorry I don't know how to build a Go project. I'm used to traditional Linux programs that use ./configure ; make ; make install

The instructions here aren't very explicit on how to get the datadash binary. The install instructions says:

go get -u github.com/keithknott26/datadash

I ran that command but I still had no datadash binary. Matter of fact, the command had zero output at all. I wasn't sure if it did anything at all. I hunted around to see if I could find anything and luckily I stumbled across a go directory inside my home directory. Inside there I was able to find a datadash directory which had a datadash.a file and some other files that look like source code.

I was hoping to get instructions that were a little more clear about what to do after running the go get command and specifically how to build the datadash binary. The usage examples all seem pretty clear so I don't think I need help with usage, I just need the binary.

Can someone help please?

go mod error

$ go mod vendor
go: finding github.com/andrew-d/go-termutil latest
go: finding github.com/keithknott26/datadash latest
go: github.com/miguelmota/btc-history imports
        github.com/keithknott26/datadash: github.com/keithknott26/[email protected]: parsing go.mod:
        module declares its path as: github.com/keithknott26/datadash/src
                but was required as: github.com/keithknott26/datadash

Using time labels still drops the first column

I'm piping in data that's across three columns and I would like to see all three plotted out, but even if I specify -m time to use time as the x-axis label, the data points from the first column don't get displayed.

As a workaround I've been using a perl one-liner to prepend 1\t to each line, but this seems like a bug.

(kudos on this btw, I was so happy to find a better replacement for termeter!)

Redraw the whole graph?

(Sorry in advance for being a bit slow and probably noisy :)

As I understand, when datadash gets the new data from STDIN, it draws a new graph and adds it alongside the previous one, thus creating something like a "tape" (similar to an electrocardiogram, for instance).

But what if we'd have an option to redraw the graph completely, so that only the new data would be added (and the missing data โ€“ if any โ€“ would be removed)?

So, that instead

...we'd get

Or, may be an option limiting the number of these graphs on the screen? Like, if set to 1, then only the latest graph will be drawn (and if set to 2, then no more than 2 graphs will be displayed, like in the example above).

Again, I do apologise if this is already possible (or if this is out of the scope of this project), just couldn't figure out how to achieve it, and thought that may be it could be a useful addition.

Thank you :)

Can't build

With the last version, I can't build datadash :

go: downloading github.com/rivo/uniseg v0.4.4
../../../../pkg/mod/github.com/mattn/[email protected]/runewidth.go:7:2: found packages uniseg (doc.go) and main (gen_breaktest.go) in /home/user/go/pkg/mod/github.com/rivo/[email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.