@react-fabric/chart 1.0.0-beta.52 → 1.0.0-beta.54
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.
- package/dist/cjs/charts/ActivityMap.js +36 -26
- package/dist/cjs/charts/CountSeries.js +17 -14
- package/dist/cjs/charts/DataSeries.js +30 -27
- package/dist/cjs/charts/Generic.js +15 -5
- package/dist/cjs/charts/MapSeries.js +9 -8
- package/dist/cjs/charts/TimeSeries.js +31 -28
- package/dist/cjs/charts/TimeSlider.js +9 -9
- package/dist/cjs/charts/WordBubble.js +11 -5
- package/dist/cjs/theme/darkBase.js +13 -10
- package/dist/cjs/theme/index.js +38 -18
- package/dist/cjs/theme/lightBase.js +18 -15
- package/dist/cjs/theme/palettes.js +27 -27
- package/dist/cjs/types/charts.js +2 -2
- package/dist/cjs/wrapper/ChartContainer.js +2 -1
- package/dist/cjs/wrapper/ChartToolbar.js +1 -1
- package/dist/esm/charts/ActivityMap.js +36 -26
- package/dist/esm/charts/CountSeries.js +17 -14
- package/dist/esm/charts/DataSeries.js +30 -27
- package/dist/esm/charts/Generic.js +17 -7
- package/dist/esm/charts/MapSeries.js +9 -8
- package/dist/esm/charts/TimeSeries.js +31 -28
- package/dist/esm/charts/TimeSlider.js +9 -9
- package/dist/esm/charts/WordBubble.js +11 -5
- package/dist/esm/theme/darkBase.js +13 -10
- package/dist/esm/theme/index.js +38 -18
- package/dist/esm/theme/lightBase.js +18 -15
- package/dist/esm/theme/palettes.js +27 -27
- package/dist/esm/types/charts.js +2 -2
- package/dist/esm/wrapper/ChartContainer.js +2 -1
- package/dist/esm/wrapper/ChartToolbar.js +1 -1
- package/dist/types/charts/ActivityMap.d.ts +1 -1
- package/dist/types/charts/MapSeries.d.ts +7 -2
- package/dist/types/charts/TimeSlider.d.ts +1 -1
- package/dist/types/charts/WordBubble.d.ts +7 -2
- package/dist/types/theme/darkBase.d.ts +8 -5
- package/dist/types/theme/index.d.ts +1 -1
- package/dist/types/theme/lightBase.d.ts +8 -5
- package/dist/types/types/charts.d.ts +1 -1
- package/dist/types/types/index.d.ts +30 -12
- package/package.json +3 -3
- package/src/charts/ActivityMap.tsx +75 -55
- package/src/charts/CountSeries.tsx +53 -41
- package/src/charts/DataSeries.tsx +98 -73
- package/src/charts/Generic.tsx +11 -4
- package/src/charts/MapSeries.tsx +33 -23
- package/src/charts/TimeSeries.tsx +87 -72
- package/src/charts/TimeSlider.tsx +12 -9
- package/src/charts/WordBubble.tsx +14 -7
- package/src/theme/darkBase.ts +12 -9
- package/src/theme/index.ts +94 -20
- package/src/theme/lightBase.ts +17 -14
- package/src/theme/palettes.ts +1 -52
- package/src/types/charts.ts +6 -2
- package/src/types/index.ts +40 -4
- package/src/wrapper/ChartContainer.tsx +1 -0
- package/src/wrapper/ChartToolbar.tsx +1 -1
package/src/theme/lightBase.ts
CHANGED
|
@@ -62,7 +62,7 @@ export const LightThemeBase = {
|
|
|
62
62
|
splitLine: {
|
|
63
63
|
show: true,
|
|
64
64
|
lineStyle: {
|
|
65
|
-
color: ["#
|
|
65
|
+
color: ["#d9d9d9"],
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
68
|
splitArea: {
|
|
@@ -174,7 +174,7 @@ export const LightThemeBase = {
|
|
|
174
174
|
axisLine: {
|
|
175
175
|
show: true,
|
|
176
176
|
lineStyle: {
|
|
177
|
-
color: "#
|
|
177
|
+
color: "#c5c5c5",
|
|
178
178
|
},
|
|
179
179
|
},
|
|
180
180
|
axisTick: {
|
|
@@ -193,7 +193,7 @@ export const LightThemeBase = {
|
|
|
193
193
|
splitLine: {
|
|
194
194
|
show: true,
|
|
195
195
|
lineStyle: {
|
|
196
|
-
color: ["#
|
|
196
|
+
color: ["#d9d9d9"],
|
|
197
197
|
},
|
|
198
198
|
},
|
|
199
199
|
splitArea: {
|
|
@@ -208,7 +208,7 @@ export const LightThemeBase = {
|
|
|
208
208
|
axisLine: {
|
|
209
209
|
show: true,
|
|
210
210
|
lineStyle: {
|
|
211
|
-
color: "#
|
|
211
|
+
color: "#c5c5c5",
|
|
212
212
|
},
|
|
213
213
|
},
|
|
214
214
|
axisTick: {
|
|
@@ -227,7 +227,7 @@ export const LightThemeBase = {
|
|
|
227
227
|
splitLine: {
|
|
228
228
|
show: true,
|
|
229
229
|
lineStyle: {
|
|
230
|
-
color: ["#
|
|
230
|
+
color: ["#d9d9d9"],
|
|
231
231
|
},
|
|
232
232
|
},
|
|
233
233
|
splitArea: {
|
|
@@ -242,7 +242,7 @@ export const LightThemeBase = {
|
|
|
242
242
|
axisLine: {
|
|
243
243
|
show: true,
|
|
244
244
|
lineStyle: {
|
|
245
|
-
color: "#
|
|
245
|
+
color: "#969696",
|
|
246
246
|
},
|
|
247
247
|
},
|
|
248
248
|
axisTick: {
|
|
@@ -261,7 +261,7 @@ export const LightThemeBase = {
|
|
|
261
261
|
splitLine: {
|
|
262
262
|
show: true,
|
|
263
263
|
lineStyle: {
|
|
264
|
-
color: ["#
|
|
264
|
+
color: ["#d9d9d9"],
|
|
265
265
|
},
|
|
266
266
|
},
|
|
267
267
|
splitArea: {
|
|
@@ -276,7 +276,7 @@ export const LightThemeBase = {
|
|
|
276
276
|
axisLine: {
|
|
277
277
|
show: true,
|
|
278
278
|
lineStyle: {
|
|
279
|
-
color: "#
|
|
279
|
+
color: "#969696",
|
|
280
280
|
},
|
|
281
281
|
},
|
|
282
282
|
axisTick: {
|
|
@@ -295,7 +295,7 @@ export const LightThemeBase = {
|
|
|
295
295
|
splitLine: {
|
|
296
296
|
show: true,
|
|
297
297
|
lineStyle: {
|
|
298
|
-
color: ["#
|
|
298
|
+
color: ["#d9d9d9"],
|
|
299
299
|
},
|
|
300
300
|
},
|
|
301
301
|
splitArea: {
|
|
@@ -305,11 +305,6 @@ export const LightThemeBase = {
|
|
|
305
305
|
},
|
|
306
306
|
},
|
|
307
307
|
},
|
|
308
|
-
visualMap: {
|
|
309
|
-
textStyle: {
|
|
310
|
-
color: "#666",
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
308
|
toolbox: {
|
|
314
309
|
iconStyle: {
|
|
315
310
|
borderColor: "#999999",
|
|
@@ -322,9 +317,17 @@ export const LightThemeBase = {
|
|
|
322
317
|
},
|
|
323
318
|
legend: {
|
|
324
319
|
inactiveColor: "rgb(96 96 96 / .75)",
|
|
320
|
+
itemHeight: 8,
|
|
325
321
|
textStyle: {
|
|
322
|
+
fontSize: 10,
|
|
326
323
|
color: "#565656",
|
|
327
324
|
},
|
|
325
|
+
pageTextStyle: {
|
|
326
|
+
fontSize: 8,
|
|
327
|
+
},
|
|
328
|
+
pageIconSize: 8,
|
|
329
|
+
pageIconColor: "#487884",
|
|
330
|
+
pageIconInactiveColor: "#CCD3D1",
|
|
328
331
|
},
|
|
329
332
|
tooltip: {
|
|
330
333
|
backgroundColor: "#FCFDFD",
|
package/src/theme/palettes.ts
CHANGED
|
@@ -225,7 +225,7 @@ const Spectral = [
|
|
|
225
225
|
"#abdda4",
|
|
226
226
|
"#66c2a5",
|
|
227
227
|
"#3288bd",
|
|
228
|
-
"#
|
|
228
|
+
"#134F74",
|
|
229
229
|
];
|
|
230
230
|
|
|
231
231
|
const PurpleBlueYellow = [
|
|
@@ -236,11 +236,8 @@ const PurpleBlueYellow = [
|
|
|
236
236
|
"#5EA28D",
|
|
237
237
|
"#82BB92",
|
|
238
238
|
"#AECEA1",
|
|
239
|
-
"#D6DEBF",
|
|
240
239
|
];
|
|
241
240
|
const YellowGreen = [
|
|
242
|
-
"#ffffe5",
|
|
243
|
-
"#f7fcb9",
|
|
244
241
|
"#d9f0a3",
|
|
245
242
|
"#addd8e",
|
|
246
243
|
"#78c679",
|
|
@@ -250,8 +247,6 @@ const YellowGreen = [
|
|
|
250
247
|
"#004529",
|
|
251
248
|
];
|
|
252
249
|
const YellowGreenBlue = [
|
|
253
|
-
"#ffffd9",
|
|
254
|
-
"#edf8b1",
|
|
255
250
|
"#c7e9b4",
|
|
256
251
|
"#7fcdbb",
|
|
257
252
|
"#41b6c4",
|
|
@@ -261,8 +256,6 @@ const YellowGreenBlue = [
|
|
|
261
256
|
"#081d58",
|
|
262
257
|
];
|
|
263
258
|
const GreenBlue = [
|
|
264
|
-
"#f7fcf0",
|
|
265
|
-
"#e0f3db",
|
|
266
259
|
"#ccebc5",
|
|
267
260
|
"#a8ddb5",
|
|
268
261
|
"#7bccc4",
|
|
@@ -272,8 +265,6 @@ const GreenBlue = [
|
|
|
272
265
|
"#084081",
|
|
273
266
|
];
|
|
274
267
|
const BlueGreen = [
|
|
275
|
-
"#f7fcfd",
|
|
276
|
-
"#e5f5f9",
|
|
277
268
|
"#ccece6",
|
|
278
269
|
"#99d8c9",
|
|
279
270
|
"#66c2a4",
|
|
@@ -283,8 +274,6 @@ const BlueGreen = [
|
|
|
283
274
|
"#00441b",
|
|
284
275
|
];
|
|
285
276
|
const PurpleBlueGreen = [
|
|
286
|
-
"#fff7fb",
|
|
287
|
-
"#ece2f0",
|
|
288
277
|
"#d0d1e6",
|
|
289
278
|
"#a6bddb",
|
|
290
279
|
"#67a9cf",
|
|
@@ -294,8 +283,6 @@ const PurpleBlueGreen = [
|
|
|
294
283
|
"#014636",
|
|
295
284
|
];
|
|
296
285
|
const PurpleBlue = [
|
|
297
|
-
"#fff7fb",
|
|
298
|
-
"#ece7f2",
|
|
299
286
|
"#d0d1e6",
|
|
300
287
|
"#a6bddb",
|
|
301
288
|
"#74a9cf",
|
|
@@ -305,8 +292,6 @@ const PurpleBlue = [
|
|
|
305
292
|
"#023858",
|
|
306
293
|
];
|
|
307
294
|
const BluePurple = [
|
|
308
|
-
"#f7fcfd",
|
|
309
|
-
"#e0ecf4",
|
|
310
295
|
"#bfd3e6",
|
|
311
296
|
"#9ebcda",
|
|
312
297
|
"#8c96c6",
|
|
@@ -316,8 +301,6 @@ const BluePurple = [
|
|
|
316
301
|
"#4d004b",
|
|
317
302
|
];
|
|
318
303
|
const RedPurple = [
|
|
319
|
-
"#fff7f3",
|
|
320
|
-
"#fde0dd",
|
|
321
304
|
"#fcc5c0",
|
|
322
305
|
"#fa9fb5",
|
|
323
306
|
"#f768a1",
|
|
@@ -327,8 +310,6 @@ const RedPurple = [
|
|
|
327
310
|
"#49006a",
|
|
328
311
|
];
|
|
329
312
|
const PurpleRed = [
|
|
330
|
-
"#f7f4f9",
|
|
331
|
-
"#e7e1ef",
|
|
332
313
|
"#d4b9da",
|
|
333
314
|
"#c994c7",
|
|
334
315
|
"#df65b0",
|
|
@@ -338,8 +319,6 @@ const PurpleRed = [
|
|
|
338
319
|
"#67001f",
|
|
339
320
|
];
|
|
340
321
|
const OrangeRed = [
|
|
341
|
-
"#fff7ec",
|
|
342
|
-
"#fee8c8",
|
|
343
322
|
"#fdd49e",
|
|
344
323
|
"#fdbb84",
|
|
345
324
|
"#fc8d59",
|
|
@@ -349,8 +328,6 @@ const OrangeRed = [
|
|
|
349
328
|
"#7f0000",
|
|
350
329
|
];
|
|
351
330
|
const YellowOrangeRed = [
|
|
352
|
-
"#ffffcc",
|
|
353
|
-
"#ffeda0",
|
|
354
331
|
"#fed976",
|
|
355
332
|
"#feb24c",
|
|
356
333
|
"#fd8d3c",
|
|
@@ -360,8 +337,6 @@ const YellowOrangeRed = [
|
|
|
360
337
|
"#800026",
|
|
361
338
|
];
|
|
362
339
|
const YellowOrangeBrown = [
|
|
363
|
-
"#ffffe5",
|
|
364
|
-
"#fff7bc",
|
|
365
340
|
"#fee391",
|
|
366
341
|
"#fec44f",
|
|
367
342
|
"#fe9929",
|
|
@@ -371,8 +346,6 @@ const YellowOrangeBrown = [
|
|
|
371
346
|
"#662506",
|
|
372
347
|
];
|
|
373
348
|
const Purple = [
|
|
374
|
-
"#fcfbfd",
|
|
375
|
-
"#efedf5",
|
|
376
349
|
"#dadaeb",
|
|
377
350
|
"#bcbddc",
|
|
378
351
|
"#9e9ac8",
|
|
@@ -382,8 +355,6 @@ const Purple = [
|
|
|
382
355
|
"#3f007d",
|
|
383
356
|
];
|
|
384
357
|
const Blue = [
|
|
385
|
-
"#f7fbff",
|
|
386
|
-
"#deebf7",
|
|
387
358
|
"#c6dbef",
|
|
388
359
|
"#9ecae1",
|
|
389
360
|
"#6baed6",
|
|
@@ -393,8 +364,6 @@ const Blue = [
|
|
|
393
364
|
"#08306b",
|
|
394
365
|
];
|
|
395
366
|
const Green = [
|
|
396
|
-
"#f7fcf5",
|
|
397
|
-
"#e5f5e0",
|
|
398
367
|
"#c7e9c0",
|
|
399
368
|
"#a1d99b",
|
|
400
369
|
"#74c476",
|
|
@@ -404,8 +373,6 @@ const Green = [
|
|
|
404
373
|
"#00441b",
|
|
405
374
|
];
|
|
406
375
|
const Orange = [
|
|
407
|
-
"#fff5eb",
|
|
408
|
-
"#fee6ce",
|
|
409
376
|
"#fdd0a2",
|
|
410
377
|
"#fdae6b",
|
|
411
378
|
"#fd8d3c",
|
|
@@ -415,8 +382,6 @@ const Orange = [
|
|
|
415
382
|
"#7f2704",
|
|
416
383
|
];
|
|
417
384
|
const Red = [
|
|
418
|
-
"#fff5f0",
|
|
419
|
-
"#fee0d2",
|
|
420
385
|
"#fcbba1",
|
|
421
386
|
"#fc9272",
|
|
422
387
|
"#fb6a4a",
|
|
@@ -426,8 +391,6 @@ const Red = [
|
|
|
426
391
|
"#67000d",
|
|
427
392
|
];
|
|
428
393
|
const Grey = [
|
|
429
|
-
"#ffffff",
|
|
430
|
-
"#f0f0f0",
|
|
431
394
|
"#d9d9d9",
|
|
432
395
|
"#bdbdbd",
|
|
433
396
|
"#969696",
|
|
@@ -442,8 +405,6 @@ const OrangePurple = [
|
|
|
442
405
|
"#e08214",
|
|
443
406
|
"#fdb863",
|
|
444
407
|
"#fee0b6",
|
|
445
|
-
"#f7f7f7",
|
|
446
|
-
"#d8daeb",
|
|
447
408
|
"#b2abd2",
|
|
448
409
|
"#8073ac",
|
|
449
410
|
"#542788",
|
|
@@ -455,8 +416,6 @@ const BrownGreen = [
|
|
|
455
416
|
"#bf812d",
|
|
456
417
|
"#dfc27d",
|
|
457
418
|
"#f6e8c3",
|
|
458
|
-
"#f5f5f5",
|
|
459
|
-
"#c7eae5",
|
|
460
419
|
"#80cdc1",
|
|
461
420
|
"#35978f",
|
|
462
421
|
"#01665e",
|
|
@@ -467,8 +426,6 @@ const PurpleGreen = [
|
|
|
467
426
|
"#762a83",
|
|
468
427
|
"#9970ab",
|
|
469
428
|
"#c2a5cf",
|
|
470
|
-
"#e7d4e8",
|
|
471
|
-
"#f7f7f7",
|
|
472
429
|
"#d9f0d3",
|
|
473
430
|
"#a6dba0",
|
|
474
431
|
"#5aae61",
|
|
@@ -480,8 +437,6 @@ const PinkGreen = [
|
|
|
480
437
|
"#c51b7d",
|
|
481
438
|
"#de77ae",
|
|
482
439
|
"#f1b6da",
|
|
483
|
-
"#fde0ef",
|
|
484
|
-
"#f7f7f7",
|
|
485
440
|
"#e6f5d0",
|
|
486
441
|
"#b8e186",
|
|
487
442
|
"#7fbc41",
|
|
@@ -494,8 +449,6 @@ const RedBlue = [
|
|
|
494
449
|
"#d6604d",
|
|
495
450
|
"#f4a582",
|
|
496
451
|
"#fddbc7",
|
|
497
|
-
"#f7f7f7",
|
|
498
|
-
"#d1e5f0",
|
|
499
452
|
"#92c5de",
|
|
500
453
|
"#4393c3",
|
|
501
454
|
"#2166ac",
|
|
@@ -507,8 +460,6 @@ const RedGray = [
|
|
|
507
460
|
"#d6604d",
|
|
508
461
|
"#f4a582",
|
|
509
462
|
"#fddbc7",
|
|
510
|
-
"#ffffff",
|
|
511
|
-
"#e0e0e0",
|
|
512
463
|
"#bababa",
|
|
513
464
|
"#878787",
|
|
514
465
|
"#4d4d4d",
|
|
@@ -520,8 +471,6 @@ const RedYellowBlue = [
|
|
|
520
471
|
"#f46d43",
|
|
521
472
|
"#fdae61",
|
|
522
473
|
"#fee090",
|
|
523
|
-
"#ffffbf",
|
|
524
|
-
"#e0f3f8",
|
|
525
474
|
"#abd9e9",
|
|
526
475
|
"#74add1",
|
|
527
476
|
"#4575b4",
|
package/src/types/charts.ts
CHANGED
|
@@ -27,6 +27,10 @@ import { registerThemes, registerTheme as RT } from "../theme";
|
|
|
27
27
|
registerThemes(echarts);
|
|
28
28
|
|
|
29
29
|
export default echarts;
|
|
30
|
-
export const registerTheme = (
|
|
31
|
-
|
|
30
|
+
export const registerTheme = (
|
|
31
|
+
key: string,
|
|
32
|
+
colors: string[],
|
|
33
|
+
heatmap: string[],
|
|
34
|
+
) => {
|
|
35
|
+
RT(echarts, key, colors, heatmap);
|
|
32
36
|
};
|
package/src/types/index.ts
CHANGED
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
+
import { type EChartOption } from "echarts";
|
|
25
|
+
|
|
24
26
|
export type Theme =
|
|
25
27
|
| "default"
|
|
26
28
|
| "activity"
|
|
@@ -34,16 +36,42 @@ export type Theme =
|
|
|
34
36
|
| "warming"
|
|
35
37
|
| "sunrise"
|
|
36
38
|
| "ocean"
|
|
37
|
-
| "wine"
|
|
39
|
+
| "wine"
|
|
40
|
+
| "red"
|
|
41
|
+
| "green"
|
|
42
|
+
| "blue";
|
|
38
43
|
|
|
39
44
|
export interface BaseChart {
|
|
40
45
|
title?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The theme to be applied to the chart.
|
|
48
|
+
* This can be one of the predefined themes or a custom theme object.
|
|
49
|
+
* Predefined themes include "default", "activity", "cloud", "qualitative", "diverging", "sequential",
|
|
50
|
+
* "spectral", "uber", "fireice", "warming", "sunrise", "ocean", "wine", "red", "green", and "blue".
|
|
51
|
+
*/
|
|
41
52
|
theme?: Theme;
|
|
53
|
+
/**
|
|
54
|
+
* Additional options for the chart.
|
|
55
|
+
* This can include any ECharts options to customize the chart's appearance and behavior.
|
|
56
|
+
*/
|
|
57
|
+
options?: EChartOption;
|
|
58
|
+
/**
|
|
59
|
+
* Whether to show the theme selector in the chart.
|
|
60
|
+
* This is useful for allowing users to switch between different themes.
|
|
61
|
+
* If set to true, the chart will render a toggle button group to select the theme.
|
|
62
|
+
*/
|
|
63
|
+
showThemeSelector?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Whether to show the type selector in the chart.
|
|
66
|
+
* This is useful for charts that can have multiple types (e.g., line, column, etc.).
|
|
67
|
+
* If set to true, the chart will render a toggle button group to select the type.
|
|
68
|
+
*/
|
|
69
|
+
showTypeSelector?: boolean;
|
|
42
70
|
onExport?: (chart: { title: string; image: string }) => void;
|
|
43
71
|
}
|
|
44
72
|
|
|
45
73
|
export interface CountType {
|
|
46
|
-
|
|
74
|
+
series: Array<EChartOption.SeriesPie & { count: number }>;
|
|
47
75
|
}
|
|
48
76
|
|
|
49
77
|
export interface SeriesType {
|
|
@@ -51,11 +79,19 @@ export interface SeriesType {
|
|
|
51
79
|
valueAxisName?: string;
|
|
52
80
|
valueFormat?: string;
|
|
53
81
|
categories: string[];
|
|
54
|
-
|
|
82
|
+
series: Array<
|
|
83
|
+
EChartOption.SeriesBar & {
|
|
84
|
+
data: number[];
|
|
85
|
+
}
|
|
86
|
+
>;
|
|
55
87
|
}
|
|
56
88
|
|
|
57
89
|
export interface TimeSeriesType {
|
|
58
90
|
categoryAxisName?: string;
|
|
59
91
|
valueAxisName?: string;
|
|
60
|
-
|
|
92
|
+
series: Array<
|
|
93
|
+
EChartOption.SeriesBar & {
|
|
94
|
+
data: Array<[Date, number]>;
|
|
95
|
+
}
|
|
96
|
+
>;
|
|
61
97
|
}
|