Echarts For React Versions Save

⛳️ Apache ECharts components for React wrapper. 一个简单的 Apache echarts 的 React 封装。

v3.0.2

2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/hustcc/echarts-for-react/compare/v3.0.1...v3.0.2

v3.0.1

3 years ago
  • add opts.locale config.

v3.0.0

3 years ago

本次升级主要的内容在于:

1. 支持 echarts v5 最新版本

image.png

2. 完全 typescript

之前是在 React 0.14 时代,还是使用 props-types 校验 props,然后 ts 类型定义单独自己手写,也非常痛苦。所以这次直接使用 ts 写,自动生成 类型定义 文件。

3. 单测覆盖率

之前使用 jest-canvas-mock 进行单元测试,毕竟是 mock 而不是真实运营,所有一些逻辑测试不到,覆盖率一直提不上去。

所以这次换成了 jest-electron,真实运行,覆盖率直接提升到 ,运行也改成使用 GitHub action 了。当然 jest-electron 这个模块,也是为了给 AntV 系列技术栈做单测,而开发的轮子,个人觉得还是挺好用的。

4. 全新官网

之前的官网是自己初学 React 的时候,完全自己搭建的,没有 lint、ci,代码凌乱,样式也不好看。所以这次直接使用 dumi 这个库自动生成,网站全部 markdown 开发,也方便大家遇到官网 typo,直接一键提交 PR。

image.png

同时 Example 实例也可直接一键导航到其他代码编辑工具上。

5. README 排版

项目很简单,概念也很简单,所以直接 Readme 作为 document,但是之前的文档结构、样式排版比较凌乱,所以按照现在的个人审美,重新写了写!

3.0.0-beta.2

3 years ago
  • peer echarts can be v3, v4, v5
  • peer react can be v15, v16, v17

3.0.0-beta.1

3 years ago
  • new website style.
  • echarts v5 supported.
  • run test case with jest-electron

v2.0.8

6 years ago

Fix issues:

  • bind events duplicate, #155
  • when onEvents is null, will thrown, #154

v2.0.7

6 years ago

Fixed:

  • bug of 100px width * height canvas #149 #150
  • events can not be removed #151
  • add opts in typescript file #153

v2.0.6

6 years ago

add new props of component named opts. It can be used to set render chart with svg.

v2.0.5

6 years ago
  • echarts 4.x supported.
  • add an demo of Sunburst
  • element-resize-event to v2.0.9

v1.4.1

6 years ago

新特性:自定义 import / 动态加载模块

在保持原来的使用方式不变的情况下, 用户可以可以自定义导入 echarts 中的模块,从而保证在少量使用 echarts 的情况下,减少打包出来的 JavaScript 文件大小。具体做法如下:

import React from 'react';
// import the core library.
import ReactEchartsCore from 'echarts-for-react/lib/core';
// then import echarts modules those you have used manually.
import echarts from 'echarts/lib/echarts';
import 'echarts/lib/chart/bar';
import 'echarts/lib/component/tooltip';

// The usage of ReactEchartsCore are same with above.
<ReactEchartsCore
  echarts={echarts}
  option={this.getOption()}
  notMerge={true}
  lazyUpdate={true}
  theme={"theme_name"}
  onChartReady={this.onChartReadyCallback}
  onEvents={EventsDict} />

使用上,除了 import 的文件不一致之外,组件的使用方式和 props 和原来没有任何区别。