npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

worker-echarts

v0.0.3

Published

worker for echarts

Readme

worker-echarts

🚄 使用教程

安装

  npm i install worker-echarts --save-dev or yarn add worker-echarts --save-dev

使用

You can use Echarts(4.3.2) API

import WorkerEcharts from "worker-echarts"

let workerEchart = new WorkerEcharts()

workerEchart.init(dom)
workerEchart.setOptions(options)

📖 文档

WorkerECharts

new WorkerECharts()

WorkerEcharts Class

workerECharts.registerTheme(name, theme) ⇒

注册主题

Returns: Promise对象

| Param | Type | Description | | --- | --- | --- | | name | string | light or dark | | theme | Object | options |

workerECharts.resizeAxisUnit(point) ⇒

重置x轴单位

Returns: Promise对象

| Param | Type | | --- | --- | | point | number |

workerECharts.on(type, listener, isMust) ⇒ Object

绑定事件

Returns: Object - - {type,lisenter}对象

| Param | Type | Description | | --- | --- | --- | | type | String | 监听echart类型 | | listener | function | 监听事件回调 | | isMust | Boolean | 是否重置 |

workerECharts.off(indicator) ⇒

解绑事件

Returns: null

| Param | Type | Description | | --- | --- | --- | | indicator | Object | - { type:String,listener:function} |

workerECharts.init(div, theme)

初始化

| Param | Type | Description | | --- | --- | --- | | div | dom | canvas | dom对象或者canvas对象 | | theme | string | echart 主题 |

workerECharts.callMethod(methodName, ...args) ⇒

调用echart方法

Returns: Promise对象

| Param | Type | Description | | --- | --- | --- | | methodName | string | echart方法名 resize、dispatchAction | | ...args | object | 配置参数options |

workerECharts.setOption(option, ...args) ⇒

调用echart的setOption

Returns: Promise对象

| Param | Type | Description | | --- | --- | --- | | option | Object | echart 配置参数options | | ...args | Object | 其他配置 { notMerge?: boolean;replaceMerge?: string | string[];lazyUpdate?: boolean;} |

workerECharts.getOption() ⇒

获取当前echart的options

Returns: Promise对象

workerECharts.getAxisGrid() ⇒

获取当前坐标数据开始点起始点

Returns: Promise对象

workerECharts.getEchartXInterval() ⇒

获取当前横坐标数据

Returns: Promise对象

workerECharts.getEchartYInterval() ⇒

获取当前纵坐标数据

Returns: Promise对象

workerECharts.enlargeZoom() ⇒

启动或关闭 toolbox 中 dataZoom 的刷选状态。

Returns: promise对象

workerECharts.restoreZoom() ⇒

重置坐标轴

Returns: promise对象

workerECharts.chartDataZoom() ⇒

重置坐标轴 params {Object}- {type: String,dataZoomIndex: Number, start: Number,end: Number,startValue: Number,endValue: Number}

Returns: promise对象

workerECharts.dispatchAction(payload) ⇒

调用echart 的dispatchAction

Returns: promise对象

| Param | Type | Description | | --- | --- | --- | | payload | Object | 配置参数 |

workerECharts.resize(opts) ⇒

调用echart的resize方法

Returns: Promise对象

| Param | Type | Description | | --- | --- | --- | | opts | Object | 配置参数 |

workerECharts.clean() ⇒

清除echart

Returns: Promise对象

workerECharts.dispose()

清除worker

workerECharts.postMessage(message) ⇒

将消息发送到工作线程;返回的承诺在onmessage消息返回时被解析

Returns: Promise对象

| Param | Type | Description | | --- | --- | --- | | message | Object | message对象 {type:String,args: Array} |