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 🙏

© 2024 – Pkg Stats / Ryan Hefner

echarts-bridge

v0.5.0

Published

echarts imperative programming bridge in MV* frontend framework.

Downloads

17

Readme

echarts-bridge

Build Status Coverage Report Package Dependency Package DevDependency

echarts imperative programming bridge in MV* frontend framework.

Break Changes

调整入口配置,默认为commonjs风格。

目标

前端MV*框架,共同点都是不提倡直接进行底层DOM操作,只能通过框架提供接口(如angularjs指令),访问原始元素,但是对待图表这种重DOM操作,使用数据同步的方式 进行,效率个人持保留意见。

echarts-bridge目标是作为MV*框架与echarts之间的中间层,存在连接未连接状态:

  • 连接状态,实例本身可以看做echarts instance,可以直接参照官方文档操作
  • 未连接状态,实例可以调用echarts instance setter方法,但不会立即执行,而是实例内部缓冲,待与实际DOM连接后进行操作

API

import { Bridge } from 'echarts-bridge';

/**
  * @description - echarts bridge instance
  *
  * @param {string} theme - echarts theme
  * @param {object} initOptions - echarts init options
  * @param {object} mediaOptions - echarts media options
  */
let instance = Reflect.construct(Bridge, [theme, initOptions, mediaOptions]);
let elem = docment.querySelector('.echarts-box');

instance.setOption({}).on('click', () => {}).connect(elem);

实例使用monkey patch方式,缓冲开发操作。以下方法,除特别指明,皆可进行链式操作

  • Bridge#connect: 数据对象与DOM元素连接
  • Bridge#disconnect: 断开连接,销毁已生成实例(不支持链式调用,实例已销毁)。
  • Bridge#resize: 目前缓冲DOM尺寸设定存在问题,连接后一切正常。 http://echarts.baidu.com/api.html#echartsInstance.resize
  • Bridge#setOption: http://echarts.baidu.com/api.html#echartsInstance.setOption
  • Bridge#on: http://echarts.baidu.com/api.html#echartsInstance.on
  • Bridge#off: http://echarts.baidu.com/api.html#echartsInstance.off
  • Bridge#showLoading: http://echarts.baidu.com/api.html#echartsInstance.showLoading
  • Bridge#hideLoading: http://echarts.baidu.com/api.html#echartsInstance.hideLoading

关联项目

目前关联项目为基于angularjs的封装: echarts-ng

Contact

[email protected]