@mapcomponents/deck-gl 1.8.5 → 1.8.7
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/CHANGELOG.md +1 -0
- package/dist/CHANGELOG.md +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +145 -7
- package/dist/package.json +8 -6
- package/package.json +8 -6
- package/src/components/MlHexagonLayer/MlHexagonLayer.stories.tsx +2 -1
- package/src/decorators/MapContextDecorator.tsx +1 -1
- package/vite.config.ts +12 -1
- package/dist/html2canvas.esm-CUkZERmf.js +0 -22
- package/dist/html2canvas.esm-Dmi1NfiH.mjs +0 -4871
- package/dist/index-2pRp38DS.js +0 -4712
- package/dist/index-XOA5TV-e.mjs +0 -102973
- package/dist/index.css +0 -1
- package/dist/index.es-BNHgyHB_.js +0 -18
- package/dist/index.es-nMmjT7oh.mjs +0 -6674
- package/dist/purify.es-D1I7B1hP.js +0 -2
- package/dist/purify.es-DHbHSKL1.mjs +0 -528
package/CHANGELOG.md
CHANGED
package/dist/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),u=require("@mapcomponents/react-maplibre"),m=require("@deck.gl/mapbox"),f=require("@deck.gl/aggregation-layers"),L=require("@deck.gl/geo-layers"),g=require("@deck.gl/mesh-layers"),k="deckgl-layer",y=n.createContext({}),v=({mapId:a,children:s})=>{const r=u.useMap({mapId:a}),e=n.useRef(void 0),[o,t]=n.useState([]),[c,i]=n.useState([]);n.useEffect(()=>{if(r.map)return e.current=new m.MapboxOverlay({id:k,interleaved:!0}),r.map.addControl(e.current),()=>{e.current&&r.map?.removeControl(e.current),e.current=void 0}},[r.map]),n.useEffect(()=>{e.current&&e.current.setProps({layers:[...o],effects:[...c]})},[o,c]);const p={deckGlLayerArray:o,setDeckGlLayerArray:t,deckGlEffectArray:c,setDeckGlEffectArray:i};return l.jsx(y.Provider,{value:p,children:s})};function d(){const a=n.useContext(y);function s(t){a.setDeckGlEffectArray(c=>[...c,t])}function r(t){a.setDeckGlEffectArray(c=>c.filter(i=>i!==t))}function e(t){a.setDeckGlLayerArray(c=>[...c,t])}function o(t){a.setDeckGlLayerArray(c=>c.filter(i=>i!==t))}return{addEffect:s,removeEffect:r,addLayer:e,removeLayer:o}}const x={type:f.HexagonLayer,layerOpacity:.8,elevationRange:[30,75],elevationScale:1,extruded:!0,coverage:.9,autoHighlight:!1,material:{ambient:.6,diffuse:.5,shininess:10},radius:16,transitions:{elevationScale:1500},_filterData:null,colorRange:[[1,152,189,125],[73,227,206,150],[216,254,181,175],[254,237,177,200],[254,173,84,225],[209,55,78,255]]},G=a=>{const s=d();a={...x,...a};const{mapId:r,...e}=a,o=u.useMap({mapId:r,waitForLayer:e.beforeId}),t=n.useMemo(()=>e.data?new f.HexagonLayer({...e}):null,[e.beforeId,e.data,e.elevationScale,e.extruded,e.coverage,e.autoHighlight,e.material,e.radius,e.transitions]);return n.useEffect(()=>{if(!(!o.map||!t))return s.addLayer(t),()=>{s.removeLayer(t)}},[o.map,t]),l.jsx(l.Fragment,{})},D=a=>{const{mapId:s,...r}=a,e=u.useMap({mapId:s}),o=d(),t=n.useMemo(()=>r.data?new L.Tile3DLayer({...r}):null,[r.data,r.id,r.pickable,r.onTileLoad,r.onTileUnload,r.loadOptions,r.loaders,r.visible,r.opacity,r.pointSize,r.beforeId]);return n.useEffect(()=>{if(!(!e.map||!t))return o.addLayer(t),()=>{t&&o.removeLayer(t)}},[e.map,t]),l.jsx(l.Fragment,{})},M=a=>{const{mapId:s,...r}=a,e=u.useMap({mapId:s,waitForLayer:r.beforeId}),o=d(),t=n.useMemo(()=>new g.ScenegraphLayer({...r}),[r]);return n.useEffect(()=>{if(!(!e.map||!t))return o.addLayer(t),()=>{t&&o.removeLayer(t)}},[e.map,t]),l.jsx(l.Fragment,{})};exports.DeckGlContext=y;exports.DeckGlContextProvider=v;exports.Ml3DTileLayer=D;exports.MlHexagonLayer=G;exports.MlSceneGraphLayer=M;exports.useDeckGl=d;
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,147 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as s, Fragment as u } from "react/jsx-runtime";
|
|
2
|
+
import v, { useRef as g, useState as m, useEffect as i, useContext as G, useMemo as f } from "react";
|
|
3
|
+
import { useMap as d } from "@mapcomponents/react-maplibre";
|
|
4
|
+
import { MapboxOverlay as x } from "@deck.gl/mapbox";
|
|
5
|
+
import { HexagonLayer as p } from "@deck.gl/aggregation-layers";
|
|
6
|
+
import { Tile3DLayer as D } from "@deck.gl/geo-layers";
|
|
7
|
+
import { ScenegraphLayer as H } from "@deck.gl/mesh-layers";
|
|
8
|
+
const h = "deckgl-layer", L = v.createContext({}), w = ({ mapId: a, children: c }) => {
|
|
9
|
+
const r = d({ mapId: a }), e = g(void 0), [o, t] = m([]), [n, l] = m([]);
|
|
10
|
+
i(() => {
|
|
11
|
+
if (r.map)
|
|
12
|
+
return e.current = new x({
|
|
13
|
+
id: h,
|
|
14
|
+
interleaved: !0
|
|
15
|
+
}), r.map.addControl(e.current), () => {
|
|
16
|
+
e.current && r.map?.removeControl(e.current), e.current = void 0;
|
|
17
|
+
};
|
|
18
|
+
}, [r.map]), i(() => {
|
|
19
|
+
e.current && e.current.setProps({
|
|
20
|
+
layers: [...o],
|
|
21
|
+
effects: [...n]
|
|
22
|
+
});
|
|
23
|
+
}, [o, n]);
|
|
24
|
+
const k = {
|
|
25
|
+
deckGlLayerArray: o,
|
|
26
|
+
setDeckGlLayerArray: t,
|
|
27
|
+
deckGlEffectArray: n,
|
|
28
|
+
setDeckGlEffectArray: l
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ s(L.Provider, { value: k, children: c });
|
|
31
|
+
};
|
|
32
|
+
function y() {
|
|
33
|
+
const a = G(L);
|
|
34
|
+
function c(t) {
|
|
35
|
+
a.setDeckGlEffectArray((n) => [...n, t]);
|
|
36
|
+
}
|
|
37
|
+
function r(t) {
|
|
38
|
+
a.setDeckGlEffectArray((n) => n.filter((l) => l !== t));
|
|
39
|
+
}
|
|
40
|
+
function e(t) {
|
|
41
|
+
a.setDeckGlLayerArray((n) => [...n, t]);
|
|
42
|
+
}
|
|
43
|
+
function o(t) {
|
|
44
|
+
a.setDeckGlLayerArray((n) => n.filter((l) => l !== t));
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
addEffect: c,
|
|
48
|
+
removeEffect: r,
|
|
49
|
+
addLayer: e,
|
|
50
|
+
removeLayer: o
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const S = {
|
|
54
|
+
type: p,
|
|
55
|
+
layerOpacity: 0.8,
|
|
56
|
+
elevationRange: [30, 75],
|
|
57
|
+
elevationScale: 1,
|
|
58
|
+
extruded: !0,
|
|
59
|
+
coverage: 0.9,
|
|
60
|
+
autoHighlight: !1,
|
|
61
|
+
material: { ambient: 0.6, diffuse: 0.5, shininess: 10 },
|
|
62
|
+
radius: 16,
|
|
63
|
+
transitions: { elevationScale: 1500 },
|
|
64
|
+
_filterData: null,
|
|
65
|
+
colorRange: [
|
|
66
|
+
[1, 152, 189, 125],
|
|
67
|
+
[73, 227, 206, 150],
|
|
68
|
+
[216, 254, 181, 175],
|
|
69
|
+
[254, 237, 177, 200],
|
|
70
|
+
[254, 173, 84, 225],
|
|
71
|
+
[209, 55, 78, 255]
|
|
72
|
+
]
|
|
73
|
+
}, R = (a) => {
|
|
74
|
+
const c = y();
|
|
75
|
+
a = {
|
|
76
|
+
...S,
|
|
77
|
+
...a
|
|
78
|
+
};
|
|
79
|
+
const { mapId: r, ...e } = a, o = d({
|
|
80
|
+
mapId: r,
|
|
81
|
+
waitForLayer: e.beforeId
|
|
82
|
+
}), t = f(() => e.data ? new p({
|
|
83
|
+
...e
|
|
84
|
+
}) : null, [
|
|
85
|
+
e.beforeId,
|
|
86
|
+
e.data,
|
|
87
|
+
e.elevationScale,
|
|
88
|
+
e.extruded,
|
|
89
|
+
e.coverage,
|
|
90
|
+
e.autoHighlight,
|
|
91
|
+
e.material,
|
|
92
|
+
e.radius,
|
|
93
|
+
e.transitions
|
|
94
|
+
]);
|
|
95
|
+
return i(() => {
|
|
96
|
+
if (!(!o.map || !t))
|
|
97
|
+
return c.addLayer(t), () => {
|
|
98
|
+
c.removeLayer(t);
|
|
99
|
+
};
|
|
100
|
+
}, [o.map, t]), /* @__PURE__ */ s(u, {});
|
|
101
|
+
}, T = (a) => {
|
|
102
|
+
const { mapId: c, ...r } = a, e = d({ mapId: c }), o = y(), t = f(() => r.data ? new D({
|
|
103
|
+
...r
|
|
104
|
+
}) : null, [
|
|
105
|
+
r.data,
|
|
106
|
+
r.id,
|
|
107
|
+
r.pickable,
|
|
108
|
+
r.onTileLoad,
|
|
109
|
+
r.onTileUnload,
|
|
110
|
+
r.loadOptions,
|
|
111
|
+
r.loaders,
|
|
112
|
+
r.visible,
|
|
113
|
+
r.opacity,
|
|
114
|
+
r.pointSize,
|
|
115
|
+
r.beforeId
|
|
116
|
+
]);
|
|
117
|
+
return i(() => {
|
|
118
|
+
if (!(!e.map || !t))
|
|
119
|
+
return o.addLayer(t), () => {
|
|
120
|
+
t && o.removeLayer(t);
|
|
121
|
+
};
|
|
122
|
+
}, [e.map, t]), /* @__PURE__ */ s(u, {});
|
|
123
|
+
}, F = (a) => {
|
|
124
|
+
const { mapId: c, ...r } = a, e = d({
|
|
125
|
+
mapId: c,
|
|
126
|
+
waitForLayer: r.beforeId
|
|
127
|
+
}), o = y(), t = f(
|
|
128
|
+
() => new H({
|
|
129
|
+
...r
|
|
130
|
+
}),
|
|
131
|
+
[r]
|
|
132
|
+
);
|
|
133
|
+
return i(() => {
|
|
134
|
+
if (!(!e.map || !t))
|
|
135
|
+
return o.addLayer(t), () => {
|
|
136
|
+
t && o.removeLayer(t);
|
|
137
|
+
};
|
|
138
|
+
}, [e.map, t]), /* @__PURE__ */ s(u, {});
|
|
139
|
+
};
|
|
2
140
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
141
|
+
L as DeckGlContext,
|
|
142
|
+
w as DeckGlContextProvider,
|
|
143
|
+
T as Ml3DTileLayer,
|
|
144
|
+
R as MlHexagonLayer,
|
|
145
|
+
F as MlSceneGraphLayer,
|
|
146
|
+
y as useDeckGl
|
|
9
147
|
};
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapcomponents/deck-gl",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -9,17 +9,19 @@
|
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"@mui/icons-material": "^7.3.2",
|
|
13
|
+
"@mui/material": "^7.3.2",
|
|
14
|
+
"@storybook/react": "^9.1.4",
|
|
15
|
+
"uuid": "^11.1.0"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
12
18
|
"@deck.gl/aggregation-layers": "^9.2.6",
|
|
13
19
|
"@deck.gl/core": "^9.2.6",
|
|
14
20
|
"@deck.gl/geo-layers": "^9.2.6",
|
|
15
21
|
"@deck.gl/mapbox": "^9.2.6",
|
|
16
22
|
"@deck.gl/mesh-layers": "^9.2.6",
|
|
17
23
|
"@mapcomponents/react-maplibre": "workspace:*",
|
|
18
|
-
"
|
|
19
|
-
"@mui/material": "^7.3.2",
|
|
20
|
-
"@storybook/react": "^9.1.4",
|
|
21
|
-
"maplibre-gl": "^5.16.0",
|
|
22
|
-
"uuid": "^11.1.0"
|
|
24
|
+
"maplibre-gl": "^5.16.0"
|
|
23
25
|
},
|
|
24
26
|
"devDependencies": {
|
|
25
27
|
"@types/geojson": "^7946.0.16"
|
package/package.json
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapcomponents/deck-gl",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
+
"@mui/icons-material": "^7.3.2",
|
|
10
|
+
"@mui/material": "^7.3.2",
|
|
11
|
+
"@storybook/react": "^9.1.4",
|
|
12
|
+
"uuid": "^11.1.0"
|
|
13
|
+
},
|
|
14
|
+
"peerDependencies": {
|
|
9
15
|
"@deck.gl/aggregation-layers": "^9.2.6",
|
|
10
16
|
"@deck.gl/core": "^9.2.6",
|
|
11
17
|
"@deck.gl/geo-layers": "^9.2.6",
|
|
12
18
|
"@deck.gl/mapbox": "^9.2.6",
|
|
13
19
|
"@deck.gl/mesh-layers": "^9.2.6",
|
|
14
|
-
"@mui/icons-material": "^7.3.2",
|
|
15
|
-
"@mui/material": "^7.3.2",
|
|
16
|
-
"@storybook/react": "^9.1.4",
|
|
17
20
|
"maplibre-gl": "^5.16.0",
|
|
18
|
-
"
|
|
19
|
-
"@mapcomponents/react-maplibre": "1.8.5"
|
|
21
|
+
"@mapcomponents/react-maplibre": "1.8.7"
|
|
20
22
|
},
|
|
21
23
|
"devDependencies": {
|
|
22
24
|
"@types/geojson": "^7946.0.16"
|
|
@@ -5,7 +5,7 @@ import { useMap } from '@mapcomponents/react-maplibre';
|
|
|
5
5
|
import { HexagonLayer } from '@deck.gl/aggregation-layers';
|
|
6
6
|
|
|
7
7
|
const storyoptions = {
|
|
8
|
-
title: 'MapComponents/
|
|
8
|
+
title: 'MapComponents/MlHexagonLayer',
|
|
9
9
|
component: MlHexagonLayer,
|
|
10
10
|
argTypes: {},
|
|
11
11
|
decorators: mapContextDecorator,
|
|
@@ -60,6 +60,7 @@ const Template = (context: any) => {
|
|
|
60
60
|
data={noiseData.features}
|
|
61
61
|
getPosition={(d: any) => d.geometry.coordinates}
|
|
62
62
|
{...context}
|
|
63
|
+
beforeId={'waterway-name'}
|
|
63
64
|
/>
|
|
64
65
|
</>
|
|
65
66
|
);
|
package/vite.config.ts
CHANGED
|
@@ -39,7 +39,18 @@ export default defineConfig(() => ({
|
|
|
39
39
|
},
|
|
40
40
|
rollupOptions: {
|
|
41
41
|
// External packages that should not be bundled into your library.
|
|
42
|
-
external: [
|
|
42
|
+
external: [
|
|
43
|
+
'react',
|
|
44
|
+
'react-dom',
|
|
45
|
+
'react/jsx-runtime',
|
|
46
|
+
'@mapcomponents/react-maplibre',
|
|
47
|
+
'maplibre-gl',
|
|
48
|
+
'@deck.gl/aggregation-layers',
|
|
49
|
+
'@deck.gl/core',
|
|
50
|
+
'@deck.gl/geo-layers',
|
|
51
|
+
'@deck.gl/mapbox',
|
|
52
|
+
'@deck.gl/mesh-layers',
|
|
53
|
+
],
|
|
43
54
|
},
|
|
44
55
|
},
|
|
45
56
|
}));
|