Skip to content

Commit 3b90913

Browse files
committed
add echarts-gl demo
1 parent 964bd41 commit 3b90913

File tree

6 files changed

+44
-8
lines changed

6 files changed

+44
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# echarts-for-react
22

3-
A very simple echarts(v3.0) wrapper for react.
3+
A very simple echarts(v3.0 & v4.0) wrapper for react.
44

5-
[![Build Status](https://travis-ci.org/hustcc/echarts-for-react.svg?branch=master)](https://travis-ci.org/hustcc/echarts-for-react) [![Coverage Status](https://coveralls.io/repos/github/hustcc/echarts-for-react/badge.svg?branch=master)](https://coveralls.io/github/hustcc/echarts-for-react?branch=master) [![npm](https://img.shields.io/npm/v/echarts-for-react.svg)](https://www.npmjs.com/package/echarts-for-react) [![npm](https://img.shields.io/npm/dt/echarts-for-react.svg)](https://www.npmjs.com/package/echarts-for-react) [![npm](https://img.shields.io/npm/l/echarts-for-react.svg)](https://www.npmjs.com/package/echarts-for-react) ![echarts supported](https://img.shields.io/badge/echarts-%5E3.0.0-blue.svg) ![react supported](https://img.shields.io/badge/React-%3E%3D0.13.2%20%7C%7C%20%5E0.14%20%7C%7C%20%5E15.0.0%20%7C%7C%20%3E%3D16.0.0-blue.svg)
5+
[![Build Status](https://travis-ci.org/hustcc/echarts-for-react.svg?branch=master)](https://travis-ci.org/hustcc/echarts-for-react) [![Coverage Status](https://coveralls.io/repos/github/hustcc/echarts-for-react/badge.svg?branch=master)](https://coveralls.io/github/hustcc/echarts-for-react?branch=master) [![npm](https://img.shields.io/npm/v/echarts-for-react.svg)](https://www.npmjs.com/package/echarts-for-react) [![npm](https://img.shields.io/npm/dt/echarts-for-react.svg)](https://www.npmjs.com/package/echarts-for-react) [![npm](https://img.shields.io/npm/l/echarts-for-react.svg)](https://www.npmjs.com/package/echarts-for-react) ![echarts supported](https://img.shields.io/badge/echarts-%5E3.0.0%20%7C%7C%20%5E4.0.0-blue.svg) ![react supported](https://img.shields.io/badge/React-%3E%3D0.13.2%20%7C%7C%20%5E0.14%20%7C%7C%20%5E15.0.0%20%7C%7C%20%3E%3D16.0.0-blue.svg)
66

77
# 1. install
88

demo/dist/bundle.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/src/App.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export default class App extends PureComponent {
3232
<Link to="/echarts/treemap">Treemap</Link> |
3333
<Link to="/echarts/gauge">Gauge</Link> |
3434
<Link to="/echarts/gcalendar">GCalendar</Link> |
35-
<Link to="/echarts/lunar">Lunar</Link>
35+
<Link to="/echarts/lunar">Lunar</Link> |
36+
<Link to="/echarts/gl">gl</Link>
3637
</h4>
3738
{ children || <Dynamic /> }
3839

demo/src/Chart.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Loading from './charts/Loading.jsx';
77
import Api from './charts/Api.jsx';
88
import Dynamic from './charts/Dynamic.jsx';
99
import Map from './charts/Map.jsx';
10+
import Gl from './charts/Gl.jsx';
1011

1112
// v1.2.0 add 7 demo.
1213
import Airport from './charts/Airport.jsx';
@@ -32,6 +33,7 @@ const Components = {
3233
Gauge,
3334
Gcalendar,
3435
Lunar,
36+
Gl,
3537
};
3638

3739
export default class Chart extends PureComponent {

demo/src/charts/Gl.jsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React, { PureComponent } from 'react';
2+
import ReactEcharts from '../../../src/index';
3+
import 'echarts-gl';
4+
5+
export default class Api extends PureComponent {
6+
getOption = () => ({
7+
grid3D: {},
8+
xAxis3D: {},
9+
yAxis3D: {},
10+
zAxis3D: {},
11+
series: [{
12+
type: 'scatter3D',
13+
symbolSize: 50,
14+
data: [[-1, -1, -1], [0, 0, 0], [1, 1, 1]],
15+
itemStyle: {
16+
opacity: 1
17+
}
18+
}]
19+
});
20+
21+
render() {
22+
return (
23+
<div className='examples'>
24+
<div className='parent'>
25+
<label>echarts-gl demo</label>
26+
<ReactEcharts option={this.getOption()} />
27+
<label>echarts-gl doc: https://ecomfe.github.io/echarts-doc/public/cn/option-gl.html#globe</label>
28+
</div>
29+
</div>
30+
);
31+
}
32+
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"cross-env": "^5.1.3",
6262
"css-loader": "^0.28.7",
6363
"echarts": "^3.8.5",
64+
"echarts-gl": "^1.0.0-beta.6",
6465
"enzyme": "^3.2.0",
6566
"enzyme-adapter-react-15": "^1.0.5",
6667
"eslint": "^4.13.1",
@@ -85,12 +86,12 @@
8586
"webpack-dev-server": "^2.9.7"
8687
},
8788
"dependencies": {
88-
"element-resize-event": "2.0.8"
89+
"element-resize-event": "2.0.9"
8990
},
9091
"peerDependencies": {
9192
"react": ">=0.13.2 || ^0.14 || ^15.0.0 || >=16.0.0",
9293
"prop-types": "^15.5.7",
93-
"echarts": "^3.0.0"
94+
"echarts": "^3.0.0 || ^4.0.0"
9495
},
9596
"jest": {
9697
"testRegex": "(/__tests__/.*\\.spec)\\.(js|jsx)$",

0 commit comments

Comments
 (0)