@dxos/react-ui-geo 0.8.3 → 0.8.4-main.3a94e84
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/data/airports.ts +1 -1
- package/data/cities.ts +1 -1
- package/data/countries-110m.ts +1 -1
- package/data/countries-dots-3.ts +1 -1
- package/data/countries-dots-4.ts +1 -1
- package/dist/lib/browser/chunk-GMWLKTLN.mjs +9 -0
- package/dist/lib/browser/{countries-110m-WI4PCLDF.mjs → countries-110m-ZM3ZIEFS.mjs} +2 -2
- package/dist/lib/browser/countries-110m-ZM3ZIEFS.mjs.map +7 -0
- package/dist/lib/browser/data.mjs +1 -1
- package/dist/lib/browser/index.mjs +16 -16
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/{chunk-PIIEDZEU.mjs → chunk-JODBF4CC.mjs} +3 -3
- package/dist/lib/node-esm/{countries-110m-DQ4XRC4B.mjs → countries-110m-3SFASWVD.mjs} +2 -2
- package/dist/lib/node-esm/countries-110m-3SFASWVD.mjs.map +7 -0
- package/dist/lib/node-esm/data.mjs +1 -1
- package/dist/lib/node-esm/index.mjs +16 -16
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Map/Map.stories.d.ts +1 -1
- package/dist/types/src/components/Map/Map.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/components/Globe/Globe.stories.tsx +5 -5
- package/src/components/Globe/Globe.tsx +30 -34
- package/src/components/Map/Map.stories.tsx +1 -1
- package/src/components/index.ts +1 -1
- package/src/index.ts +1 -1
- package/dist/lib/browser/chunk-ENCWOTYX.mjs +0 -9
- package/dist/lib/browser/countries-110m-WI4PCLDF.mjs.map +0 -7
- package/dist/lib/node/chunk-LAICG6L2.cjs +0 -40
- package/dist/lib/node/chunk-LAICG6L2.cjs.map +0 -7
- package/dist/lib/node/countries-110m-KQ5WAB2O.cjs +0 -37877
- package/dist/lib/node/countries-110m-KQ5WAB2O.cjs.map +0 -7
- package/dist/lib/node/data.cjs +0 -28
- package/dist/lib/node/data.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -1187
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node-esm/countries-110m-DQ4XRC4B.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-ENCWOTYX.mjs.map → chunk-GMWLKTLN.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-PIIEDZEU.mjs.map → chunk-JODBF4CC.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-geo",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4-main.3a94e84",
|
|
4
4
|
"description": "Geo components.",
|
|
5
5
|
"homepage": "https://github.com/dxos",
|
|
6
6
|
"bugs": "https://github.com/dxos/issues",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"topojson-client": "^3.1.0",
|
|
47
47
|
"topojson-simplify": "^3.0.3",
|
|
48
48
|
"versor": "^0.2.0",
|
|
49
|
-
"@dxos/async": "0.8.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
49
|
+
"@dxos/async": "0.8.4-main.3a94e84",
|
|
50
|
+
"@dxos/debug": "0.8.4-main.3a94e84",
|
|
51
|
+
"@dxos/log": "0.8.4-main.3a94e84",
|
|
52
|
+
"@dxos/node-std": "0.8.4-main.3a94e84",
|
|
53
|
+
"@dxos/util": "0.8.4-main.3a94e84"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@react-three/drei": "^9.99.0",
|
|
@@ -70,15 +70,15 @@
|
|
|
70
70
|
"react": "~18.2.0",
|
|
71
71
|
"react-dom": "~18.2.0",
|
|
72
72
|
"three": "0.165.0",
|
|
73
|
-
"@dxos/react-ui": "0.8.
|
|
74
|
-
"@dxos/react-ui-theme": "0.8.
|
|
75
|
-
"@dxos/storybook-utils": "0.8.
|
|
73
|
+
"@dxos/react-ui": "0.8.4-main.3a94e84",
|
|
74
|
+
"@dxos/react-ui-theme": "0.8.4-main.3a94e84",
|
|
75
|
+
"@dxos/storybook-utils": "0.8.4-main.3a94e84"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": "~18.2.0",
|
|
79
79
|
"react-dom": "~18.2.0",
|
|
80
|
-
"@dxos/react-ui": "0.8.
|
|
81
|
-
"@dxos/react-ui-theme": "0.8.
|
|
80
|
+
"@dxos/react-ui": "0.8.4-main.3a94e84",
|
|
81
|
+
"@dxos/react-ui-theme": "0.8.4-main.3a94e84"
|
|
82
82
|
},
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
7
|
+
import { type Meta } from '@storybook/react-vite';
|
|
8
8
|
import { type FeatureCollection, type Geometry, type Position } from 'geojson';
|
|
9
9
|
import { Leva } from 'leva';
|
|
10
10
|
import React, { useMemo, useRef, useState } from 'react';
|
|
@@ -138,7 +138,7 @@ const Story = ({
|
|
|
138
138
|
translation,
|
|
139
139
|
rotation = [0, 0, 0],
|
|
140
140
|
projection,
|
|
141
|
-
styles,
|
|
141
|
+
styles = defaultStyles,
|
|
142
142
|
drag = false,
|
|
143
143
|
spin = false,
|
|
144
144
|
tour = false,
|
|
@@ -235,7 +235,7 @@ export const Earth1 = () => {
|
|
|
235
235
|
|
|
236
236
|
return (
|
|
237
237
|
<Globe.Root scale={1.2} rotation={[Math.random() * 360, 0, 0]}>
|
|
238
|
-
<Globe.Canvas ref={setController} topology={topology} />
|
|
238
|
+
<Globe.Canvas ref={setController} topology={topology} styles={defaultStyles} />
|
|
239
239
|
<Globe.Zoom onAction={handleAction} />
|
|
240
240
|
</Globe.Root>
|
|
241
241
|
);
|
|
@@ -250,7 +250,7 @@ export const Earth2 = () => {
|
|
|
250
250
|
return (
|
|
251
251
|
<div className='absolute bottom-0 left-0 right-0 '>
|
|
252
252
|
<Globe.Root classNames='h-[400px]' scale={2.8} translation={{ x: 0, y: 400 }}>
|
|
253
|
-
<Globe.Canvas ref={setController} topology={topology} />
|
|
253
|
+
<Globe.Canvas ref={setController} topology={topology} styles={defaultStyles} />
|
|
254
254
|
<Globe.Zoom onAction={handleAction} />
|
|
255
255
|
</Globe.Root>
|
|
256
256
|
</div>
|
|
@@ -291,7 +291,7 @@ export const Mercator = () => {
|
|
|
291
291
|
};
|
|
292
292
|
|
|
293
293
|
export const Globe1 = () => {
|
|
294
|
-
return <Story drag projection='mercator' scale={0.8} rotation={initialRotation} />;
|
|
294
|
+
return <Story drag projection='mercator' scale={0.8} rotation={initialRotation} styles={defaultStyles} />;
|
|
295
295
|
};
|
|
296
296
|
|
|
297
297
|
export const Globe2 = () => {
|
|
@@ -188,40 +188,36 @@ const GlobeCanvas = forwardRef<GlobeController, GlobeCanvasProps>(
|
|
|
188
188
|
|
|
189
189
|
// External controller.
|
|
190
190
|
const zooming = useRef(false);
|
|
191
|
-
useImperativeHandle<GlobeController, GlobeController>(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
};
|
|
222
|
-
},
|
|
223
|
-
[canvas],
|
|
224
|
-
);
|
|
191
|
+
useImperativeHandle<GlobeController, GlobeController>(forwardRef, () => {
|
|
192
|
+
return {
|
|
193
|
+
canvas,
|
|
194
|
+
projection,
|
|
195
|
+
center,
|
|
196
|
+
get scale() {
|
|
197
|
+
return scaleRef.current;
|
|
198
|
+
},
|
|
199
|
+
translation,
|
|
200
|
+
rotation,
|
|
201
|
+
setCenter,
|
|
202
|
+
setScale: (s) => {
|
|
203
|
+
if (typeof s === 'function') {
|
|
204
|
+
const is = interpolateNumber(scaleRef.current, s(scaleRef.current));
|
|
205
|
+
// Stop easing if already zooming.
|
|
206
|
+
transition()
|
|
207
|
+
.ease(zooming.current ? easeLinear : easeSinOut)
|
|
208
|
+
.duration(200)
|
|
209
|
+
.tween('scale', () => (t) => setScale(is(t)))
|
|
210
|
+
.on('end', () => {
|
|
211
|
+
zooming.current = false;
|
|
212
|
+
});
|
|
213
|
+
} else {
|
|
214
|
+
setScale(s);
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
setTranslation,
|
|
218
|
+
setRotation,
|
|
219
|
+
};
|
|
220
|
+
}, [canvas]);
|
|
225
221
|
|
|
226
222
|
// https://d3js.org/d3-geo/path#geoPath
|
|
227
223
|
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react';
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
package/src/components/index.ts
CHANGED
package/src/index.ts
CHANGED