rails_charts 0.0.8 → 0.0.9

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.
@@ -0,0 +1,581 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ (function(root, factory) {
21
+ if (typeof define === 'function' && define.amd) {
22
+ // AMD. Register as an anonymous module.
23
+ define(['exports', 'echarts'], factory);
24
+ } else if (
25
+ typeof exports === 'object' &&
26
+ typeof exports.nodeName !== 'string'
27
+ ) {
28
+ // CommonJS
29
+ factory(exports, require('echarts/lib/echarts'));
30
+ } else {
31
+ // Browser globals
32
+ factory({}, root.echarts);
33
+ }
34
+ })(this, function(exports, echarts) {
35
+ var log = function(msg) {
36
+ if (typeof console !== 'undefined') {
37
+ console && console.error && console.error(msg);
38
+ }
39
+ };
40
+ if (!echarts) {
41
+ log('ECharts is not Loaded');
42
+ return;
43
+ }
44
+ var colorPalette = [
45
+ '#5470c6',
46
+ '#91cc75',
47
+ '#fac858',
48
+ '#ee6666',
49
+ '#73c0de',
50
+ '#3ba272',
51
+ '#fc8452',
52
+ '#9a60b4',
53
+ '#ea7ccc'
54
+ ];
55
+
56
+ var axisCommon = function() {
57
+ return {
58
+ axisLine: {
59
+ lineStyle: {
60
+ color: '#6E7079'
61
+ }
62
+ },
63
+ axisLabel: {
64
+ color: null
65
+ },
66
+ splitLine: {
67
+ lineStyle: {
68
+ color: ['#E0E6F1']
69
+ }
70
+ },
71
+ splitArea: {
72
+ areaStyle: {
73
+ color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']
74
+ }
75
+ },
76
+ minorSplitLine: {
77
+ color: '#F4F7FD'
78
+ }
79
+ };
80
+ };
81
+
82
+ var gradientColor = ['#f6efa6', '#d88273', '#bf444c'];
83
+
84
+ echarts.registerTheme('v5', {
85
+ color: colorPalette,
86
+ gradientColor: gradientColor,
87
+
88
+ loading: {
89
+ textColor: 'red'
90
+ },
91
+
92
+ // Series
93
+
94
+ bar: {
95
+ defaultBarGap: '20%',
96
+ select: {
97
+ itemStyle: {
98
+ borderColor: '#212121',
99
+ borderWidth: 1
100
+ }
101
+ }
102
+ },
103
+
104
+ boxplot: {
105
+ emphasis: {
106
+ itemStyle: {
107
+ shadowColor: 'rgba(0,0,0,0.2)'
108
+ }
109
+ }
110
+ },
111
+
112
+ funnel: {
113
+ bottom: 60,
114
+ select: {
115
+ itemStyle: {
116
+ borderColor: '#212121',
117
+ borderWidth: 1
118
+ }
119
+ },
120
+ label: {
121
+ color: 'inherit'
122
+ }
123
+ },
124
+
125
+ gauge: {
126
+ axisLine: {
127
+ lineStyle: {
128
+ color: [[1, '#E6EBF8']]
129
+ }
130
+ },
131
+ splitLine: {
132
+ lineStyle: {
133
+ color: '#63677A'
134
+ }
135
+ },
136
+ axisTick: {
137
+ lineStyle: {
138
+ color: '#63677A'
139
+ }
140
+ },
141
+ axisLabel: {
142
+ color: '#464646'
143
+ },
144
+ anchor: {
145
+ itemStyle: {
146
+ color: '#fff',
147
+ borderColor: '#5470c6'
148
+ }
149
+ },
150
+ title: {
151
+ color: '#464646',
152
+ },
153
+ detail: {
154
+ backgroundColor: 'rgba(0,0,0,0)',
155
+ borderColor: '#ccc',
156
+ color: '#464646'
157
+ }
158
+ },
159
+
160
+ graph: {
161
+ lineStyle: {
162
+ color: '#aaa'
163
+ },
164
+ select: {
165
+ itemStyle: {
166
+ borderColor: '#212121'
167
+ }
168
+ }
169
+ },
170
+
171
+ heatmap: {
172
+ select: {
173
+ itemStyle: {
174
+ borderColor: '#212121'
175
+ }
176
+ }
177
+ },
178
+
179
+ line: {
180
+ symbolSize: 4
181
+ },
182
+
183
+ pictorialBar: {
184
+ select: {
185
+ itemStyle: {
186
+ borderColor: '#212121',
187
+ borderWidth: 1
188
+ }
189
+ }
190
+ },
191
+
192
+ pie: {
193
+ radius: [0, '75%'],
194
+ labelLine: {
195
+ length2: 15
196
+ }
197
+ },
198
+
199
+ map: {
200
+ defaultItemStyleColor: '#eee',
201
+ label: {
202
+ color: '#000'
203
+ },
204
+ itemStyle: {
205
+ borderColor: '#444',
206
+ areaColor: '#eee'
207
+ },
208
+ emphasis: {
209
+ label: {
210
+ color: 'rgb(100,0,0)'
211
+ },
212
+ itemStyle: {
213
+ areaColor: 'rgba(255,215,0,0.8)'
214
+ }
215
+ },
216
+ select: {
217
+ label: {
218
+ color: 'rgb(100,0,0)'
219
+ },
220
+ itemStyle: {
221
+ color: 'rgba(255,215,0,0.8)'
222
+ }
223
+ },
224
+ },
225
+
226
+ sankey: {
227
+ lineStyle: {
228
+ color: '#314656'
229
+ },
230
+ select: {
231
+ itemStyle: {
232
+ borderColor: '#212121'
233
+ }
234
+ },
235
+ },
236
+
237
+ scatter: {
238
+ select: {
239
+ itemStyle: {
240
+ borderColor: '#212121'
241
+ }
242
+ }
243
+ },
244
+
245
+ tree: {
246
+ lineStyle: {
247
+ color: '#ccc'
248
+ }
249
+ },
250
+
251
+ treemap: {
252
+ left: 'center',
253
+ top: 'middle',
254
+ width: '80%',
255
+ height: '80%',
256
+ scaleLimit: {
257
+ max: null,
258
+ min: null
259
+ },
260
+ breadcrumb: {
261
+ top: 'bottom',
262
+ bottom: null,
263
+ itemStyle: {
264
+ color: 'rgba(0,0,0,0.7)', // '#5793f3',
265
+ textStyle: {
266
+ color: '#fff'
267
+ }
268
+ },
269
+ emphasis: {
270
+ itemStyle: {
271
+ color: 'rgba(0,0,0,0.9)' // '#5793f3',
272
+ }
273
+ }
274
+ }
275
+ },
276
+
277
+ // Components
278
+
279
+ timeAxis: axisCommon(),
280
+ logAxis: axisCommon(),
281
+ valueAxis: axisCommon(),
282
+ categoryAxis: (() => {
283
+ const axis = axisCommon();
284
+ axis.axisTick = {
285
+ show: true
286
+ };
287
+ return axis;
288
+ })(),
289
+
290
+ axisPointer: {
291
+ lineStyle: {
292
+ color: '#B9BEC9'
293
+ },
294
+ shadowStyle: {
295
+ color: 'rgba(210,219,238,0.2)'
296
+ },
297
+ label: {
298
+ backgroundColor: 'auto',
299
+ color: '#fff'
300
+ },
301
+ handle: {
302
+ color: '#333',
303
+ shadowBlur: 3,
304
+ shadowColor: '#aaa',
305
+ shadowOffsetX: 0,
306
+ shadowOffsetY: 2,
307
+ }
308
+ },
309
+
310
+ brush: {
311
+ brushStyle: {
312
+ color: 'rgba(210,219,238,0.3)',
313
+ borderColor: '#D2DBEE'
314
+ },
315
+ defaultOutOfBrushColor: '#ddd'
316
+ },
317
+
318
+ calendar: {
319
+ splitLine: {
320
+ lineStyle: {
321
+ color: '#000'
322
+ }
323
+ },
324
+ itemStyle: {
325
+ borderColor: '#ccc'
326
+ },
327
+ dayLabel: {
328
+ margin: '50%',
329
+ color: '#000'
330
+ },
331
+ monthLabel: {
332
+ margin: 5,
333
+ color: '#000'
334
+ },
335
+ yearLabel: {
336
+ margin: 30,
337
+ color: '#ccc'
338
+ }
339
+ },
340
+
341
+ dataZoom: {
342
+ borderColor: '#d2dbee',
343
+ borderRadius: 3,
344
+ backgroundColor: 'rgba(47,69,84,0)',
345
+ dataBackground: {
346
+ lineStyle: {
347
+ color: '#d2dbee',
348
+ width: 0.5
349
+ },
350
+ areaStyle: {
351
+ color: '#d2dbee',
352
+ opacity: 0.2
353
+ }
354
+ },
355
+ selectedDataBackground: {
356
+ lineStyle: {
357
+ color: '#8fb0f7',
358
+ width: 0.5
359
+ },
360
+ areaStyle: {
361
+ color: '#8fb0f7',
362
+ opacity: 0.2
363
+ }
364
+ },
365
+ handleStyle: {
366
+ color: '#fff',
367
+ borderColor: '#ACB8D1'
368
+ },
369
+ moveHandleStyle: {
370
+ color: '#D2DBEE',
371
+ opacity: 0.7
372
+ },
373
+ textStyle: {
374
+ color: '#6E7079'
375
+ },
376
+ brushStyle: {
377
+ color: 'rgba(135,175,274,0.15)'
378
+ },
379
+ emphasis: {
380
+ handleStyle: {
381
+ borderColor: '#8FB0F7'
382
+ },
383
+ moveHandleStyle: {
384
+ color: '#8FB0F7',
385
+ opacity: 0.7
386
+ }
387
+ },
388
+ defaultLocationEdgeGap: 7
389
+ },
390
+
391
+ geo: {
392
+ defaultItemStyleColor: '#eee',
393
+ label: {
394
+ color: '#000'
395
+ },
396
+ itemStyle: {
397
+ borderColor: '#444'
398
+ },
399
+ emphasis: {
400
+ label: {
401
+ color: 'rgb(100,0,0)'
402
+ },
403
+ itemStyle: {
404
+ color: 'rgba(255,215,0,0.8)'
405
+ }
406
+ },
407
+ select: {
408
+ label: {
409
+ color: 'rgb(100,0,0)'
410
+ },
411
+ itemStyle: {
412
+ color: 'rgba(255,215,0,0.8)'
413
+ }
414
+ }
415
+ },
416
+
417
+ grid: {
418
+ left: '10%',
419
+ top: 60,
420
+ bottom: 70,
421
+ borderColor: '#ccc'
422
+ },
423
+
424
+ legend: {
425
+ top: 0,
426
+ bottom: null,
427
+ backgroundColor: 'rgba(0,0,0,0)',
428
+ borderColor: '#ccc',
429
+ itemGap: 10,
430
+ inactiveColor: '#ccc',
431
+ inactiveBorderColor: '#ccc',
432
+ lineStyle: {
433
+ inactiveColor: '#ccc',
434
+ },
435
+ textStyle: {
436
+ color: '#333'
437
+ },
438
+ selectorLabel: {
439
+ color: '#666',
440
+ borderColor: '#666'
441
+ },
442
+ emphasis: {
443
+ selectorLabel: {
444
+ color: '#eee',
445
+ backgroundColor: '#666'
446
+ }
447
+ },
448
+ pageIconColor: '#2f4554',
449
+ pageIconInactiveColor: '#aaa',
450
+ pageTextStyle: {
451
+ color: '#333'
452
+ }
453
+ },
454
+
455
+ radar: (() => {
456
+ const radar = axisCommon();
457
+ radar.radius = '75%';
458
+ radar.axisName = {
459
+ color: '#bbb'
460
+ };
461
+ radar.axisLine.lineStyle.color = '#bbb';
462
+ return radar;
463
+ })(),
464
+
465
+ timeline: {
466
+ padding: 5,
467
+ borderColor: '#ccc',
468
+ lineStyle: {
469
+ color: '#DAE1F5'
470
+ },
471
+ label: {
472
+ color: '#A4B1D7'
473
+ },
474
+ itemStyle: {
475
+ color: '#A4B1D7',
476
+ borderWidth: 1
477
+ },
478
+ checkpointStyle: {
479
+ color: '#316bf3',
480
+ borderColor: '#fff',
481
+ borderWidth: 2,
482
+ shadowBlur: 2,
483
+ shadowOffsetX: 1,
484
+ shadowOffsetY: 1,
485
+ shadowColor: 'rgba(0, 0, 0, 0.3)',
486
+ },
487
+ controlStyle: {
488
+ playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z', // jshint ignore:line
489
+ stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z', // jshint ignore:line
490
+ // eslint-disable-next-line max-len
491
+ nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z', // jshint ignore:line
492
+ // eslint-disable-next-line max-len
493
+ prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z', // jshint ignore:line
494
+ color: '#A4B1D7',
495
+ borderColor: '#A4B1D7',
496
+ borderWidth: 1
497
+ },
498
+ emphasis: {
499
+ label: {
500
+ color: '#6f778d'
501
+ },
502
+ itemStyle: {
503
+ color: '#316BF3'
504
+ },
505
+ controlStyle: {
506
+ color: '#316BF3',
507
+ borderColor: '#316BF3',
508
+ borderWidth: 2
509
+ }
510
+ },
511
+ progress: {
512
+ lineStyle: {
513
+ color: '#316BF3'
514
+ },
515
+ itemStyle: {
516
+ color: '#316BF3'
517
+ },
518
+ label: {
519
+ color: '#6f778d'
520
+ }
521
+ },
522
+ },
523
+
524
+ title: {
525
+ left: 0,
526
+ top: 0,
527
+ backgroundColor: 'rgba(0,0,0,0)',
528
+ borderColor: '#ccc',
529
+ textStyle: {
530
+ color: '#464646'
531
+ },
532
+ subtextStyle: {
533
+ color: '#6E7079'
534
+ }
535
+ },
536
+
537
+ toolbox: {
538
+ borderColor: '#ccc',
539
+ padding: 5,
540
+ itemGap: 8,
541
+ iconStyle: {
542
+ borderColor: '#666',
543
+ },
544
+ emphasis: {
545
+ iconStyle: {
546
+ borderColor: '#3E98C5'
547
+ }
548
+ }
549
+ },
550
+
551
+ tooltip: {
552
+ axisPointer: {
553
+ crossStyle: {
554
+ color: '#999'
555
+ }
556
+ },
557
+ textStyle: {
558
+ color: '#666'
559
+ },
560
+ backgroundColor: '#fff',
561
+ borderWidth: 1,
562
+ defaultBorderColor: '#fff'
563
+ },
564
+
565
+ visualMap: {
566
+ color: [gradientColor[2], gradientColor[1], gradientColor[0]],
567
+ inactive: ['rgba(0,0,0,0)'],
568
+ indicatorStyle: {
569
+ shadowColor: 'rgba(0,0,0,0.2)'
570
+ },
571
+ backgroundColor: 'rgba(0,0,0,0)',
572
+ borderColor: '#ccc',
573
+ contentColor: '#5793f3',
574
+ inactiveColor: '#aaa',
575
+ padding: 5,
576
+ textStyle: {
577
+ color: '#333'
578
+ }
579
+ }
580
+ });
581
+ });