{"id":13583211,"url":"https://github.com/kessler/catchart","last_synced_at":"2025-03-21T23:31:51.175Z","repository":{"id":27016475,"uuid":"110905431","full_name":"kessler/catchart","owner":"kessler","description":"Pipe something from command line to a chart in the browser","archived":false,"fork":false,"pushed_at":"2023-03-15T02:03:05.000Z","size":1527,"stargazers_count":37,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-17T08:09:22.388Z","etag":null,"topics":["chart","command-line-tool","javascript","nodejs","nodejs-modules","npm-module","npm-package","tool"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kessler.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-11-16T01:07:44.000Z","updated_at":"2025-03-13T12:12:46.000Z","dependencies_parsed_at":"2024-04-08T16:59:01.927Z","dependency_job_id":"537d39b6-c7db-4758-94dd-c04375e41cf1","html_url":"https://github.com/kessler/catchart","commit_stats":{"total_commits":89,"total_committers":2,"mean_commits":44.5,"dds":0.0561797752808989,"last_synced_commit":"54a624e4adcf76eb88fd143fddd22cb91cc29812"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fcatchart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fcatchart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fcatchart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fcatchart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kessler","download_url":"https://codeload.github.com/kessler/catchart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244885166,"owners_count":20526282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chart","command-line-tool","javascript","nodejs","nodejs-modules","npm-module","npm-package","tool"],"created_at":"2024-08-01T15:03:19.758Z","updated_at":"2025-03-21T23:31:50.892Z","avatar_url":"https://github.com/kessler.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# catchart\r\n_(pronounced ca-chart)_\r\n\r\n**Pipe something from command line to a chart in the browser**\r\n\r\nuses [chart.js](http://www.chartjs.org/) for, ahem, charting...\r\n\r\n[![npm status](http://img.shields.io/npm/v/catchart.svg?style=flat-square)](https://www.npmjs.org/package/catchart) \r\n\r\n## command line\r\n\r\n`npm i -g catchart`\r\n\r\n`catchart --help`\r\n\r\n#### simple y over t\r\n```\r\necho 1\\n2\\n3\\n | catchart\r\n```\r\n\u003cimg src=\"/1.png?raw=true\" width=\"400\"\u003e\r\n\r\n#### custom label / value\r\n```\r\necho sunday,1,2,3\\nmonday,4,5,6\\ntuesday,7,8,9\\n | catchart --labelSource=row\r\n```\r\n\u003cimg src=\"/2.png?raw=true\" width=\"400\"\u003e\r\n\r\n#### multiple data sets over time\r\n```\r\necho 1,2,3\\n4,5,6\\n-1,-2,-3\\n | catchart\r\n```\r\n\u003cimg src=\"/3.png?raw=true\" width=\"400\"\u003e\r\n\r\n#### other chart types, custom title\r\n```\r\necho 1,2,3\\n4,5,6\\n-1,-2,-3 | catchart --title=catchart --chartType=bar\r\n```\r\nchart types: `line`, `bar`, `radar`, `pie`, `doughnut`, `scatter`, `polar`, `bubble`\r\n\r\n\u003cimg src=\"/4.png?raw=true\" width=\"400\"\u003e\r\n\r\n#### JSON input works too!\r\n```\r\necho \"{ \\\"data\\\": 1 }\"\\n\"{ \\\"data\\\": 2, \\\"label\\\": \\\"foo\\\" }\"\\n | catchart\r\n```\r\n\r\n## api\r\n`catchart` cli in it's simplest form, looks very much like this:\r\n\r\n```js\r\nconst { pipeline } = require('stream')\r\nconst catchart = require('./index')\r\nconst split = require('split')\r\n\r\npipeline(process.stdin, split(), catchart(), err =\u003e err ? console.error(err) : undefined)\r\n```\r\n\r\n## features\r\n- support most of chart.js chart types\r\n- support json and simple array input formats\r\n- specify configuration through environment variables, files or cli parameters (see rc module and commander module for further information)\r\n- fill the area under the line, also supports patterns.\r\n- restrict the amount of displayed data using --windowSize. Catchart will dump data that falls outside of the window.\r\n- align data to a left or right Y axis using configuration or automatically:\r\n  * `--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\r\n  * Auto align Y axis: a somewhat feeble/experimental attempt at grouping series with similar magnitude on the left and right Y axes. `--disableAutoAlignYAxis` to disable \r\n\r\n## dev\r\n- clone this repo\r\n- hack\r\n- npm run build_client; node emitter `\u003ccsv | singlecsv | json\u003e` | node catchart`\r\n- also `node emitter.js csv | node catchart.js --yLeft=[0,1] --yRight=[2,3]`\r\n- send a PR :)\r\n\r\n### TODOS\r\n- refactor code, especially server\r\n- write tests (right now using emitter.js to test manually)\r\n\r\n## license\r\n\r\n[MIT](http://opensource.org/licenses/MIT) © Yaniv Kessler\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fcatchart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkessler%2Fcatchart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fcatchart/lists"}