# react-native-sparkline

> An ART-based sparkline component for react-native

Latest version **2.0.0-beta** (published 2020-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-sparkline
pnpm add react-native-sparkline
yarn add react-native-sparkline
bun add react-native-sparkline
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0-beta |
| Published | 2020-01-25 |
| First published | 2018-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 471.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Arniu Tseng |
| Maintainers | arniu |
| Keywords | react-native, sparkline, chart, ART |

## Links

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

## Dependencies (1)

- [@react-native-community/art](https://npm.io/package/@react-native-community/art.md) ^1.1.2

## 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.0.0-beta (latest) — 2020-01-25
- 1.0.5-beta — 2018-05-06
- 1.0.4-rc — 2018-05-06
- 1.0.4-beta — 2018-04-10
- 1.0.3-beta — 2018-04-10
- 1.0.2-beta — 2018-04-07
- 1.0.1-beta — 2018-04-07
- 1.0.0-beta — 2018-03-30
- 1.0.0-alpha — 2018-03-29

## README

# react-native-sparkline

[![npm](https://img.shields.io/npm/v/react-native-sparkline.svg)](https://www.npmjs.com/package/react-native-sparkline)
[![code style: standard](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io/)

An ART-based sparkline component for react-native

![example screenshot](/example/screenshot.png)

## Prerequisite

This library is based on [ART][art-library] and works on both Android and iOS platform.

## Linking module

For `react-native >= 0.60` ReactNativeART should be auto-linked and no additional action is required.

For `react-native < 0.60` you need to link ReactNative ART:

```
react-native link @react-native-community/art
```

Manual:
[manual-linking]: https://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking

## Usage

- Install

```bash
npm i react-native-sparkline
```

- Use it

```jsx harmony
import React from 'react'
import Sparkline from 'react-native-sparkline'

const data = Array.from({ length: 20 }).map(
  (unused, i) => i + (i + 1) * Math.random()
)

const App = () => (
  <Sparkline data={data}>
    <Sparkline.Line />
    <Sparkline.Fill />
    <Sparkline.Spots />
    <Sparkline.Band />
  </Sparkline>
)
```

## Example

1.  `cd example`
2.  `npm install`
3.  `react-native run-ios` or `react-native run-android`

## License

[MIT](./LICENSE)

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