char-charts

0.2.2 • Public • Published

Char Charts

ES6 character based charting library

npm build coverage deps size vulnerabilities license


Installation

npm install char-charts

Functions

barChart(settings)Array

Builds a bar chart.

                        Test chart
Fruit      ┌───────┬───────┬───────┬───────┬───────┬───────┐
   Oranges ▐       ╵       ╵       ╵       ╵       │       │
    Apples ▐███▌   ╵       ╵       ╵       ╵       │       │
     Pears ▐███████╵       ╵       ╵       ╵       │       │
  Apricots ▐████████████████████▌  ╵       ╵       │       │
   Peaches ▐███████████████████████████████████████████████▌
Nuts       │       ╵       ╵       ╵       ╵       │       │
    Almond ▐▌      ╵       ╵       ╵       ╵       │       │
    Peanut ▐       ╵       ╵       ╵       ╵       │       │
     Pecan │       ╵       ╵       ╵       ╵       │       │
           └───────┴───────┴───────┴───────┴───────┼───────┘
           0      20      40      60      80      100    120
                             Satisfaction
boxChart(settings)Array.<string>

Builds a box and whisker chart.

String   ╭─────────┬─────────┬─────────┬─────────┬─────────╮
         │         ·         ╵    •    ╵         ╵    ●• · │
  concat │         ·         ╵    ┣━━━━━━━━━░░░░░░░░░░▓▓━┫ │
         │         ╵         ╵         ╵   μ½: 90.00 ─╯ ····
  length │         ╵         ╵         ╵         ╵      ┣░▓┫
Array    │      ╭─ μ½: 13.00 ╵         ╵       μ½: 98.00 ─╯│
         │·    ·   ╵ ·       ╵         ╵         ╵         │
    push │┣━░░░░▓▓▓━━┫       ╵         ╵         ╵         │
         •         ╵         ╵         ╵         ╵         │
  concat ░ ── μ½: 0.15       ╵         ╵         ╵         │
         │·        ╵         ╵         ╵         ╵         │
   shift │┃ ── μ½: 2.00      ╵         ╵         ╵         │
         ╰─────────┴─────────┴─────────┴─────────┴─────────╯
         0        20        40        60        80       100
                                Ops/s
barChart(settings)Array

Builds a stacked bar chart.

                        Test chart
Fruit     ╭────────┬─────────┬─────────┬─────────┬─────────╮
  Oranges ▐███▒▒▒▒▒▒▒▒░░░░░░░░░░░░████████       │         │
   Apples ▐█████▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░██████████   │
    Pears ▐███████▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░██████████         │
Nuts      │        ╵         │         ╵         │         │
   Almond ▐███▒▒▒▒▒▒▒▒░░░░░░░░░░░░████████       │         │
   Peanut ▐█████▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░██████████   │
          ╰────────┴─────────┼─────────┴─────────┼─────────╯
          0        5        10        15        20        25

Package Sidebar

Install

npm i char-charts

Weekly Downloads

3

Version

0.2.2

License

MIT

Unpacked Size

277 kB

Total Files

56

Last publish

Collaborators

  • darrenpaulwright