0.1.1 • Published 4 years ago

ink-chart v0.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

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