Socket
Book a DemoInstallSign in
Socket

precharts

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

precharts

Wraps Recharts up for Preact, without preact-compat

latest
Source
npmnpm
Version
1.4.0
Version published
Weekly downloads
60
-14.29%
Maintainers
3
Weekly downloads
 
Created
Source

Precharts

NPM travis-ci

Wraps Recharts up for Preact, without using preact-compat.

Think of this as a version of Precharts that is pre-aliased to use preact in place of React.

See Webpackbin Example:

demo

Usage Example

import { h, render } from 'preact';
import { ComposedChart, Area, Line, XAxis, CartesianGrid, Tooltip } from 'precharts';

const DATA = [
	{ name: 'A', a: 4000, b: 2400 },
	{ name: 'B', a: 3000, b: 1398 },
	{ name: 'C', a: 2000, b: 9800 },
	{ name: 'D', a: 2780, b: 3908 },
	{ name: 'E', a: 1890, b: 4800 },
	{ name: 'F', a: 2390, b: 3800 },
	{ name: 'G', a: 3490, b: 4300 }
];

render((
	<ComposedChart width={500} height={200} data={DATA}>
		<XAxis dataKey="name" orientation="bottom" height={20} />
		<CartesianGrid strokeDasharray="3 3" />
		<Line dataKey="a" stroke="red" />
		<Area dataKey="b" fill="green" opacity={.3} />
		<Tooltip />
	</ComposedChart>
), document.body);

License

MIT

Keywords

preact

FAQs

Package last updated on 01 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts