# echarts-worker

> This package allows you to run your [Apache ECharts](https://echarts.apache.org/) instance inside a [web worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers).

Latest version **0.0.8** (published 2023-06-11) · 0 weekly downloads

## Install

```sh
npm install echarts-worker
pnpm add echarts-worker
yarn add echarts-worker
bun add echarts-worker
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2023-06-11 |
| First published | 2023-06-10 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 259.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | yassidevteam |

## Links

- npm: https://www.npmjs.com/package/echarts-worker
- npm.io page: https://npm.io/package/echarts-worker

## Dependencies (1)

- [telejson](https://npm.io/package/telejson.md) ^7.1.0

## Recent versions

- 0.0.8 (latest) — 2023-06-11
- 0.0.7 — 2023-06-11
- 0.0.6 — 2023-06-11
- 0.0.5 — 2023-06-11
- 0.0.4 — 2023-06-11
- 0.0.3 — 2023-06-11
- 0.0.2 — 2023-06-11
- 0.0.1 — 2023-06-10

## README

# ECharts Worker

This package allows you to run your [Apache ECharts](https://echarts.apache.org/) instance inside a [web worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers).


## Installation

```bash
npm install echarts-worker
yarn add echarts-worker
pnpm add echarts-worker
```

## Usage

The package does not include the `echarts` package as it is being imported from [jsdelivr](https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js) inside the Worker. Besides this, usage should be identical to the regular echarts package except that the first argument of the `init` function has to be an HTMLCanvasElement to transfer it off-screen;

```ts
import { init } from 'echarts-worker'

const canvas = document.querySelector('canvas')

const instance = init(canvas)

instance.setOption({ ...options })

instance.on('click', (event) => {
    // do something
})

instance.off('click')

instance.resize({ width: 100, height: 100 })
```

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