echarts-for-react 1.2.5 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,273 +0,0 @@
1
- import React from 'react';
2
- import ReactEcharts from '../lib/echarts-for-react';
3
- import echarts from 'echarts';
4
-
5
- const TreemapComponent = React.createClass({
6
- getOtion: function() {
7
- var diskData = [
8
- {
9
- "value": 180,
10
- "name": "Accounts",
11
- "path": "Accounts",
12
- "children": [
13
- {
14
- "value": 76,
15
- "name": "Access",
16
- "path": "Accounts/Access",
17
- "children": [
18
- {
19
- "value": 12,
20
- "name": "DefaultAccessPlugin.bundle",
21
- "path": "Accounts/Access/DefaultAccessPlugin.bundle"
22
- },
23
- {
24
- "value": 28,
25
- "name": "FacebookAccessPlugin.bundle",
26
- "path": "Accounts/Access/FacebookAccessPlugin.bundle"
27
- },
28
- {
29
- "value": 20,
30
- "name": "LinkedInAccessPlugin.bundle",
31
- "path": "Accounts/Access/LinkedInAccessPlugin.bundle"
32
- },
33
- {
34
- "value": 16,
35
- "name": "TencentWeiboAccessPlugin.bundle",
36
- "path": "Accounts/Access/TencentWeiboAccessPlugin.bundle"
37
- }
38
- ]
39
- },
40
- {
41
- "value": 92,
42
- "name": "Authentication",
43
- "path": "Accounts/Authentication",
44
- "children": [
45
- {
46
- "value": 24,
47
- "name": "FacebookAuthenticationPlugin.bundle",
48
- "path": "Accounts/Authentication/FacebookAuthenticationPlugin.bundle"
49
- },
50
- {
51
- "value": 16,
52
- "name": "LinkedInAuthenticationPlugin.bundle",
53
- "path": "Accounts/Authentication/LinkedInAuthenticationPlugin.bundle"
54
- },
55
- {
56
- "value": 20,
57
- "name": "TencentWeiboAuthenticationPlugin.bundle",
58
- "path": "Accounts/Authentication/TencentWeiboAuthenticationPlugin.bundle"
59
- },
60
- {
61
- "value": 16,
62
- "name": "TwitterAuthenticationPlugin.bundle",
63
- "path": "Accounts/Authentication/TwitterAuthenticationPlugin.bundle"
64
- },
65
- {
66
- "value": 16,
67
- "name": "WeiboAuthenticationPlugin.bundle",
68
- "path": "Accounts/Authentication/WeiboAuthenticationPlugin.bundle"
69
- }
70
- ]
71
- },
72
- {
73
- "value": 12,
74
- "name": "Notification",
75
- "path": "Accounts/Notification",
76
- "children": [
77
- {
78
- "value": 12,
79
- "name": "SPAAccountsNotificationPlugin.bundle",
80
- "path": "Accounts/Notification/SPAAccountsNotificationPlugin.bundle"
81
- }
82
- ]
83
- }
84
- ]
85
- },
86
- {
87
- "value": 1904,
88
- "name": "AddressBook Plug-Ins",
89
- "path": "AddressBook Plug-Ins",
90
- "children": [
91
- {
92
- "value": 744,
93
- "name": "CardDAVPlugin.sourcebundle",
94
- "path": "AddressBook Plug-Ins/CardDAVPlugin.sourcebundle",
95
- "children": [
96
- {
97
- "value": 744,
98
- "name": "Contents",
99
- "path": "AddressBook Plug-Ins/CardDAVPlugin.sourcebundle/Contents"
100
- }
101
- ]
102
- },
103
- {
104
- "value": 28,
105
- "name": "DirectoryServices.sourcebundle",
106
- "path": "AddressBook Plug-Ins/DirectoryServices.sourcebundle",
107
- "children": [
108
- {
109
- "value": 28,
110
- "name": "Contents",
111
- "path": "AddressBook Plug-Ins/DirectoryServices.sourcebundle/Contents"
112
- }
113
- ]
114
- },
115
- {
116
- "value": 680,
117
- "name": "Exchange.sourcebundle",
118
- "path": "AddressBook Plug-Ins/Exchange.sourcebundle",
119
- "children": [
120
- {
121
- "value": 680,
122
- "name": "Contents",
123
- "path": "AddressBook Plug-Ins/Exchange.sourcebundle/Contents"
124
- }
125
- ]
126
- },
127
- {
128
- "value": 432,
129
- "name": "LDAP.sourcebundle",
130
- "path": "AddressBook Plug-Ins/LDAP.sourcebundle",
131
- "children": [
132
- {
133
- "value": 432,
134
- "name": "Contents",
135
- "path": "AddressBook Plug-Ins/LDAP.sourcebundle/Contents"
136
- }
137
- ]
138
- },
139
- {
140
- "value": 20,
141
- "name": "LocalSource.sourcebundle",
142
- "path": "AddressBook Plug-Ins/LocalSource.sourcebundle",
143
- "children": [
144
- {
145
- "value": 20,
146
- "name": "Contents",
147
- "path": "AddressBook Plug-Ins/LocalSource.sourcebundle/Contents"
148
- }
149
- ]
150
- }
151
- ]
152
- },
153
- {
154
- "value": 36,
155
- "name": "Assistant",
156
- "path": "Assistant",
157
- "children": [
158
- {
159
- "value": 36,
160
- "name": "Plugins",
161
- "path": "Assistant/Plugins",
162
- "children": [
163
- {
164
- "value": 36,
165
- "name": "AddressBook.assistantBundle",
166
- "path": "Assistant/Plugins/AddressBook.assistantBundle"
167
- },
168
- {
169
- "value": 8,
170
- "name": "GenericAddressHandler.addresshandler",
171
- "path": "Recents/Plugins/GenericAddressHandler.addresshandler"
172
- },
173
- {
174
- "value": 12,
175
- "name": "MapsRecents.addresshandler",
176
- "path": "Recents/Plugins/MapsRecents.addresshandler"
177
- }
178
- ]
179
- }
180
- ]
181
- }
182
- ]
183
- function colorMappingChange(value) {
184
- var levelOption = getLevelOption(value);
185
- chart.setOption({
186
- series: [{
187
- levels: levelOption
188
- }]
189
- });
190
- }
191
- var formatUtil = echarts.format;
192
- function getLevelOption() {
193
- return [{
194
- itemStyle: {
195
- normal: {
196
- borderWidth: 0,
197
- gapWidth: 5
198
- }
199
- }
200
- }, {
201
- itemStyle: {
202
- normal: {
203
- gapWidth: 1
204
- }
205
- }
206
- }, {
207
- colorSaturation: [0.35, 0.5],
208
- itemStyle: {
209
- normal: {
210
- gapWidth: 1,
211
- borderColorSaturation: 0.6
212
- }
213
- }
214
- }];
215
- }
216
- const option = {
217
- title: {
218
- text: 'Disk Usage',
219
- left: 'center'
220
- },
221
-
222
- tooltip: {
223
- formatter: function (info) {
224
- var value = info.value;
225
- var treePathInfo = info.treePathInfo;
226
- var treePath = [];
227
-
228
- for (var i = 1; i < treePathInfo.length; i++) {
229
- treePath.push(treePathInfo[i].name);
230
- }
231
-
232
- return [
233
- '<div class="tooltip-title">' + formatUtil.encodeHTML(treePath.join('/')) + '</div>',
234
- 'Disk Usage: ' + formatUtil.addCommas(value) + ' KB',
235
- ].join('');
236
- }
237
- },
238
-
239
- series: [{
240
- name:'Disk Usage',
241
- type:'treemap',
242
- visibleMin: 300,
243
- label: {
244
- show: true,
245
- formatter: '{b}'
246
- },
247
- itemStyle: {
248
- normal: {
249
- borderColor: '#fff'
250
- }
251
- },
252
- levels: getLevelOption(),
253
- data: diskData
254
- }]
255
- }
256
- return option;
257
- },
258
- render: function() {
259
- return (
260
- <div className='examples'>
261
- <div className='parent'>
262
- <label> render a disk usage treemap. </label>
263
- <ReactEcharts
264
- option={this.getOtion()}
265
- style={{height: '500px', width: '100%'}}
266
- className='react_for_echarts' />
267
- </div>
268
- </div>
269
- );
270
- }
271
- });
272
-
273
- export default TreemapComponent;
package/demo/demo.css DELETED
@@ -1,151 +0,0 @@
1
- body {
2
- background-color: #f3f4fa;
3
- margin: 0 auto;
4
- max-width: 1000px;
5
- }
6
-
7
- html, body {
8
- -webkit-box-sizing: border-box;
9
- -moz-box-sizing: border-box;
10
- box-sizing: border-box;
11
- }
12
-
13
- *, *:before, *:after {
14
- -webkit-box-sizing: inherit;
15
- -moz-box-sizing: inherit;
16
- box-sizing: inherit;
17
- }
18
-
19
- body, input, button, textarea {
20
- font-family: Georgia, Helvetica;
21
- font-size: 17px;
22
- color: #005064;
23
- }
24
- h1 {
25
- margin-top: 20px;
26
- text-align: center;
27
- }
28
-
29
- h3 {
30
- background-color: hsla(0, 0%, 0%, 0.2);
31
- padding: 20px;
32
- text-align: center;
33
- }
34
-
35
- h4 {
36
- padding: 5px 20px;
37
- text-align: center;
38
- color: black;
39
- margin: 5px 0;
40
- }
41
-
42
- h4 a {
43
- color: black;
44
- }
45
-
46
- h4 a:hover {
47
- color: blue;
48
- }
49
-
50
- a,
51
- a:hover {
52
- color: #ecf0f1;
53
- }
54
-
55
- pre {
56
- background-color: #ead9d9;
57
- }
58
- pre code {
59
- color: #111;
60
- font-size: 18px;
61
- }
62
-
63
- pre {
64
- overflow-x: auto;
65
- }
66
-
67
- label {
68
- display: block;
69
- margin-bottom: 15px;
70
- }
71
-
72
- sub {
73
- display: block;
74
- margin-top: -10px;
75
- margin-bottom: 15px;
76
- font-size: 11px;
77
- font-style: italic;
78
- }
79
-
80
- ul {
81
- margin: 0;
82
- padding: 0;
83
- }
84
-
85
- .parent {
86
- background-color: rgba(255, 255, 255, 0.2);
87
- margin: 20px 0;
88
- padding: 20px;
89
- }
90
-
91
- input {
92
- border: none;
93
- outline: none;
94
- background-color: #ecf0f1;
95
- padding: 10px;
96
- color: #14204f;
97
- border: 0;
98
- margin: 5px 0;
99
- display: block;
100
- width: 100%;
101
- }
102
-
103
- button {
104
- background-color: #ecf0f1;
105
- color: #14204f;
106
- border: 0;
107
- padding: 18px 12px;
108
- margin-left: 6px;
109
- cursor: pointer;
110
- outline: none;
111
- }
112
-
113
- button:hover {
114
- background-color: #e74c3c;
115
- color: #ecf0f1;
116
- }
117
-
118
- .a_line {
119
- display: block;
120
- width: 100%;
121
- }
122
-
123
- .nsg-tag {
124
- border-color: #14204f;
125
- }
126
-
127
- .inline {
128
- display: inline-block;
129
- }
130
-
131
- .gh-fork {
132
- position: fixed;
133
- top: 0;
134
- right: 0;
135
- border: 0;
136
- }
137
-
138
- .autofruit {
139
- width: 16px;
140
- margin-right: 3px;
141
- }
142
-
143
- #ddl {
144
- cursor: pointer;
145
- padding: 10px;
146
- background-color: rgba(0,0,0,0.1);
147
- }
148
-
149
- .examples {
150
- background-color: rgba(0,0,0,0.1);
151
- }
package/demo/demo.jsx DELETED
@@ -1,17 +0,0 @@
1
- require('./demo.css');
2
-
3
- import React from 'react';
4
- import ReactDOM from 'react-dom';
5
- import { Router, Route, hashHistory } from 'react-router';
6
-
7
- import MainPageComponent from './MainPageComponent.jsx';
8
- import EchartsComponent from './EchartsComponent.jsx';
9
-
10
- ReactDOM.render((
11
- <Router history={hashHistory}>
12
- <Route path="/" component={MainPageComponent}>
13
- <Route path="/echarts/:type" component={EchartsComponent}/>
14
- </Route>
15
- </Router>),
16
- document.querySelector('#wrapper')
17
- );