react-use-echarts 1.0.0 → 1.0.2

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/README.md CHANGED
@@ -282,6 +282,8 @@ function LinkedCharts() {
282
282
 
283
283
  Only initialize charts when they enter the viewport, great for pages with many charts.
284
284
 
285
+ > 默认懒加载参数:`rootMargin: '50px'`,`threshold: 0.1`
286
+
285
287
  ```tsx
286
288
  import { useRef } from 'react';
287
289
  import { useEcharts } from 'react-use-echarts';
@@ -385,6 +387,24 @@ function ChartWithInstance() {
385
387
  </div>
386
388
  );
387
389
  }
390
+
391
+ ### Utilities
392
+
393
+ 高级场景可直接使用导出的实例缓存与组联动工具:
394
+
395
+ ```tsx
396
+ import {
397
+ getCachedInstance,
398
+ clearInstanceCache,
399
+ getGroupInstances,
400
+ updateGroup,
401
+ addToGroup,
402
+ removeFromGroup,
403
+ } from 'react-use-echarts';
404
+ ```
405
+
406
+ - `getCachedInstance` / `clearInstanceCache`:查询或清理内部实例缓存
407
+ - `getGroupInstances` / `addToGroup` / `removeFromGroup` / `updateGroup`:手动管理 ECharts 组联动
388
408
  ```
389
409
 
390
410
  ### Manual Resize
@@ -494,11 +514,11 @@ const { setOption, getInstance, resize } = useEcharts(chartRef, options);
494
514
 
495
515
  ```tsx
496
516
  import {
497
- registerBuiltinThemes,
498
- getBuiltinTheme,
517
+ getAvailableThemes,
499
518
  isBuiltinTheme,
519
+ getBuiltinTheme,
500
520
  registerCustomTheme,
501
- getAvailableThemes,
521
+ registerBuiltinThemes,
502
522
  } from 'react-use-echarts';
503
523
 
504
524
  // Get all available built-in theme names
@@ -513,6 +533,9 @@ const darkTheme = getBuiltinTheme('dark');
513
533
 
514
534
  // Register a custom theme globally
515
535
  registerCustomTheme('my-theme', { color: ['#ff0000', '#00ff00'] });
536
+
537
+ // Register built-in themes to ECharts (auto-called on module load, rarely needed manually)
538
+ registerBuiltinThemes();
516
539
  ```
517
540
 
518
541
  ### useLazyInit
@@ -615,6 +638,13 @@ function MyChart() {
615
638
  }
616
639
  ```
617
640
 
641
+ ### 1.0.2
642
+
643
+ - 主题切换后保留组联动与 loading 状态
644
+ - 懒加载完成后正确加入组
645
+ - onEvents 变更时自动重绑事件
646
+ - 文档补充实例缓存与组联动工具导出
647
+
618
648
  ## 📝 Changelog
619
649
 
620
650
  Detailed changes for each release are documented in the [release notes](https://github.com/chensid/react-use-echarts/releases).
package/dist/index.es.js CHANGED
@@ -1,69 +1,73 @@
1
- import { useEffect, useLayoutEffect, useRef, useState } from "react";
1
+ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
2
2
  import * as echarts from "echarts";
3
- var __commonJSMin = (e, l) => () => (l || e((l = { exports: {} }).exports, l), l.exports), __require = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, l) => (typeof require < "u" ? require : e)[l] }) : e)(function(e) {
3
+ var __commonJSMin = (e, i) => () => (i || e((i = { exports: {} }).exports, i), i.exports), __require = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, i) => (typeof require < "u" ? require : e)[i] }) : e)(function(e) {
4
4
  if (typeof require < "u") return require.apply(this, arguments);
5
5
  throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function.");
6
6
  }), require_react_compiler_runtime_production = /* @__PURE__ */ __commonJSMin(((e) => {
7
- var l = __require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
7
+ var i = __require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
8
8
  e.c = function(e) {
9
- return l.H.useMemoCache(e);
9
+ return i.H.useMemoCache(e);
10
10
  };
11
11
  })), require_react_compiler_runtime_development = /* @__PURE__ */ __commonJSMin(((e) => {
12
12
  process.env.NODE_ENV !== "production" && (function() {
13
- var l = __require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
13
+ var i = __require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
14
14
  e.c = function(e) {
15
- var u = l.H;
16
- return u === null && console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."), u.useMemoCache(e);
15
+ var a = i.H;
16
+ return a === null && console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."), a.useMemoCache(e);
17
17
  };
18
18
  })();
19
- })), import_compiler_runtime = (/* @__PURE__ */ __commonJSMin(((e, l) => {
20
- process.env.NODE_ENV === "production" ? l.exports = require_react_compiler_runtime_production() : l.exports = require_react_compiler_runtime_development();
19
+ })), import_compiler_runtime = (/* @__PURE__ */ __commonJSMin(((e, i) => {
20
+ process.env.NODE_ENV === "production" ? i.exports = require_react_compiler_runtime_production() : i.exports = require_react_compiler_runtime_development();
21
21
  })))();
22
- function useLazyInit(l, f = !1) {
23
- let p = f !== !1, [m, h] = useState(!p), g = useRef(f);
24
- return g.current = f, useEffect(() => {
25
- if (!p || m) return;
26
- let e = l.current;
22
+ function useLazyInit(i, o = !1) {
23
+ let c = o !== !1, [l, u] = useState(!c), d = typeof o == "object", f = d ? o.root : null, p = d ? o.rootMargin : void 0, m = d ? o.threshold : void 0, h = useMemo(() => ({
24
+ root: f ?? null,
25
+ rootMargin: p ?? "50px",
26
+ threshold: m ?? .1
27
+ }), [
28
+ f,
29
+ p,
30
+ m === void 0 ? void 0 : JSON.stringify(m)
31
+ ]);
32
+ return useEffect(() => {
33
+ if (!c || l) return;
34
+ let e = i.current;
27
35
  if (!e) return;
28
- let u = g.current, d = {
29
- root: null,
30
- rootMargin: "50px",
31
- threshold: .1,
32
- ...typeof u == "object" ? u : {}
33
- }, f = new IntersectionObserver((e) => {
34
- let [l] = e;
35
- l.isIntersecting && (h(!0), f.disconnect());
36
- }, d);
37
- return f.observe(e), () => {
38
- f.disconnect();
36
+ let a = new IntersectionObserver((e) => {
37
+ let [i] = e;
38
+ i.isIntersecting && (u(!0), a.disconnect());
39
+ }, h);
40
+ return a.observe(e), () => {
41
+ a.disconnect();
39
42
  };
40
43
  }, [
44
+ i,
45
+ c,
41
46
  l,
42
- p,
43
- m
44
- ]), m;
47
+ h
48
+ ]), l;
45
49
  }
46
50
  var instanceCache = /* @__PURE__ */ new WeakMap(), trackedElements = /* @__PURE__ */ new Set();
47
51
  function getCachedInstance(e) {
48
52
  return instanceCache.get(e)?.instance;
49
53
  }
50
- function setCachedInstance(e, l) {
51
- let u = instanceCache.get(e);
52
- return u ? (u.refCount += 1, u.instance) : (instanceCache.set(e, {
53
- instance: l,
54
+ function setCachedInstance(e, i) {
55
+ let a = instanceCache.get(e);
56
+ return a ? (a.refCount += 1, a.instance) : (instanceCache.set(e, {
57
+ instance: i,
54
58
  refCount: 1
55
- }), trackedElements.add(e), l);
59
+ }), trackedElements.add(e), i);
56
60
  }
57
- function replaceCachedInstance(e, l) {
58
- let u = instanceCache.get(e);
59
- return u ? (u.instance.dispose(), u.instance = l, l) : (instanceCache.set(e, {
60
- instance: l,
61
+ function replaceCachedInstance(e, i) {
62
+ let a = instanceCache.get(e);
63
+ return a ? (a.instance.dispose(), a.instance = i, i) : (instanceCache.set(e, {
64
+ instance: i,
61
65
  refCount: 1
62
- }), trackedElements.add(e), l);
66
+ }), trackedElements.add(e), i);
63
67
  }
64
68
  function releaseCachedInstance(e) {
65
- let l = instanceCache.get(e);
66
- l && (--l.refCount, l.refCount <= 0 && (l.instance.dispose(), instanceCache.delete(e), trackedElements.delete(e)));
69
+ let i = instanceCache.get(e);
70
+ i && (--i.refCount, i.refCount <= 0 && (i.instance.dispose(), instanceCache.delete(e), trackedElements.delete(e)));
67
71
  }
68
72
  function getReferenceCount(e) {
69
73
  return instanceCache.get(e)?.refCount ?? 0;
@@ -73,23 +77,23 @@ function clearInstanceCache() {
73
77
  instanceCache = /* @__PURE__ */ new WeakMap(), trackedElements.clear();
74
78
  }
75
79
  var groupRegistry = /* @__PURE__ */ new Map();
76
- function addToGroup(e, l) {
77
- let u = groupRegistry.get(l);
78
- u || (u = /* @__PURE__ */ new Set(), groupRegistry.set(l, u)), u.add(e), u.size > 1 && echarts.connect(l);
80
+ function addToGroup(e, i) {
81
+ let a = groupRegistry.get(i);
82
+ a || (a = /* @__PURE__ */ new Set(), groupRegistry.set(i, a)), a.add(e), a.size > 1 && echarts.connect(i);
79
83
  }
80
- function removeFromGroup(e, l) {
81
- let u = groupRegistry.get(l);
82
- u && (u.delete(e), u.size === 0 ? (groupRegistry.delete(l), echarts.disconnect(l)) : u.size === 1 ? echarts.disconnect(l) : echarts.connect(l));
84
+ function removeFromGroup(e, i) {
85
+ let a = groupRegistry.get(i);
86
+ a && (a.delete(e), a.size === 0 ? (groupRegistry.delete(i), echarts.disconnect(i)) : a.size === 1 ? echarts.disconnect(i) : echarts.connect(i));
83
87
  }
84
- function updateGroup(e, l, u) {
85
- l && removeFromGroup(e, l), u && addToGroup(e, u);
88
+ function updateGroup(e, i, a) {
89
+ i && removeFromGroup(e, i), a && addToGroup(e, a);
86
90
  }
87
91
  function getGroupInstances(e) {
88
- let l = groupRegistry.get(e);
89
- return l ? Array.from(l) : [];
92
+ let i = groupRegistry.get(e);
93
+ return i ? Array.from(i) : [];
90
94
  }
91
95
  function getInstanceGroup(e) {
92
- for (let [l, u] of groupRegistry.entries()) if (u.has(e)) return l;
96
+ for (let [i, a] of groupRegistry.entries()) if (a.has(e)) return i;
93
97
  }
94
98
  function isInGroup(e) {
95
99
  return getInstanceGroup(e) !== void 0;
@@ -944,7 +948,7 @@ var themeRegistry = new Map([
944
948
  }]
945
949
  ]), customThemeCache = /* @__PURE__ */ new WeakMap(), customThemeCounter = 0;
946
950
  function registerBuiltinThemes() {
947
- for (let [e, l] of themeRegistry.entries()) echarts.registerTheme(e, l);
951
+ for (let [e, i] of themeRegistry.entries()) echarts.registerTheme(e, i);
948
952
  }
949
953
  function getBuiltinTheme(e) {
950
954
  return themeRegistry.get(e) || null;
@@ -952,14 +956,14 @@ function getBuiltinTheme(e) {
952
956
  function isBuiltinTheme(e) {
953
957
  return themeRegistry.has(e);
954
958
  }
955
- function registerCustomTheme(e, l) {
956
- echarts.registerTheme(e, l);
959
+ function registerCustomTheme(e, i) {
960
+ echarts.registerTheme(e, i);
957
961
  }
958
962
  function getOrRegisterCustomTheme(e) {
959
- let l = customThemeCache.get(e);
960
- if (l) return l;
961
- let u = `__custom_theme_${customThemeCounter++}`;
962
- return echarts.registerTheme(u, e), customThemeCache.set(e, u), u;
963
+ let i = customThemeCache.get(e);
964
+ if (i) return i;
965
+ let a = `__custom_theme_${customThemeCounter++}`;
966
+ return echarts.registerTheme(a, e), customThemeCache.set(e, a), a;
963
967
  }
964
968
  function getAvailableThemes() {
965
969
  return Array.from(themeRegistry.keys());
@@ -968,129 +972,151 @@ registerBuiltinThemes();
968
972
  function resolveThemeName(e) {
969
973
  return e == null ? null : typeof e == "string" && isBuiltinTheme(e) ? e : typeof e == "object" ? getOrRegisterCustomTheme(e) : null;
970
974
  }
971
- function bindEvents(e, l) {
972
- if (l) for (let [u, { handler: d, query: f, context: p }] of Object.entries(l)) f ? e.on(u, f, d, p) : e.on(u, d, p);
975
+ function bindEvents(e, i) {
976
+ if (i) for (let [a, { handler: o, query: s, context: c }] of Object.entries(i)) s ? e.on(a, s, o, c) : e.on(a, o, c);
973
977
  }
974
- function unbindEvents(e, l) {
975
- if (l) for (let [u, { handler: d }] of Object.entries(l)) e.off(u, d);
978
+ function unbindEvents(e, i) {
979
+ if (i) for (let [a, { handler: o }] of Object.entries(i)) e.off(a, o);
976
980
  }
977
- function useEcharts(d, p) {
978
- let m = (0, import_compiler_runtime.c)(53), { option: h, theme: g, renderer: _, lazyInit: v, group: y, setOptionOpts: b, showLoading: x, loadingOption: S, onEvents: C } = p, w = _ === void 0 ? "canvas" : _, T = v === void 0 ? !1 : v, E = x === void 0 ? !1 : x, D = useRef(void 0), O = useRef(void 0), k = useRef(C), A, j;
979
- m[0] === C ? (A = m[1], j = m[2]) : (A = () => {
980
- k.current = C;
981
- }, j = [C], m[0] = C, m[1] = A, m[2] = j), useEffect(A, j);
982
- let M = useLazyInit(d, T), N;
983
- m[3] === d ? N = m[4] : (N = () => {
984
- if (d.current) return getCachedInstance(d.current);
985
- }, m[3] = d, m[4] = N);
986
- let P = N, F;
987
- m[5] !== d || m[6] !== w || m[7] !== M || m[8] !== g ? (F = () => {
988
- let e = d.current;
989
- if (!e || !M) return;
990
- let l = getCachedInstance(e);
991
- if (!l) {
992
- let u = resolveThemeName(g);
993
- l = echarts.init(e, u, { renderer: w }), setCachedInstance(e, l), O.current = g;
981
+ function useEcharts(a, s) {
982
+ let l = (0, import_compiler_runtime.c)(68), { option: u, theme: d, renderer: f, lazyInit: h, group: g, setOptionOpts: _, showLoading: v, loadingOption: y, onEvents: b } = s, x = f === void 0 ? "canvas" : f, S = h === void 0 ? !1 : h, C = v === void 0 ? !1 : v, w = useRef(void 0), T = useRef(void 0), E = useRef(b), D = useRef(void 0), O, k;
983
+ l[0] === b ? (O = l[1], k = l[2]) : (O = () => {
984
+ E.current = b;
985
+ }, k = [b], l[0] = b, l[1] = O, l[2] = k), useEffect(O, k);
986
+ let A = useLazyInit(a, S), j;
987
+ l[3] === a ? j = l[4] : (j = () => {
988
+ if (a.current) return getCachedInstance(a.current);
989
+ }, l[3] = a, l[4] = j);
990
+ let M = j, N;
991
+ l[5] !== a || l[6] !== x || l[7] !== A || l[8] !== d ? (N = () => {
992
+ let e = a.current;
993
+ if (!e || !A) return;
994
+ let i = getCachedInstance(e);
995
+ if (!i) {
996
+ let a = resolveThemeName(d);
997
+ i = echarts.init(e, a, { renderer: x }), setCachedInstance(e, i), T.current = d;
994
998
  }
995
- return l;
996
- }, m[5] = d, m[6] = w, m[7] = M, m[8] = g, m[9] = F) : F = m[9];
997
- let I = F, L;
998
- m[10] !== P || m[11] !== I || m[12] !== b ? (L = (e, l) => {
999
+ return i;
1000
+ }, l[5] = a, l[6] = x, l[7] = A, l[8] = d, l[9] = N) : N = l[9];
1001
+ let P = N, F;
1002
+ l[10] !== M || l[11] !== P || l[12] !== _ ? (F = (e, i) => {
999
1003
  queueMicrotask(() => {
1000
- let u = P() || I();
1001
- if (u) {
1002
- let d = {
1003
- ...b,
1004
- ...l
1004
+ let a = M() || P();
1005
+ if (a) {
1006
+ let o = {
1007
+ ..._,
1008
+ ...i
1005
1009
  };
1006
- u.setOption(e, d);
1010
+ a.setOption(e, o);
1007
1011
  }
1008
1012
  });
1009
- }, m[10] = P, m[11] = I, m[12] = b, m[13] = L) : L = m[13];
1010
- let R = L, z;
1011
- m[14] === P ? z = m[15] : (z = () => {
1012
- P()?.resize();
1013
- }, m[14] = P, m[15] = z);
1014
- let B = z, V, H;
1015
- m[16] !== I || m[17] !== S || m[18] !== h || m[19] !== d || m[20] !== b || m[21] !== M || m[22] !== E ? (H = () => {
1016
- if (!M) return;
1017
- let e = d.current;
1013
+ }, l[10] = M, l[11] = P, l[12] = _, l[13] = F) : F = l[13];
1014
+ let I = F, L;
1015
+ l[14] === M ? L = l[15] : (L = () => {
1016
+ M()?.resize();
1017
+ }, l[14] = M, l[15] = L);
1018
+ let R = L, z, B;
1019
+ l[16] !== P || l[17] !== y || l[18] !== u || l[19] !== a || l[20] !== _ || l[21] !== A || l[22] !== C ? (B = () => {
1020
+ if (!A) return;
1021
+ let e = a.current;
1018
1022
  if (!e) return;
1019
- let l = I();
1020
- if (l) return l.setOption(h, b), E && l.showLoading(S), bindEvents(l, k.current), () => {
1021
- let l = getCachedInstance(e);
1022
- if (!l) return;
1023
- let u = D.current;
1024
- u && updateGroup(l, u, void 0), unbindEvents(l, k.current), releaseCachedInstance(e);
1023
+ let i = P();
1024
+ if (i) return i.setOption(u, _), C && i.showLoading(y), bindEvents(i, E.current), D.current = E.current, () => {
1025
+ let i = getCachedInstance(e);
1026
+ if (!i) return;
1027
+ let a = w.current;
1028
+ a && updateGroup(i, a, void 0), unbindEvents(i, D.current), D.current = void 0, releaseCachedInstance(e);
1025
1029
  };
1026
- }, V = [
1030
+ }, z = [
1031
+ A,
1032
+ P,
1033
+ u,
1034
+ _,
1035
+ C,
1036
+ y,
1037
+ a
1038
+ ], l[16] = P, l[17] = y, l[18] = u, l[19] = a, l[20] = _, l[21] = A, l[22] = C, l[23] = z, l[24] = B) : (z = l[23], B = l[24]), useLayoutEffect(B, z);
1039
+ let V, H;
1040
+ l[25] !== M || l[26] !== u || l[27] !== _ ? (V = () => {
1041
+ let e = M();
1042
+ e && e.setOption(u, _);
1043
+ }, H = [
1027
1044
  M,
1028
- I,
1029
- h,
1030
- b,
1031
- E,
1032
- S,
1033
- d
1034
- ], m[16] = I, m[17] = S, m[18] = h, m[19] = d, m[20] = b, m[21] = M, m[22] = E, m[23] = V, m[24] = H) : (V = m[23], H = m[24]), useLayoutEffect(H, V);
1045
+ u,
1046
+ _
1047
+ ], l[25] = M, l[26] = u, l[27] = _, l[28] = V, l[29] = H) : (V = l[28], H = l[29]), useEffect(V, H);
1035
1048
  let U, W;
1036
- m[25] !== P || m[26] !== h || m[27] !== b ? (U = () => {
1037
- let e = P();
1038
- e && e.setOption(h, b);
1049
+ l[30] !== y || l[31] !== u || l[32] !== a || l[33] !== x || l[34] !== _ || l[35] !== C || l[36] !== d ? (U = () => {
1050
+ let e = a.current;
1051
+ if (!e) return;
1052
+ let i = getCachedInstance(e);
1053
+ if (!i || T.current === d) return;
1054
+ let o = w.current;
1055
+ o && updateGroup(i, o, void 0);
1056
+ let s = resolveThemeName(d), l = echarts.init(e, s, { renderer: x });
1057
+ replaceCachedInstance(e, l), T.current = d, l.setOption(u, _), bindEvents(l, E.current), D.current = E.current, o && updateGroup(l, void 0, o), C ? l.showLoading(y) : l.hideLoading();
1039
1058
  }, W = [
1040
- P,
1041
- h,
1042
- b
1043
- ], m[25] = P, m[26] = h, m[27] = b, m[28] = U, m[29] = W) : (U = m[28], W = m[29]), useEffect(U, W);
1044
- let G, K;
1045
- m[30] !== h || m[31] !== d || m[32] !== w || m[33] !== b || m[34] !== g ? (G = () => {
1046
- let e = d.current;
1047
- if (!e || !getCachedInstance(e) || O.current === g) return;
1048
- let l = resolveThemeName(g), u = echarts.init(e, l, { renderer: w });
1049
- replaceCachedInstance(e, u), O.current = g, u.setOption(h, b), bindEvents(u, k.current);
1050
- }, K = [
1059
+ a,
1051
1060
  d,
1052
- g,
1053
- w,
1054
- h,
1055
- b
1056
- ], m[30] = h, m[31] = d, m[32] = w, m[33] = b, m[34] = g, m[35] = G, m[36] = K) : (G = m[35], K = m[36]), useEffect(G, K);
1061
+ x,
1062
+ u,
1063
+ _,
1064
+ C,
1065
+ y
1066
+ ], l[30] = y, l[31] = u, l[32] = a, l[33] = x, l[34] = _, l[35] = C, l[36] = d, l[37] = U, l[38] = W) : (U = l[37], W = l[38]), useEffect(U, W);
1067
+ let G;
1068
+ l[39] !== M || l[40] !== y || l[41] !== C ? (G = () => {
1069
+ let e = M();
1070
+ e && (C ? e.showLoading(y) : e.hideLoading());
1071
+ }, l[39] = M, l[40] = y, l[41] = C, l[42] = G) : G = l[42];
1072
+ let K;
1073
+ l[43] !== M || l[44] !== y || l[45] !== C || l[46] !== d ? (K = [
1074
+ M,
1075
+ C,
1076
+ y,
1077
+ d
1078
+ ], l[43] = M, l[44] = y, l[45] = C, l[46] = d, l[47] = K) : K = l[47], useEffect(G, K);
1057
1079
  let q, J;
1058
- m[37] !== P || m[38] !== S || m[39] !== E ? (q = () => {
1059
- let e = P();
1060
- e && (E ? e.showLoading(S) : e.hideLoading());
1061
- }, J = [
1062
- P,
1063
- E,
1064
- S
1065
- ], m[37] = P, m[38] = S, m[39] = E, m[40] = q, m[41] = J) : (q = m[40], J = m[41]), useEffect(q, J);
1066
- let Y, X;
1067
- m[42] !== P || m[43] !== y ? (Y = () => {
1068
- let e = P();
1069
- e && (updateGroup(e, D.current, y), D.current = y);
1070
- }, X = [P, y], m[42] = P, m[43] = y, m[44] = Y, m[45] = X) : (Y = m[44], X = m[45]), useEffect(Y, X);
1080
+ l[48] !== M || l[49] !== b ? (q = () => {
1081
+ let e = M();
1082
+ e && D.current !== b && (unbindEvents(e, D.current), bindEvents(e, b), D.current = b);
1083
+ }, J = [M, b], l[48] = M, l[49] = b, l[50] = q, l[51] = J) : (q = l[50], J = l[51]), useEffect(q, J);
1084
+ let Y;
1085
+ l[52] !== M || l[53] !== g || l[54] !== A ? (Y = () => {
1086
+ if (!A) return;
1087
+ let e = M();
1088
+ e && (updateGroup(e, w.current, g), w.current = g);
1089
+ }, l[52] = M, l[53] = g, l[54] = A, l[55] = Y) : Y = l[55];
1090
+ let X;
1091
+ l[56] !== M || l[57] !== g || l[58] !== A || l[59] !== d ? (X = [
1092
+ M,
1093
+ g,
1094
+ A,
1095
+ d
1096
+ ], l[56] = M, l[57] = g, l[58] = A, l[59] = d, l[60] = X) : X = l[60], useEffect(Y, X);
1071
1097
  let Z, Q;
1072
- m[46] === d ? (Z = m[47], Q = m[48]) : (Z = () => {
1073
- let e = d.current;
1098
+ l[61] === a ? (Z = l[62], Q = l[63]) : (Z = () => {
1099
+ let e = a.current;
1074
1100
  if (!e) return;
1075
- let l;
1101
+ let i;
1076
1102
  try {
1077
- l = new ResizeObserver(() => {
1103
+ i = new ResizeObserver(() => {
1078
1104
  getCachedInstance(e)?.resize();
1079
- }), l.observe(e);
1105
+ }), i.observe(e);
1080
1106
  } catch (e) {
1081
- let l = e;
1082
- console.warn("ResizeObserver not available:", l);
1107
+ let i = e;
1108
+ console.warn("ResizeObserver not available:", i);
1083
1109
  }
1084
1110
  return () => {
1085
- l?.disconnect();
1111
+ i?.disconnect();
1086
1112
  };
1087
- }, Q = [d], m[46] = d, m[47] = Z, m[48] = Q), useEffect(Z, Q);
1113
+ }, Q = [a], l[61] = a, l[62] = Z, l[63] = Q), useEffect(Z, Q);
1088
1114
  let $;
1089
- return m[49] !== P || m[50] !== B || m[51] !== R ? ($ = {
1090
- setOption: R,
1091
- getInstance: P,
1092
- resize: B
1093
- }, m[49] = P, m[50] = B, m[51] = R, m[52] = $) : $ = m[52], $;
1115
+ return l[64] !== M || l[65] !== R || l[66] !== I ? ($ = {
1116
+ setOption: I,
1117
+ getInstance: M,
1118
+ resize: R
1119
+ }, l[64] = M, l[65] = R, l[66] = I, l[67] = $) : $ = l[67], $;
1094
1120
  }
1095
1121
  var use_echarts_default = useEcharts;
1096
1122
  export { addToGroup, clearGroups, clearInstanceCache, getAvailableThemes, getBuiltinTheme, getCachedInstance, getGroupInstances, getInstanceGroup, getReferenceCount, isBuiltinTheme, isInGroup, registerBuiltinThemes, registerCustomTheme, releaseCachedInstance, removeFromGroup, replaceCachedInstance, setCachedInstance, updateGroup, use_echarts_default as useEcharts, useLazyInit };
package/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react`),require(`echarts`)):typeof define==`function`&&define.amd?define([`exports`,`react`,`echarts`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`react-use-echarts`]={},e.React,e.echarts))})(this,function(e,t,n){var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)))(n);var d=l((e=>{var t=require(`react`).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),f=l((e=>{process.env.NODE_ENV!==`production`&&(function(){var t=require(`react`).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){var n=t.H;return n===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react`),require(`echarts`)):typeof define==`function`&&define.amd?define([`exports`,`react`,`echarts`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`react-use-echarts`]={},e.React,e.echarts))})(this,function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)))(n);var d=l((e=>{var t=require(`react`).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),f=l((e=>{process.env.NODE_ENV!==`production`&&(function(){var t=require(`react`).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){var n=t.H;return n===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
2
2
  1. You might have mismatching versions of React and the renderer (such as React DOM)
3
3
  2. You might be breaking the Rules of Hooks
4
4
  3. You might have more than one copy of React in the same app
5
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),n.useMemoCache(e)}})()})),p=l(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=d():t.exports=f()}))();function m(e,n=!1){let r=n!==!1,[i,a]=(0,t.useState)(!r),o=(0,t.useRef)(n);return o.current=n,(0,t.useEffect)(()=>{if(!r||i)return;let t=e.current;if(!t)return;let n=o.current,s={root:null,rootMargin:`50px`,threshold:.1,...typeof n==`object`?n:{}},c=new IntersectionObserver(e=>{let[t]=e;t.isIntersecting&&(a(!0),c.disconnect())},s);return c.observe(t),()=>{c.disconnect()}},[e,r,i]),i}var h=new WeakMap,g=new Set;function _(e){return h.get(e)?.instance}function v(e,t){let n=h.get(e);return n?(n.refCount+=1,n.instance):(h.set(e,{instance:t,refCount:1}),g.add(e),t)}function y(e,t){let n=h.get(e);return n?(n.instance.dispose(),n.instance=t,t):(h.set(e,{instance:t,refCount:1}),g.add(e),t)}function b(e){let t=h.get(e);t&&(--t.refCount,t.refCount<=0&&(t.instance.dispose(),h.delete(e),g.delete(e)))}function x(e){return h.get(e)?.refCount??0}function S(){for(let e of g)h.get(e)?.instance.dispose();h=new WeakMap,g.clear()}var C=new Map;function w(e,t){let r=C.get(t);r||(r=new Set,C.set(t,r)),r.add(e),r.size>1&&n.connect(t)}function T(e,t){let r=C.get(t);r&&(r.delete(e),r.size===0?(C.delete(t),n.disconnect(t)):r.size===1?n.disconnect(t):n.connect(t))}function E(e,t,n){t&&T(e,t),n&&w(e,n)}function D(e){let t=C.get(e);return t?Array.from(t):[]}function O(e){for(let[t,n]of C.entries())if(n.has(e))return t}function k(e){return O(e)!==void 0}function A(){for(let e of C.keys())n.disconnect(e);C.clear()}var j=new Map([[`light`,{color:[`#5470c6`,`#91cc75`,`#fac858`,`#ee6666`,`#73c0de`,`#3ba272`,`#fc8452`,`#9a60b4`,`#ea7ccc`],backgroundColor:`rgba(0,0,0,0)`,textStyle:{},title:{textStyle:{color:`#464646`}},line:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:`emptyCircle`,smooth:!1},radar:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:`emptyCircle`,smooth:!1},bar:{itemStyle:{barBorderWidth:0,barBorderColor:`#ccc`}},pie:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},scatter:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},boxplot:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},parallel:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},sankey:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},funnel:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},gauge:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},candlestick:{itemStyle:{color:`#eb5454`,color0:`#47b262`,borderColor:`#eb5454`,borderColor0:`#47b262`,borderWidth:1}},graph:{itemStyle:{borderWidth:0,borderColor:`#ccc`},lineStyle:{width:1,color:`#aaa`},symbolSize:4,symbol:`emptyCircle`,smooth:!1,color:[`#5470c6`,`#91cc75`,`#fac858`,`#ee6666`,`#73c0de`,`#3ba272`,`#fc8452`,`#9a60b4`,`#ea7ccc`],label:{color:`#eee`}},map:{itemStyle:{areaColor:`#eee`,borderColor:`#444`,borderWidth:.5},label:{color:`#000`},emphasis:{itemStyle:{areaColor:`rgba(255,215,0,0.8)`,borderColor:`#444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},geo:{itemStyle:{areaColor:`#eee`,borderColor:`#444`,borderWidth:.5},label:{color:`#000`},emphasis:{itemStyle:{areaColor:`rgba(255,215,0,0.8)`,borderColor:`#444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:`#333`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!1,lineStyle:{color:[`#ccc`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},valueAxis:{axisLine:{show:!0,lineStyle:{color:`#333`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#ccc`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},logAxis:{axisLine:{show:!0,lineStyle:{color:`#333`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#ccc`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:`#333`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#ccc`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},toolbox:{iconStyle:{borderColor:`#999`},emphasis:{iconStyle:{borderColor:`#666`}}},legend:{textStyle:{color:`#333`}},tooltip:{axisPointer:{lineStyle:{color:`#ccc`,width:1},crossStyle:{color:`#ccc`,width:1}}},timeline:{lineStyle:{color:`#293c55`,width:1},itemStyle:{color:`#293c55`,borderWidth:1},controlStyle:{color:`#293c55`,borderColor:`#293c55`,borderWidth:.5},checkpointStyle:{color:`#e43c59`,borderColor:`#c23531`},label:{color:`#293c55`},emphasis:{itemStyle:{color:`#a9334c`},controlStyle:{color:`#293c55`,borderColor:`#293c55`,borderWidth:.5},label:{color:`#293c55`}}},visualMap:{color:[`#bf444c`,`#d88273`,`#f6efa6`]},dataZoom:{backgroundColor:`rgba(47,69,84,0)`,dataBackgroundColor:`rgba(255,255,255,0.3)`,fillerColor:`rgba(167,183,204,0.4)`,handleColor:`#a7b7cc`,handleSize:`100%`,textStyle:{color:`#333`}},markPoint:{label:{color:`#eee`},emphasis:{label:{color:`#eee`}}}}],[`dark`,{color:[`#4992ff`,`#7cffb2`,`#fddd60`,`#ff6e76`,`#58d9f9`,`#05c091`,`#ff8a45`,`#8d4eda`,`#dd79ff`],backgroundColor:`rgba(0,0,0,0)`,textStyle:{},title:{textStyle:{color:`#cccccc`}},line:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:`emptyCircle`,smooth:!1},radar:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:`emptyCircle`,smooth:!1},bar:{itemStyle:{barBorderWidth:0,barBorderColor:`#cccccc`}},pie:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},scatter:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},boxplot:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},parallel:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},sankey:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},funnel:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},gauge:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},candlestick:{itemStyle:{color:`#eb5454`,color0:`#47b262`,borderColor:`#eb5454`,borderColor0:`#47b262`,borderWidth:1}},graph:{itemStyle:{borderWidth:0,borderColor:`#cccccc`},lineStyle:{width:1,color:`#aaaaaa`},symbolSize:4,symbol:`emptyCircle`,smooth:!1,color:[`#4992ff`,`#7cffb2`,`#fddd60`,`#ff6e76`,`#58d9f9`,`#05c091`,`#ff8a45`,`#8d4eda`,`#dd79ff`],label:{color:`#cccccc`}},map:{itemStyle:{areaColor:`#2a2a2a`,borderColor:`#444444`,borderWidth:.5},label:{color:`#cccccc`},emphasis:{itemStyle:{areaColor:`rgba(255,215,0,0.8)`,borderColor:`#444444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},geo:{itemStyle:{areaColor:`#2a2a2a`,borderColor:`#444444`,borderWidth:.5},label:{color:`#cccccc`},emphasis:{itemStyle:{areaColor:`rgba(255,215,0,0.8)`,borderColor:`#444444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:`#cccccc`}},axisTick:{show:!0,lineStyle:{color:`#cccccc`}},axisLabel:{show:!0,color:`#cccccc`},splitLine:{show:!1,lineStyle:{color:[`#444444`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(255,255,255,0.05)`,`rgba(255,255,255,0.1)`]}}},valueAxis:{axisLine:{show:!0,lineStyle:{color:`#cccccc`}},axisTick:{show:!0,lineStyle:{color:`#cccccc`}},axisLabel:{show:!0,color:`#cccccc`},splitLine:{show:!0,lineStyle:{color:[`#444444`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(255,255,255,0.05)`,`rgba(255,255,255,0.1)`]}}},logAxis:{axisLine:{show:!0,lineStyle:{color:`#cccccc`}},axisTick:{show:!0,lineStyle:{color:`#cccccc`}},axisLabel:{show:!0,color:`#cccccc`},splitLine:{show:!0,lineStyle:{color:[`#444444`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(255,255,255,0.05)`,`rgba(255,255,255,0.1)`]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:`#cccccc`}},axisTick:{show:!0,lineStyle:{color:`#cccccc`}},axisLabel:{show:!0,color:`#cccccc`},splitLine:{show:!0,lineStyle:{color:[`#444444`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(255,255,255,0.05)`,`rgba(255,255,255,0.1)`]}}},toolbox:{iconStyle:{borderColor:`#cccccc`},emphasis:{iconStyle:{borderColor:`#ffffff`}}},legend:{textStyle:{color:`#cccccc`}},tooltip:{axisPointer:{lineStyle:{color:`#cccccc`,width:1},crossStyle:{color:`#cccccc`,width:1}}},timeline:{lineStyle:{color:`#cccccc`,width:1},itemStyle:{color:`#cccccc`,borderWidth:1},controlStyle:{color:`#cccccc`,borderColor:`#cccccc`,borderWidth:.5},checkpointStyle:{color:`#e43c59`,borderColor:`#c23531`},label:{color:`#cccccc`},emphasis:{itemStyle:{color:`#a9334c`},controlStyle:{color:`#cccccc`,borderColor:`#cccccc`,borderWidth:.5},label:{color:`#cccccc`}}},visualMap:{color:[`#ff6e76`,`#fddd60`,`#7cffb2`]},dataZoom:{backgroundColor:`rgba(47,69,84,0)`,dataBackgroundColor:`rgba(255,255,255,0.3)`,fillerColor:`rgba(167,183,204,0.4)`,handleColor:`#a7b7cc`,handleSize:`100%`,textStyle:{color:`#cccccc`}},markPoint:{label:{color:`#cccccc`},emphasis:{label:{color:`#cccccc`}}}}],[`macarons`,{color:[`#2ec7c9`,`#b6a2de`,`#5ab1ef`,`#ffb980`,`#d87a80`,`#8d98b3`,`#e5cf0d`,`#97b552`,`#95706d`,`#dc69aa`,`#07a2a4`,`#9a7fd1`,`#588dd5`,`#f5994e`,`#c05050`,`#59678c`,`#c9ab00`,`#7eb00a`,`#6f5553`,`#c14089`],backgroundColor:`rgba(0,0,0,0)`,textStyle:{},title:{textStyle:{color:`#008acd`}},line:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:3,symbol:`emptyCircle`,smooth:!0},radar:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:3,symbol:`emptyCircle`,smooth:!0},bar:{itemStyle:{barBorderWidth:0,barBorderColor:`#ccc`}},pie:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},scatter:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},boxplot:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},parallel:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},sankey:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},funnel:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},gauge:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},candlestick:{itemStyle:{color:`#d87a80`,color0:`#2ec7c9`,borderColor:`#d87a80`,borderColor0:`#2ec7c9`,borderWidth:1}},graph:{itemStyle:{borderWidth:0,borderColor:`#ccc`},lineStyle:{width:1,color:`#aaa`},symbolSize:3,symbol:`emptyCircle`,smooth:!0,color:[`#2ec7c9`,`#b6a2de`,`#5ab1ef`,`#ffb980`,`#d87a80`,`#8d98b3`,`#e5cf0d`,`#97b552`,`#95706d`,`#dc69aa`,`#07a2a4`,`#9a7fd1`,`#588dd5`,`#f5994e`,`#c05050`,`#59678c`,`#c9ab00`,`#7eb00a`,`#6f5553`,`#c14089`],label:{color:`#eee`}},map:{itemStyle:{areaColor:`#dddddd`,borderColor:`#eeeeee`,borderWidth:.5},label:{color:`#d87a80`},emphasis:{itemStyle:{areaColor:`rgba(254,153,78,1)`,borderColor:`#444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},geo:{itemStyle:{areaColor:`#dddddd`,borderColor:`#eeeeee`,borderWidth:.5},label:{color:`#d87a80`},emphasis:{itemStyle:{areaColor:`rgba(254,153,78,1)`,borderColor:`#444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:`#008acd`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!1,lineStyle:{color:[`#eee`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},valueAxis:{axisLine:{show:!0,lineStyle:{color:`#008acd`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#eee`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},logAxis:{axisLine:{show:!0,lineStyle:{color:`#008acd`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#eee`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:`#008acd`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#eee`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},toolbox:{iconStyle:{borderColor:`#2ec7c9`},emphasis:{iconStyle:{borderColor:`#18a4a6`}}},legend:{textStyle:{color:`#333333`}},tooltip:{axisPointer:{lineStyle:{color:`#008acd`,width:`1`},crossStyle:{color:`#008acd`,width:`1`}}},timeline:{lineStyle:{color:`#008acd`,width:1},itemStyle:{color:`#008acd`,borderWidth:1},controlStyle:{color:`#008acd`,borderColor:`#008acd`,borderWidth:.5},checkpointStyle:{color:`#2ec7c9`,borderColor:`#2ec7c9`},label:{color:`#008acd`},emphasis:{itemStyle:{color:`#a9334c`},controlStyle:{color:`#008acd`,borderColor:`#008acd`,borderWidth:.5},label:{color:`#008acd`}}},visualMap:{color:[`#5ab1ef`,`#e0ffff`]},dataZoom:{backgroundColor:`rgba(47,69,84,0)`,dataBackgroundColor:`rgba(239,239,255,0.3)`,fillerColor:`rgba(182,162,222,0.2)`,handleColor:`#008acd`,handleSize:`100%`,textStyle:{color:`#333333`}},markPoint:{label:{color:`#eeeeee`},emphasis:{label:{color:`#eeeeee`}}}}]]),M=new WeakMap,N=0;function P(){for(let[e,t]of j.entries())n.registerTheme(e,t)}function F(e){return j.get(e)||null}function I(e){return j.has(e)}function L(e,t){n.registerTheme(e,t)}function R(e){let t=M.get(e);if(t)return t;let r=`__custom_theme_${N++}`;return n.registerTheme(r,e),M.set(e,r),r}function z(){return Array.from(j.keys())}P();function B(e){return e==null?null:typeof e==`string`&&I(e)?e:typeof e==`object`?R(e):null}function V(e,t){if(t)for(let[n,{handler:r,query:i,context:a}]of Object.entries(t))i?e.on(n,i,r,a):e.on(n,r,a)}function H(e,t){if(t)for(let[n,{handler:r}]of Object.entries(t))e.off(n,r)}function U(e,r){let i=(0,p.c)(53),{option:a,theme:o,renderer:s,lazyInit:c,group:l,setOptionOpts:u,showLoading:d,loadingOption:f,onEvents:h}=r,g=s===void 0?`canvas`:s,x=c===void 0?!1:c,S=d===void 0?!1:d,C=(0,t.useRef)(void 0),w=(0,t.useRef)(void 0),T=(0,t.useRef)(h),D,O;i[0]===h?(D=i[1],O=i[2]):(D=()=>{T.current=h},O=[h],i[0]=h,i[1]=D,i[2]=O),(0,t.useEffect)(D,O);let k=m(e,x),A;i[3]===e?A=i[4]:(A=()=>{if(e.current)return _(e.current)},i[3]=e,i[4]=A);let j=A,M;i[5]!==e||i[6]!==g||i[7]!==k||i[8]!==o?(M=()=>{let t=e.current;if(!t||!k)return;let r=_(t);if(!r){let e=B(o);r=n.init(t,e,{renderer:g}),v(t,r),w.current=o}return r},i[5]=e,i[6]=g,i[7]=k,i[8]=o,i[9]=M):M=i[9];let N=M,P;i[10]!==j||i[11]!==N||i[12]!==u?(P=(e,t)=>{queueMicrotask(()=>{let n=j()||N();if(n){let r={...u,...t};n.setOption(e,r)}})},i[10]=j,i[11]=N,i[12]=u,i[13]=P):P=i[13];let F=P,I;i[14]===j?I=i[15]:(I=()=>{j()?.resize()},i[14]=j,i[15]=I);let L=I,R,z;i[16]!==N||i[17]!==f||i[18]!==a||i[19]!==e||i[20]!==u||i[21]!==k||i[22]!==S?(z=()=>{if(!k)return;let t=e.current;if(!t)return;let n=N();if(n)return n.setOption(a,u),S&&n.showLoading(f),V(n,T.current),()=>{let e=_(t);if(!e)return;let n=C.current;n&&E(e,n,void 0),H(e,T.current),b(t)}},R=[k,N,a,u,S,f,e],i[16]=N,i[17]=f,i[18]=a,i[19]=e,i[20]=u,i[21]=k,i[22]=S,i[23]=R,i[24]=z):(R=i[23],z=i[24]),(0,t.useLayoutEffect)(z,R);let U,W;i[25]!==j||i[26]!==a||i[27]!==u?(U=()=>{let e=j();e&&e.setOption(a,u)},W=[j,a,u],i[25]=j,i[26]=a,i[27]=u,i[28]=U,i[29]=W):(U=i[28],W=i[29]),(0,t.useEffect)(U,W);let G,K;i[30]!==a||i[31]!==e||i[32]!==g||i[33]!==u||i[34]!==o?(G=()=>{let t=e.current;if(!t||!_(t)||w.current===o)return;let r=B(o),i=n.init(t,r,{renderer:g});y(t,i),w.current=o,i.setOption(a,u),V(i,T.current)},K=[e,o,g,a,u],i[30]=a,i[31]=e,i[32]=g,i[33]=u,i[34]=o,i[35]=G,i[36]=K):(G=i[35],K=i[36]),(0,t.useEffect)(G,K);let q,J;i[37]!==j||i[38]!==f||i[39]!==S?(q=()=>{let e=j();e&&(S?e.showLoading(f):e.hideLoading())},J=[j,S,f],i[37]=j,i[38]=f,i[39]=S,i[40]=q,i[41]=J):(q=i[40],J=i[41]),(0,t.useEffect)(q,J);let Y,X;i[42]!==j||i[43]!==l?(Y=()=>{let e=j();e&&(E(e,C.current,l),C.current=l)},X=[j,l],i[42]=j,i[43]=l,i[44]=Y,i[45]=X):(Y=i[44],X=i[45]),(0,t.useEffect)(Y,X);let Z,Q;i[46]===e?(Z=i[47],Q=i[48]):(Z=()=>{let t=e.current;if(!t)return;let n;try{n=new ResizeObserver(()=>{_(t)?.resize()}),n.observe(t)}catch(e){let t=e;console.warn(`ResizeObserver not available:`,t)}return()=>{n?.disconnect()}},Q=[e],i[46]=e,i[47]=Z,i[48]=Q),(0,t.useEffect)(Z,Q);let $;return i[49]!==j||i[50]!==L||i[51]!==F?($={setOption:F,getInstance:j,resize:L},i[49]=j,i[50]=L,i[51]=F,i[52]=$):$=i[52],$}var W=U;e.addToGroup=w,e.clearGroups=A,e.clearInstanceCache=S,e.getAvailableThemes=z,e.getBuiltinTheme=F,e.getCachedInstance=_,e.getGroupInstances=D,e.getInstanceGroup=O,e.getReferenceCount=x,e.isBuiltinTheme=I,e.isInGroup=k,e.registerBuiltinThemes=P,e.registerCustomTheme=L,e.releaseCachedInstance=b,e.removeFromGroup=T,e.replaceCachedInstance=y,e.setCachedInstance=v,e.updateGroup=E,e.useEcharts=W,e.useLazyInit=m});
5
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),n.useMemoCache(e)}})()})),ee=l(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=d():t.exports=f()}))();function te(e,n=!1){let r=n!==!1,[i,a]=(0,t.useState)(!r),o=typeof n==`object`,s=o?n.root:null,c=o?n.rootMargin:void 0,l=o?n.threshold:void 0,u=(0,t.useMemo)(()=>({root:s??null,rootMargin:c??`50px`,threshold:l??.1}),[s,c,l===void 0?void 0:JSON.stringify(l)]);return(0,t.useEffect)(()=>{if(!r||i)return;let t=e.current;if(!t)return;let n=new IntersectionObserver(e=>{let[t]=e;t.isIntersecting&&(a(!0),n.disconnect())},u);return n.observe(t),()=>{n.disconnect()}},[e,r,i,u]),i}var p=new WeakMap,m=new Set;function h(e){return p.get(e)?.instance}function ne(e,t){let n=p.get(e);return n?(n.refCount+=1,n.instance):(p.set(e,{instance:t,refCount:1}),m.add(e),t)}function g(e,t){let n=p.get(e);return n?(n.instance.dispose(),n.instance=t,t):(p.set(e,{instance:t,refCount:1}),m.add(e),t)}function _(e){let t=p.get(e);t&&(--t.refCount,t.refCount<=0&&(t.instance.dispose(),p.delete(e),m.delete(e)))}function v(e){return p.get(e)?.refCount??0}function y(){for(let e of m)p.get(e)?.instance.dispose();p=new WeakMap,m.clear()}var b=new Map;function x(e,t){let r=b.get(t);r||(r=new Set,b.set(t,r)),r.add(e),r.size>1&&n.connect(t)}function S(e,t){let r=b.get(t);r&&(r.delete(e),r.size===0?(b.delete(t),n.disconnect(t)):r.size===1?n.disconnect(t):n.connect(t))}function C(e,t,n){t&&S(e,t),n&&x(e,n)}function w(e){let t=b.get(e);return t?Array.from(t):[]}function T(e){for(let[t,n]of b.entries())if(n.has(e))return t}function E(e){return T(e)!==void 0}function D(){for(let e of b.keys())n.disconnect(e);b.clear()}var O=new Map([[`light`,{color:[`#5470c6`,`#91cc75`,`#fac858`,`#ee6666`,`#73c0de`,`#3ba272`,`#fc8452`,`#9a60b4`,`#ea7ccc`],backgroundColor:`rgba(0,0,0,0)`,textStyle:{},title:{textStyle:{color:`#464646`}},line:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:`emptyCircle`,smooth:!1},radar:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:`emptyCircle`,smooth:!1},bar:{itemStyle:{barBorderWidth:0,barBorderColor:`#ccc`}},pie:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},scatter:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},boxplot:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},parallel:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},sankey:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},funnel:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},gauge:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},candlestick:{itemStyle:{color:`#eb5454`,color0:`#47b262`,borderColor:`#eb5454`,borderColor0:`#47b262`,borderWidth:1}},graph:{itemStyle:{borderWidth:0,borderColor:`#ccc`},lineStyle:{width:1,color:`#aaa`},symbolSize:4,symbol:`emptyCircle`,smooth:!1,color:[`#5470c6`,`#91cc75`,`#fac858`,`#ee6666`,`#73c0de`,`#3ba272`,`#fc8452`,`#9a60b4`,`#ea7ccc`],label:{color:`#eee`}},map:{itemStyle:{areaColor:`#eee`,borderColor:`#444`,borderWidth:.5},label:{color:`#000`},emphasis:{itemStyle:{areaColor:`rgba(255,215,0,0.8)`,borderColor:`#444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},geo:{itemStyle:{areaColor:`#eee`,borderColor:`#444`,borderWidth:.5},label:{color:`#000`},emphasis:{itemStyle:{areaColor:`rgba(255,215,0,0.8)`,borderColor:`#444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:`#333`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!1,lineStyle:{color:[`#ccc`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},valueAxis:{axisLine:{show:!0,lineStyle:{color:`#333`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#ccc`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},logAxis:{axisLine:{show:!0,lineStyle:{color:`#333`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#ccc`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:`#333`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#ccc`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},toolbox:{iconStyle:{borderColor:`#999`},emphasis:{iconStyle:{borderColor:`#666`}}},legend:{textStyle:{color:`#333`}},tooltip:{axisPointer:{lineStyle:{color:`#ccc`,width:1},crossStyle:{color:`#ccc`,width:1}}},timeline:{lineStyle:{color:`#293c55`,width:1},itemStyle:{color:`#293c55`,borderWidth:1},controlStyle:{color:`#293c55`,borderColor:`#293c55`,borderWidth:.5},checkpointStyle:{color:`#e43c59`,borderColor:`#c23531`},label:{color:`#293c55`},emphasis:{itemStyle:{color:`#a9334c`},controlStyle:{color:`#293c55`,borderColor:`#293c55`,borderWidth:.5},label:{color:`#293c55`}}},visualMap:{color:[`#bf444c`,`#d88273`,`#f6efa6`]},dataZoom:{backgroundColor:`rgba(47,69,84,0)`,dataBackgroundColor:`rgba(255,255,255,0.3)`,fillerColor:`rgba(167,183,204,0.4)`,handleColor:`#a7b7cc`,handleSize:`100%`,textStyle:{color:`#333`}},markPoint:{label:{color:`#eee`},emphasis:{label:{color:`#eee`}}}}],[`dark`,{color:[`#4992ff`,`#7cffb2`,`#fddd60`,`#ff6e76`,`#58d9f9`,`#05c091`,`#ff8a45`,`#8d4eda`,`#dd79ff`],backgroundColor:`rgba(0,0,0,0)`,textStyle:{},title:{textStyle:{color:`#cccccc`}},line:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:`emptyCircle`,smooth:!1},radar:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:`emptyCircle`,smooth:!1},bar:{itemStyle:{barBorderWidth:0,barBorderColor:`#cccccc`}},pie:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},scatter:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},boxplot:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},parallel:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},sankey:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},funnel:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},gauge:{itemStyle:{borderWidth:0,borderColor:`#cccccc`}},candlestick:{itemStyle:{color:`#eb5454`,color0:`#47b262`,borderColor:`#eb5454`,borderColor0:`#47b262`,borderWidth:1}},graph:{itemStyle:{borderWidth:0,borderColor:`#cccccc`},lineStyle:{width:1,color:`#aaaaaa`},symbolSize:4,symbol:`emptyCircle`,smooth:!1,color:[`#4992ff`,`#7cffb2`,`#fddd60`,`#ff6e76`,`#58d9f9`,`#05c091`,`#ff8a45`,`#8d4eda`,`#dd79ff`],label:{color:`#cccccc`}},map:{itemStyle:{areaColor:`#2a2a2a`,borderColor:`#444444`,borderWidth:.5},label:{color:`#cccccc`},emphasis:{itemStyle:{areaColor:`rgba(255,215,0,0.8)`,borderColor:`#444444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},geo:{itemStyle:{areaColor:`#2a2a2a`,borderColor:`#444444`,borderWidth:.5},label:{color:`#cccccc`},emphasis:{itemStyle:{areaColor:`rgba(255,215,0,0.8)`,borderColor:`#444444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:`#cccccc`}},axisTick:{show:!0,lineStyle:{color:`#cccccc`}},axisLabel:{show:!0,color:`#cccccc`},splitLine:{show:!1,lineStyle:{color:[`#444444`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(255,255,255,0.05)`,`rgba(255,255,255,0.1)`]}}},valueAxis:{axisLine:{show:!0,lineStyle:{color:`#cccccc`}},axisTick:{show:!0,lineStyle:{color:`#cccccc`}},axisLabel:{show:!0,color:`#cccccc`},splitLine:{show:!0,lineStyle:{color:[`#444444`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(255,255,255,0.05)`,`rgba(255,255,255,0.1)`]}}},logAxis:{axisLine:{show:!0,lineStyle:{color:`#cccccc`}},axisTick:{show:!0,lineStyle:{color:`#cccccc`}},axisLabel:{show:!0,color:`#cccccc`},splitLine:{show:!0,lineStyle:{color:[`#444444`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(255,255,255,0.05)`,`rgba(255,255,255,0.1)`]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:`#cccccc`}},axisTick:{show:!0,lineStyle:{color:`#cccccc`}},axisLabel:{show:!0,color:`#cccccc`},splitLine:{show:!0,lineStyle:{color:[`#444444`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(255,255,255,0.05)`,`rgba(255,255,255,0.1)`]}}},toolbox:{iconStyle:{borderColor:`#cccccc`},emphasis:{iconStyle:{borderColor:`#ffffff`}}},legend:{textStyle:{color:`#cccccc`}},tooltip:{axisPointer:{lineStyle:{color:`#cccccc`,width:1},crossStyle:{color:`#cccccc`,width:1}}},timeline:{lineStyle:{color:`#cccccc`,width:1},itemStyle:{color:`#cccccc`,borderWidth:1},controlStyle:{color:`#cccccc`,borderColor:`#cccccc`,borderWidth:.5},checkpointStyle:{color:`#e43c59`,borderColor:`#c23531`},label:{color:`#cccccc`},emphasis:{itemStyle:{color:`#a9334c`},controlStyle:{color:`#cccccc`,borderColor:`#cccccc`,borderWidth:.5},label:{color:`#cccccc`}}},visualMap:{color:[`#ff6e76`,`#fddd60`,`#7cffb2`]},dataZoom:{backgroundColor:`rgba(47,69,84,0)`,dataBackgroundColor:`rgba(255,255,255,0.3)`,fillerColor:`rgba(167,183,204,0.4)`,handleColor:`#a7b7cc`,handleSize:`100%`,textStyle:{color:`#cccccc`}},markPoint:{label:{color:`#cccccc`},emphasis:{label:{color:`#cccccc`}}}}],[`macarons`,{color:[`#2ec7c9`,`#b6a2de`,`#5ab1ef`,`#ffb980`,`#d87a80`,`#8d98b3`,`#e5cf0d`,`#97b552`,`#95706d`,`#dc69aa`,`#07a2a4`,`#9a7fd1`,`#588dd5`,`#f5994e`,`#c05050`,`#59678c`,`#c9ab00`,`#7eb00a`,`#6f5553`,`#c14089`],backgroundColor:`rgba(0,0,0,0)`,textStyle:{},title:{textStyle:{color:`#008acd`}},line:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:3,symbol:`emptyCircle`,smooth:!0},radar:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:3,symbol:`emptyCircle`,smooth:!0},bar:{itemStyle:{barBorderWidth:0,barBorderColor:`#ccc`}},pie:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},scatter:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},boxplot:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},parallel:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},sankey:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},funnel:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},gauge:{itemStyle:{borderWidth:0,borderColor:`#ccc`}},candlestick:{itemStyle:{color:`#d87a80`,color0:`#2ec7c9`,borderColor:`#d87a80`,borderColor0:`#2ec7c9`,borderWidth:1}},graph:{itemStyle:{borderWidth:0,borderColor:`#ccc`},lineStyle:{width:1,color:`#aaa`},symbolSize:3,symbol:`emptyCircle`,smooth:!0,color:[`#2ec7c9`,`#b6a2de`,`#5ab1ef`,`#ffb980`,`#d87a80`,`#8d98b3`,`#e5cf0d`,`#97b552`,`#95706d`,`#dc69aa`,`#07a2a4`,`#9a7fd1`,`#588dd5`,`#f5994e`,`#c05050`,`#59678c`,`#c9ab00`,`#7eb00a`,`#6f5553`,`#c14089`],label:{color:`#eee`}},map:{itemStyle:{areaColor:`#dddddd`,borderColor:`#eeeeee`,borderWidth:.5},label:{color:`#d87a80`},emphasis:{itemStyle:{areaColor:`rgba(254,153,78,1)`,borderColor:`#444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},geo:{itemStyle:{areaColor:`#dddddd`,borderColor:`#eeeeee`,borderWidth:.5},label:{color:`#d87a80`},emphasis:{itemStyle:{areaColor:`rgba(254,153,78,1)`,borderColor:`#444`,borderWidth:1},label:{color:`rgb(100,0,0)`}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:`#008acd`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!1,lineStyle:{color:[`#eee`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},valueAxis:{axisLine:{show:!0,lineStyle:{color:`#008acd`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#eee`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},logAxis:{axisLine:{show:!0,lineStyle:{color:`#008acd`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#eee`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:`#008acd`}},axisTick:{show:!0,lineStyle:{color:`#333`}},axisLabel:{show:!0,color:`#333`},splitLine:{show:!0,lineStyle:{color:[`#eee`]}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.3)`,`rgba(200,200,200,0.3)`]}}},toolbox:{iconStyle:{borderColor:`#2ec7c9`},emphasis:{iconStyle:{borderColor:`#18a4a6`}}},legend:{textStyle:{color:`#333333`}},tooltip:{axisPointer:{lineStyle:{color:`#008acd`,width:`1`},crossStyle:{color:`#008acd`,width:`1`}}},timeline:{lineStyle:{color:`#008acd`,width:1},itemStyle:{color:`#008acd`,borderWidth:1},controlStyle:{color:`#008acd`,borderColor:`#008acd`,borderWidth:.5},checkpointStyle:{color:`#2ec7c9`,borderColor:`#2ec7c9`},label:{color:`#008acd`},emphasis:{itemStyle:{color:`#a9334c`},controlStyle:{color:`#008acd`,borderColor:`#008acd`,borderWidth:.5},label:{color:`#008acd`}}},visualMap:{color:[`#5ab1ef`,`#e0ffff`]},dataZoom:{backgroundColor:`rgba(47,69,84,0)`,dataBackgroundColor:`rgba(239,239,255,0.3)`,fillerColor:`rgba(182,162,222,0.2)`,handleColor:`#008acd`,handleSize:`100%`,textStyle:{color:`#333333`}},markPoint:{label:{color:`#eeeeee`},emphasis:{label:{color:`#eeeeee`}}}}]]),k=new WeakMap,A=0;function j(){for(let[e,t]of O.entries())n.registerTheme(e,t)}function M(e){return O.get(e)||null}function N(e){return O.has(e)}function P(e,t){n.registerTheme(e,t)}function F(e){let t=k.get(e);if(t)return t;let r=`__custom_theme_${A++}`;return n.registerTheme(r,e),k.set(e,r),r}function I(){return Array.from(O.keys())}j();function L(e){return e==null?null:typeof e==`string`&&N(e)?e:typeof e==`object`?F(e):null}function R(e,t){if(t)for(let[n,{handler:r,query:i,context:a}]of Object.entries(t))i?e.on(n,i,r,a):e.on(n,r,a)}function z(e,t){if(t)for(let[n,{handler:r}]of Object.entries(t))e.off(n,r)}function B(e,r){let i=(0,ee.c)(68),{option:a,theme:o,renderer:s,lazyInit:c,group:l,setOptionOpts:u,showLoading:d,loadingOption:f,onEvents:p}=r,m=s===void 0?`canvas`:s,v=c===void 0?!1:c,y=d===void 0?!1:d,b=(0,t.useRef)(void 0),x=(0,t.useRef)(void 0),S=(0,t.useRef)(p),w=(0,t.useRef)(void 0),T,E;i[0]===p?(T=i[1],E=i[2]):(T=()=>{S.current=p},E=[p],i[0]=p,i[1]=T,i[2]=E),(0,t.useEffect)(T,E);let D=te(e,v),O;i[3]===e?O=i[4]:(O=()=>{if(e.current)return h(e.current)},i[3]=e,i[4]=O);let k=O,A;i[5]!==e||i[6]!==m||i[7]!==D||i[8]!==o?(A=()=>{let t=e.current;if(!t||!D)return;let r=h(t);if(!r){let e=L(o);r=n.init(t,e,{renderer:m}),ne(t,r),x.current=o}return r},i[5]=e,i[6]=m,i[7]=D,i[8]=o,i[9]=A):A=i[9];let j=A,M;i[10]!==k||i[11]!==j||i[12]!==u?(M=(e,t)=>{queueMicrotask(()=>{let n=k()||j();if(n){let r={...u,...t};n.setOption(e,r)}})},i[10]=k,i[11]=j,i[12]=u,i[13]=M):M=i[13];let N=M,P;i[14]===k?P=i[15]:(P=()=>{k()?.resize()},i[14]=k,i[15]=P);let F=P,I,B;i[16]!==j||i[17]!==f||i[18]!==a||i[19]!==e||i[20]!==u||i[21]!==D||i[22]!==y?(B=()=>{if(!D)return;let t=e.current;if(!t)return;let n=j();if(n)return n.setOption(a,u),y&&n.showLoading(f),R(n,S.current),w.current=S.current,()=>{let e=h(t);if(!e)return;let n=b.current;n&&C(e,n,void 0),z(e,w.current),w.current=void 0,_(t)}},I=[D,j,a,u,y,f,e],i[16]=j,i[17]=f,i[18]=a,i[19]=e,i[20]=u,i[21]=D,i[22]=y,i[23]=I,i[24]=B):(I=i[23],B=i[24]),(0,t.useLayoutEffect)(B,I);let V,H;i[25]!==k||i[26]!==a||i[27]!==u?(V=()=>{let e=k();e&&e.setOption(a,u)},H=[k,a,u],i[25]=k,i[26]=a,i[27]=u,i[28]=V,i[29]=H):(V=i[28],H=i[29]),(0,t.useEffect)(V,H);let U,W;i[30]!==f||i[31]!==a||i[32]!==e||i[33]!==m||i[34]!==u||i[35]!==y||i[36]!==o?(U=()=>{let t=e.current;if(!t)return;let r=h(t);if(!r||x.current===o)return;let i=b.current;i&&C(r,i,void 0);let s=L(o),c=n.init(t,s,{renderer:m});g(t,c),x.current=o,c.setOption(a,u),R(c,S.current),w.current=S.current,i&&C(c,void 0,i),y?c.showLoading(f):c.hideLoading()},W=[e,o,m,a,u,y,f],i[30]=f,i[31]=a,i[32]=e,i[33]=m,i[34]=u,i[35]=y,i[36]=o,i[37]=U,i[38]=W):(U=i[37],W=i[38]),(0,t.useEffect)(U,W);let G;i[39]!==k||i[40]!==f||i[41]!==y?(G=()=>{let e=k();e&&(y?e.showLoading(f):e.hideLoading())},i[39]=k,i[40]=f,i[41]=y,i[42]=G):G=i[42];let K;i[43]!==k||i[44]!==f||i[45]!==y||i[46]!==o?(K=[k,y,f,o],i[43]=k,i[44]=f,i[45]=y,i[46]=o,i[47]=K):K=i[47],(0,t.useEffect)(G,K);let q,J;i[48]!==k||i[49]!==p?(q=()=>{let e=k();e&&w.current!==p&&(z(e,w.current),R(e,p),w.current=p)},J=[k,p],i[48]=k,i[49]=p,i[50]=q,i[51]=J):(q=i[50],J=i[51]),(0,t.useEffect)(q,J);let Y;i[52]!==k||i[53]!==l||i[54]!==D?(Y=()=>{if(!D)return;let e=k();e&&(C(e,b.current,l),b.current=l)},i[52]=k,i[53]=l,i[54]=D,i[55]=Y):Y=i[55];let X;i[56]!==k||i[57]!==l||i[58]!==D||i[59]!==o?(X=[k,l,D,o],i[56]=k,i[57]=l,i[58]=D,i[59]=o,i[60]=X):X=i[60],(0,t.useEffect)(Y,X);let Z,Q;i[61]===e?(Z=i[62],Q=i[63]):(Z=()=>{let t=e.current;if(!t)return;let n;try{n=new ResizeObserver(()=>{h(t)?.resize()}),n.observe(t)}catch(e){let t=e;console.warn(`ResizeObserver not available:`,t)}return()=>{n?.disconnect()}},Q=[e],i[61]=e,i[62]=Z,i[63]=Q),(0,t.useEffect)(Z,Q);let $;return i[64]!==k||i[65]!==F||i[66]!==N?($={setOption:N,getInstance:k,resize:F},i[64]=k,i[65]=F,i[66]=N,i[67]=$):$=i[67],$}var V=B;e.addToGroup=x,e.clearGroups=D,e.clearInstanceCache=y,e.getAvailableThemes=I,e.getBuiltinTheme=M,e.getCachedInstance=h,e.getGroupInstances=w,e.getInstanceGroup=T,e.getReferenceCount=v,e.isBuiltinTheme=N,e.isInGroup=E,e.registerBuiltinThemes=j,e.registerCustomTheme=P,e.releaseCachedInstance=_,e.removeFromGroup=S,e.replaceCachedInstance=g,e.setCachedInstance=ne,e.updateGroup=C,e.useEcharts=V,e.useLazyInit=te});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-use-echarts",
3
3
  "private": false,
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "description": "A powerful React hooks library for Apache ECharts",
6
6
  "keywords": [
7
7
  "react",
@@ -51,7 +51,7 @@
51
51
  "@types/react": "^19.2.7",
52
52
  "@types/react-dom": "^19.2.3",
53
53
  "@vitejs/plugin-react": "^5.1.1",
54
- "@vitest/coverage-v8": "^4.0.14",
54
+ "@vitest/coverage-v8": "^4.0.15",
55
55
  "babel-plugin-react-compiler": "^1.0.0",
56
56
  "echarts": "^6.0.0",
57
57
  "eslint": "^9.39.1",
@@ -59,13 +59,13 @@
59
59
  "eslint-plugin-react-refresh": "^0.4.24",
60
60
  "globals": "^16.5.0",
61
61
  "jsdom": "^27.2.0",
62
- "react": "^19.2.0",
63
- "react-dom": "^19.2.0",
62
+ "react": "^19.2.1",
63
+ "react-dom": "^19.2.1",
64
64
  "typescript": "~5.9.3",
65
- "typescript-eslint": "^8.48.0",
66
- "vite": "^7.2.4",
65
+ "typescript-eslint": "^8.48.1",
66
+ "vite": "npm:rolldown-vite@7.2.10",
67
67
  "vite-plugin-dts": "^4.5.4",
68
- "vitest": "^4.0.14"
68
+ "vitest": "^4.0.15"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "echarts": "^6.0.0",