@hybridcore/ui 1.6.27 → 1.6.28
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/components/charts/drill-down-voronoi-treemap/logic.js +4 -1
- package/dist/components/charts/highlighting-line-data/logic.js +12 -10
- package/dist/components/charts/packed-circles/logic.js +4 -1
- package/dist/components/data-map/index.js +5 -1
- package/dist/components/data-map/logic.js +93 -82
- package/dist/components/heat-map/index.js +16 -12
- package/package.json +1 -1
|
@@ -1451,7 +1451,10 @@ const kn = (t) => {
|
|
|
1451
1451
|
Ee.new(m, {
|
|
1452
1452
|
width: Vt,
|
|
1453
1453
|
height: Vt,
|
|
1454
|
-
|
|
1454
|
+
// Off by default for the same reason the XY charts set `wheelX`/`wheelY`
|
|
1455
|
+
// to "none": the widget lives in a scrollable dashboard, and capturing the
|
|
1456
|
+
// wheel traps the page scroll. Drill-down is click-driven; pinch still zooms.
|
|
1457
|
+
wheelable: !1,
|
|
1455
1458
|
pinchZoom: !0
|
|
1456
1459
|
})
|
|
1457
1460
|
).contents.children.push(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { R as I, A as W } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import { useRef as d, useLayoutEffect as
|
|
2
|
+
import { useThemeProps as S } from "@mui/material";
|
|
3
|
+
import { useRef as d, useLayoutEffect as z } from "react";
|
|
4
4
|
import { X as F, V } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
5
5
|
import { X as G } from "../../../XYCursor-CVUSpqb9.js";
|
|
6
6
|
import { D as M } from "../../../DateAxis-DEXKps1S.js";
|
|
@@ -11,7 +11,7 @@ import { L as j } from "../../../LineSeries-D_IL2qGF.js";
|
|
|
11
11
|
import { T as q } from "../../../Tooltip-vyZRZWih.js";
|
|
12
12
|
import { L as B } from "../../../Legend-CFvQiIfn.js";
|
|
13
13
|
const ie = (v) => {
|
|
14
|
-
const u =
|
|
14
|
+
const u = S({
|
|
15
15
|
props: v,
|
|
16
16
|
name: "HCHighlightLineChart"
|
|
17
17
|
}), {
|
|
@@ -24,7 +24,7 @@ const ie = (v) => {
|
|
|
24
24
|
emptyMessage: x = "No data available",
|
|
25
25
|
sx: A,
|
|
26
26
|
...L
|
|
27
|
-
} = u,
|
|
27
|
+
} = u, y = {
|
|
28
28
|
...u,
|
|
29
29
|
height: f,
|
|
30
30
|
width: k,
|
|
@@ -32,8 +32,8 @@ const ie = (v) => {
|
|
|
32
32
|
showLegend: l,
|
|
33
33
|
loading: g,
|
|
34
34
|
emptyMessage: x
|
|
35
|
-
},
|
|
36
|
-
return
|
|
35
|
+
}, X = d(null), C = d(null), h = d(null);
|
|
36
|
+
return z(() => {
|
|
37
37
|
if (!h.current) return;
|
|
38
38
|
const e = I.new(h.current);
|
|
39
39
|
C.current = e, e.setThemes([W.new(e)]);
|
|
@@ -41,12 +41,14 @@ const ie = (v) => {
|
|
|
41
41
|
F.new(e, {
|
|
42
42
|
panX: !0,
|
|
43
43
|
panY: !0,
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
// The widget lives in a scrollable dashboard, so the wheel must reach the
|
|
45
|
+
// page instead of panning/zooming the plot. Drag-pan and pinch still zoom.
|
|
46
|
+
wheelX: "none",
|
|
47
|
+
wheelY: "none",
|
|
46
48
|
pinchZoomX: !0
|
|
47
49
|
})
|
|
48
50
|
);
|
|
49
|
-
|
|
51
|
+
X.current = o, o.set(
|
|
50
52
|
"cursor",
|
|
51
53
|
G.new(e, {
|
|
52
54
|
behavior: "zoomX"
|
|
@@ -120,7 +122,7 @@ const ie = (v) => {
|
|
|
120
122
|
emptyMessage: x,
|
|
121
123
|
sx: A,
|
|
122
124
|
other: L,
|
|
123
|
-
ownerState:
|
|
125
|
+
ownerState: y
|
|
124
126
|
};
|
|
125
127
|
};
|
|
126
128
|
export {
|
|
@@ -383,7 +383,10 @@ const ze = (t) => {
|
|
|
383
383
|
U.new(f, {
|
|
384
384
|
width: q,
|
|
385
385
|
height: q,
|
|
386
|
-
|
|
386
|
+
// Off by default for the same reason the XY charts set `wheelX`/`wheelY`
|
|
387
|
+
// to "none": the widget lives in a scrollable dashboard, and capturing the
|
|
388
|
+
// wheel traps the page scroll. `ZoomTools` and pinch still zoom.
|
|
389
|
+
wheelable: !1,
|
|
387
390
|
pinchZoom: !0
|
|
388
391
|
})
|
|
389
392
|
);
|
|
@@ -21,7 +21,11 @@ const H = (i) => {
|
|
|
21
21
|
zoom: 3,
|
|
22
22
|
options: {
|
|
23
23
|
cssPosition: "absolute",
|
|
24
|
-
controls: { zoom: !1 }
|
|
24
|
+
controls: { zoom: !1 },
|
|
25
|
+
// The widget sits in a scrollable dashboard: swallowing the wheel would
|
|
26
|
+
// trap the page scroll on the map. Zoom stays available through
|
|
27
|
+
// `Controls` and double-click.
|
|
28
|
+
interactions: { mouseWheelZoom: !1 }
|
|
25
29
|
},
|
|
26
30
|
onInit: a.onInit
|
|
27
31
|
}
|
|
@@ -1,108 +1,119 @@
|
|
|
1
|
-
import { useThemeProps as
|
|
2
|
-
import { V as
|
|
3
|
-
import { t as
|
|
4
|
-
import { V as
|
|
5
|
-
import { uniqueId as
|
|
6
|
-
import { useRef as
|
|
7
|
-
import { createMapboxLayer as
|
|
8
|
-
import { parse as
|
|
9
|
-
import { W as
|
|
10
|
-
import { S as
|
|
11
|
-
const
|
|
12
|
-
const q =
|
|
13
|
-
|
|
1
|
+
import { useThemeProps as C, useTheme as O } from "@mui/material";
|
|
2
|
+
import { V as U } from "../../Vector-BmuhQO4p.js";
|
|
3
|
+
import { t as Y } from "../../Source-BSZST_GH.js";
|
|
4
|
+
import { V as K } from "../../Vector-DfTqQEln.js";
|
|
5
|
+
import { uniqueId as j, isEmpty as _, values as L, isEqual as $ } from "lodash";
|
|
6
|
+
import { useRef as n, useEffect as b, useState as w } from "react";
|
|
7
|
+
import { createMapboxLayer as ee } from "../map/helpers/mapbox.js";
|
|
8
|
+
import { parse as te } from "../map/helpers/wkt.js";
|
|
9
|
+
import { W as re } from "../../WKT-2wsDT-nq.js";
|
|
10
|
+
import { S as oe, I as ae } from "../../Text-ChJRuaD8.js";
|
|
11
|
+
const ne = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAADNCAMAAAAmPqoJAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAohQTFRFAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Ro2BGQAAANh0Uk5TABA4XICDn6e/y9/Pq4dkPBgoWHyjx+v/8zQEGkx/seTntIJPHSxwr++3eAqO1JJQDgFDhYlHBQhAkeHmlkVOnvRTAgtbrPxgSD6dRCDeJmHAxmebu9zjdwwumaBWwchdE37q8DuuQmLbam7odnv7CQ0VkyHDj2niJK2G8sw5pRJxomyLP0uqswZXqb4w97V5NRxo1yeMxA91+C1a5f3KjXLSvbzO7h8lUS8X2Zea/qHCsMVv2tDpPdFUhJzJc5VSuKQbbbLsdGM2Ht1Z1SM37RQDqPFmZYEzh2hhYQAAC0NJREFUeJzNnQ1UFNcVx+cKKOAHu0BslSY1ftRDbSs0p0I4Ao1gbBRpNaaLVpEYCIqkGjXERKM2iTZHaSqpVoNGiYpVjtFgYo/aqE1NY6icVmrUnGiSNtWEtEZEQBABu7OfM7vz8d67b2b2fzzZndl33/1lmZ15H/fdBwJXgUuC51+3EN4p9GmPBrjO1wuviuweXhU3LXCrZyB8wccXD+gEkbaDoGCUWPAS3iEaeoSTo4nGoR0+6kH6REGParZ91o/BbqDzf/QMwi87dDLA572YrW+MAvgbqzErdMqFzhhWnx61fvsLxpsKG3QqwCds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MCGgkNYIZA42ixjCjoBHUKGYcNDM1jhkJzUiNZMZCM1FjmdHQDNRoZjw0NTWemQM0JTUHZh7QVNQ8mLlAC3lvkobmt0agMi94xGe/u8FXydL1tOWobl1MI16b9J0box+cPyyJ0/Z63HYWzHlH7xKBb/CK1uG3HeJg22NawbWOjEIel7NLPPdwLJ94Wm1datTK1ER+jvhuPAmJN5WWe5ZVNvLYP8HvhmdlTqVcrPxSnjrAfjUhkirpur54Q4uy9Sqo7Cp13ilKqpqjoC9lzhIC/R8ayIzTAQpU0QAAAABJRU5ErkJggg==", ce = [-170, -65, 170, 65], qe = (S) => {
|
|
12
|
+
const q = C({ props: S, name: "HCDataMap" }), { data: l, payload: g, onPayloadUpdate: y, accessToken: P, sx: W, ...v } = q, m = O(), M = n(j("map-")), o = n(null), u = n(null), i = n(null), c = n(null), d = n(), A = n(!1), x = n(!1), h = n(null), p = n({ payload: g, onPayloadUpdate: y });
|
|
13
|
+
b(() => {
|
|
14
|
+
p.current = { payload: g, onPayloadUpdate: y };
|
|
15
|
+
});
|
|
16
|
+
const [z, I] = w(!1), [k, J] = w(null), X = () => {
|
|
17
|
+
if (!z || !o.current || !l || _(l) || !i.current)
|
|
14
18
|
return;
|
|
15
|
-
const
|
|
16
|
-
const a =
|
|
19
|
+
const e = new re(), t = l.filter((r) => {
|
|
20
|
+
const a = L(r.variables.geometry)[0];
|
|
17
21
|
try {
|
|
18
|
-
return
|
|
22
|
+
return te(a), !0;
|
|
19
23
|
} catch {
|
|
20
24
|
return !1;
|
|
21
25
|
}
|
|
22
|
-
}).map((
|
|
23
|
-
const a =
|
|
26
|
+
}).map((r) => {
|
|
27
|
+
const a = L(r.variables.geometry)[0], s = e.readFeature(a, {
|
|
24
28
|
dataProjection: "EPSG:4326",
|
|
25
29
|
featureProjection: "EPSG:3857"
|
|
26
30
|
});
|
|
27
|
-
return
|
|
31
|
+
return s.set("title", r.title), s;
|
|
28
32
|
});
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
i.current.clear(), i.current.addFeatures(t);
|
|
34
|
+
}, N = () => {
|
|
35
|
+
if (!A.current || !o.current) return !1;
|
|
36
|
+
const e = o.current.getSize();
|
|
37
|
+
return !!(e && e[0] > 0 && e[1] > 0);
|
|
38
|
+
}, R = () => {
|
|
39
|
+
if (!o.current || !N()) return;
|
|
40
|
+
const e = o.current.getBoundingBox(), t = {
|
|
41
|
+
...p.current.payload,
|
|
42
|
+
boundingBox: e
|
|
36
43
|
};
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
$(t, h.current) || (h.current = t, p.current.onPayloadUpdate(t));
|
|
45
|
+
}, D = () => {
|
|
46
|
+
var r, a;
|
|
47
|
+
if (x.current || !N()) return;
|
|
48
|
+
const e = (r = p.current.payload) == null ? void 0 : r.boundingBox, t = e ? [
|
|
49
|
+
e.bottomLeft.longitude,
|
|
50
|
+
e.bottomLeft.latitude,
|
|
51
|
+
e.topRight.longitude,
|
|
52
|
+
e.topRight.latitude
|
|
53
|
+
] : ce;
|
|
54
|
+
(a = o.current) == null || a.centerToExtent(
|
|
55
|
+
Y(t, "EPSG:4326", "EPSG:3857")
|
|
56
|
+
), x.current = !0, R();
|
|
57
|
+
}, F = () => {
|
|
58
|
+
d.current && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
59
|
+
var e;
|
|
60
|
+
A.current && ((e = o.current) == null || e.updateSize(), u.current && u.current.map.resize(), D());
|
|
42
61
|
}, 100);
|
|
43
|
-
},
|
|
44
|
-
var
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
}), (
|
|
48
|
-
|
|
62
|
+
}, Q = () => {
|
|
63
|
+
var e, t;
|
|
64
|
+
(e = o.current) == null || e.on("movestart", () => {
|
|
65
|
+
c.current && (clearTimeout(c.current), c.current = null);
|
|
66
|
+
}), (t = o.current) == null || t.on("moveend", () => {
|
|
67
|
+
c.current && (clearTimeout(c.current), c.current = null), c.current = setTimeout(R, 500);
|
|
49
68
|
});
|
|
50
|
-
},
|
|
51
|
-
var
|
|
52
|
-
const
|
|
53
|
-
id:
|
|
69
|
+
}, B = () => {
|
|
70
|
+
var s, G, Z;
|
|
71
|
+
const e = m.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", t = ee({
|
|
72
|
+
id: M.current,
|
|
54
73
|
center: [0, 0],
|
|
55
|
-
style:
|
|
56
|
-
accessToken:
|
|
74
|
+
style: e,
|
|
75
|
+
accessToken: P
|
|
57
76
|
});
|
|
58
|
-
(
|
|
59
|
-
const
|
|
60
|
-
source:
|
|
61
|
-
style: new
|
|
62
|
-
image: new
|
|
77
|
+
(s = o.current) == null || s.addLayer(t.layer), u.current = t;
|
|
78
|
+
const r = new K(), a = new U({
|
|
79
|
+
source: r,
|
|
80
|
+
style: new oe({
|
|
81
|
+
image: new ae({
|
|
63
82
|
anchor: [0.5, 1],
|
|
64
|
-
src:
|
|
83
|
+
src: ne,
|
|
65
84
|
scale: 0.1,
|
|
66
|
-
color:
|
|
85
|
+
color: m.palette.primary.main
|
|
67
86
|
})
|
|
68
87
|
})
|
|
69
88
|
});
|
|
70
|
-
|
|
71
|
-
var
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
text:
|
|
75
|
-
x:
|
|
76
|
-
y:
|
|
89
|
+
(G = o.current) == null || G.addLayer(a), i.current = r, A.current = !0, I(!0), Q(), (Z = o.current) == null || Z.on("pointermove", (f) => {
|
|
90
|
+
var E;
|
|
91
|
+
const H = (E = o.current) == null ? void 0 : E.forEachFeatureAtPixel(f.pixel, 4);
|
|
92
|
+
J(H ? {
|
|
93
|
+
text: H.get("title"),
|
|
94
|
+
x: f.pixel[0],
|
|
95
|
+
y: f.pixel[1]
|
|
77
96
|
} : null);
|
|
78
|
-
}),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
], F = V(b, "EPSG:4326", "EPSG:3857");
|
|
85
|
-
t.current.centerToExtent(F);
|
|
86
|
-
}
|
|
87
|
-
}, v = () => {
|
|
88
|
-
var e, a;
|
|
89
|
-
if (!c.current) return;
|
|
90
|
-
const r = p.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", o = ((a = (e = c.current.layer.getSource()) == null ? void 0 : e.getMapboxMap) == null ? void 0 : a.call(e)) || c.current.map;
|
|
91
|
-
o && o.setStyle(r);
|
|
97
|
+
}), D();
|
|
98
|
+
}, V = () => {
|
|
99
|
+
var r, a;
|
|
100
|
+
if (!u.current) return;
|
|
101
|
+
const e = m.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", t = ((a = (r = u.current.layer.getSource()) == null ? void 0 : r.getMapboxMap) == null ? void 0 : a.call(r)) || u.current.map;
|
|
102
|
+
t && t.setStyle(e);
|
|
92
103
|
};
|
|
93
|
-
|
|
94
|
-
}), [
|
|
95
|
-
}), [
|
|
96
|
-
const
|
|
104
|
+
b(() => (X(), () => {
|
|
105
|
+
}), [l, z]), b(() => (V(), () => {
|
|
106
|
+
}), [m.palette.mode]);
|
|
107
|
+
const T = { ...q };
|
|
97
108
|
return {
|
|
98
|
-
refs: { mapRef:
|
|
99
|
-
state: { tooltip:
|
|
100
|
-
actions: { onInit:
|
|
101
|
-
ownerState:
|
|
102
|
-
sx:
|
|
103
|
-
other:
|
|
109
|
+
refs: { mapRef: o, mapId: M },
|
|
110
|
+
state: { tooltip: k },
|
|
111
|
+
actions: { onInit: B, onMapResize: F },
|
|
112
|
+
ownerState: T,
|
|
113
|
+
sx: W,
|
|
114
|
+
other: v
|
|
104
115
|
};
|
|
105
116
|
};
|
|
106
117
|
export {
|
|
107
|
-
|
|
118
|
+
qe as useDataMapLogic
|
|
108
119
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { useEffect as
|
|
2
|
+
import { Typography as l } from "@mui/material";
|
|
3
|
+
import { useEffect as d } from "react";
|
|
4
4
|
import { u } from "../../index.esm-DAf19hyR.js";
|
|
5
5
|
import { Map as h } from "../map/index.js";
|
|
6
6
|
import { Controls as M } from "./components/controls/index.js";
|
|
@@ -8,27 +8,31 @@ import { Legend as R } from "./components/legend/index.js";
|
|
|
8
8
|
import { useHeatMapLogic as g } from "./logic.js";
|
|
9
9
|
import { HeatMapRoot as H, HeatMapHeader as z, HeatMapContent as x } from "./styled.js";
|
|
10
10
|
const E = (r) => {
|
|
11
|
-
const { refs:
|
|
12
|
-
return
|
|
13
|
-
}), [n, a]), /* @__PURE__ */ m(H, { ownerState:
|
|
14
|
-
/* @__PURE__ */ e(z, { ownerState:
|
|
15
|
-
/* @__PURE__ */ m(x, { ownerState:
|
|
11
|
+
const { refs: o, actions: i, gradient: s, ownerState: t, sx: p, other: f } = g(r), { width: n, height: a, ref: c } = u();
|
|
12
|
+
return d(() => (n && a && i.onMapResize(), () => {
|
|
13
|
+
}), [n, a]), /* @__PURE__ */ m(H, { ownerState: t, sx: p, ref: c, ...f, children: [
|
|
14
|
+
/* @__PURE__ */ e(z, { ownerState: t, children: /* @__PURE__ */ e(l, { variant: "h3", children: r.title }) }),
|
|
15
|
+
/* @__PURE__ */ m(x, { ownerState: t, children: [
|
|
16
16
|
/* @__PURE__ */ e(
|
|
17
17
|
h,
|
|
18
18
|
{
|
|
19
|
-
id:
|
|
20
|
-
ref:
|
|
19
|
+
id: o.mapId.current,
|
|
20
|
+
ref: o.mapRef,
|
|
21
21
|
center: { latitude: 0, longitude: 0 },
|
|
22
22
|
zoom: 3,
|
|
23
23
|
options: {
|
|
24
24
|
cssPosition: "absolute",
|
|
25
|
-
controls: { zoom: !1 }
|
|
25
|
+
controls: { zoom: !1 },
|
|
26
|
+
// The widget sits in a scrollable dashboard: swallowing the wheel would
|
|
27
|
+
// trap the page scroll on the map. Zoom stays available through
|
|
28
|
+
// `Controls` and double-click.
|
|
29
|
+
interactions: { mouseWheelZoom: !1 }
|
|
26
30
|
},
|
|
27
31
|
onInit: i.onInit
|
|
28
32
|
}
|
|
29
33
|
),
|
|
30
|
-
/* @__PURE__ */ e(R, { gradient:
|
|
31
|
-
/* @__PURE__ */ e(M, { mapRef:
|
|
34
|
+
/* @__PURE__ */ e(R, { gradient: s }),
|
|
35
|
+
/* @__PURE__ */ e(M, { mapRef: o.mapRef.current })
|
|
32
36
|
] })
|
|
33
37
|
] });
|
|
34
38
|
};
|