@hybridcore/ui 1.6.8 → 1.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/AnimatedTheme-BOKdw2Oy.js +7708 -0
  2. package/dist/{AxisRenderer-DTyLLA6c.js → AxisRenderer-lUbezuh7.js} +51 -49
  3. package/dist/{AxisRendererY-C_ItLPNV.js → AxisRendererY-DbSiyb45.js} +3 -3
  4. package/dist/{Bullet-DVczI2TD.js → Bullet-PgoNb3Jv.js} +1 -1
  5. package/dist/{Button-CcsPEIDh.js → Button-XBf4Mwz-.js} +3 -3
  6. package/dist/{CategoryAxis-CwnfaGc8.js → CategoryAxis-B8KQp1pE.js} +3 -3
  7. package/dist/{Circle-Cy5s-pVc.js → Circle-BWRdiMpG.js} +1 -1
  8. package/dist/ColorSet-DDmFoKtZ.js +77 -0
  9. package/dist/{ColumnSeries-CjgdJ2QL.js → ColumnSeries-rgnGm-Bg.js} +4 -4
  10. package/dist/{DataProcessor-CHDO51q4.js → DataProcessor-CvIe9BVn.js} +1 -1
  11. package/dist/{DateAxis-YX3QNIB-.js → DateAxis-zNtbSVjW.js} +8 -7
  12. package/dist/{ColorSet-C7vpNXhM.js → Entity-CCUIdRAr.js} +638 -712
  13. package/dist/{Hierarchy-Bihj0S61.js → Hierarchy-CCvGsF1A.js} +25 -23
  14. package/dist/{Legend-Dp_MKfS4.js → Legend-kbCFjJAW.js} +11 -10
  15. package/dist/{LineSeries-Uiv5o56b.js → LineSeries-BLFvwrLT.js} +13 -12
  16. package/dist/{LinearGradient-DiRq5YcI.js → LinearGradient-C7rnipF7.js} +11 -11
  17. package/dist/{PieSeries-B2fW3z0s.js → PieSeries-3iLRbqFv.js} +34 -32
  18. package/dist/{RoundedRectangle-CWLi2PXn.js → RoundedRectangle-CqMMmPM0.js} +4 -4
  19. package/dist/{Scrollbar-D86MJyr2.js → Scrollbar-BzSBcIUt.js} +4 -4
  20. package/dist/{Slice-B19rbYDZ.js → Slice-CS23iLiS.js} +2 -2
  21. package/dist/{Tick-2bcLyHpF.js → Tick-BADQ8QeT.js} +15 -15
  22. package/dist/Tooltip-A_HlttXp.js +3606 -0
  23. package/dist/{XYCursor-C8WktvKM.js → XYCursor-gHAo40xC.js} +3 -3
  24. package/dist/{ZoomableContainer-DYyqwaMb.js → ZoomableContainer-Brs1wHM1.js} +9 -9
  25. package/dist/components/charts/_common/tooltip.js +73 -0
  26. package/dist/components/charts/_common/utils.js +10 -9
  27. package/dist/components/charts/candlestick/logic.js +181 -156
  28. package/dist/components/charts/column-line-mix/logic.js +80 -77
  29. package/dist/components/charts/donut-chart/logic.js +36 -34
  30. package/dist/components/charts/drill-down-treemap/logic.js +49 -48
  31. package/dist/components/charts/drill-down-voronoi-treemap/logic.js +102 -101
  32. package/dist/components/charts/heatmap/logic.js +33 -32
  33. package/dist/components/charts/highlighting-line-data/logic.js +26 -24
  34. package/dist/components/charts/line/logic.js +123 -174
  35. package/dist/components/charts/logaritmic-scale/logic.js +69 -60
  36. package/dist/components/charts/multiple-value-axes/logic.js +93 -88
  37. package/dist/components/charts/nested-pie/logic.js +3 -3
  38. package/dist/components/charts/packed-circles/logic.js +28 -27
  39. package/dist/components/charts/pie-chart/logic.js +43 -41
  40. package/dist/components/charts/stacked-area-radar/logic.js +124 -121
  41. package/dist/components/charts/stacked-column-chart/logic.js +107 -95
  42. package/dist/components/charts/xy-chart/logic.js +103 -91
  43. package/dist/components/metric-card/MetricChart.js +29 -28
  44. package/package.json +1 -1
  45. package/dist/AnimatedTheme-jnasw6rT.js +0 -11305
@@ -1,143 +1,155 @@
1
- import { R as q, A as I, T as R, L as N } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useThemeProps as P, useTheme as z } from "@mui/material";
3
- import H from "dayjs";
1
+ import { R as V, A as q } from "../../../AnimatedTheme-BOKdw2Oy.js";
2
+ import { useThemeProps as I, useTheme as N } from "@mui/material";
3
+ import P from "dayjs";
4
4
  import v from "lodash";
5
- import { useId as _, useRef as $, useEffect as G } from "react";
6
- import { humanizeLabel as J } from "../_common/format.js";
7
- import { applyValueFormat as K, colorSetFromPalette as Q } from "../_common/utils.js";
8
- import { c as p, a as f, p as W } from "../../../ColorSet-C7vpNXhM.js";
9
- import { X as Z, V as ee } from "../../../AxisRenderer-DTyLLA6c.js";
10
- import { A as te, a as re } from "../../../AxisRendererY-C_ItLPNV.js";
11
- import { C as D } from "../../../CategoryAxis-CwnfaGc8.js";
12
- import { L as oe } from "../../../Legend-Dp_MKfS4.js";
13
- import { C as ae } from "../../../ColumnSeries-CjgdJ2QL.js";
14
- import { B as se } from "../../../Bullet-DVczI2TD.js";
15
- const ve = (O) => {
16
- const w = P({
17
- props: O,
5
+ import { useId as z, useRef as H, useEffect as _ } from "react";
6
+ import { humanizeLabel as $ } from "../_common/format.js";
7
+ import { attachCombinedAxisTooltip as G } from "../_common/tooltip.js";
8
+ import { applyValueFormat as J, colorSetFromPalette as K } from "../_common/utils.js";
9
+ import { c as p, a as h, p as Q } from "../../../Entity-CCUIdRAr.js";
10
+ import { X as W, V as Z } from "../../../AxisRenderer-lUbezuh7.js";
11
+ import { A as ee, a as te } from "../../../AxisRendererY-DbSiyb45.js";
12
+ import { C as D } from "../../../CategoryAxis-B8KQp1pE.js";
13
+ import { L as re } from "../../../Legend-kbCFjJAW.js";
14
+ import { X as oe } from "../../../XYCursor-gHAo40xC.js";
15
+ import { C as ae } from "../../../ColumnSeries-rgnGm-Bg.js";
16
+ import { B as se } from "../../../Bullet-PgoNb3Jv.js";
17
+ import { L as ne } from "../../../Tooltip-A_HlttXp.js";
18
+ const Xe = (L) => {
19
+ const C = I({
20
+ props: L,
18
21
  name: "HCStackedColumnChart"
19
22
  }), {
20
- dimensions: d,
23
+ dimensions: u,
21
24
  values: n,
22
- data: C,
23
- initDelay: b = 0,
24
- baseInterval: h,
25
+ data: w,
26
+ initDelay: R = 0,
27
+ baseInterval: d,
25
28
  colors: k,
26
- sx: B,
27
- ...E
28
- } = w, l = z(), T = `hc-stacked-column-chart-${_().replace(/:/g, "")}`, x = $(null);
29
- let u = null;
30
- d.length < 2 ? u = "StackedColumnChart requires at least 2 dimensions" : n.length < 1 && (u = "StackedColumnChart requires at least 1 value"), G(() => {
31
- if (u) return;
32
- let y;
33
- return y = setTimeout(() => {
34
- var X, S, L;
35
- const e = q.new(T);
36
- x.current = e, K(e, (X = n == null ? void 0 : n[0]) == null ? void 0 : X.format), e.setThemes([I.new(e)]), e.interfaceColors.setAll({
37
- text: p(l.palette.text.primary),
38
- grid: p(l.palette.divider),
39
- stroke: p(l.palette.divider)
29
+ sx: O,
30
+ ...B
31
+ } = C, i = N(), T = `hc-stacked-column-chart-${z().replace(/:/g, "")}`, x = H(null);
32
+ let f = null;
33
+ u.length < 2 ? f = "StackedColumnChart requires at least 2 dimensions" : n.length < 1 && (f = "StackedColumnChart requires at least 1 value"), _(() => {
34
+ if (f) return;
35
+ let A;
36
+ return A = setTimeout(() => {
37
+ var F, S, b;
38
+ const e = V.new(T);
39
+ x.current = e, J(e, (F = n == null ? void 0 : n[0]) == null ? void 0 : F.format), e.setThemes([q.new(e)]), e.interfaceColors.setAll({
40
+ text: p(i.palette.text.primary),
41
+ grid: p(i.palette.divider),
42
+ stroke: p(i.palette.divider)
40
43
  });
41
- const s = e.container.children.push(
42
- Z.new(e, {
44
+ const o = e.container.children.push(
45
+ W.new(e, {
43
46
  panX: !1,
44
47
  panY: !1,
45
48
  wheelX: "none",
46
49
  wheelY: "none",
50
+ maxTooltipDistance: -1,
47
51
  layout: e.verticalLayout
48
52
  })
49
53
  );
50
- s.set("colors", Q(e, k)), s.get("colors", {}).set("step", 2);
51
- const Y = te.new(e, {});
54
+ o.set("colors", K(e, k)), o.get("colors", {}).set("step", 2);
55
+ const Y = ee.new(e, {});
52
56
  Y.grid.template.setAll({ location: 1 });
53
- const o = d[0], j = d[1];
54
- let c, m = C;
55
- if (o.type === "date") {
56
- const t = (h == null ? void 0 : h.timeUnit) || "day";
57
- let a = "DD/MM/YYYY";
58
- t === "month" ? a = "MM YYYY" : t === "year" && (a = "YYYY"), c = s.xAxes.push(
57
+ const a = u[0], M = u[1];
58
+ let l, c = w;
59
+ if (a.type === "date") {
60
+ const t = (d == null ? void 0 : d.timeUnit) || "day";
61
+ let s = "DD/MM/YYYY";
62
+ t === "month" ? s = "MM YYYY" : t === "year" && (s = "YYYY"), l = o.xAxes.push(
59
63
  D.new(e, {
60
- categoryField: o.value,
61
- renderer: Y,
62
- tooltip: R.new(e, {})
64
+ categoryField: a.value,
65
+ renderer: Y
63
66
  })
64
- ), m = v.orderBy(m, [o.value]), m = m.map((r) => ({
67
+ ), c = v.orderBy(c, [a.value]), c = c.map((r) => ({
65
68
  ...r,
66
- [o.value]: H(r[o.value]).format(a)
69
+ [a.value]: P(r[a.value]).format(s)
67
70
  }));
68
71
  } else
69
- c = s.xAxes.push(
72
+ l = o.xAxes.push(
70
73
  D.new(e, {
71
- categoryField: o.value,
72
- renderer: Y,
73
- tooltip: R.new(e, {})
74
+ categoryField: a.value,
75
+ renderer: Y
74
76
  })
75
77
  );
76
- const i = [], g = v.groupBy(m, j.value);
77
- Object.keys(g).forEach((t) => {
78
- g[t].forEach((a) => {
79
- const r = a[o.value], A = v.findIndex(i, { [o.value]: r });
80
- A === -1 ? i.push({
81
- [o.value]: r,
82
- [t]: a[n[0].dataFieldName]
83
- }) : i[A] = {
84
- ...i[A],
85
- [t]: a[n[0].dataFieldName]
78
+ const m = [], y = v.groupBy(c, M.value);
79
+ Object.keys(y).forEach((t) => {
80
+ y[t].forEach((s) => {
81
+ const r = s[a.value], g = v.findIndex(m, { [a.value]: r });
82
+ g === -1 ? m.push({
83
+ [a.value]: r,
84
+ [t]: s[n[0].dataFieldName]
85
+ }) : m[g] = {
86
+ ...m[g],
87
+ [t]: s[n[0].dataFieldName]
86
88
  };
87
89
  });
88
- }), c.data.setAll(i);
89
- const F = s.yAxes.push(
90
- ee.new(e, {
90
+ }), l.data.setAll(m);
91
+ const X = o.yAxes.push(
92
+ Z.new(e, {
91
93
  min: 0,
92
- renderer: re.new(e, { strokeOpacity: 0.1 })
94
+ renderer: te.new(e, { strokeOpacity: 0.1 })
93
95
  })
94
- ), U = s.children.push(
95
- oe.new(e, {
96
- centerX: f,
97
- x: f
96
+ ), j = o.children.push(
97
+ re.new(e, {
98
+ centerX: h,
99
+ x: h
98
100
  })
99
101
  );
100
- (S = c.get("renderer")) == null || S.grid.template.setAll({
101
- stroke: p(l.palette.divider),
102
+ (S = l.get("renderer")) == null || S.grid.template.setAll({
103
+ stroke: p(i.palette.divider),
102
104
  strokeOpacity: 1
103
- }), (L = F.get("renderer")) == null || L.grid.template.setAll({
104
- stroke: p(l.palette.divider),
105
+ }), (b = X.get("renderer")) == null || b.grid.template.setAll({
106
+ stroke: p(i.palette.divider),
105
107
  strokeOpacity: 1
106
108
  });
107
- function V(t, a) {
108
- const r = s.series.push(
109
+ function U(t, s) {
110
+ const r = o.series.push(
109
111
  ae.new(e, {
110
112
  name: t,
111
113
  stacked: !0,
112
- xAxis: c,
113
- yAxis: F,
114
- valueYField: a,
115
- categoryXField: o.value
114
+ xAxis: l,
115
+ yAxis: X,
116
+ valueYField: s,
117
+ categoryXField: a.value
116
118
  })
117
119
  );
118
120
  r.columns.template.setAll({
119
- tooltipText: "{name}, {categoryX}: {valueY}",
120
- tooltipY: W(10)
121
- }), r.data.setAll(i), r.appear(), r.bullets.push(function() {
121
+ tooltipY: Q(10)
122
+ }), r.data.setAll(m), r.appear(), r.bullets.push(function() {
122
123
  return se.new(e, {
123
- sprite: N.new(e, {
124
+ sprite: ne.new(e, {
124
125
  fill: e.interfaceColors.get("alternativeText"),
125
- centerY: f,
126
- centerX: f,
126
+ centerY: h,
127
+ centerX: h,
127
128
  populateText: !0
128
129
  })
129
130
  });
130
- }), U.data.push(r);
131
+ }), j.data.push(r);
131
132
  }
132
- Object.keys(g).forEach((t) => V(J(t), t)), s.appear(1e3, 100);
133
- }, b), () => {
133
+ Object.keys(y).forEach((t) => U($(t), t)), o.set(
134
+ "cursor",
135
+ oe.new(e, { xAxis: l, behavior: "none" })
136
+ ).lineY.set("visible", !1), G({
137
+ root: e,
138
+ chart: o,
139
+ xAxis: l,
140
+ theme: i,
141
+ isDateAxis: !1,
142
+ baseInterval: d,
143
+ follow: !0
144
+ }), o.appear(1e3, 100);
145
+ }, R), () => {
134
146
  var e;
135
- y && clearTimeout(y), (e = x.current) == null || e.dispose(), x.current = null;
147
+ A && clearTimeout(A), (e = x.current) == null || e.dispose(), x.current = null;
136
148
  };
137
- }, [C, d, n, l.palette.mode, k]);
138
- const M = { ...w };
139
- return { chartId: T, ownerState: M, sx: B, error: u, other: E };
149
+ }, [w, u, n, i.palette.mode, k]);
150
+ const E = { ...C };
151
+ return { chartId: T, ownerState: E, sx: O, error: f, other: B };
140
152
  };
141
153
  export {
142
- ve as useStackedColumnChartLogic
154
+ Xe as useStackedColumnChartLogic
143
155
  };
@@ -1,172 +1,184 @@
1
- import { R as V, A as W, T as x, b as z, L as G } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useThemeProps as N, useTheme as j } from "@mui/material";
3
- import X from "lodash";
4
- import { useId as H, useRef as M, useEffect as U } from "react";
1
+ import { R as P, A as V } from "../../../AnimatedTheme-BOKdw2Oy.js";
2
+ import { useThemeProps as W, useTheme as z } from "@mui/material";
3
+ import Y from "lodash";
4
+ import { useId as G, useRef as N, useEffect as j } from "react";
5
5
  import { humanizeLabel as k } from "../_common/format.js";
6
- import { colorSetFromPalette as _, applyValueFormat as $ } from "../_common/utils.js";
7
- import { c as p, a as g, p as q } from "../../../ColorSet-C7vpNXhM.js";
8
- import { X as J, V as K } from "../../../AxisRenderer-DTyLLA6c.js";
9
- import { L as Q } from "../../../Legend-Dp_MKfS4.js";
10
- import { D as Z } from "../../../DateAxis-YX3QNIB-.js";
11
- import { A as F, a as ee } from "../../../AxisRendererY-C_ItLPNV.js";
12
- import { C as te } from "../../../CategoryAxis-CwnfaGc8.js";
13
- import { C as re } from "../../../ColumnSeries-CjgdJ2QL.js";
14
- import { D as oe } from "../../../DataProcessor-CHDO51q4.js";
15
- import { B as ae } from "../../../Bullet-DVczI2TD.js";
16
- const be = (L) => {
17
- const y = N({ props: L, name: "HCXYChart" }), {
18
- dimensions: c,
6
+ import { attachCombinedAxisTooltip as H } from "../_common/tooltip.js";
7
+ import { colorSetFromPalette as M, applyValueFormat as U } from "../_common/utils.js";
8
+ import { c, a as x, p as _ } from "../../../Entity-CCUIdRAr.js";
9
+ import { X as $, V as q } from "../../../AxisRenderer-lUbezuh7.js";
10
+ import { L as J } from "../../../Legend-kbCFjJAW.js";
11
+ import { D as K } from "../../../DateAxis-zNtbSVjW.js";
12
+ import { A as F, a as Q } from "../../../AxisRendererY-DbSiyb45.js";
13
+ import { C as Z } from "../../../CategoryAxis-B8KQp1pE.js";
14
+ import { T as ee, R as te, L as re } from "../../../Tooltip-A_HlttXp.js";
15
+ import { X as oe } from "../../../XYCursor-gHAo40xC.js";
16
+ import { C as ae } from "../../../ColumnSeries-rgnGm-Bg.js";
17
+ import { D as se } from "../../../DataProcessor-CvIe9BVn.js";
18
+ import { B as ie } from "../../../Bullet-PgoNb3Jv.js";
19
+ const Ye = (L) => {
20
+ const y = W({ props: L, name: "HCXYChart" }), {
21
+ dimensions: m,
19
22
  values: n,
20
23
  data: d,
21
24
  initDelay: R = 0,
22
- baseInterval: O,
23
- colors: w,
24
- sx: B,
25
- ...S
26
- } = y, i = j(), A = `hc-xy-chart-${H().replace(/:/g, "")}`, u = M(null), b = c.length < 1 ? "Missing dimensions config!" : null;
27
- U(() => {
25
+ baseInterval: A,
26
+ colors: g,
27
+ sx: O,
28
+ ...B
29
+ } = y, i = z(), w = `hc-xy-chart-${G().replace(/:/g, "")}`, u = N(null), b = m.length < 1 ? "Missing dimensions config!" : null;
30
+ j(() => {
28
31
  if (b) return;
29
32
  let f;
30
33
  return f = setTimeout(() => {
31
- var C, Y, D;
32
- const e = V.new(A);
33
- u.current = e, e.setThemes([W.new(e)]), e.interfaceColors.setAll({
34
- text: p(i.palette.text.primary),
35
- grid: p(i.palette.divider),
36
- stroke: p(i.palette.divider)
34
+ var T, D, X;
35
+ const e = P.new(w);
36
+ u.current = e, e.setThemes([V.new(e)]), e.interfaceColors.setAll({
37
+ text: c(i.palette.text.primary),
38
+ grid: c(i.palette.divider),
39
+ stroke: c(i.palette.divider)
37
40
  });
38
- const o = e.container.children.push(
39
- J.new(e, {
41
+ const r = e.container.children.push(
42
+ $.new(e, {
40
43
  panX: !1,
41
44
  panY: !1,
42
45
  wheelX: "none",
43
46
  wheelY: "none",
47
+ // Let the cursor surface the combined tooltip anywhere in the plot.
48
+ maxTooltipDistance: -1,
44
49
  layout: e.verticalLayout
45
50
  })
46
51
  );
47
- o.set("colors", _(e, w));
48
- const I = o.children.push(
49
- Q.new(e, {
50
- centerX: g,
51
- x: g
52
+ r.set("colors", M(e, g));
53
+ const E = r.children.push(
54
+ J.new(e, {
55
+ centerX: x,
56
+ x
52
57
  })
53
- ), a = c[0];
54
- let s, m = d;
58
+ ), a = m[0];
59
+ let o, p = d;
55
60
  if (a.type === "date")
56
- s = o.xAxes.push(
57
- Z.new(e, {
61
+ o = r.xAxes.push(
62
+ K.new(e, {
58
63
  maxDeviation: 0,
59
- baseInterval: O || { timeUnit: "day", count: 1 },
60
- renderer: F.new(e, { minGridDistance: 60 }),
61
- tooltip: x.new(e, {})
64
+ baseInterval: A || { timeUnit: "day", count: 1 },
65
+ renderer: F.new(e, { minGridDistance: 60 })
62
66
  })
63
- ), m = X.orderBy(d, [a.value]);
67
+ ), p = Y.orderBy(d, [a.value]);
64
68
  else {
65
69
  const t = F.new(e, {
66
70
  cellStartLocation: 0.1,
67
71
  cellEndLocation: 0.9,
68
72
  minGridDistance: 30
69
73
  });
70
- s = o.xAxes.push(
71
- te.new(e, {
74
+ o = r.xAxes.push(
75
+ Z.new(e, {
72
76
  categoryField: a.value,
73
- renderer: t,
74
- tooltip: x.new(e, {})
77
+ renderer: t
75
78
  })
76
- ), t.grid.template.setAll({ location: 1 }), s.labelsContainer.set(
79
+ ), t.grid.template.setAll({ location: 1 }), o.labelsContainer.set(
77
80
  "tooltip",
78
- x.new(e, { pointerOrientation: "down" })
81
+ ee.new(e, { pointerOrientation: "down" })
79
82
  ), t.labels.template.setAll({
80
83
  oversizedBehavior: "truncate",
81
84
  maxWidth: 150,
82
85
  tooltipText: "{category}"
83
- }), t.labels.template.setup = function(r) {
84
- r.set(
86
+ }), t.labels.template.setup = function(s) {
87
+ s.set(
85
88
  "background",
86
- z.new(e, {
87
- fill: p(0),
89
+ te.new(e, {
90
+ fill: c(0),
88
91
  fillOpacity: 0
89
92
  })
90
93
  );
91
- }, s.onPrivate("cellWidth", function(r) {
92
- t.labels.template.set("maxWidth", r);
94
+ }, o.onPrivate("cellWidth", function(s) {
95
+ t.labels.template.set("maxWidth", s);
93
96
  }), e.numberFormatter.setAll({
94
97
  numberFormat: "#",
95
98
  numericFields: ["valueX"]
96
- }), s.data.setAll(m);
99
+ }), o.data.setAll(p);
97
100
  }
98
- const v = o.yAxes.push(
99
- K.new(e, {
100
- renderer: ee.new(e, { strokeOpacity: 0.1 })
101
+ const v = r.yAxes.push(
102
+ q.new(e, {
103
+ renderer: Q.new(e, { strokeOpacity: 0.1 })
101
104
  })
102
105
  );
103
- (C = s.get("renderer")) == null || C.grid.template.setAll({
104
- stroke: p(i.palette.divider),
106
+ (T = o.get("renderer")) == null || T.grid.template.setAll({
107
+ stroke: c(i.palette.divider),
105
108
  strokeOpacity: 1
106
- }), (Y = v.get("renderer")) == null || Y.grid.template.setAll({
107
- stroke: p(i.palette.divider),
109
+ }), (D = v.get("renderer")) == null || D.grid.template.setAll({
110
+ stroke: c(i.palette.divider),
108
111
  strokeOpacity: 1
109
112
  });
110
- function T(t, r, h, P) {
111
- const l = o.series.push(
112
- re.new(e, {
113
+ function C(t, s, h, I) {
114
+ const l = r.series.push(
115
+ ae.new(e, {
113
116
  name: t,
114
- xAxis: s,
117
+ xAxis: o,
115
118
  yAxis: v,
116
- valueYField: P,
119
+ valueYField: I,
117
120
  ...a.type === "date" ? { valueXField: h } : { categoryXField: h }
118
121
  })
119
122
  );
120
123
  l.columns.template.setAll({
121
- tooltipText: "{name}, {categoryX}:{valueY}",
122
- width: q(90),
123
- tooltipY: 0,
124
+ width: _(90),
124
125
  strokeOpacity: 0
125
- }), a.type === "date" && (l.data.processor = oe.new(e, {
126
+ }), a.type === "date" && (l.data.processor = se.new(e, {
126
127
  dateFormat: "i",
127
128
  dateFields: [h]
128
- })), l.data.setAll(r), l.appear(), l.bullets.push(function() {
129
- return ae.new(e, {
129
+ })), l.data.setAll(s), l.appear(), l.bullets.push(function() {
130
+ return ie.new(e, {
130
131
  locationY: 0,
131
- sprite: G.new(e, {
132
+ sprite: re.new(e, {
132
133
  text: "{valueY}",
133
134
  fill: e.interfaceColors.get("alternativeText"),
134
135
  centerY: 0,
135
- centerX: g,
136
+ centerX: x,
136
137
  populateText: !0
137
138
  })
138
139
  });
139
- }), I.data.push(l);
140
+ }), E.data.push(l);
140
141
  }
141
- if (c.length === 1)
142
+ if (m.length === 1)
142
143
  n.forEach((t) => {
143
- T(
144
+ C(
144
145
  t.label ?? k(t.name),
145
- m,
146
+ p,
146
147
  a.value,
147
148
  t.dataFieldName
148
149
  );
149
150
  });
150
151
  else {
151
- const t = X.groupBy(m, c[1].value);
152
- Object.keys(t).forEach((r) => {
153
- T(
154
- k(r),
155
- t[r],
152
+ const t = Y.groupBy(p, m[1].value);
153
+ Object.keys(t).forEach((s) => {
154
+ C(
155
+ k(s),
156
+ t[s],
156
157
  a.value,
157
158
  n[0].dataFieldName
158
159
  );
159
160
  });
160
161
  }
161
- $(e, (D = n == null ? void 0 : n[0]) == null ? void 0 : D.format), o.appear(1e3, 100);
162
+ r.set(
163
+ "cursor",
164
+ oe.new(e, { xAxis: o, behavior: "none" })
165
+ ).lineY.set("visible", !1), H({
166
+ root: e,
167
+ chart: r,
168
+ xAxis: o,
169
+ theme: i,
170
+ isDateAxis: a.type === "date",
171
+ baseInterval: A,
172
+ follow: !0
173
+ }), U(e, (X = n == null ? void 0 : n[0]) == null ? void 0 : X.format), r.appear(1e3, 100);
162
174
  }, R), () => {
163
175
  var e;
164
176
  f && clearTimeout(f), (e = u.current) == null || e.dispose(), u.current = null;
165
177
  };
166
- }, [d, c, n, i.palette.mode, w]);
167
- const E = { ...y };
168
- return { chartId: A, ownerState: E, sx: B, error: b, other: S };
178
+ }, [d, m, n, i.palette.mode, g]);
179
+ const S = { ...y };
180
+ return { chartId: w, ownerState: S, sx: O, error: b, other: B };
169
181
  };
170
182
  export {
171
- be as useXYChartLogic
183
+ Ye as useXYChartLogic
172
184
  };
@@ -1,27 +1,28 @@
1
1
  import { jsx as h } from "react/jsx-runtime";
2
- import { R as u, A, T as g } from "../../AnimatedTheme-jnasw6rT.js";
3
- import { useTheme as v, alpha as w } from "@mui/material";
4
- import { useRef as x, useLayoutEffect as y } from "react";
5
- import { X as R, V as L } from "../../AxisRenderer-DTyLLA6c.js";
6
- import { C as T } from "../../CategoryAxis-CwnfaGc8.js";
7
- import { A as b, a as X } from "../../AxisRendererY-C_ItLPNV.js";
8
- import { C } from "../../ColumnSeries-CjgdJ2QL.js";
9
- import { c as a } from "../../ColorSet-C7vpNXhM.js";
10
- import { L as Y } from "../../LineSeries-Uiv5o56b.js";
11
- import { L as F } from "../../LinearGradient-DiRq5YcI.js";
12
- const q = ({
13
- data: l,
2
+ import { R as u, A } from "../../AnimatedTheme-BOKdw2Oy.js";
3
+ import { useTheme as g, alpha as v } from "@mui/material";
4
+ import { useRef as w, useLayoutEffect as x } from "react";
5
+ import { X as y, V as R } from "../../AxisRenderer-lUbezuh7.js";
6
+ import { C as L } from "../../CategoryAxis-B8KQp1pE.js";
7
+ import { A as T, a as b } from "../../AxisRendererY-DbSiyb45.js";
8
+ import { T as X } from "../../Tooltip-A_HlttXp.js";
9
+ import { C } from "../../ColumnSeries-rgnGm-Bg.js";
10
+ import { c as a } from "../../Entity-CCUIdRAr.js";
11
+ import { L as Y } from "../../LineSeries-BLFvwrLT.js";
12
+ import { L as F } from "../../LinearGradient-C7rnipF7.js";
13
+ const z = ({
14
+ data: o,
14
15
  type: p,
15
16
  inset: d = !1,
16
17
  gradient: m = !1
17
18
  }) => {
18
- const o = x(null), t = v();
19
- return y(() => {
20
- if (!o.current) return;
21
- const e = u.new(o.current);
19
+ const l = w(null), t = g();
20
+ return x(() => {
21
+ if (!l.current) return;
22
+ const e = u.new(l.current);
22
23
  e.setThemes([A.new(e)]);
23
24
  const i = e.container.children.push(
24
- R.new(e, {
25
+ y.new(e, {
25
26
  panX: !1,
26
27
  panY: !1,
27
28
  wheelX: "none",
@@ -32,21 +33,21 @@ const q = ({
32
33
  paddingBottom: 0
33
34
  })
34
35
  ), s = i.xAxes.push(
35
- T.new(e, {
36
+ L.new(e, {
36
37
  categoryField: "t",
37
- renderer: b.new(e, {
38
+ renderer: T.new(e, {
38
39
  minGridDistance: 10
39
40
  }),
40
- tooltip: g.new(e, {})
41
+ tooltip: X.new(e, {})
41
42
  })
42
43
  ), c = s.get("renderer");
43
44
  c.grid.template.set("visible", !1), c.labels.template.set("visible", !1), s.setAll({
44
45
  startLocation: 0.5,
45
46
  endLocation: 0.5
46
- }), s.data.setAll(l);
47
+ }), s.data.setAll(o);
47
48
  const n = i.yAxes.push(
48
- L.new(e, {
49
- renderer: X.new(e, {})
49
+ R.new(e, {
50
+ renderer: b.new(e, {})
50
51
  })
51
52
  ), f = n.get("renderer");
52
53
  f.grid.template.set("visible", !1), f.labels.template.set("visible", !1);
@@ -72,7 +73,7 @@ const q = ({
72
73
  valueYField: "v",
73
74
  categoryXField: "t",
74
75
  // @ts-expect-error amcharts5 typing accepts string/Color; alpha returns rgba string
75
- fill: w(t.palette.divider, 0.25),
76
+ fill: v(t.palette.divider, 0.25),
76
77
  stroke: a(t.palette.divider)
77
78
  })
78
79
  ), r.strokes.template.setAll({
@@ -89,13 +90,13 @@ const q = ({
89
90
  ]
90
91
  })
91
92
  }
92
- })), r.data.setAll(l), r.appear(1e3), i.appear(1e3, 100), () => {
93
+ })), r.data.setAll(o), r.appear(1e3), i.appear(1e3, 100), () => {
93
94
  e.dispose();
94
95
  };
95
- }, [l, p, d, m, t.palette.mode, t.palette.divider]), /* @__PURE__ */ h(
96
+ }, [o, p, d, m, t.palette.mode, t.palette.divider]), /* @__PURE__ */ h(
96
97
  "div",
97
98
  {
98
- ref: o,
99
+ ref: l,
99
100
  style: d ? { width: "100%", height: "100%" } : {
100
101
  width: "calc(100% + 10px)",
101
102
  height: "100%",
@@ -106,5 +107,5 @@ const q = ({
106
107
  );
107
108
  };
108
109
  export {
109
- q as MetricChart
110
+ z as MetricChart
110
111
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hybridcore/ui",
3
3
  "description": "Hybrid Core UI Library",
4
- "version": "1.6.8",
4
+ "version": "1.6.9",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",