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

rg-echarts

v1.1.1

Published

> :chicken: Regularjs + Echarts

Downloads

6

Readme

rg-echarts

:chicken: Regularjs + Echarts

依赖环境

安装运行

npm install rg-echarts --save-dev

组件特点

  • 独立、可复用 充分发挥regular组件独立、可复用的特性。
  • 简单、灵活 前期尽量避免深度抽象数据选项,防止额外增加学习成本,同时也保证图形组件的灵活特性

组件亮点

  • [x] 支持图形联动配置
  • [x] 支持自定义主题配置
  • [x] 数据区域缩放组件配置入口
  • [x] 事件配置入口
  • [x] 开放图形组件的实例
  • [x] 工具栏配置入口

使用案列

HTML
<chart ref="c1" option="{option}" config="{config}" class="col-md-5 echarts"></chart>
JavaScript
this.data.config = {
  // 主题设置
  theme: 'dark',
  // 事件设置
  event : {
    click : action
  },
  // 数据区间开关
  dataZoom : true,
  // 右上角工具栏开关
  toolbox : true,
  // 组件标识唯一id
  name: 'chart1',
  // 指定联动的组件,通过唯一标识来指定
  link : 'chart2'
}

this.data.option = {
  title: {
    text: 'ECharts 入门示例'
  },
  tooltip: {},
  legend: {
    data: ['销量']
  },
  xAxis: {
    data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
  },
  yAxis: {},
  series: [{
    name: '销量',
    type: 'bar',
    data: [5, 20, 36, 10, 10, 20]
  }]
}

BTW: 更多使用请详细参考example的示例。

TO DO

  • 丰富示例
  • 模拟更多应用场景
  • 完善README.md

更改日志

1.0.0

1.1.0

  • 可直接获取echart的图形实例,不需要借助在setTimeout才能获取实例。
  • 添加showLoading、hideLoading、setOption等接口
  • 添加on-click组件事件
  • 图形联动支持多对多且具备双向特性,同时移除配置中的link、name等配置
  • 部分代码优化以及重构
  • 添加无数据状态接口
  • 修复dataZoom取值为false提示错误的bug
  • 支持图形自适应(window的onresize事件)

1.1.1

  • 右上角新增tab开关,top可取值为'top'和'average'
  • 新增on-tab-select接口,通过top和average字符串值作为区分
  • 由于需求和布局,强制移除 dataZoom、toolbox等入口
  • 强制legend定位图形底部以及图形title为空
  • tooltip支持并新增tooltip提示信息入口,,基于[email protected]的rg-tooltip元件
  • 新增折现图demo
  • 新增饼图demo
  • 组件实例新增resize接口
  • 完善example示例

btw: 注意必须加apm-ui作为依赖,否则tips无法正常运行。

注: 涉及变动较多,详细查看example.