Pipe something from command line to a chart in the browser
MIT License
(pronounced ca-chart)
Pipe something from command line to a chart in the browser
uses chart.js for, ahem, charting...
npm i -g catchart
catchart --help
echo 1\n2\n3\n | catchart
echo sunday,1,2,3\nmonday,4,5,6\ntuesday,7,8,9\n | catchart --labelSource=row
echo 1,2,3\n4,5,6\n-1,-2,-3\n | catchart
echo 1,2,3\n4,5,6\n-1,-2,-3 | catchart --title=catchart --chartType=bar
chart types: line
, bar
, radar
, pie
, doughnut
, scatter
, polar
, bubble
echo "{ \"data\": 1 }"\n"{ \"data\": 2, \"label\": \"foo\" }"\n | catchart
catchart
cli in it's simplest form, looks very much like this:
const { pipeline } = require('stream')
const catchart = require('./index')
const split = require('split')
pipeline(process.stdin, split(), catchart(), err => err ? console.error(err) : undefined)
--yLeft=[0, 1, 2]
and --yRight=[3, 4]
will make series 0, 1 and 2 be on the left and 3,4 on the right. When using this config, all the series indices must be specified. With arrays the first item is the X value, if your input array is [1,2,3,4,5], yLeft=0,1 and yRight=3,4 will put 2 and 3 on the left Y axis and 3,4 on the right Y axis for X=1--disableAutoAlignYAxis
to disable<csv | singlecsv | json>
| node catchart`node emitter.js csv | node catchart.js --yLeft=[0,1] --yRight=[2,3]
MIT © Yaniv Kessler