{"id":13800469,"url":"https://github.com/maximousblk/chart","last_synced_at":"2025-09-14T20:02:33.336Z","repository":{"id":104791272,"uuid":"303301177","full_name":"maximousblk/chart","owner":"maximousblk","description":"Console ASCII line charts with no dependencies","archived":false,"fork":false,"pushed_at":"2023-02-03T12:40:18.000Z","size":12,"stargazers_count":66,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-09T01:37:33.718Z","etag":null,"topics":["chart","console-ascii","deno"],"latest_commit_sha":null,"homepage":"https://deno.land/x/chart","language":"TypeScript","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/maximousblk.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2020-10-12T06:43:02.000Z","updated_at":"2025-08-27T13:21:32.000Z","dependencies_parsed_at":"2024-01-05T20:59:54.860Z","dependency_job_id":"f05ff814-082f-4317-acae-459f45f30e80","html_url":"https://github.com/maximousblk/chart","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/maximousblk/chart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximousblk%2Fchart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximousblk%2Fchart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximousblk%2Fchart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximousblk%2Fchart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximousblk","download_url":"https://codeload.github.com/maximousblk/chart/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximousblk%2Fchart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275160352,"owners_count":25415764,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","console-ascii","deno"],"created_at":"2024-08-04T00:01:12.878Z","updated_at":"2025-09-14T20:02:33.285Z","avatar_url":"https://github.com/maximousblk.png","language":"TypeScript","funding_links":[],"categories":["Modules"],"sub_categories":["CLI utils"],"readme":"# chart\n\nConsole ASCII line charts with no dependencies.\n\nThis is a port of the npm package\n[`asciichart`](https://www.npmjs.com/package/asciichart) by\n[Igor Kroitor](https://github.com/kroitor)\n\n\u003cimg width=\"700\" alt=\"Console ASCII Line charts in pure Javascript (for NodeJS and browsers)\" src=\"https://cloud.githubusercontent.com/assets/1294454/22818709/9f14e1c2-ef7f-11e6-978f-34b5b595fb63.png\"\u003e\n\n## Usage\n\n```ts\nimport { plot } from \"https://deno.land/x/chart/mod.ts\";\n\nvar s0 = new Array(120);\nfor (var i = 0; i \u003c s0.length; i++) {\n  s0[i] = 15 * Math.sin(i * ((Math.PI * 4) / s0.length));\n}\n\nconsole.log(plot(s0));\n```\n\nyou can also run [test.ts](./test.ts) if you want to see how it looks.\n\n```sh\ndeno run https://deno.land/x/chart/test.ts\n```\n\n### Options\n\nThe width of the chart will always equal the length of data series. The height\nand range are determined automatically.\n\n```ts\nvar s0 = new Array(120);\nfor (var i = 0; i \u003c s0.length; i++) {\n  s0[i] = 15 * Math.sin(i * ((Math.PI * 4) / s0.length));\n}\n\nconsole.log(plot(s0));\n```\n\n![](https://cloud.githubusercontent.com/assets/1294454/22818807/313cd636-ef80-11e6-9d1a-7a90abdb38c8.png)\n\nThe output can be configured by passing a second parameter to the\n`plot(series, config)` function. The following options are supported:\n\n```ts\ninterface config {\n  min?: number; // y-axis minimum range\n  max?: number; // y-axis maximum range\n  offset?: number; // axis offset from the left (min 2)\n  padding?: string; // padding string for label formatting (can be overrided)\n  height?: number; // any height you want\n  colors?: string[]; // set colors for the output\n  symbols?: string[]; // change drawing symbols\n  format?: any; // the label format function applies default padding\n}\n```\n\n#### Height\n\n```ts\nvar s = [];\nfor (var i = 0; i \u003c 120; i++) s[i] = 15 * Math.cos(i * ((Math.PI * 8) / 120)); // values range from -15 to +15\n\nconsole.log(plot(s, { height: 6 })); // this rescales the graph to 6 lines\n```\n\n![](https://cloud.githubusercontent.com/assets/1294454/22818711/9f166128-ef7f-11e6-9748-b23b151974ed.png)\n\n#### Auto-range\n\n```ts\nvar s2 = new Array(120);\ns2[0] = Math.round(Math.random() * 15);\nfor (i = 1; i \u003c s2.length; i++) {\n  s2[i] = s2[i - 1] +\n    Math.round(Math.random() * (Math.random() \u003e 0.5 ? 2 : -2));\n}\n\nconsole.log(plot(s2));\n```\n\n![](https://cloud.githubusercontent.com/assets/1294454/22825525/dd295294-ef9e-11e6-93d1-0beb80b93133.png)\n\n![](https://cloud.githubusercontent.com/assets/1294454/22818710/9f157a74-ef7f-11e6-893a-f7494b5abef1.png)\n\n#### Multiple Series\n\n```ts\nvar s2 = new Array(120);\ns2[0] = Math.round(Math.random() * 15);\nfor (i = 1; i \u003c s2.length; i++) {\n  s2[i] = s2[i - 1] +\n    Math.round(Math.random() * (Math.random() \u003e 0.5 ? 2 : -2));\n}\n\nvar s3 = new Array(120);\ns3[0] = Math.round(Math.random() * 15);\nfor (i = 1; i \u003c s3.length; i++) {\n  s3[i] = s3[i - 1] +\n    Math.round(Math.random() * (Math.random() \u003e 0.5 ? 2 : -2));\n}\n\nconsole.log(plot([s2, s3]));\n```\n\n![](https://user-images.githubusercontent.com/27967284/79398277-5322da80-7f91-11ea-8da8-e47976b76c12.png)\n\n### Colors\n\n```ts\nvar arr1 = new Array(120);\narr1[0] = Math.round(Math.random() * 15);\nfor (i = 1; i \u003c arr1.length; i++) {\n  arr1[i] = arr1[i - 1] +\n    Math.round(Math.random() * (Math.random() \u003e 0.5 ? 2 : -2));\n}\n\nvar arr2 = new Array(120);\narr2[0] = Math.round(Math.random() * 15);\nfor (i = 1; i \u003c arr2.length; i++) {\n  arr2[i] = arr2[i - 1] +\n    Math.round(Math.random() * (Math.random() \u003e 0.5 ? 2 : -2));\n}\n\nvar arr3 = new Array(120);\narr3[0] = Math.round(Math.random() * 15);\nfor (i = 1; i \u003c arr3.length; i++) {\n  arr3[i] = arr3[i - 1] +\n    Math.round(Math.random() * (Math.random() \u003e 0.5 ? 2 : -2));\n}\n\nvar arr4 = new Array(120);\narr4[0] = Math.round(Math.random() * 15);\nfor (i = 1; i \u003c arr4.length; i++) {\n  arr4[i] = arr4[i - 1] +\n    Math.round(Math.random() * (Math.random() \u003e 0.5 ? 2 : -2));\n}\n\nvar config = { colors: [\"blue\", \"green\", \"red\", \"magenta\"] };\n\nconsole.log(plot([arr1, arr2, arr3, arr4], config));\n```\n\n![](https://user-images.githubusercontent.com/27967284/79398700-51a5e200-7f92-11ea-9048-8dbdeeb60830.png)\n\n## License\n\nThis software is distributed under [The MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximousblk%2Fchart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximousblk%2Fchart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximousblk%2Fchart/lists"}