Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ink-chart

slaweet18MIT0.1.1

Chart component for Ink

ink-component, ink, component, chart

readme

Chart component for Ink

Install

$ npm install ink-chart

Usage

import React from 'react';
import {render} from 'ink';
import Chart from 'ink-chart';

const data = [
  { key: 'A', value: 30 },
  { key: 'B', value: 10 },
  { key: 'C', value: 50 }
];

render(
    <Chart preserveAspectRatio data={data} type'bar'/>
);

API

<Chart/>

Besides the props below, it accepts props allowed in ansi-escapes.

data

Type: array

List with the data to display.

type

Type: string

Type of the chart, e.g. 'bar', 'pie'.

License

MIT © Vít Stanislav