# viser-react

> viser-react is react of viser.

Latest version **2.4.8** (published 2019-12-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install viser-react
pnpm add viser-react
yarn add viser-react
bun add viser-react
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.8 |
| Published | 2019-12-24 |
| First published | 2017-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 841.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | arcthur |
| Keywords | g2, chart, react, datavis |

## Links

- npm: https://www.npmjs.com/package/viser-react
- Repository: https://github.com/viserjs/viser-react
- Homepage: https://github.com/viserjs/viser-react#readme
- Issues: https://github.com/viserjs/viser-react/issues
- npm.io page: https://npm.io/package/viser-react

## Dependencies (4)

- [viser](https://npm.io/package/viser.md) ^2.0.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0
- [@types/node](https://npm.io/package/@types/node.md) *
- [@types/prop-types](https://npm.io/package/@types/prop-types.md) *

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 2.4.8 (latest) — 2019-12-24
- 2.4.7 — 2019-11-08
- 2.4.6 — 2019-04-30
- 2.4.5 — 2019-02-13
- 2.4.4 — 2019-01-03
- 2.4.3 — 2018-12-28
- 2.4.2 — 2018-11-19
- 2.4.1 — 2018-10-23
- 2.4.0 — 2018-10-23
- 2.3.4 — 2018-09-29
- 2.3.3 — 2018-09-13
- 2.3.2 — 2018-09-06
- 2.3.1 — 2018-09-04
- 2.3.0 — 2018-08-09
- 2.2.6 — 2018-05-19
- … 50 more at https://npm.io/package/viser-react/versions

## README

# viser-react [![npm](https://img.shields.io/npm/v/viser-react.svg)](https://www.npmjs.com/package/viser-react) [![Dependency Status](https://david-dm.org/viserjs/viser-react.svg?path=packages/viser-react)](https://david-dm.org/viserjs/viser-react.svg?path=packages/viser-react)

> A toolkit fit for data vis engineer (react version).

## Install

```sh
$ npm install --save viser-react
```

## Usage

```jsx
import { Chart, SmoothLine, Point, Tooltip, Legend, Axis } from 'viser-react';
import * as ReactDOM from 'react-dom';
import * as React from 'react';
const DataSet = require('@antv/data-set');

const sourceData = [
  { month: 'Jan', Tokyo: 7.0, London: 3.9 },
  { month: 'Feb', Tokyo: 6.9, London: 4.2 },
  { month: 'Mar', Tokyo: 9.5, London: 5.7 },
  { month: 'Apr', Tokyo: 14.5, London: 8.5 },
  { month: 'May', Tokyo: 18.4, London: 11.9 },
  { month: 'Jun', Tokyo: 21.5, London: 15.2 },
  { month: 'Jul', Tokyo: 25.2, London: 17.0 },
  { month: 'Aug', Tokyo: 26.5, London: 16.6 },
  { month: 'Sep', Tokyo: 23.3, London: 14.2 },
  { month: 'Oct', Tokyo: 18.3, London: 10.3 },
  { month: 'Nov', Tokyo: 13.9, London: 6.6 },
  { month: 'Dec', Tokyo: 9.6, London: 4.8 },
];

const dv = new DataSet.View().source(sourceData);
dv.transform({
  type: 'fold',
  fields: ['Tokyo', 'London'],
  key: 'city',
  value: 'temperature',
});
const data = dv.rows;

const scale = [{
  dataKey: 'percent',
  min: 0,
  formatter: '.2%',
}];

class App extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <div>
        <Chart forceFit height={400} data={data} scale={scale}>
          <SmoothLine position="month*temperature" color="city" size="2" />
          <Tooltip />
          <Legend />
          <Axis />
        </Chart>
      </div>
    );
  }
}

ReactDOM.render(<App />, document.getElementById('mountNode'));
```

---
_Source: https://npm.io/package/viser-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
