@cgeui/utils 0.0.2 → 0.0.3

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.
Files changed (97) hide show
  1. package/dist/esm/charts/Chart/utils/complementData.js +714 -0
  2. package/dist/esm/charts/Chart/utils/convertToEchartsConfig/chartsToEchartsConfig.js +99 -0
  3. package/dist/esm/charts/Chart/utils/convertToEchartsConfig/index.js +2 -0
  4. package/dist/esm/charts/Chart/utils/convertToEchartsConfig/pieChartToEchartsConfig.js +140 -0
  5. package/dist/esm/charts/Chart/utils/getOption.js +365 -0
  6. package/dist/esm/charts/Chart/utils/handleChartConfig.js +279 -0
  7. package/dist/esm/charts/Chart/utils/index.js +5 -0
  8. package/dist/esm/charts/Chart/utils/preConfig/index.js +307 -0
  9. package/dist/esm/charts/Chart/utils/preConfig/type.js +1 -0
  10. package/dist/esm/charts/PieChart/interface.js +1 -0
  11. package/dist/esm/charts/PieChart/locales/en-US.js +9 -0
  12. package/dist/esm/charts/PieChart/locales/index.js +7 -0
  13. package/dist/esm/charts/PieChart/locales/zh-CN.js +9 -0
  14. package/dist/esm/charts/PieChart/util.js +434 -0
  15. package/dist/esm/charts/SuperChart/config/bar.js +39 -0
  16. package/dist/esm/charts/SuperChart/config/index.js +237 -0
  17. package/dist/esm/charts/SuperChart/configStyle/color.js +23 -0
  18. package/dist/esm/charts/SuperChart/configStyle/dataZoom.js +13 -0
  19. package/dist/esm/charts/SuperChart/configStyle/grid.js +20 -0
  20. package/dist/esm/charts/SuperChart/configStyle/index.js +10 -0
  21. package/dist/esm/charts/SuperChart/configStyle/legend.js +68 -0
  22. package/dist/esm/charts/SuperChart/configStyle/lineStyle.js +80 -0
  23. package/dist/esm/charts/SuperChart/configStyle/title.js +16 -0
  24. package/dist/esm/charts/SuperChart/configStyle/tooltip.js +38 -0
  25. package/dist/esm/charts/SuperChart/configStyle/visualMap.js +18 -0
  26. package/dist/esm/charts/SuperChart/configStyle/xAxis.js +19 -0
  27. package/dist/esm/charts/SuperChart/configStyle/yAxis.js +56 -0
  28. package/dist/esm/charts/SuperChart/interface.js +1 -0
  29. package/dist/esm/charts/chartTheme/colorUtil.js +22 -0
  30. package/dist/esm/charts/chartTheme/darkChart.js +508 -0
  31. package/dist/esm/charts/chartTheme/defaultChart.js +492 -0
  32. package/dist/esm/charts/chartTheme/index.js +4 -0
  33. package/dist/esm/charts/chartTheme/themeColor.js +168 -0
  34. package/dist/esm/charts/index.js +5 -0
  35. package/dist/esm/charts/utils/charts/hex2Rgb.js +32 -0
  36. package/dist/esm/charts/utils/constants/env.js +6 -0
  37. package/dist/esm/charts/utils/constants/helper.js +5 -0
  38. package/dist/esm/charts/utils/constants/index.js +3 -0
  39. package/dist/esm/charts/utils/constants/table.js +17 -0
  40. package/dist/esm/charts/utils/data.js +450 -0
  41. package/dist/esm/charts/utils/index.js +5 -0
  42. package/dist/esm/charts/utils/locale.js +7 -0
  43. package/dist/esm/charts/utils/time/index.js +14 -0
  44. package/dist/esm/charts/utils/types/action.d.ts +33 -0
  45. package/dist/esm/charts/utils/types/chart.d.ts +220 -0
  46. package/dist/esm/charts/utils/types/data.d.ts +51 -0
  47. package/dist/esm/charts/utils/types/index.d.ts +3 -0
  48. package/dist/esm/index.js +3 -0
  49. package/dist/lib/charts/Chart/utils/complementData.js +721 -0
  50. package/dist/lib/charts/Chart/utils/convertToEchartsConfig/chartsToEchartsConfig.js +105 -0
  51. package/dist/lib/charts/Chart/utils/convertToEchartsConfig/index.js +27 -0
  52. package/dist/lib/charts/Chart/utils/convertToEchartsConfig/pieChartToEchartsConfig.js +147 -0
  53. package/dist/lib/charts/Chart/utils/getOption.js +371 -0
  54. package/dist/lib/charts/Chart/utils/handleChartConfig.js +284 -0
  55. package/dist/lib/charts/Chart/utils/index.js +60 -0
  56. package/dist/lib/charts/Chart/utils/preConfig/index.js +313 -0
  57. package/dist/lib/charts/Chart/utils/preConfig/type.js +5 -0
  58. package/dist/lib/charts/PieChart/interface.js +5 -0
  59. package/dist/lib/charts/PieChart/locales/en-US.js +15 -0
  60. package/dist/lib/charts/PieChart/locales/index.js +14 -0
  61. package/dist/lib/charts/PieChart/locales/zh-CN.js +15 -0
  62. package/dist/lib/charts/PieChart/util.js +441 -0
  63. package/dist/lib/charts/SuperChart/config/bar.js +45 -0
  64. package/dist/lib/charts/SuperChart/config/index.js +243 -0
  65. package/dist/lib/charts/SuperChart/configStyle/color.js +29 -0
  66. package/dist/lib/charts/SuperChart/configStyle/dataZoom.js +19 -0
  67. package/dist/lib/charts/SuperChart/configStyle/grid.js +26 -0
  68. package/dist/lib/charts/SuperChart/configStyle/index.js +76 -0
  69. package/dist/lib/charts/SuperChart/configStyle/legend.js +74 -0
  70. package/dist/lib/charts/SuperChart/configStyle/lineStyle.js +86 -0
  71. package/dist/lib/charts/SuperChart/configStyle/title.js +22 -0
  72. package/dist/lib/charts/SuperChart/configStyle/tooltip.js +44 -0
  73. package/dist/lib/charts/SuperChart/configStyle/visualMap.js +24 -0
  74. package/dist/lib/charts/SuperChart/configStyle/xAxis.js +25 -0
  75. package/dist/lib/charts/SuperChart/configStyle/yAxis.js +62 -0
  76. package/dist/lib/charts/SuperChart/interface.js +5 -0
  77. package/dist/lib/charts/chartTheme/colorUtil.js +28 -0
  78. package/dist/lib/charts/chartTheme/darkChart.js +514 -0
  79. package/dist/lib/charts/chartTheme/defaultChart.js +498 -0
  80. package/dist/lib/charts/chartTheme/index.js +49 -0
  81. package/dist/lib/charts/chartTheme/themeColor.js +174 -0
  82. package/dist/lib/charts/index.js +60 -0
  83. package/dist/lib/charts/utils/charts/hex2Rgb.js +38 -0
  84. package/dist/lib/charts/utils/constants/env.js +12 -0
  85. package/dist/lib/charts/utils/constants/helper.js +11 -0
  86. package/dist/lib/charts/utils/constants/index.js +38 -0
  87. package/dist/lib/charts/utils/constants/table.js +23 -0
  88. package/dist/lib/charts/utils/data.js +454 -0
  89. package/dist/lib/charts/utils/index.js +60 -0
  90. package/dist/lib/charts/utils/locale.js +13 -0
  91. package/dist/lib/charts/utils/time/index.js +21 -0
  92. package/dist/lib/charts/utils/types/action.d.ts +33 -0
  93. package/dist/lib/charts/utils/types/chart.d.ts +220 -0
  94. package/dist/lib/charts/utils/types/data.d.ts +51 -0
  95. package/dist/lib/charts/utils/types/index.d.ts +3 -0
  96. package/dist/lib/index.js +25 -0
  97. package/package.json +2 -1
@@ -0,0 +1,508 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { themeColor } from "./themeColor";
8
+ var legend = {
9
+ itemWidth: 8,
10
+ itemHeight: 8,
11
+ textStyle: {
12
+ color: "rgba(255, 255, 255, 0.85)"
13
+ },
14
+ itemStyle: {
15
+ opacity: 0.85
16
+ },
17
+ icon: 'diamond',
18
+ right: 0,
19
+ pageIconSize: 10,
20
+ // 翻页按钮大小
21
+ pageIconColor: "rgba(255,255,255, 0.7)",
22
+ // 可以翻页
23
+ pageIconInactiveColor: "rgba(255,255,255, 0.3)",
24
+ // 不能翻页
25
+ pageTextStyle: {
26
+ color: "rgba(255, 255, 255, 0.85)"
27
+ }
28
+ };
29
+ var barBackground = {
30
+ showBackground: true,
31
+ backgroundStyle: {
32
+ color: themeColor.grey,
33
+ opacity: 0.0857
34
+ }
35
+ };
36
+ var tooltip = {
37
+ trigger: "axis",
38
+ axisPointer: {
39
+ type: "shadow",
40
+ shadowStyle: {
41
+ color: "rgba(12, 111, 242, 0.09)",
42
+ width: 40
43
+ }
44
+ },
45
+ backgroundColor: "rgba(255, 255, 255, 0.13)",
46
+ borderColor: "rgba(255, 255, 255, 0.13)",
47
+ textStyle: {
48
+ color: "#fff"
49
+ },
50
+ padding: 10,
51
+ className: "frosted-glass",
52
+ extraCssText: "max-height: 240px; max-width: 400px; overflow: auto;box-shadow: 0 0 60px rgba(0, 0, 0, 0.3);",
53
+ appendToBody: true,
54
+ enterable: true,
55
+ confine: true
56
+ };
57
+ var colorArr = ["#00B42A", "#F4A547", "#525FDD", "#FFCB47", "#34A5E5", "#E67754", "#13BDCC", "#C85DB8", "#30C147", "#9251DE"];
58
+ export var darkPieChartTheme = {
59
+ color: colorArr,
60
+ backgroundColor: "transparent",
61
+ textStyle: {},
62
+ title: {
63
+ textStyle: {
64
+ color: themeColor.white
65
+ },
66
+ subtextStyle: {
67
+ color: themeColor["white-1"]
68
+ }
69
+ },
70
+ legend: {
71
+ itemWidth: 6,
72
+ itemHeight: 6,
73
+ textStyle: {
74
+ color: "rgba(255, 255, 255, 0.85)"
75
+ },
76
+ itemStyle: {
77
+ opacity: 0.85
78
+ },
79
+ icon: "circle",
80
+ right: 0,
81
+ pageIconSize: 10,
82
+ // 翻页按钮大小
83
+ pageIconColor: "rgba(255,255,255, 0.7)",
84
+ // 可以翻页
85
+ pageIconInactiveColor: "rgba(255,255,255, 0.3)",
86
+ // 不能翻页
87
+ pageTextStyle: {
88
+ color: "rgba(255, 255, 255, 0.85)"
89
+ }
90
+ },
91
+ tooltip: tooltip
92
+ };
93
+ export var darkChartTheme = {
94
+ color: colorArr,
95
+ backgroundColor: "transparent",
96
+ textStyle: {},
97
+ title: {
98
+ textStyle: {
99
+ color: themeColor.white
100
+ },
101
+ subtextStyle: {
102
+ color: themeColor["white-1"]
103
+ }
104
+ },
105
+ line: {
106
+ itemStyle: {
107
+ borderWidth: 1
108
+ },
109
+ lineStyle: {
110
+ width: 2
111
+ },
112
+ symbolSize: 4,
113
+ symbol: "emptyCircle"
114
+ // smooth: true,
115
+ },
116
+ radar: {
117
+ itemStyle: {
118
+ borderWidth: 1
119
+ },
120
+ lineStyle: {
121
+ width: 2
122
+ },
123
+ symbolSize: 4,
124
+ symbol: "emptyCircle",
125
+ smooth: false
126
+ },
127
+ bar: _objectSpread(_objectSpread({}, barBackground), {}, {
128
+ barWidth: 16,
129
+ itemStyle: {
130
+ barBorderWidth: 0,
131
+ barBorderColor: "#ccc"
132
+ },
133
+ label: {
134
+ color: "#fff",
135
+ fontWeight: 500,
136
+ fontSize: 14
137
+ }
138
+ }),
139
+ pie: {
140
+ itemStyle: {
141
+ borderWidth: 3,
142
+ borderColor: "#0B1227"
143
+ }
144
+ },
145
+ scatter: {
146
+ itemStyle: {
147
+ borderWidth: 0,
148
+ borderColor: "#ccc"
149
+ }
150
+ },
151
+ boxplot: {},
152
+ parallel: {
153
+ itemStyle: {
154
+ borderWidth: 0,
155
+ borderColor: "#ccc"
156
+ }
157
+ },
158
+ sankey: {
159
+ itemStyle: {
160
+ borderWidth: 0,
161
+ borderColor: "#ccc"
162
+ }
163
+ },
164
+ funnel: {
165
+ itemStyle: {
166
+ borderWidth: 0,
167
+ borderColor: "#ccc"
168
+ }
169
+ },
170
+ gauge: {
171
+ itemStyle: {
172
+ borderWidth: 0,
173
+ borderColor: "#ccc"
174
+ }
175
+ },
176
+ candlestick: {
177
+ itemStyle: {
178
+ color: "#c12e34",
179
+ color0: "#2b821d",
180
+ borderColor: "#c12e34",
181
+ borderColor0: "#2b821d",
182
+ borderWidth: 1
183
+ }
184
+ },
185
+ graph: {
186
+ itemStyle: {
187
+ borderWidth: 0,
188
+ borderColor: "#ccc"
189
+ },
190
+ lineStyle: {
191
+ width: 1,
192
+ color: "#aaaaaa"
193
+ },
194
+ symbolSize: 4,
195
+ symbol: "emptyCircle",
196
+ smooth: false,
197
+ color: ["#c12e34", "#e6b600", "#0098d9", "#2b821d", "#005eaa", "#339ca8", "#cda819", "#32a487"],
198
+ label: {
199
+ color: "#eeeeee"
200
+ }
201
+ },
202
+ map: {
203
+ itemStyle: {
204
+ areaColor: "#ddd",
205
+ borderColor: "#eee",
206
+ borderWidth: 0.5
207
+ },
208
+ label: {
209
+ color: "#c12e34"
210
+ },
211
+ emphasis: {
212
+ itemStyle: {
213
+ areaColor: "#e6b600",
214
+ borderColor: "#ddd",
215
+ borderWidth: 1
216
+ },
217
+ label: {
218
+ color: "#c12e34"
219
+ }
220
+ }
221
+ },
222
+ geo: {
223
+ itemStyle: {
224
+ areaColor: "#ddd",
225
+ borderColor: "#eee",
226
+ borderWidth: 0.5
227
+ },
228
+ label: {
229
+ color: "#c12e34"
230
+ },
231
+ emphasis: {
232
+ itemStyle: {
233
+ areaColor: "#e6b600",
234
+ borderColor: "#ddd",
235
+ borderWidth: 1
236
+ },
237
+ label: {
238
+ color: "#c12e34"
239
+ }
240
+ }
241
+ },
242
+ categoryAxis: {
243
+ axisLine: {
244
+ show: true,
245
+ lineStyle: {
246
+ type: "solid",
247
+ color: "#414961",
248
+ width: 1.5
249
+ }
250
+ },
251
+ axisTick: {
252
+ show: false,
253
+ lineStyle: {
254
+ color: "#414961"
255
+ }
256
+ },
257
+ nameTextStyle: {
258
+ color: themeColor.white,
259
+ opacity: 0.85
260
+ },
261
+ axisLabel: {
262
+ show: true,
263
+ color: themeColor["white-9"],
264
+ hideOverlap: true
265
+ },
266
+ splitLine: {
267
+ show: false,
268
+ lineStyle: {
269
+ type: "dashed",
270
+ color: themeColor["white-5"]
271
+ }
272
+ },
273
+ splitArea: {
274
+ show: false,
275
+ areaStyle: {
276
+ color: ["rgba(250,250,250,0.3)", "rgba(200,200,200,0.3)"]
277
+ }
278
+ }
279
+ },
280
+ valueAxis: {
281
+ scale: true,
282
+ axisLine: {
283
+ show: false,
284
+ lineStyle: {
285
+ type: "solid",
286
+ color: "#414961",
287
+ width: 1.5
288
+ }
289
+ },
290
+ axisTick: {
291
+ show: false,
292
+ lineStyle: {
293
+ color: "#414961"
294
+ }
295
+ },
296
+ axisLabel: {
297
+ show: true,
298
+ margin: 15,
299
+ color: themeColor["white-9"],
300
+ hideOverlap: true
301
+ },
302
+ splitLine: {
303
+ show: true,
304
+ lineStyle: {
305
+ type: "dashed",
306
+ color: themeColor["white-5"]
307
+ }
308
+ },
309
+ splitArea: {
310
+ show: false,
311
+ areaStyle: {
312
+ color: ["rgba(250,250,250,0.3)", "rgba(200,200,200,0.3)"]
313
+ }
314
+ },
315
+ nameTextStyle: {
316
+ color: themeColor.white,
317
+ opacity: 0.85
318
+ }
319
+ },
320
+ logAxis: {
321
+ axisLine: {
322
+ show: true,
323
+ lineStyle: {
324
+ color: "#414961"
325
+ }
326
+ },
327
+ axisTick: {
328
+ show: true,
329
+ lineStyle: {
330
+ color: "#414961"
331
+ }
332
+ },
333
+ axisLabel: {
334
+ show: true,
335
+ color: themeColor["white-9"],
336
+ hideOverlap: true
337
+ },
338
+ splitLine: {
339
+ show: true,
340
+ lineStyle: {
341
+ type: "dashed",
342
+ color: themeColor["white-5"]
343
+ }
344
+ },
345
+ splitArea: {
346
+ show: false,
347
+ areaStyle: {
348
+ color: ["rgba(250,250,250,0.3)", "rgba(200,200,200,0.3)"]
349
+ }
350
+ }
351
+ },
352
+ timeAxis: {
353
+ axisLine: {
354
+ show: true,
355
+ lineStyle: {
356
+ type: "solid",
357
+ color: "#414961",
358
+ width: 1.5
359
+ }
360
+ },
361
+ axisTick: {
362
+ show: false,
363
+ lineStyle: {
364
+ color: "#414961"
365
+ }
366
+ },
367
+ axisLabel: {
368
+ show: true,
369
+ color: themeColor["white-9"],
370
+ formatter: {
371
+ year: "{yyyy}",
372
+ month: "{MMM}",
373
+ day: "{d}",
374
+ hour: "{HH}:{mm}",
375
+ minute: "{HH}:{mm}",
376
+ second: "{HH}:{mm}:{ss}"
377
+ },
378
+ hideOverlap: true
379
+ },
380
+ splitLine: {
381
+ show: false,
382
+ lineStyle: {
383
+ type: "dashed",
384
+ color: themeColor["white-5"]
385
+ }
386
+ },
387
+ splitArea: {
388
+ show: false
389
+ },
390
+ nameTextStyle: {
391
+ color: themeColor.white,
392
+ opacity: 0.85
393
+ }
394
+ },
395
+ toolbox: {
396
+ iconStyle: {
397
+ borderColor: "#06467c"
398
+ },
399
+ emphasis: {
400
+ iconStyle: {
401
+ borderColor: "#4187c2"
402
+ }
403
+ }
404
+ },
405
+ legend: legend,
406
+ tooltip: tooltip,
407
+ timeline: {
408
+ lineStyle: {
409
+ color: "#005eaa",
410
+ width: 1
411
+ },
412
+ itemStyle: {
413
+ color: "#005eaa",
414
+ borderWidth: 1
415
+ },
416
+ controlStyle: {
417
+ color: "#005eaa",
418
+ borderColor: "#005eaa",
419
+ borderWidth: 0.5
420
+ },
421
+ checkpointStyle: {
422
+ color: "#005eaa",
423
+ borderColor: "#316bc2"
424
+ },
425
+ label: {
426
+ color: "#005eaa"
427
+ },
428
+ emphasis: {
429
+ itemStyle: {
430
+ color: "#005eaa"
431
+ },
432
+ controlStyle: {
433
+ color: "#005eaa",
434
+ borderColor: "#005eaa",
435
+ borderWidth: 0.5
436
+ },
437
+ label: {
438
+ color: "#005eaa"
439
+ }
440
+ }
441
+ },
442
+ visualMap: {
443
+ color: ["#1790cf", "#a2d4e6"],
444
+ textStyle: {
445
+ color: "#fff"
446
+ }
447
+ },
448
+ dataZoom: {
449
+ backgroundColor: "rgba(47,69,84,0)",
450
+ dataBackgroundColor: "rgba(47,69,84,0.3)",
451
+ fillerColor: "rgba(167,183,204,0.4)",
452
+ handleColor: "#a7b7cc",
453
+ handleSize: "100%",
454
+ textStyle: {
455
+ color: "#333333"
456
+ }
457
+ },
458
+ markPoint: {
459
+ label: {
460
+ color: "#eeeeee"
461
+ },
462
+ emphasis: {
463
+ label: {
464
+ color: "#eeeeee"
465
+ }
466
+ }
467
+ },
468
+ categoryAxis3D: {
469
+ axisLabel: {
470
+ color: "rgba(255, 255, 255, 0.5)",
471
+ hideOverlap: true
472
+ },
473
+ axisLine: {
474
+ lineStyle: {
475
+ type: "solid",
476
+ color: "#414961",
477
+ width: 1.5
478
+ }
479
+ },
480
+ splitLine: {
481
+ show: true,
482
+ lineStyle: {
483
+ type: "dashed",
484
+ color: "rgba(255, 255, 255, 0.2)"
485
+ }
486
+ }
487
+ },
488
+ valueAxis3D: {
489
+ axisLabel: {
490
+ color: "rgba(255, 255, 255, 0.5)",
491
+ hideOverlap: true
492
+ },
493
+ axisLine: {
494
+ lineStyle: {
495
+ type: "solid",
496
+ color: "#414961",
497
+ width: 1.5
498
+ }
499
+ },
500
+ splitLine: {
501
+ show: true,
502
+ lineStyle: {
503
+ type: "dashed",
504
+ color: "rgba(255, 255, 255, 0.2)"
505
+ }
506
+ }
507
+ }
508
+ };