# viser

> viser is a toolkit fit for data vis engineer.

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

## Install

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

## 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.9 |
| Published | 2019-12-24 |
| First published | 2017-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 837.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | arcthur |
| Keywords | g2, chart, datavis |

## Links

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

## Dependencies (8)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [@antv/g2](https://npm.io/package/@antv/g2.md) ~3.5.3
- [d3-format](https://npm.io/package/d3-format.md) ^1.3.0
- [@types/node](https://npm.io/package/@types/node.md) ^8.0.53
- [@types/lodash](https://npm.io/package/@types/lodash.md) *
- [@antv/g2-brush](https://npm.io/package/@antv/g2-brush.md) ^0.0.2
- [@types/d3-format](https://npm.io/package/@types/d3-format.md) *
- [@antv/g2-plugin-slider](https://npm.io/package/@antv/g2-plugin-slider.md) ^2.1.0

## 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.9 (latest) — 2019-12-24
- 2.4.8 — 2019-11-14
- 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.3 — 2018-09-29
- 2.3.2 — 2018-09-06
- 2.3.1 — 2018-09-04
- 2.3.0 — 2018-08-09
- 2.2.6 — 2018-05-18
- … 65 more at https://npm.io/package/viser/versions

## README

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

> A toolkit fit for data vis engineer.

## Install

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

## Usage

```jsx
import viser from 'viser';
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;

viser({
  data,
  axis: true,
  legend: true,
  tooltip: true,
  series: [{
    quickType: 'smoothLine',
    position: 'month*temperature',
    color: "city",
    size: 2,
  }, {
    quickType: 'point',
    position: 'month*temperature',
    color: "city",
    size: 4,
    style: {
      stroke: '#fff',
      lineWidth: 1,
    },
  }],
  chart: {
    container: 'mountNode',
    width: 800,
    height: 400,
  },
});
```

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