{"id":44594187,"url":"https://github.com/gtktsc/ascii-chart","last_synced_at":"2026-02-14T08:01:02.249Z","repository":{"id":37684960,"uuid":"454001767","full_name":"gtktsc/ascii-chart","owner":"gtktsc","description":"Simple console ascii chart (lines and bars) - for node, browser and terminal, no dependencies.","archived":false,"fork":false,"pushed_at":"2025-08-02T13:37:53.000Z","size":567,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T18:40:01.463Z","etag":null,"topics":["ascii","ascii-art","ascii-chart","barchart","browser","chart","charting","charts","console","javascript","linechart","lines","node","plot","terminal","text-chart","typescript"],"latest_commit_sha":null,"homepage":"https://simple-ascii-chart-website.vercel.app/","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/gtktsc.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-31T12:40:49.000Z","updated_at":"2025-09-01T19:50:29.000Z","dependencies_parsed_at":"2023-09-24T13:26:28.805Z","dependency_job_id":null,"html_url":"https://github.com/gtktsc/ascii-chart","commit_stats":{"total_commits":50,"total_committers":2,"mean_commits":25.0,"dds":"0.020000000000000018","last_synced_commit":"0b3f0e279f643dc31b22af03c5bdc5a321a60b90"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/gtktsc/ascii-chart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtktsc%2Fascii-chart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtktsc%2Fascii-chart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtktsc%2Fascii-chart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtktsc%2Fascii-chart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gtktsc","download_url":"https://codeload.github.com/gtktsc/ascii-chart/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtktsc%2Fascii-chart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29439820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T07:24:13.446Z","status":"ssl_error","status_checked_at":"2026-02-14T07:23:58.969Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ascii","ascii-art","ascii-chart","barchart","browser","chart","charting","charts","console","javascript","linechart","lines","node","plot","terminal","text-chart","typescript"],"created_at":"2026-02-14T08:00:50.068Z","updated_at":"2026-02-14T08:01:02.221Z","avatar_url":"https://github.com/gtktsc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple ASCII Chart\n\n![NPM License](https://img.shields.io/npm/l/simple-ascii-chart)\n![NPM Version](https://img.shields.io/npm/v/simple-ascii-chart)\n![npm package minimized gzipped size (select exports)](https://img.shields.io/bundlejs/size/simple-ascii-chart)\n![Codecov](https://img.shields.io/codecov/c/github/gtktsc/ascii-chart)\n\n**Simple ASCII Chart** is a TypeScript package for creating customizable ASCII charts in the terminal. It supports two-dimensional data, multiple series, custom colors, and formatters, making it a versatile solution for terminal-based data visualization.\n\n[Playground and documentation](https://simple-ascii-chart.vercel.app/)\n[NPM](https://www.npmjs.com/package/simple-ascii-chart)\n\n## Installation\n\nInstall the package using `yarn` (or `npm`):\n\n```bash\nyarn add simple-ascii-chart\n# or\nnpm install simple-ascii-chart\n```\n\n## Usage\n\nIn ESM (e.g., TypeScript, modern Node.js)\n\n```javascript\nimport plot from 'simple-ascii-chart';\n// or, if you prefer named imports:\nimport { plot } from 'simple-ascii-chart';\n\nconst graph = plot(input, settings);\nconsole.log(graph);\n```\n\nIn CommonJS (e.g., legacy Node.js)\n\n```javascript\n// Option 1: access default export\nconst plot = require('simple-ascii-chart').default;\n\n// Option 2: use named export\nconst { plot } = require('simple-ascii-chart');\n\nconst graph = plot(input, settings);\nconsole.log(graph);\n```\n\n## CLI\n\n[CLI tool is available too](https://github.com/gtktsc/simple-ascii-chart-cli)\n[NPM](https://www.npmjs.com/package/simple-ascii-chart-cli)\n\n## Playground\n\nCreate charts interactively in the [playground](https://simple-ascii-chart.vercel.app/playground).\n\n## API Endpoint\n\nGenerate charts via the API by sending a POST request with your input data:\n\n```bash\ncurl -d input='[[1,2],[2,3],[3,4]]' -G https://simple-ascii-chart.vercel.app/api\n```\n\nOr pass it as a URL parameter:\n\n```bash\nhttps://simple-ascii-chart.vercel.app/api?input=[[1,2],[2,3],[3,4]]\u0026settings={%22width%22:50}\n```\n\n## Input Format\n\nInput data should be a two-dimensional array of points or an array of arrays for multiple series:\n\n```typescript\ntype Point = [x: number, y: number];\ntype Input = Point[] | Point[][];\n```\n\nSingle series\n\n```typescript\nconst input = [\n  [1, 1],\n  [2, 4],\n  [3, 40],\n];\n\n```\n\nMultiple series\n\n```typescript\nconst input = [\n  [\n    [0, 18],\n    [1, 1],\n    [2, 3],\n  ],\n  [\n    [4, 1],\n    [5, 0],\n    [6, 1],\n  ],\n];\n```\n\n### Detailed Input Parameters\n\n- **`Point`**: A single point with x and y coordinates, represented as `[x, y]`.\n- **`MaybePoint`**: Allows partial or undefined values within a point, accommodating incomplete data.\n- **`SingleLine`**: A series of connected points representing a single line.\n- **`MultiLine`**: A collection of `SingleLine` arrays for multiple data series.\n\n## Configuration (Settings)\n\nCustomize the `plot` function with a variety of settings:\n\n### Available Settings\n\n| Option           | Description                                                                                                   |\n|------------------|---------------------------------------------------------------------------------------------------------------|\n| `color`          | Colors for the graph. Options include `'ansiRed'`, `'ansiGreen'`, etc. Multiple colors are accepted for series. |\n| `width`          | Sets the graph width.                                                                                         |\n| `height`         | Sets the graph height.                                                                                        |\n| `axisCenter`     | Specifies the center of the axis as `[x, y]`, with default as bottom-left.                                    |\n| `formatter`      | A function to format axis labels, offering custom display styles.                                             |\n| `lineFormatter`  | Function to define custom styles for each line.                                                               |\n| `title`          | Title of the chart, displayed above the graph.                                                                |\n| `xLabel`         | Label for the x-axis.                                                                                         |\n| `yLabel`         | Label for the y-axis.                                                                                         |\n| `thresholds`     | Defines threshold lines or points with optional colors at specific x or y coordinates.                        |\n| `points`         | Defines points with optional colors at specific x or y coordinates.                                           |\n| `fillArea`       | Fills the area under each line, suitable for area charts.                                                     |\n| `hideXAxis`      | Hides the x-axis.                                                                                             |\n| `hideYAxis`      | Hides the y-axis.                                                                                             |\n| `mode`           | Sets the plotting mode (line, point, bar, horizontal bar), defaults to line                                   |\n| `symbols`        | Symbols for customizing the chart’s appearance, including axis, background, and chart symbols.                |\n| `legend`         | Configuration for a legend, showing series names and position options (`left`, `right`, `top`, `bottom`).     |\n| `debugMode`      | Enables debug mode (`default = false`).                                                                       |\n\n### Advanced Settings\n\n| Setting              | Description                                                                                               |\n|----------------------|-----------------------------------------------------------------------------------------------------------|\n| `yRange`             | Specifies the y-axis range as `[min, max]`.                                                               |\n| `showTickLabel`      | Enables tick labels on the axis, improving readability for larger plots.                                  |\n| `legend`             | Configures legend display with position and series names, such as `{ position: 'top', series: ['Series 1', 'Series 2'] }, thresholds: ['first', 'second'], points: ['1', '2']]`. |\n| `ColorGetter`        | A function for dynamic color assignment based on series or coordinates.                                   |\n| `axisCenter`         | Sets a custom origin point for the chart, shifting the chart layout to focus around a particular point.    |\n| `lineFormatter`      | Customize each line using the format `lineFormatter: (args: LineFormatterArgs) =\u003e CustomSymbol | CustomSymbol[]`. |\n| `formatterHelpers`   | Provides helpers such as axis type and range for detailed formatting of axis labels.                      |\n\n### Symbols\n\nOverrides default symbols. Three independent sections are: `empty` - background, `axis` - symbols used to draw axis, `chart` - symbols used to draw graph.\n\n```typescript\nsymbols: {\n  background: ' ',\n  border: undefined,\n  point: '●',\n  thresholds:{\n    x: '━',\n    y: '┃',\n  },\n  empty: ' ',\n  axis: {\n    n: '▲',\n    ns: '│',\n    y: '┤',\n    nse: '└',\n    x: '┬',\n    we: '─',\n    e: '▶',\n  },\n  chart: {\n    we: '━',\n    wns: '┓',\n    ns: '┃',\n    nse: '┗',\n    wsn: '┛',\n    sne: '┏',\n    area: '█'\n    }\n}\n```\n\n### Summary\n\n```typescript\nSettings = {\n  color?: Colors; // Colors for the plot lines or areas\n  width?: number; // Width of the plot\n  height?: number; // Height of the plot\n  yRange?: [number, number]; // Range of y-axis values\n  showTickLabel?: boolean; // Option to show tick labels on the axis\n  hideXAxis?: boolean; // Option to hide the x-axis\n  hideYAxis?: boolean; // Option to hide the y-axis\n  title?: string; // Title of the plot\n  xLabel?: string; // Label for the x-axis\n  yLabel?: string; // Label for the y-axis\n  thresholds?: Threshold[]; // Array of threshold lines\n  points?: GraphPoint[] // Array of points to render\n  fillArea?: boolean; // Option to fill the area under lines\n  legend?: Legend; // Legend settings\n  axisCenter?: MaybePoint; // Center point for axes alignment\n  formatter?: Formatter; // Custom formatter for axis values\n  lineFormatter?: (args: LineFormatterArgs) =\u003e CustomSymbol | CustomSymbol[]; // Custom line formatter\n  symbols?: Symbols; // Custom symbols for chart elements\n};\n```\n\n## Examples\n\n### Simple Plot\n\nInput:\n\n```typescript\nplot(\n  [\n    [1, 1],\n    [2, 4],\n    [3, 4],\n    [4, 2],\n    [5, -1],\n  ],\n  { width: 9, height: 6 },\n);\n```\n\nExpected Output:\n\n```bash\n  ▲\n 4┤ ┏━━━┓\n  │ ┃   ┃\n 2┤ ┃   ┗━┓\n 1┤━┛     ┃\n  │       ┃\n-1┤       ┗━\n  └┬─┬─┬─┬─┬▶\n   1 2 3 4 5\n```\n\n### Plot with Title and Custom Size\n\nInput:\n\n```typescript\nplot(\n  [\n    [1, 1],\n    [2, 4],\n    [3, 4],\n    [4, 2],\n    [5, -1],\n    [6, 3],\n    [7, -1],\n    [8, 9],\n  ],\n  { title: 'Important data', width: 20, height: 8 },\n);\n```\n\nExpected Output:\n\n```bash\nImportant data\n  ▲\n 9┤                  ┏━\n  │                  ┃\n  │                  ┃\n 4┤  ┏━━━━┓          ┃\n 3┤  ┃    ┃     ┏━┓  ┃\n 2┤  ┃    ┗━━┓  ┃ ┃  ┃\n 1┤━━┛       ┃  ┃ ┃  ┃\n-1┤          ┗━━┛ ┗━━┛\n  └┬──┬─┬──┬──┬──┬─┬──┬▶\n   1  2 3  4  5  6 7  8\n```\n\n### Plot with Axis Labels\n\nInput:\n\n```typescript\nplot(\n  [\n    [1, 1],\n    [2, 4],\n    [3, 4],\n    [4, 2],\n    [5, -1],\n    [6, 3],\n    [7, -1],\n    [8, 9],\n  ],\n  { xLabel: 'x', yLabel: 'y', width: 20, height: 8 },\n);\n```\n\nExpected Output:\n\n```bash\n   ▲\n  9┤                  ┏━\n   │                  ┃\n   │                  ┃\n  4┤  ┏━━━━┓          ┃\n  3┤  ┃    ┃     ┏━┓  ┃\ny 2┤  ┃    ┗━━┓  ┃ ┃  ┃\n  1┤━━┛       ┃  ┃ ┃  ┃\n -1┤          ┗━━┛ ┗━━┛\n   └┬──┬─┬──┬──┬──┬─┬──┬▶\n    1  2 3  4  5  6 7  8\n             x\n```\n\n### Plot with colors\n\nInput:\n\n```typescript\nplot(\n  [\n    [\n      [1, 1],\n      [2, 2],\n      [3, 4],\n      [4, 6],\n    ],\n    [\n      [5, 4],\n      [6, 1],\n      [7, 2],\n      [8, 3],\n    ],\n  ],\n  {\n    width: 20,\n    fillArea: true,\n    color: ['ansiGreen', 'ansiBlue'],\n    legend: { position: 'bottom', series: ['first', 'second'] },\n  },\n);\n```\n\nExpected Output:\n\n```bash\n ▲\n6┤       ██\n │       ██\n4┤    █████  ███\n3┤    █████  ███    ██\n2┤  ███████  ███ █████\n1┤█████████  █████████\n └┬──┬─┬──┬──┬──┬─┬──┬▶\n  1  2 3  4  5  6 7  8\n█ first\n█ second\n\n```\n\n### Plot with borders\n\nInput:\n\n```typescript\nplot(\n  [\n    [1, 1],\n    [2, 4],\n    [3, 4],\n    [4, 2],\n    [5, -1],\n    [6, 3],\n    [7, -1],\n    [8, 9],\n  ],\n  { symbols: { border: '█' }, xLabel: 'x', yLabel: 'y', width: 20, height: 8 },\n);\n```\n\nExpected Output:\n\n```bash\n███████████████████████████\n█   ▲                     █\n█  9┤                  ┏━ █\n█   │                  ┃  █\n█   │                  ┃  █\n█  4┤  ┏━━━━┓          ┃  █\n█  3┤  ┃    ┃     ┏━┓  ┃  █\n█y 2┤  ┃    ┗━━┓  ┃ ┃  ┃  █\n█  1┤━━┛       ┃  ┃ ┃  ┃  █\n█ -1┤          ┗━━┛ ┗━━┛  █\n█   └┬──┬─┬──┬──┬──┬─┬──┬▶█\n█    1  2 3  4  5  6 7  8 █\n█             x           █\n███████████████████████████\n```\n\n### Plot with filled area\n\nInput:\n\n```typescript\nplot(\n  [\n    [\n      [1, 1],\n      [2, 2],\n      [3, 4],\n      [4, 6],\n    ],\n    [\n      [1, 4],\n      [2, 1],\n      [3, 2],\n      [4, 3],\n    ],\n  ],\n  {\n    fillArea: true,\n    color: ['ansiGreen', 'ansiBlue'],\n  },\n);\n```\n\nExpected Output:\n\n```bash\n  ▲\n 6┤  ██\n  │  ██\n 4┤████\n 3┤████\n 2┤████\n 1┤████\n  └┬┬┬┬▶\n   1234\n```\n\n### Scaled up plot\n\nInput:\n\n```typescript\nplot(\n  [\n    [1, 1],\n    [2, 4],\n    [3, 40],\n    [4, 2],\n    [5, -1],\n    [6, 3],\n    [7, -1],\n    [8, -1],\n    [9, 9],\n    [10, 9],\n  ],\n  { width: 40, height: 10 },\n);\n```\n\nExpected Output:\n\n```bash\n   ▲\n 40┤        ┏━━━┓\n   │        ┃   ┃\n   │        ┃   ┃\n   │        ┃   ┃\n   │        ┃   ┃\n   │        ┃   ┃\n   │        ┃   ┃\n  9┤        ┃   ┃                     ┏━━━━━\n  3┤   ┏━━━━┛   ┗━━━┓    ┏━━━┓        ┃\n -1┤━━━┛            ┗━━━━┛   ┗━━━━━━━━┛\n   └┬───┬────┬───┬───┬────┬───┬───┬────┬───┬▶\n    1   2    3   4   5    6   7   8    9   10\n```\n\n### Add thresholds\n\nInput:\n\n```typescript\nplot(\n  [\n    [1, 1],\n    [2, 4],\n    [3, 4],\n    [4, 2],\n    [5, -1],\n    [6, 3],\n    [7, -1],\n    [8, 9],\n  ],\n  {\n    width: 40,\n    thresholds: [\n      {\n        y: 5,\n        x: 5,\n      },\n      {\n        x: 2,\n      },\n    ],\n  },\n);\n```\n\nExpected Output:\n\n```bash\n  ▲     ┃               ┃\n 9┤     ┃               ┃                ┏━\n  │     ┃               ┃                ┃\n  │     ┃               ┃                ┃\n  │━━━━━┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n  │     ┃               ┃                ┃\n 4┤     ┃━━━━━━━━━━┓    ┃                ┃\n 3┤     ┃          ┃    ┃     ┏━━━━┓     ┃\n 2┤     ┃          ┗━━━━┃     ┃    ┃     ┃\n 1┤━━━━━┃               ┃     ┃    ┃     ┃\n  │     ┃               ┃     ┃    ┃     ┃\n-1┤     ┃               ┃━━━━━┛    ┗━━━━━┛\n  └┬─────┬────┬─────┬────┬─────┬────┬─────┬▶\n   1     2    3     4    5     6    7     8\n```\n\n### Add points, threshold and legend\n\nInput:\n\n```typescript\nplot(\n    [\n      [\n        [1, 2],\n        [2, -2],\n        [3, 4],\n        [4, 1],\n      ],\n      [\n        [1, 6],\n        [2, -3],\n        [3, 0],\n        [4, 0],\n      ],\n    ],\n    {\n      width: 40,\n      color: ['ansiGreen', 'ansiMagenta', 'ansiBlack', 'ansiYellow'],\n      legend: {\n        position: 'left',\n        series: ['series 1', 'series 2'],\n        points: ['point 1', 'point 2', 'point 3'],\n        thresholds: ['threshold 1', 'threshold 2'],\n      },\n      title: 'Points',\n      thresholds: [\n        {\n          y: 5,\n          x: 2,\n          color: 'ansiBlue',\n        },\n        {\n          y: 2,\n          color: 'ansiGreen',\n        },\n      ],\n      points: [\n        {\n          y: 5,\n          x: 5,\n          color: 'ansiBlue',\n        },\n        {\n          y: -1,\n          x: 1,\n          color: 'ansiCyan',\n        },\n        {\n          y: 2,\n          x: 2,\n          color: 'ansiRed',\n        },\n      ],\n    },\n);\n```\n\nExpected Output:\n\n```bash\nPoints\n█ series 1     ▲             ┃\n█ series 2    6┤━━━━━━━━━━━━┓┃\n               │━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━●\n┃ threshold 1 4┤            ┃┃           ┏━━━━━━━━━━━━┓\n┃ threshold 2  │            ┃┃           ┃            ┃\n              2┤━━━━━━━━━━━━━●━━━━━━━━━━━━━━━━━━━━━━━━━━━\n● point 1     1┤            ┃┃           ┃            ┗━\n● point 2     0┤            ┃┃           ┏━━━━━━━━━━━━━━\n● point 3      │●           ┃┃           ┃\n             -2┤            ┃┃━━━━━━━━━━━┃\n             -3┤            ┗┃━━━━━━━━━━━┛\n               └┬────────────┬────────────┬────────────┬▶\n                1            2            3            4\n```\n\n\n### Add Points\n\nInput:\n\n```typescript\nplot(\n  [\n      [1, 1],\n      [2, 4],\n      [3, 4],\n      [4, 2],\n      [5, -1],\n      [6, 3],\n      [7, -1],\n      [8, 9],\n    ],\n    {\n      width: 40,\n      title: 'Points',\n      points: [\n        {\n          y: 5,\n          x: 5,\n          color: 'ansiBlue',\n        },\n        {\n          y: -1,\n          x: 1,\n          color: 'ansiBlue',\n        },\n        {\n          y: 205,\n          x: 1005,\n          color: 'ansiBlue',\n        },\n        {\n          y: 2,\n          x: 2,\n          color: 'ansiRed',\n        },\n      ],\n    },\n);\n```\n\nExpected Output:\n\n```bash\nPoints\n  ▲\n 9┤                                      ┏━\n  │                                      ┃\n  │                                      ┃\n  │                                      ┃\n  │                      ●               ┃\n 4┤     ┏━━━━━━━━━━┓                     ┃\n 3┤     ┃          ┃          ┏━━━━┓     ┃\n 2┤     ┃●         ┗━━━━┓     ┃    ┃     ┃\n 1┤━━━━━┛               ┃     ┃    ┃     ┃\n  │                     ┃     ┃    ┃     ┃\n-1┤●                    ┗━━━━━┛    ┗━━━━━┛\n  └┬─────┬────┬─────┬────┬─────┬────┬─────┬▶\n   1     2    3     4    5     6    7     8\n```\n\n### Multi-series plot\n\nInput:\n\n```typescript\nplot(\n  [\n    [\n      [0, 18],\n      [1, 1],\n      [2, 3],\n      [3, 11],\n      [4, 5],\n      [5, 16],\n      [6, 17],\n      [7, 14],\n      [8, 7],\n      [9, 4],\n    ],\n    [\n      [0, 0],\n      [1, 1],\n      [2, 1],\n      [3, 1],\n      [4, 1],\n      [5, 0],\n      [6, 1],\n      [7, 0],\n      [8, 1],\n      [9, 0],\n    ],\n  ],\n  { width: 40, height: 10, color: ['ansiBlue', 'ansiGreen'] },\n);\n```\n\nExpected Output:\n\n```bash\n   ▲\n 17┤━━━━┓                           ┏━━━━┓\n 16┤    ┃                     ┏━━━━━┛    ┃\n 14┤    ┃                     ┃          ┗━━━━━┓\n 11┤    ┃          ┏━━━━━┓    ┃                ┃\n   │    ┃          ┃     ┃    ┃                ┃\n  7┤    ┃          ┃     ┃    ┃                ┗━━━━┓\n  5┤    ┃          ┃     ┗━━━━┛                     ┃\n  4┤    ┃     ┏━━━━┛                                ┗━\n  1┤    ┏━━━━━━━━━━━━━━━━━━━━━┓     ┏━━━━┓     ┏━━━━┓\n  0┤━━━━┛                     ┗━━━━━┛    ┗━━━━━┛    ┗━\n   └┬────┬─────┬────┬─────┬────┬─────┬────┬─────┬────┬▶\n    0    1     2    3     4    5     6    7     8    9\n```\n\n### Plot with formatting applied\n\nInput:\n\n```typescript\nplot(\n  [\n    [\n      [0, -10],\n      [1, 0.001],\n      [2, 10],\n      [3, 200],\n      [4, 10000],\n      [5, 2000000],\n      [6, 50000000],\n    ],\n  ],\n  {\n    width: 30,\n    height: 20,\n    formatter: (n: number, { axis }: FormatterHelpers) =\u003e {\n      const labels = ['A', 'B', 'C', 'D', 'E', 'F', 'G'];\n      if (axis === 'y') return n;\n      return labels[n] || 'X';\n    },\n  },\n);\n```\n\nExpected Output:\n\n```bash\n         ▲\n 50000000┤                            ┏━\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n         │                            ┃\n  2000000┤                       ┏━━━━┛\n      -10┤━━━━━━━━━━━━━━━━━━━━━━━┛\n         └┬────┬────┬────┬───┬────┬────┬▶\n          A    B    C    D   E    F    G\n```\n\n### Plot with axis center\n\nInput:\n\n```typescript\nplot(\n  [\n    [\n      [-8, -8],\n      [-4, -4],\n      [-3, -3],\n      [-2, -2],\n      [-1, -1],\n      [0, 0],\n      [2, 2],\n      [3, 3],\n      [4, 4],\n      [8, 8],\n    ],\n  ],\n  { width: 60, height: 20, axisCenter: [0, 0] },\n);\n```\n\nExpected Output:\n\n```bash\n                                 ▲\n                                8┤                           ┏━\n                                 │                           ┃\n                                 │                           ┃\n                                 │                           ┃\n                                 │                           ┃\n                                4┤            ┏━━━━━━━━━━━━━━┛\n                                3┤         ┏━━┛\n                                2┤     ┏━━━┛\n                                 │     ┃\n  ┬──────────────┬──┬───┬───┬───0│─────────┬──┬──────────────┬─▶\n -8             -4 -3  -2  -1   0│     2   3  4              8\n                            ┏━━-1┤\n                        ┏━━━┛  -2┤\n                    ┏━━━┛      -3┤\n                 ┏━━┛          -4┤\n                 ┃               │\n                 ┃               │\n                 ┃               │\n                 ┃               │\n   ━━━━━━━━━━━━━━┛             -8┤\n                                 │\n```\n\n## Plot with custom symbols\n\nInput:\n\n```typescript\nplot(\n  [\n    [1, 2],\n    [2, 0],\n    [3, 5],\n    [4, 2],\n    [5, -2],\n    [6, 3],\n  ],\n  {\n    symbols: {\n      empty: 'x',\n      empty: '-',\n      axis: {\n        n: 'A',\n        ns: 'i',\n        y: 't',\n        nse: 'o',\n        x: 'j',\n        we: 'm',\n        e: 'B',\n      },\n      chart: {\n        we: '1',\n        wns: '2',\n        ns: '3',\n        nse: '4',\n        wsn: '5',\n        sne: '6',\n      },\n    },\n    width: 40,\n    height: 10,\n  },\n);\n```\n\nExpected Output:\n\n```bash\nxxA-----------------------------------------\nx5t---------------61111112------------------\nxxi---------------3------3------------------\nxxi---------------3------3------------------\nx3t---------------3------3---------------61-\nx2t11111112-------3------411111112-------3--\nxxi-------3-------3--------------3-------3--\nx0t-------411111115--------------3-------3--\nxxi------------------------------3-------3--\nxxi------------------------------3-------3--\n-2t------------------------------411111115--\nxxojmmmmmmmjmmmmmmmjmmmmmmjmmmmmmmjmmmmmmmjB\nxxx1xxxxxxx2xxxxxxx3xxxxxx4xxxxxxx5xxxxxxx6x\n```\n\n### Plot without axis\n\nInput:\n\n```typescript\nplot(\n  [\n    [-5, 2],\n    [2, -3],\n    [13, 0.1],\n    [4, 2],\n    [5, -2],\n    [6, 12],\n  ],\n  {\n    width: 40,\n    height: 10,\n    hideYAxis: true,\n    hideXAxis: true,\n  },\n);\n```\n\nExpected Output:\n\n```bash\n                           ┏━━━━━━━━━━━━━━┓\n                           ┃              ┃\n                           ┃              ┃\n                           ┃              ┃\n                           ┃              ┃\n                           ┃              ┃\n    ━━━━━━━━━━━━━━┓    ┏━┓ ┃              ┃\n                  ┃    ┃ ┃ ┃              ┗━\n                  ┃    ┃ ┗━┛\n                  ┗━━━━┛\n```\n\n### Plot with with large numbers\n\nInput:\n\n```typescript\nplot(\n  [\n    [-9000, 2000],\n    [-8000, -3000],\n    [-2000, -2000],\n    [2000, 2000],\n    [3000, 1500],\n    [4000, 5000],\n    [10000, 1400],\n    [11000, 20000],\n    [12000, 30000],\n  ],\n  {\n    width: 60,\n    height: 20,\n  },\n);\n```\n\nExpected Output:\n\n```bash\n      ▲\n   30k┤                                                          ┏━\n      │                                                          ┃\n      │                                                          ┃\n      │                                                          ┃\n      │                                                          ┃\n      │                                                          ┃\n   20k┤                                                       ┏━━┛\n      │                                                       ┃\n      │                                                       ┃\n      │                                                       ┃\n      │                                                       ┃\n      │                                                       ┃\n      │                                                       ┃\n      │                                                       ┃\n    5k┤                                    ┏━━━━━━━━━━━━━━━┓  ┃\n      │                                    ┃               ┃  ┃\n  1.4k┤━━┓                           ┏━━━━━┛               ┗━━┛\n      │  ┃                           ┃\n   -2k┤  ┃                ┏━━━━━━━━━━┛\n   -3k┤  ┗━━━━━━━━━━━━━━━━┛\n      └┬──┬────────────────┬──────────┬──┬──┬───────────────┬──┬──┬▶\n        -8k                          2k    4k                11k\n     -9k                 -2k            3k                10k   12k\n```\n\n### Plot with custom line format\n\nInput:\n\n```typescript\nplot(\n  [\n    [1, 0],\n    [2, 20],\n    [3, 29],\n    [4, 10],\n    [5, 3],\n    [6, 40],\n    [7, 0],\n    [8, 20],\n  ],\n  {\n    height: 10,\n    width: 30,\n    lineFormatter: ({ y, plotX, plotY, input, index }) =\u003e {\n      const output = [{ x: plotX, y: plotY, symbol: '█' }];\n\n      if (input[index - 1]?.[1] \u003c y) {\n        return [...output, { x: plotX, y: plotY - 1, symbol: '▲' }];\n      }\n\n      return [...output, { x: plotX, y: plotY + 1, symbol: '▼' }];\n    },\n  },\n);\n```\n\nExpected Output:\n\n```bash\n   ▲                     ▲\n 40┤                     █\n   │        ▲\n 29┤        █\n   │    ▲                        ▲\n 20┤    █                        █\n   │\n   │\n 10┤            █\n  3┤            ▼    █\n  0┤█                ▼       █\n   └┬───┬───┬───┬────┬───┬───┬───┬▶\n    1   2   3   4    5   6   7   8\n```\n\n### Bar chart\n\nInput:\n\n```typescript\nplot(\n  [\n  [0, 3],\n  [1, 2],\n  [2, 3],\n  [3, 4],\n  [4, -2],\n  [5, -5],\n  [6, 2],\n  [7, 0],\n],\n{\n  title: 'bar chart with axis',\n  mode: 'bar',\n  showTickLabel: true,\n  width: 40,\n  axisCenter: [0, 0],\n},\n);\n```\n\nExpected Output:\n\n```bash\nbar chart with axis                         \n  ▲                █                        \n 4┤          █     █                        \n 3┤     █    █     █               █        \n 2┤     █    █     █               █        \n 1┤     █    █     █               █     █  \n 0┤─────┬────┬─────┬────┬─────┬────┬─────┬─▶\n-1┤     1    2     3    4     5    6     7  \n-2┤                           █             \n-3┤                           █             \n-4┤                           █             \n-5┤                                         \n  │                                         \n```\n\n### Horizontal Bar chart\n\nInput:\n\n```typescript\nplot(\n  [\n    [0, 3],\n    [1, 2],\n    [2, 3],\n    [3, 4],\n    [4, -2],\n    [5, -5],\n    [6, 2],\n    [7, 0],\n  ],\n  {\n    mode: 'horizontalBar',\n    showTickLabel: true,\n    width: 40,\n    height: 20,\n    axisCenter: [3, 1],\n  },\n);\n```\n\nExpected Output:\n\n```bash\n                 ▲                        \n                4┤                        \n                 │                        \n████████████████3┤                        \n                 │                        \n      ██████████2┤████████████████        \n                 │                        \n┬─────┬────┬────1┤────┬─────┬────┬─────┬─▶\n0     1    2     3    4     5    6     7  \n                0┤██████████████████████  \n                 │                        \n               -1┤                        \n                 │                        \n               -2┤                        \n                 │█████                   \n               -3┤                        \n                 │                        \n               -4┤                        \n                 │                        \n                 │                        \n               -5┤███████████             \n                 │                        \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtktsc%2Fascii-chart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgtktsc%2Fascii-chart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtktsc%2Fascii-chart/lists"}