react-use-echarts 1.0.1 → 1.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.
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, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), __require = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : 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 t = __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 t.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 t = __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 n = t.H;
16
+ 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:\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."), n.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, t) => {
20
+ process.env.NODE_ENV === "production" ? t.exports = require_react_compiler_runtime_production() : t.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(t, r = !1) {
23
+ let a = r !== !1, [o, s] = useState(!a), c = typeof r == "object", l = c ? r.root : null, u = c ? r.rootMargin : void 0, d = c ? r.threshold : void 0, f = useMemo(() => ({
24
+ root: l ?? null,
25
+ rootMargin: u ?? "50px",
26
+ threshold: d ?? .1
27
+ }), [
28
+ l,
29
+ u,
30
+ d === void 0 ? void 0 : JSON.stringify(d)
31
+ ]);
32
+ return useEffect(() => {
33
+ if (!a || o) return;
34
+ let e = t.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 n = new IntersectionObserver((e) => {
37
+ let [t] = e;
38
+ t.isIntersecting && (s(!0), n.disconnect());
39
+ }, f);
40
+ return n.observe(e), () => {
41
+ n.disconnect();
39
42
  };
40
43
  }, [
41
- l,
42
- p,
43
- m
44
- ]), m;
44
+ t,
45
+ a,
46
+ o,
47
+ f
48
+ ]), o;
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, t) {
55
+ let n = instanceCache.get(e);
56
+ return n ? (n.refCount += 1, n.instance) : (instanceCache.set(e, {
57
+ instance: t,
54
58
  refCount: 1
55
- }), trackedElements.add(e), l);
59
+ }), trackedElements.add(e), t);
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, t) {
62
+ let n = instanceCache.get(e);
63
+ return n ? (n.instance.dispose(), n.instance = t, t) : (instanceCache.set(e, {
64
+ instance: t,
61
65
  refCount: 1
62
- }), trackedElements.add(e), l);
66
+ }), trackedElements.add(e), t);
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 t = instanceCache.get(e);
70
+ t && (--t.refCount, t.refCount <= 0 && (t.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, t) {
81
+ let n = groupRegistry.get(t);
82
+ n || (n = /* @__PURE__ */ new Set(), groupRegistry.set(t, n)), e.group = t, n.add(e), n.size > 1 && echarts.connect(t);
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, t) {
85
+ let n = groupRegistry.get(t);
86
+ n && (n.delete(e), e.group === t && (e.group = void 0), n.size === 0 ? (groupRegistry.delete(t), echarts.disconnect(t)) : n.size === 1 ? echarts.disconnect(t) : echarts.connect(t));
83
87
  }
84
- function updateGroup(e, l, u) {
85
- l && removeFromGroup(e, l), u && addToGroup(e, u);
88
+ function updateGroup(e, t, n) {
89
+ t && removeFromGroup(e, t), n && addToGroup(e, n);
86
90
  }
87
91
  function getGroupInstances(e) {
88
- let l = groupRegistry.get(e);
89
- return l ? Array.from(l) : [];
92
+ let t = groupRegistry.get(e);
93
+ return t ? Array.from(t) : [];
90
94
  }
91
95
  function getInstanceGroup(e) {
92
- for (let [l, u] of groupRegistry.entries()) if (u.has(e)) return l;
96
+ for (let [t, n] of groupRegistry.entries()) if (n.has(e)) return t;
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, t] of themeRegistry.entries()) echarts.registerTheme(e, t);
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, t) {
960
+ echarts.registerTheme(e, t);
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 t = customThemeCache.get(e);
964
+ if (t) return t;
965
+ let n = `__custom_theme_${customThemeCounter++}`;
966
+ return echarts.registerTheme(n, e), customThemeCache.set(e, n), n;
963
967
  }
964
968
  function getAvailableThemes() {
965
969
  return Array.from(themeRegistry.keys());
@@ -968,129 +972,159 @@ 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, t) {
976
+ 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);
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, t) {
979
+ if (t) for (let [n, { handler: r }] of Object.entries(t)) e.off(n, r);
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(n, i) {
982
+ let o = (0, import_compiler_runtime.c)(70), { option: s, theme: c, renderer: l, lazyInit: f, group: p, setOptionOpts: m, showLoading: ce, loadingOption: h, onEvents: g } = i, _ = l === void 0 ? "canvas" : l, le = f === void 0 ? !1 : f, v = ce === void 0 ? !1 : ce, ue = useRef(s), de = useRef(m), fe = useRef(v), y = useRef(h), b = useRef(void 0), x = useRef(void 0), S = useRef(!1), C = useRef(g), w = useRef(void 0), T, E;
983
+ o[0] === g ? (T = o[1], E = o[2]) : (T = () => {
984
+ C.current = g;
985
+ }, E = [g], o[0] = g, o[1] = T, o[2] = E), useEffect(T, E);
986
+ let D = useLazyInit(n, le), O;
987
+ o[3] === n ? O = o[4] : (O = () => {
988
+ if (n.current) return getCachedInstance(n.current);
989
+ }, o[3] = n, o[4] = O);
990
+ let k = O, A;
991
+ o[5] !== n || o[6] !== _ || o[7] !== D || o[8] !== c ? (A = () => {
992
+ let e = n.current;
993
+ if (!e || !D) return;
994
+ let t = getCachedInstance(e);
995
+ if (!t) {
996
+ let n = resolveThemeName(c);
997
+ t = echarts.init(e, n, { renderer: _ }), setCachedInstance(e, t), x.current = c;
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 t;
1000
+ }, o[5] = n, o[6] = _, o[7] = D, o[8] = c, o[9] = A) : A = o[9];
1001
+ let j = A, M = useRef(j), N, P;
1002
+ o[10] !== j || o[11] !== h || o[12] !== s || o[13] !== m || o[14] !== v ? (N = () => {
1003
+ ue.current = s, de.current = m, fe.current = v, y.current = h, M.current = j;
1004
+ }, P = [
1005
+ s,
1006
+ m,
1007
+ v,
1008
+ h,
1009
+ j
1010
+ ], o[10] = j, o[11] = h, o[12] = s, o[13] = m, o[14] = v, o[15] = N, o[16] = P) : (N = o[15], P = o[16]), useLayoutEffect(N, P);
1011
+ let F;
1012
+ o[17] !== k || o[18] !== j || o[19] !== m ? (F = (e, t) => {
999
1013
  queueMicrotask(() => {
1000
- let u = P() || I();
1001
- if (u) {
1002
- let d = {
1003
- ...b,
1004
- ...l
1014
+ let n = k() || j();
1015
+ if (n) {
1016
+ let r = {
1017
+ ...m,
1018
+ ...t
1005
1019
  };
1006
- u.setOption(e, d);
1020
+ n.setOption(e, r);
1007
1021
  }
1008
1022
  });
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;
1023
+ }, o[17] = k, o[18] = j, o[19] = m, o[20] = F) : F = o[20];
1024
+ let I = F, L;
1025
+ o[21] === k ? L = o[22] : (L = () => {
1026
+ k()?.resize();
1027
+ }, o[21] = k, o[22] = L);
1028
+ let R = L, z, B;
1029
+ o[23] !== n || o[24] !== D ? (z = () => {
1030
+ if (!D) return;
1031
+ let e = n.current;
1018
1032
  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);
1033
+ let t = M.current();
1034
+ if (t) return t.setOption(ue.current, de.current), S.current = !0, fe.current && t.showLoading(y.current), bindEvents(t, C.current), w.current = C.current, () => {
1035
+ let t = getCachedInstance(e);
1036
+ if (!t) return;
1037
+ let n = b.current;
1038
+ n && updateGroup(t, n, void 0), unbindEvents(t, w.current), w.current = void 0, releaseCachedInstance(e);
1025
1039
  };
1026
- }, V = [
1027
- 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);
1040
+ }, B = [D, n], o[23] = n, o[24] = D, o[25] = z, o[26] = B) : (z = o[25], B = o[26]), useLayoutEffect(z, B);
1041
+ let V, H;
1042
+ o[27] !== k || o[28] !== s || o[29] !== m ? (V = () => {
1043
+ let e = k();
1044
+ if (e) {
1045
+ if (S.current) {
1046
+ S.current = !1;
1047
+ return;
1048
+ }
1049
+ e.setOption(s, m);
1050
+ }
1051
+ }, H = [
1052
+ k,
1053
+ s,
1054
+ m
1055
+ ], o[27] = k, o[28] = s, o[29] = m, o[30] = V, o[31] = H) : (V = o[30], H = o[31]), useEffect(V, H);
1035
1056
  let U, W;
1036
- m[25] !== P || m[26] !== h || m[27] !== b ? (U = () => {
1037
- let e = P();
1038
- e && e.setOption(h, b);
1057
+ o[32] !== h || o[33] !== s || o[34] !== n || o[35] !== _ || o[36] !== m || o[37] !== v || o[38] !== c ? (U = () => {
1058
+ let e = n.current;
1059
+ if (!e) return;
1060
+ let t = getCachedInstance(e);
1061
+ if (!t || x.current === c) return;
1062
+ let r = b.current;
1063
+ r && updateGroup(t, r, void 0);
1064
+ let i = resolveThemeName(c), o = echarts.init(e, i, { renderer: _ });
1065
+ replaceCachedInstance(e, o), x.current = c, o.setOption(s, m), bindEvents(o, C.current), w.current = C.current, r && updateGroup(o, void 0, r), v ? o.showLoading(h) : o.hideLoading();
1039
1066
  }, 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 = [
1051
- d,
1052
- g,
1053
- w,
1067
+ n,
1068
+ c,
1069
+ _,
1070
+ s,
1071
+ m,
1072
+ v,
1073
+ h
1074
+ ], o[32] = h, o[33] = s, o[34] = n, o[35] = _, o[36] = m, o[37] = v, o[38] = c, o[39] = U, o[40] = W) : (U = o[39], W = o[40]), useEffect(U, W);
1075
+ let G;
1076
+ o[41] !== k || o[42] !== h || o[43] !== v ? (G = () => {
1077
+ let e = k();
1078
+ e && (v ? e.showLoading(h) : e.hideLoading());
1079
+ }, o[41] = k, o[42] = h, o[43] = v, o[44] = G) : G = o[44];
1080
+ let K;
1081
+ o[45] !== k || o[46] !== h || o[47] !== v || o[48] !== c ? (K = [
1082
+ k,
1083
+ v,
1054
1084
  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);
1085
+ c
1086
+ ], o[45] = k, o[46] = h, o[47] = v, o[48] = c, o[49] = K) : K = o[49], useEffect(G, K);
1057
1087
  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);
1088
+ o[50] !== k || o[51] !== g ? (q = () => {
1089
+ let e = k();
1090
+ e && w.current !== g && (unbindEvents(e, w.current), bindEvents(e, g), w.current = g);
1091
+ }, J = [k, g], o[50] = k, o[51] = g, o[52] = q, o[53] = J) : (q = o[52], J = o[53]), useEffect(q, J);
1092
+ let Y;
1093
+ o[54] !== k || o[55] !== p || o[56] !== D ? (Y = () => {
1094
+ if (!D) return;
1095
+ let e = k();
1096
+ e && (updateGroup(e, b.current, p), b.current = p);
1097
+ }, o[54] = k, o[55] = p, o[56] = D, o[57] = Y) : Y = o[57];
1098
+ let X;
1099
+ o[58] !== k || o[59] !== p || o[60] !== D || o[61] !== c ? (X = [
1100
+ k,
1101
+ p,
1102
+ D,
1103
+ c
1104
+ ], o[58] = k, o[59] = p, o[60] = D, o[61] = c, o[62] = X) : X = o[62], useEffect(Y, X);
1071
1105
  let Z, Q;
1072
- m[46] === d ? (Z = m[47], Q = m[48]) : (Z = () => {
1073
- let e = d.current;
1106
+ o[63] === n ? (Z = o[64], Q = o[65]) : (Z = () => {
1107
+ let e = n.current;
1074
1108
  if (!e) return;
1075
- let l;
1109
+ let t;
1076
1110
  try {
1077
- l = new ResizeObserver(() => {
1111
+ t = new ResizeObserver(() => {
1078
1112
  getCachedInstance(e)?.resize();
1079
- }), l.observe(e);
1113
+ }), t.observe(e);
1080
1114
  } catch (e) {
1081
- let l = e;
1082
- console.warn("ResizeObserver not available:", l);
1115
+ let t = e;
1116
+ console.warn("ResizeObserver not available:", t);
1083
1117
  }
1084
1118
  return () => {
1085
- l?.disconnect();
1119
+ t?.disconnect();
1086
1120
  };
1087
- }, Q = [d], m[46] = d, m[47] = Z, m[48] = Q), useEffect(Z, Q);
1121
+ }, Q = [n], o[63] = n, o[64] = Z, o[65] = Q), useEffect(Z, Q);
1088
1122
  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], $;
1123
+ return o[66] !== k || o[67] !== R || o[68] !== I ? ($ = {
1124
+ setOption: I,
1125
+ getInstance: k,
1126
+ resize: R
1127
+ }, o[66] = k, o[67] = R, o[68] = I, o[69] = $) : $ = o[69], $;
1094
1128
  }
1095
1129
  var use_echarts_default = useEcharts;
1096
1130
  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
@@ -2,4 +2,4 @@
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 re(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 ie(e){let t=p.get(e);t&&(--t.refCount,t.refCount<=0&&(t.instance.dispose(),p.delete(e),m.delete(e)))}function ae(e){return p.get(e)?.refCount??0}function g(){for(let e of m)p.get(e)?.instance.dispose();p=new WeakMap,m.clear()}var _=new Map;function v(e,t){let r=_.get(t);r||(r=new Set,_.set(t,r)),e.group=t,r.add(e),r.size>1&&n.connect(t)}function y(e,t){let r=_.get(t);r&&(r.delete(e),e.group===t&&(e.group=void 0),r.size===0?(_.delete(t),n.disconnect(t)):r.size===1?n.disconnect(t):n.connect(t))}function b(e,t,n){t&&y(e,t),n&&v(e,n)}function oe(e){let t=_.get(e);return t?Array.from(t):[]}function x(e){for(let[t,n]of _.entries())if(n.has(e))return t}function S(e){return x(e)!==void 0}function C(){for(let e of _.keys())n.disconnect(e);_.clear()}var w=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`}}}}]]),T=new WeakMap,E=0;function D(){for(let[e,t]of w.entries())n.registerTheme(e,t)}function O(e){return w.get(e)||null}function k(e){return w.has(e)}function A(e,t){n.registerTheme(e,t)}function j(e){let t=T.get(e);if(t)return t;let r=`__custom_theme_${E++}`;return n.registerTheme(r,e),T.set(e,r),r}function M(){return Array.from(w.keys())}D();function se(e){return e==null?null:typeof e==`string`&&k(e)?e:typeof e==`object`?j(e):null}function ce(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 le(e,t){if(t)for(let[n,{handler:r}]of Object.entries(t))e.off(n,r)}function N(e,r){let i=(0,ee.c)(70),{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,ae=c===void 0?!1:c,g=d===void 0?!1:d,_=(0,t.useRef)(a),v=(0,t.useRef)(u),y=(0,t.useRef)(g),oe=(0,t.useRef)(f),x=(0,t.useRef)(void 0),S=(0,t.useRef)(void 0),C=(0,t.useRef)(!1),w=(0,t.useRef)(p),T=(0,t.useRef)(void 0),E,D;i[0]===p?(E=i[1],D=i[2]):(E=()=>{w.current=p},D=[p],i[0]=p,i[1]=E,i[2]=D),(0,t.useEffect)(E,D);let O=te(e,ae),k;i[3]===e?k=i[4]:(k=()=>{if(e.current)return h(e.current)},i[3]=e,i[4]=k);let A=k,j;i[5]!==e||i[6]!==m||i[7]!==O||i[8]!==o?(j=()=>{let t=e.current;if(!t||!O)return;let r=h(t);if(!r){let e=se(o);r=n.init(t,e,{renderer:m}),ne(t,r),S.current=o}return r},i[5]=e,i[6]=m,i[7]=O,i[8]=o,i[9]=j):j=i[9];let M=j,N=(0,t.useRef)(M),P,F;i[10]!==M||i[11]!==f||i[12]!==a||i[13]!==u||i[14]!==g?(P=()=>{_.current=a,v.current=u,y.current=g,oe.current=f,N.current=M},F=[a,u,g,f,M],i[10]=M,i[11]=f,i[12]=a,i[13]=u,i[14]=g,i[15]=P,i[16]=F):(P=i[15],F=i[16]),(0,t.useLayoutEffect)(P,F);let I;i[17]!==A||i[18]!==M||i[19]!==u?(I=(e,t)=>{queueMicrotask(()=>{let n=A()||M();if(n){let r={...u,...t};n.setOption(e,r)}})},i[17]=A,i[18]=M,i[19]=u,i[20]=I):I=i[20];let L=I,R;i[21]===A?R=i[22]:(R=()=>{A()?.resize()},i[21]=A,i[22]=R);let ue=R,z,B;i[23]!==e||i[24]!==O?(z=()=>{if(!O)return;let t=e.current;if(!t)return;let n=N.current();if(n)return n.setOption(_.current,v.current),C.current=!0,y.current&&n.showLoading(oe.current),ce(n,w.current),T.current=w.current,()=>{let e=h(t);if(!e)return;let n=x.current;n&&b(e,n,void 0),le(e,T.current),T.current=void 0,ie(t)}},B=[O,e],i[23]=e,i[24]=O,i[25]=z,i[26]=B):(z=i[25],B=i[26]),(0,t.useLayoutEffect)(z,B);let V,H;i[27]!==A||i[28]!==a||i[29]!==u?(V=()=>{let e=A();if(e){if(C.current){C.current=!1;return}e.setOption(a,u)}},H=[A,a,u],i[27]=A,i[28]=a,i[29]=u,i[30]=V,i[31]=H):(V=i[30],H=i[31]),(0,t.useEffect)(V,H);let U,W;i[32]!==f||i[33]!==a||i[34]!==e||i[35]!==m||i[36]!==u||i[37]!==g||i[38]!==o?(U=()=>{let t=e.current;if(!t)return;let r=h(t);if(!r||S.current===o)return;let i=x.current;i&&b(r,i,void 0);let s=se(o),c=n.init(t,s,{renderer:m});re(t,c),S.current=o,c.setOption(a,u),ce(c,w.current),T.current=w.current,i&&b(c,void 0,i),g?c.showLoading(f):c.hideLoading()},W=[e,o,m,a,u,g,f],i[32]=f,i[33]=a,i[34]=e,i[35]=m,i[36]=u,i[37]=g,i[38]=o,i[39]=U,i[40]=W):(U=i[39],W=i[40]),(0,t.useEffect)(U,W);let G;i[41]!==A||i[42]!==f||i[43]!==g?(G=()=>{let e=A();e&&(g?e.showLoading(f):e.hideLoading())},i[41]=A,i[42]=f,i[43]=g,i[44]=G):G=i[44];let K;i[45]!==A||i[46]!==f||i[47]!==g||i[48]!==o?(K=[A,g,f,o],i[45]=A,i[46]=f,i[47]=g,i[48]=o,i[49]=K):K=i[49],(0,t.useEffect)(G,K);let q,J;i[50]!==A||i[51]!==p?(q=()=>{let e=A();e&&T.current!==p&&(le(e,T.current),ce(e,p),T.current=p)},J=[A,p],i[50]=A,i[51]=p,i[52]=q,i[53]=J):(q=i[52],J=i[53]),(0,t.useEffect)(q,J);let Y;i[54]!==A||i[55]!==l||i[56]!==O?(Y=()=>{if(!O)return;let e=A();e&&(b(e,x.current,l),x.current=l)},i[54]=A,i[55]=l,i[56]=O,i[57]=Y):Y=i[57];let X;i[58]!==A||i[59]!==l||i[60]!==O||i[61]!==o?(X=[A,l,O,o],i[58]=A,i[59]=l,i[60]=O,i[61]=o,i[62]=X):X=i[62],(0,t.useEffect)(Y,X);let Z,Q;i[63]===e?(Z=i[64],Q=i[65]):(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[63]=e,i[64]=Z,i[65]=Q),(0,t.useEffect)(Z,Q);let $;return i[66]!==A||i[67]!==ue||i[68]!==L?($={setOption:L,getInstance:A,resize:ue},i[66]=A,i[67]=ue,i[68]=L,i[69]=$):$=i[69],$}var P=N;e.addToGroup=v,e.clearGroups=C,e.clearInstanceCache=g,e.getAvailableThemes=M,e.getBuiltinTheme=O,e.getCachedInstance=h,e.getGroupInstances=oe,e.getInstanceGroup=x,e.getReferenceCount=ae,e.isBuiltinTheme=k,e.isInGroup=S,e.registerBuiltinThemes=D,e.registerCustomTheme=A,e.releaseCachedInstance=ie,e.removeFromGroup=y,e.replaceCachedInstance=re,e.setCachedInstance=ne,e.updateGroup=b,e.useEcharts=P,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.1",
4
+ "version": "1.0.3",
5
5
  "description": "A powerful React hooks library for Apache ECharts",
6
6
  "keywords": [
7
7
  "react",
@@ -44,40 +44,47 @@
44
44
  "files": [
45
45
  "dist"
46
46
  ],
47
+ "scripts": {
48
+ "dev": "vite",
49
+ "build": "tsc -b && vite build",
50
+ "test": "vitest",
51
+ "coverage": "vitest run --coverage",
52
+ "lint": "eslint .",
53
+ "prepare": "pnpm build",
54
+ "typecheck": "tsc -b"
55
+ },
47
56
  "devDependencies": {
48
- "@eslint/js": "^9.39.1",
49
- "@testing-library/react": "^16.3.0",
50
- "@types/node": "^24.10.1",
51
- "@types/react": "^19.2.7",
57
+ "@eslint/js": "^9.39.2",
58
+ "@testing-library/react": "^16.3.2",
59
+ "@types/node": "^25.2.0",
60
+ "@types/react": "^19.2.11",
52
61
  "@types/react-dom": "^19.2.3",
53
- "@vitejs/plugin-react": "^5.1.1",
54
- "@vitest/coverage-v8": "^4.0.15",
62
+ "@vitejs/plugin-react": "^5.1.3",
63
+ "@vitest/coverage-v8": "^4.0.18",
55
64
  "babel-plugin-react-compiler": "^1.0.0",
65
+ "baseline-browser-mapping": "^2.9.19",
56
66
  "echarts": "^6.0.0",
57
- "eslint": "^9.39.1",
67
+ "eslint": "^9.39.2",
58
68
  "eslint-plugin-react-hooks": "^7.0.1",
59
- "eslint-plugin-react-refresh": "^0.4.24",
60
- "globals": "^16.5.0",
61
- "jsdom": "^27.2.0",
62
- "react": "^19.2.1",
63
- "react-dom": "^19.2.1",
69
+ "eslint-plugin-react-refresh": "^0.5.0",
70
+ "globals": "^17.3.0",
71
+ "jsdom": "^28.0.0",
72
+ "react": "^19.2.4",
73
+ "react-dom": "^19.2.4",
64
74
  "typescript": "~5.9.3",
65
- "typescript-eslint": "^8.48.1",
66
- "vite": "npm:rolldown-vite@7.2.10",
75
+ "typescript-eslint": "^8.54.0",
76
+ "vite": "npm:rolldown-vite@7.3.1",
67
77
  "vite-plugin-dts": "^4.5.4",
68
- "vitest": "^4.0.15"
78
+ "vitest": "^4.0.18"
69
79
  },
70
80
  "peerDependencies": {
71
81
  "echarts": "^6.0.0",
72
- "react": "^19.0.0",
73
- "react-dom": "^19.0.0"
82
+ "react": "^19.2.0",
83
+ "react-dom": "^19.2.0"
74
84
  },
75
- "scripts": {
76
- "dev": "vite",
77
- "build": "tsc -b && vite build",
78
- "test": "vitest",
79
- "coverage": "vitest run --coverage",
80
- "lint": "eslint .",
81
- "typecheck": "tsc -b"
85
+ "pnpm": {
86
+ "overrides": {
87
+ "vite": "npm:rolldown-vite@7.3.1"
88
+ }
82
89
  }
83
- }
90
+ }