@dxos/react-ui-geo 0.7.5-labs.ea4b4c2 → 0.7.5-labs.f400bbc
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/lib/browser/index.mjs +113 -48
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +111 -46
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +113 -48
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts +5 -5
- package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +9 -10
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Map/Map.d.ts +7 -7
- package/dist/types/src/components/Map/Map.d.ts.map +1 -1
- package/dist/types/src/components/Map/Map.stories.d.ts +6 -2
- package/dist/types/src/components/Map/Map.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Controls.d.ts +2 -3
- package/dist/types/src/components/Toolbar/Controls.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +2 -1
- package/dist/types/src/components/types.d.ts.map +1 -1
- package/dist/types/src/hooks/context.d.ts +2 -2
- package/dist/types/src/hooks/context.d.ts.map +1 -1
- package/dist/types/src/hooks/useTour.d.ts +8 -3
- package/dist/types/src/hooks/useTour.d.ts.map +1 -1
- package/dist/types/src/util/debug.d.ts.map +1 -1
- package/dist/types/src/util/render.d.ts +2 -2
- package/dist/types/src/util/render.d.ts.map +1 -1
- package/package.json +12 -10
- package/src/components/Globe/Globe.stories.tsx +8 -11
- package/src/components/Globe/Globe.tsx +56 -32
- package/src/components/Map/Map.stories.tsx +28 -6
- package/src/components/Map/Map.tsx +93 -82
- package/src/components/types.ts +2 -1
- package/src/hooks/useDrag.ts +1 -1
- package/src/hooks/useTour.ts +31 -19
- package/src/util/debug.ts +1 -0
- package/src/util/render.ts +18 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/ui/react-ui-geo/data/countries-110m.ts":{"bytes":1352295,"imports":[],"format":"esm"},"packages/ui/react-ui-geo/src/data.ts":{"bytes":914,"imports":[{"path":"packages/ui/react-ui-geo/data/countries-110m.ts","kind":"dynamic-import","original":"../data/countries-110m.ts"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/types.ts":{"bytes":951,"imports":[],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/context.tsx":{"bytes":5204,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/util/debug.ts":{"bytes":1506,"imports":[],"format":"esm"},"packages/ui/react-ui-geo/src/util/inertia.ts":{"bytes":21992,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"versor","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/util/path.ts":{"bytes":5846,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/util/render.ts":{"bytes":11848,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-geo/src/util/path.ts","kind":"import-statement","original":"./path"}],"format":"esm"},"packages/ui/react-ui-geo/src/util/index.ts":{"bytes":747,"imports":[{"path":"packages/ui/react-ui-geo/src/util/debug.ts","kind":"import-statement","original":"./debug"},{"path":"packages/ui/react-ui-geo/src/util/inertia.ts","kind":"import-statement","original":"./inertia"},{"path":"packages/ui/react-ui-geo/src/util/path.ts","kind":"import-statement","original":"./path"},{"path":"packages/ui/react-ui-geo/src/util/render.ts","kind":"import-statement","original":"./render"}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/useDrag.ts":{"bytes":4603,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-geo/src/util/index.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/useGlobeZoomHandler.ts":{"bytes":2396,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/useMapZoomHandler.ts":{"bytes":2362,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/useSpinner.ts":{"bytes":5331,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/useTour.ts":{"bytes":14072,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"versor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-geo/src/util/index.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/index.ts":{"bytes":997,"imports":[{"path":"packages/ui/react-ui-geo/src/hooks/context.tsx","kind":"import-statement","original":"./context"},{"path":"packages/ui/react-ui-geo/src/hooks/useDrag.ts","kind":"import-statement","original":"./useDrag"},{"path":"packages/ui/react-ui-geo/src/hooks/useGlobeZoomHandler.ts","kind":"import-statement","original":"./useGlobeZoomHandler"},{"path":"packages/ui/react-ui-geo/src/hooks/useMapZoomHandler.ts","kind":"import-statement","original":"./useMapZoomHandler"},{"path":"packages/ui/react-ui-geo/src/hooks/useSpinner.ts","kind":"import-statement","original":"./useSpinner"},{"path":"packages/ui/react-ui-geo/src/hooks/useTour.ts","kind":"import-statement","original":"./useTour"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Toolbar/Controls.tsx":{"bytes":5932,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Toolbar/index.ts":{"bytes":515,"imports":[{"path":"packages/ui/react-ui-geo/src/components/Toolbar/Controls.tsx","kind":"import-statement","original":"./Controls"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Globe/Globe.tsx":{"bytes":24734,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-geo/src/hooks/index.ts","kind":"import-statement","original":"../../hooks"},{"path":"packages/ui/react-ui-geo/src/util/index.ts","kind":"import-statement","original":"../../util"},{"path":"packages/ui/react-ui-geo/src/components/Toolbar/index.ts","kind":"import-statement","original":"../Toolbar"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Globe/index.ts":{"bytes":506,"imports":[{"path":"packages/ui/react-ui-geo/src/components/Globe/Globe.tsx","kind":"import-statement","original":"./Globe"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Map/Map.tsx":{"bytes":19049,"imports":[{"path":"leaflet/dist/leaflet.css","kind":"import-statement","external":true},{"path":"leaflet","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom/client","kind":"import-statement","external":true},{"path":"react-leaflet","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-geo/src/components/Toolbar/index.ts","kind":"import-statement","original":"../Toolbar"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Map/index.ts":{"bytes":498,"imports":[{"path":"packages/ui/react-ui-geo/src/components/Map/Map.tsx","kind":"import-statement","original":"./Map"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/index.ts":{"bytes":751,"imports":[{"path":"packages/ui/react-ui-geo/src/components/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/ui/react-ui-geo/src/components/Globe/index.ts","kind":"import-statement","original":"./Globe"},{"path":"packages/ui/react-ui-geo/src/components/Map/index.ts","kind":"import-statement","original":"./Map"},{"path":"packages/ui/react-ui-geo/src/components/Toolbar/index.ts","kind":"import-statement","original":"./Toolbar"}],"format":"esm"},"packages/ui/react-ui-geo/src/types.ts":{"bytes":624,"imports":[],"format":"esm"},"packages/ui/react-ui-geo/src/index.ts":{"bytes":824,"imports":[{"path":"packages/ui/react-ui-geo/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-geo/src/data.ts","kind":"import-statement","original":"./data"},{"path":"packages/ui/react-ui-geo/src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"packages/ui/react-ui-geo/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/ui/react-ui-geo/src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"packages/ui/react-ui-geo/dist/lib/node-esm/data.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/ui/react-ui-geo/dist/lib/node-esm/data.mjs":{"imports":[{"path":"packages/ui/react-ui-geo/dist/lib/node-esm/chunk-PIIEDZEU.mjs","kind":"import-statement"}],"exports":["loadTopology"],"entryPoint":"packages/ui/react-ui-geo/src/data.ts","inputs":{},"bytes":208},"packages/ui/react-ui-geo/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":62928},"packages/ui/react-ui-geo/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/ui/react-ui-geo/dist/lib/node-esm/chunk-PIIEDZEU.mjs","kind":"import-statement"},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"versor","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"versor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"leaflet/dist/leaflet.css","kind":"import-statement","external":true},{"path":"leaflet","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom/client","kind":"import-statement","external":true},{"path":"react-leaflet","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ActionControls","Globe","GlobeContextProvider","Map","ZoomControls","closestPoint","controlPositions","createLayers","geoCircle","geoInertiaDrag","geoLine","geoPoint","geoToPosition","getDistance","loadTopology","positionToRotation","renderLayers","restrictAxis","timer","useDrag","useGlobeContext","useGlobeZoomHandler","useMapZoomHandler","useSpinner","useTour"],"entryPoint":"packages/ui/react-ui-geo/src/index.ts","inputs":{"packages/ui/react-ui-geo/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/components/Globe/Globe.tsx":{"bytesInOutput":5288},"packages/ui/react-ui-geo/src/hooks/context.tsx":{"bytesInOutput":960},"packages/ui/react-ui-geo/src/hooks/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/hooks/useDrag.ts":{"bytesInOutput":839},"packages/ui/react-ui-geo/src/util/debug.ts":{"bytesInOutput":211},"packages/ui/react-ui-geo/src/util/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/util/inertia.ts":{"bytesInOutput":4544},"packages/ui/react-ui-geo/src/util/path.ts":{"bytesInOutput":1051},"packages/ui/react-ui-geo/src/util/render.ts":{"bytesInOutput":2320},"packages/ui/react-ui-geo/src/hooks/useGlobeZoomHandler.ts":{"bytesInOutput":417},"packages/ui/react-ui-geo/src/hooks/useMapZoomHandler.ts":{"bytesInOutput":426},"packages/ui/react-ui-geo/src/hooks/useSpinner.ts":{"bytesInOutput":1141},"packages/ui/react-ui-geo/src/hooks/useTour.ts":{"bytesInOutput":3137},"packages/ui/react-ui-geo/src/components/Toolbar/Controls.tsx":{"bytesInOutput":1521},"packages/ui/react-ui-geo/src/components/Toolbar/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/components/Globe/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/components/Map/Map.tsx":{"bytesInOutput":4258},"packages/ui/react-ui-geo/src/components/Map/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/index.ts":{"bytesInOutput":0}},"bytes":27517},"packages/ui/react-ui-geo/dist/lib/node-esm/chunk-PIIEDZEU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":432},"packages/ui/react-ui-geo/dist/lib/node-esm/chunk-PIIEDZEU.mjs":{"imports":[{"path":"packages/ui/react-ui-geo/dist/lib/node-esm/countries-110m-DQ4XRC4B.mjs","kind":"dynamic-import"}],"exports":["loadTopology"],"inputs":{"packages/ui/react-ui-geo/src/data.ts":{"bytesInOutput":102}},"bytes":307},"packages/ui/react-ui-geo/dist/lib/node-esm/countries-110m-DQ4XRC4B.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":352621},"packages/ui/react-ui-geo/dist/lib/node-esm/countries-110m-DQ4XRC4B.mjs":{"imports":[],"exports":["default"],"entryPoint":"packages/ui/react-ui-geo/data/countries-110m.ts","inputs":{"packages/ui/react-ui-geo/data/countries-110m.ts":{"bytesInOutput":420420}},"bytes":420665}}}
|
|
1
|
+
{"inputs":{"packages/ui/react-ui-geo/data/countries-110m.ts":{"bytes":1352295,"imports":[],"format":"esm"},"packages/ui/react-ui-geo/src/data.ts":{"bytes":914,"imports":[{"path":"packages/ui/react-ui-geo/data/countries-110m.ts","kind":"dynamic-import","original":"../data/countries-110m.ts"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/types.ts":{"bytes":983,"imports":[],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/context.tsx":{"bytes":5204,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/util/debug.ts":{"bytes":1506,"imports":[],"format":"esm"},"packages/ui/react-ui-geo/src/util/inertia.ts":{"bytes":21992,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"versor","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/util/path.ts":{"bytes":5846,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/util/render.ts":{"bytes":12455,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-geo/src/util/path.ts","kind":"import-statement","original":"./path"}],"format":"esm"},"packages/ui/react-ui-geo/src/util/index.ts":{"bytes":747,"imports":[{"path":"packages/ui/react-ui-geo/src/util/debug.ts","kind":"import-statement","original":"./debug"},{"path":"packages/ui/react-ui-geo/src/util/inertia.ts","kind":"import-statement","original":"./inertia"},{"path":"packages/ui/react-ui-geo/src/util/path.ts","kind":"import-statement","original":"./path"},{"path":"packages/ui/react-ui-geo/src/util/render.ts","kind":"import-statement","original":"./render"}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/useDrag.ts":{"bytes":4691,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-geo/src/util/index.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/useGlobeZoomHandler.ts":{"bytes":2396,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/useMapZoomHandler.ts":{"bytes":2362,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/useSpinner.ts":{"bytes":5331,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/useTour.ts":{"bytes":15403,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"versor","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-geo/src/util/index.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/ui/react-ui-geo/src/hooks/index.ts":{"bytes":997,"imports":[{"path":"packages/ui/react-ui-geo/src/hooks/context.tsx","kind":"import-statement","original":"./context"},{"path":"packages/ui/react-ui-geo/src/hooks/useDrag.ts","kind":"import-statement","original":"./useDrag"},{"path":"packages/ui/react-ui-geo/src/hooks/useGlobeZoomHandler.ts","kind":"import-statement","original":"./useGlobeZoomHandler"},{"path":"packages/ui/react-ui-geo/src/hooks/useMapZoomHandler.ts","kind":"import-statement","original":"./useMapZoomHandler"},{"path":"packages/ui/react-ui-geo/src/hooks/useSpinner.ts","kind":"import-statement","original":"./useSpinner"},{"path":"packages/ui/react-ui-geo/src/hooks/useTour.ts","kind":"import-statement","original":"./useTour"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Toolbar/Controls.tsx":{"bytes":5932,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Toolbar/index.ts":{"bytes":515,"imports":[{"path":"packages/ui/react-ui-geo/src/components/Toolbar/Controls.tsx","kind":"import-statement","original":"./Controls"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Globe/Globe.tsx":{"bytes":26472,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-geo/src/hooks/index.ts","kind":"import-statement","original":"../../hooks"},{"path":"packages/ui/react-ui-geo/src/util/index.ts","kind":"import-statement","original":"../../util"},{"path":"packages/ui/react-ui-geo/src/components/Toolbar/index.ts","kind":"import-statement","original":"../Toolbar"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Globe/index.ts":{"bytes":506,"imports":[{"path":"packages/ui/react-ui-geo/src/components/Globe/Globe.tsx","kind":"import-statement","original":"./Globe"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Map/Map.tsx":{"bytes":20610,"imports":[{"path":"leaflet/dist/leaflet.css","kind":"import-statement","external":true},{"path":"leaflet","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom/client","kind":"import-statement","external":true},{"path":"react-leaflet","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-geo/src/components/Toolbar/index.ts","kind":"import-statement","original":"../Toolbar"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/Map/index.ts":{"bytes":498,"imports":[{"path":"packages/ui/react-ui-geo/src/components/Map/Map.tsx","kind":"import-statement","original":"./Map"}],"format":"esm"},"packages/ui/react-ui-geo/src/components/index.ts":{"bytes":751,"imports":[{"path":"packages/ui/react-ui-geo/src/components/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/ui/react-ui-geo/src/components/Globe/index.ts","kind":"import-statement","original":"./Globe"},{"path":"packages/ui/react-ui-geo/src/components/Map/index.ts","kind":"import-statement","original":"./Map"},{"path":"packages/ui/react-ui-geo/src/components/Toolbar/index.ts","kind":"import-statement","original":"./Toolbar"}],"format":"esm"},"packages/ui/react-ui-geo/src/types.ts":{"bytes":624,"imports":[],"format":"esm"},"packages/ui/react-ui-geo/src/index.ts":{"bytes":824,"imports":[{"path":"packages/ui/react-ui-geo/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-geo/src/data.ts","kind":"import-statement","original":"./data"},{"path":"packages/ui/react-ui-geo/src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"packages/ui/react-ui-geo/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/ui/react-ui-geo/src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"packages/ui/react-ui-geo/dist/lib/node-esm/data.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/ui/react-ui-geo/dist/lib/node-esm/data.mjs":{"imports":[{"path":"packages/ui/react-ui-geo/dist/lib/node-esm/chunk-PIIEDZEU.mjs","kind":"import-statement"}],"exports":["loadTopology"],"entryPoint":"packages/ui/react-ui-geo/src/data.ts","inputs":{},"bytes":208},"packages/ui/react-ui-geo/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":65339},"packages/ui/react-ui-geo/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/ui/react-ui-geo/dist/lib/node-esm/chunk-PIIEDZEU.mjs","kind":"import-statement"},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"versor","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"versor","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"leaflet/dist/leaflet.css","kind":"import-statement","external":true},{"path":"leaflet","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom/client","kind":"import-statement","external":true},{"path":"react-leaflet","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ActionControls","Globe","GlobeContextProvider","Map","ZoomControls","closestPoint","controlPositions","createLayers","geoCircle","geoInertiaDrag","geoLine","geoPoint","geoToPosition","getDistance","loadTopology","positionToRotation","renderLayers","restrictAxis","timer","useDrag","useGlobeContext","useGlobeZoomHandler","useMapZoomHandler","useSpinner","useTour"],"entryPoint":"packages/ui/react-ui-geo/src/index.ts","inputs":{"packages/ui/react-ui-geo/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/components/Globe/Globe.tsx":{"bytesInOutput":5742},"packages/ui/react-ui-geo/src/hooks/context.tsx":{"bytesInOutput":960},"packages/ui/react-ui-geo/src/hooks/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/hooks/useDrag.ts":{"bytesInOutput":855},"packages/ui/react-ui-geo/src/util/debug.ts":{"bytesInOutput":211},"packages/ui/react-ui-geo/src/util/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/util/inertia.ts":{"bytesInOutput":4544},"packages/ui/react-ui-geo/src/util/path.ts":{"bytesInOutput":1051},"packages/ui/react-ui-geo/src/util/render.ts":{"bytesInOutput":2479},"packages/ui/react-ui-geo/src/hooks/useGlobeZoomHandler.ts":{"bytesInOutput":417},"packages/ui/react-ui-geo/src/hooks/useMapZoomHandler.ts":{"bytesInOutput":426},"packages/ui/react-ui-geo/src/hooks/useSpinner.ts":{"bytesInOutput":1141},"packages/ui/react-ui-geo/src/hooks/useTour.ts":{"bytesInOutput":3589},"packages/ui/react-ui-geo/src/components/Toolbar/Controls.tsx":{"bytesInOutput":1521},"packages/ui/react-ui-geo/src/components/Toolbar/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/components/Globe/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/components/Map/Map.tsx":{"bytesInOutput":4837},"packages/ui/react-ui-geo/src/components/Map/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-geo/src/index.ts":{"bytesInOutput":0}},"bytes":29177},"packages/ui/react-ui-geo/dist/lib/node-esm/chunk-PIIEDZEU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":432},"packages/ui/react-ui-geo/dist/lib/node-esm/chunk-PIIEDZEU.mjs":{"imports":[{"path":"packages/ui/react-ui-geo/dist/lib/node-esm/countries-110m-DQ4XRC4B.mjs","kind":"dynamic-import"}],"exports":["loadTopology"],"inputs":{"packages/ui/react-ui-geo/src/data.ts":{"bytesInOutput":102}},"bytes":307},"packages/ui/react-ui-geo/dist/lib/node-esm/countries-110m-DQ4XRC4B.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":352621},"packages/ui/react-ui-geo/dist/lib/node-esm/countries-110m-DQ4XRC4B.mjs":{"imports":[],"exports":["default"],"entryPoint":"packages/ui/react-ui-geo/data/countries-110m.ts","inputs":{"packages/ui/react-ui-geo/data/countries-110m.ts":{"bytesInOutput":420420}},"bytes":420665}}}
|
|
@@ -22,16 +22,16 @@ type GlobeControlProps = {
|
|
|
22
22
|
position?: ControlPosition;
|
|
23
23
|
} & Pick<ControlProps, 'onAction'>;
|
|
24
24
|
export declare const Globe: {
|
|
25
|
-
Root: ({ classNames, children, ...props }: GlobeRootProps) =>
|
|
25
|
+
Root: ({ classNames, children, ...props }: GlobeRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
Canvas: React.ForwardRefExoticComponent<GlobeCanvasProps & React.RefAttributes<GlobeController>>;
|
|
27
|
-
Zoom: ({ onAction, position, ...props }: GlobeControlProps) =>
|
|
28
|
-
Action: ({ onAction, position, ...props }: GlobeControlProps) =>
|
|
27
|
+
Zoom: ({ onAction, position, ...props }: GlobeControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
Action: ({ onAction, position, ...props }: GlobeControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
Debug: ({ position }: {
|
|
30
30
|
position?: ControlPosition;
|
|
31
|
-
}) =>
|
|
31
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
Panel: ({ position, classNames, children, }: ThemedClassName<PropsWithChildren & {
|
|
33
33
|
position?: ControlPosition;
|
|
34
|
-
}>) =>
|
|
34
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
};
|
|
36
36
|
export type { GlobeRootProps, GlobeCanvasProps };
|
|
37
37
|
//# sourceMappingURL=Globe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Globe.d.ts","sourceRoot":"","sources":["../../../../../src/components/Globe/Globe.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,EACZ,KAAK,iBAAiB,EAOvB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"Globe.d.ts","sourceRoot":"","sources":["../../../../../src/components/Globe/Globe.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,EACZ,KAAK,iBAAiB,EAOvB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,KAAK,eAAe,EAAkD,MAAM,gBAAgB,CAAC;AAGtG,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EAEtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,QAAQ,EAMd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAgC,KAAK,YAAY,EAAoB,MAAM,YAAY,CAAC;AAwD/F,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE,aAAa,CAAC;CAC3B,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,gBAAgB,GAAG,aAAa,CAAC,CAAC;AAEjH,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,UAAU,GAAG,qBAAqB,CAAC;AAqBjF,KAAK,cAAc,GAAG,iBAAiB,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC,CAAC;AAiBpF,KAAK,gBAAgB,GAAG;IACtB,UAAU,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;IAC5C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB,CAAC;AAqIF,KAAK,iBAAiB,GAAG;IAAE,QAAQ,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AAEzF,eAAO,MAAM,KAAK;+CA3JqC,cAAc;;6CA8JX,iBAAiB;+CAKd,iBAAiB;0BAtChC;QAAE,QAAQ,CAAC,EAAE,eAAe,CAAA;KAAE;iDAoBzE,eAAe,CAAC,iBAAiB,GAAG;QAAE,QAAQ,CAAC,EAAE,eAAe,CAAA;KAAE,CAAC;CAyBrE,CAAC;AAEF,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import { type Meta } from '@storybook/react';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
declare const meta: Meta;
|
|
5
4
|
export default meta;
|
|
6
|
-
export declare const Earth1: () =>
|
|
7
|
-
export declare const Earth2: () =>
|
|
8
|
-
export declare const Mercator: () =>
|
|
9
|
-
export declare const Globe1: () =>
|
|
10
|
-
export declare const Globe2: () =>
|
|
11
|
-
export declare const Globe3: () =>
|
|
12
|
-
export declare const Globe4: () =>
|
|
13
|
-
export declare const Globe5: () =>
|
|
14
|
-
export declare const Globe6: () =>
|
|
5
|
+
export declare const Earth1: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const Earth2: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Mercator: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const Globe1: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const Globe2: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const Globe3: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const Globe4: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const Globe5: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const Globe6: () => import("react/jsx-runtime").JSX.Element;
|
|
15
14
|
//# sourceMappingURL=Globe.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Globe.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Globe/Globe.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Globe.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Globe/Globe.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAuN7C,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,MAAM,+CAYlB,CAAC;AAEF,eAAO,MAAM,MAAM,+CAclB,CAAC;AAqBF,eAAO,MAAM,QAAQ,+CAYpB,CAAC;AAEF,eAAO,MAAM,MAAM,+CAElB,CAAC;AAEF,eAAO,MAAM,MAAM,+CAElB,CAAC;AAEF,eAAO,MAAM,MAAM,+CAElB,CAAC;AAEF,eAAO,MAAM,MAAM,+CAElB,CAAC;AAEF,eAAO,MAAM,MAAM,+CAElB,CAAC;AAEF,eAAO,MAAM,MAAM,+CAElB,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import 'leaflet/dist/leaflet.css';
|
|
2
|
-
import type
|
|
3
|
-
import { type ControlPosition, type LatLngExpression } from 'leaflet';
|
|
2
|
+
import L, { type ControlPosition, type LatLngExpression } from 'leaflet';
|
|
4
3
|
import React from 'react';
|
|
5
|
-
import {
|
|
4
|
+
import type { MapContainerProps } from 'react-leaflet';
|
|
6
5
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
7
6
|
import { type ControlProps } from '../Toolbar';
|
|
8
7
|
import { type MapCanvasProps } from '../types';
|
|
@@ -15,9 +14,10 @@ type MapControlProps = {
|
|
|
15
14
|
position?: ControlPosition;
|
|
16
15
|
} & Pick<ControlProps, 'onAction'>;
|
|
17
16
|
export declare const Map: {
|
|
18
|
-
Root: ({ classNames, center, zoom, ...props }: MapRootProps) =>
|
|
17
|
+
Root: ({ classNames, center, zoom, ...props }: MapRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
18
|
Canvas: React.ForwardRefExoticComponent<Omit<{
|
|
20
19
|
markers?: import("../..").MapMarker[];
|
|
20
|
+
selected?: string[];
|
|
21
21
|
zoom?: number;
|
|
22
22
|
center?: L.LatLngLiteral;
|
|
23
23
|
onChange?: (ev: {
|
|
@@ -25,10 +25,10 @@ export declare const Map: {
|
|
|
25
25
|
zoom: number;
|
|
26
26
|
}) => void;
|
|
27
27
|
}, "className"> & {
|
|
28
|
-
classNames?: import("@dxos/react-ui").ClassNameValue;
|
|
28
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
29
29
|
} & React.RefAttributes<MapController>>;
|
|
30
|
-
Zoom: ({ onAction, position, ...props }: MapControlProps) =>
|
|
31
|
-
Action: ({ onAction, position, ...props }: MapControlProps) =>
|
|
30
|
+
Zoom: ({ onAction, position, ...props }: MapControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
Action: ({ onAction, position, ...props }: MapControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
};
|
|
33
33
|
export { type MapCanvasProps, type MapController };
|
|
34
34
|
//# sourceMappingURL=Map.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.d.ts","sourceRoot":"","sources":["../../../../../src/components/Map/Map.tsx"],"names":[],"mappings":"AAKA,OAAO,0BAA0B,CAAC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"Map.d.ts","sourceRoot":"","sources":["../../../../../src/components/Map/Map.tsx"],"names":[],"mappings":"AAKA,OAAO,0BAA0B,CAAC;AAElC,OAAO,CAAC,EAAE,EAA4C,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACnH,OAAO,KAA6E,MAAM,OAAO,CAAC;AAElG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAKvD,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAG9E,OAAO,EAAkD,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAe/C,KAAK,YAAY,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAuBvD,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,KAAK,IAAI,CAAC;CACjD,CAAC;AAoIF,KAAK,eAAe,GAAG;IAAE,QAAQ,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AAMvF,eAAO,MAAM,GAAG;mDAjK2E,YAAY;;;;;;;;;;;;;6CAoK7C,eAAe;+CAKZ,eAAe;CAK3E,CAAC;AAEF,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import { type StoryObj, type Meta } from '@storybook/react';
|
|
3
|
-
declare const
|
|
3
|
+
declare const Render: ({ markers }: {
|
|
4
|
+
markers: any;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const meta: Meta<typeof Render>;
|
|
4
7
|
export default meta;
|
|
5
|
-
type Story = StoryObj
|
|
8
|
+
type Story = StoryObj<typeof Render>;
|
|
6
9
|
export declare const Default: Story;
|
|
10
|
+
export declare const WithMarkers: Story;
|
|
7
11
|
//# sourceMappingURL=Map.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Map/Map.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Map.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Map/Map.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAS5D,QAAA,MAAM,MAAM;;6CAWX,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAI7B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,WAAW,EAAE,KAoBzB,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { type ControlPosition } from 'leaflet';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
3
|
export type ControlAction = 'toggle' | 'start' | 'zoom-in' | 'zoom-out';
|
|
5
4
|
export type ControlProps = ThemedClassName<{
|
|
6
5
|
onAction?: (action: ControlAction) => void;
|
|
7
6
|
}>;
|
|
8
7
|
export declare const controlPositions: Record<ControlPosition, string>;
|
|
9
|
-
export declare const ZoomControls: ({ classNames, onAction }: ControlProps) =>
|
|
10
|
-
export declare const ActionControls: ({ classNames, onAction }: ControlProps) =>
|
|
8
|
+
export declare const ZoomControls: ({ classNames, onAction }: ControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const ActionControls: ({ classNames, onAction }: ControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
//# sourceMappingURL=Controls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Controls.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Controls.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Controls.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Controls.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,EAAc,KAAK,eAAe,EAAW,MAAM,gBAAgB,CAAC;AAE3E,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC;AAExE,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC5C,CAAC,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAK5D,CAAC;AAEF,eAAO,MAAM,YAAY,6BAA8B,YAAY,4CAuBlE,CAAC;AAEF,eAAO,MAAM,cAAc,6BAA8B,YAAY,4CAuBpE,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type LatLngLiteral } from 'leaflet';
|
|
2
2
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
3
|
import { type MapMarker } from '../types';
|
|
4
|
-
export type
|
|
4
|
+
export { type LatLngLiteral };
|
|
5
5
|
export type MapCanvasProps = ThemedClassName<{
|
|
6
6
|
markers?: MapMarker[];
|
|
7
|
+
selected?: string[];
|
|
7
8
|
zoom?: number;
|
|
8
9
|
center?: LatLngLiteral;
|
|
9
10
|
onChange?: (ev: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,KAAK,aAAa,EAAE,CAAC;AAE9B,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC;IAC3C,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE;QAAE,MAAM,EAAE,aAAa,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAClE,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Dispatch, type PropsWithChildren, type SetStateAction } from 'react';
|
|
2
2
|
import { type LatLng } from '../util';
|
|
3
3
|
export type Size = {
|
|
4
4
|
width: number;
|
|
@@ -21,6 +21,6 @@ export type GlobeContextType = {
|
|
|
21
21
|
setRotation: Dispatch<SetStateAction<Vector>>;
|
|
22
22
|
};
|
|
23
23
|
export type GlobeContextProviderProps = PropsWithChildren<Partial<Pick<GlobeContextType, 'size' | 'center' | 'scale' | 'translation' | 'rotation'>>>;
|
|
24
|
-
export declare const GlobeContextProvider: ({ children, size, center: _center, scale: _scale, translation: _translation, rotation: _rotation, }: GlobeContextProviderProps) =>
|
|
24
|
+
export declare const GlobeContextProvider: ({ children, size, center: _center, scale: _scale, translation: _translation, rotation: _rotation, }: GlobeContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
export declare const useGlobeContext: () => GlobeContextType;
|
|
26
26
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/hooks/context.tsx"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/hooks/context.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAiB,KAAK,QAAQ,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAc,MAAM,OAAO,CAAC;AAKrH,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,MAAM,MAAM,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACrD,MAAM,MAAM,KAAK,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7C,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,KAAK,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,cAAc,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;CAC/C,CAAC;AAIF,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CACvD,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,GAAG,UAAU,CAAC,CAAC,CAC1F,CAAC;AAEF,eAAO,MAAM,oBAAoB,wGAO9B,yBAAyB,4CAa3B,CAAC;AAEF,eAAO,MAAM,eAAe,wBAE3B,CAAC"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
import { type Dispatch, type SetStateAction } from 'react';
|
|
1
2
|
import type { GlobeController } from '../components';
|
|
2
|
-
import { type
|
|
3
|
+
import { type LatLng, type StyleSet } from '../util';
|
|
3
4
|
export type TourOptions = {
|
|
5
|
+
running?: boolean;
|
|
4
6
|
disabled?: boolean;
|
|
5
|
-
styles?: StyleSet;
|
|
6
7
|
duration?: number;
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
tilt?: number;
|
|
10
|
+
autoRotate?: boolean;
|
|
11
|
+
styles?: StyleSet;
|
|
7
12
|
};
|
|
8
13
|
/**
|
|
9
14
|
* Iterates between points.
|
|
10
15
|
* Inspired by: https://observablehq.com/@mbostock/top-100-cities
|
|
11
16
|
*/
|
|
12
|
-
export declare const useTour: (controller?: GlobeController | null,
|
|
17
|
+
export declare const useTour: (controller?: GlobeController | null, points?: LatLng[], options?: TourOptions) => [boolean, Dispatch<SetStateAction<boolean>>];
|
|
13
18
|
//# sourceMappingURL=useTour.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTour.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTour.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTour.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTour.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAKhF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAiB,KAAK,MAAM,EAAsB,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMxF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,gBACL,eAAe,GAAG,IAAI,WAC1B,MAAM,EAAE,YACR,WAAW,KACnB,CAAC,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CA0F7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../../src/util/debug.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,KAAK,GAAI,CAAC,aAAa,MAAM,CAAC,KAAG,
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../../src/util/debug.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,KAAK,GAAI,CAAC,aAAa,MAAM,CAAC,KAAG,CAU7C,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type GeoPath, type GeoPermissibleObjects } from 'd3';
|
|
|
2
2
|
import { type Topology } from 'topojson-specification';
|
|
3
3
|
import { type LatLng } from './path';
|
|
4
4
|
export type Styles = Record<string, any>;
|
|
5
|
-
export type Style = 'water' | 'graticule' | 'land' | 'border' | 'dots' | 'point' | 'line' | 'cursor' | 'arc';
|
|
5
|
+
export type Style = 'background' | 'water' | 'graticule' | 'land' | 'border' | 'dots' | 'point' | 'line' | 'cursor' | 'arc';
|
|
6
6
|
export type StyleSet = Partial<Record<Style, Styles>>;
|
|
7
7
|
export type Features = {
|
|
8
8
|
points?: LatLng[];
|
|
@@ -22,5 +22,5 @@ export declare const createLayers: (topology: Topology, features: Features, styl
|
|
|
22
22
|
/**
|
|
23
23
|
* Render layers created above.
|
|
24
24
|
*/
|
|
25
|
-
export declare const renderLayers: (generator: GeoPath, layers: Layer[], scale: number) => CanvasRenderingContext2D;
|
|
25
|
+
export declare const renderLayers: (generator: GeoPath, layers: Layer[], scale: number, styles: StyleSet) => CanvasRenderingContext2D;
|
|
26
26
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/util/render.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAE9D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,KAAK,MAAM,EAAqB,MAAM,QAAQ,CAAC;AAExD,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEzC,MAAM,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/util/render.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAE9D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,KAAK,MAAM,EAAqB,MAAM,QAAQ,CAAC;AAExD,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEzC,MAAM,MAAM,KAAK,GACb,YAAY,GACZ,OAAO,GACP,WAAW,GACX,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,MAAM,GACN,QAAQ,GACR,KAAK,CAAC;AAEV,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAEtD,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,qBAAqB,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,aAAc,QAAQ,YAAY,QAAQ,UAAU,QAAQ,KAAG,KAAK,EA2E5F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,cAAe,OAAO,UAAU,KAAK,EAAE,SAAc,MAAM,UAAU,QAAQ,6BA0CrG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-geo",
|
|
3
|
-
"version": "0.7.5-labs.
|
|
3
|
+
"version": "0.7.5-labs.f400bbc",
|
|
4
4
|
"description": "Geo components.",
|
|
5
5
|
"homepage": "https://github.com/dxos",
|
|
6
6
|
"bugs": "https://github.com/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
9
|
"sideEffects": true,
|
|
10
|
+
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
"./data": {
|
|
12
13
|
"types": "./dist/types/src/data.d.ts",
|
|
@@ -44,10 +45,11 @@
|
|
|
44
45
|
"topojson-client": "^3.1.0",
|
|
45
46
|
"topojson-simplify": "^3.0.3",
|
|
46
47
|
"versor": "^0.2.0",
|
|
47
|
-
"@dxos/async": "0.7.5-labs.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/node-std": "0.7.5-labs.
|
|
48
|
+
"@dxos/async": "0.7.5-labs.f400bbc",
|
|
49
|
+
"@dxos/debug": "0.7.5-labs.f400bbc",
|
|
50
|
+
"@dxos/log": "0.7.5-labs.f400bbc",
|
|
51
|
+
"@dxos/node-std": "0.7.5-labs.f400bbc",
|
|
52
|
+
"@dxos/util": "0.7.5-labs.f400bbc"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
55
|
"@react-three/drei": "^9.99.0",
|
|
@@ -67,15 +69,15 @@
|
|
|
67
69
|
"react": "~18.2.0",
|
|
68
70
|
"react-dom": "~18.2.0",
|
|
69
71
|
"three": "0.165.0",
|
|
70
|
-
"@dxos/react-ui": "0.7.5-labs.
|
|
71
|
-
"@dxos/react-ui-theme": "0.7.5-labs.
|
|
72
|
-
"@dxos/storybook-utils": "0.7.5-labs.
|
|
72
|
+
"@dxos/react-ui": "0.7.5-labs.f400bbc",
|
|
73
|
+
"@dxos/react-ui-theme": "0.7.5-labs.f400bbc",
|
|
74
|
+
"@dxos/storybook-utils": "0.7.5-labs.f400bbc"
|
|
73
75
|
},
|
|
74
76
|
"peerDependencies": {
|
|
75
77
|
"react": "~18.2.0",
|
|
76
78
|
"react-dom": "~18.2.0",
|
|
77
|
-
"@dxos/react-ui": "0.7.5-labs.
|
|
78
|
-
"@dxos/react-ui-theme": "0.7.5-labs.
|
|
79
|
+
"@dxos/react-ui": "0.7.5-labs.f400bbc",
|
|
80
|
+
"@dxos/react-ui-theme": "0.7.5-labs.f400bbc"
|
|
79
81
|
},
|
|
80
82
|
"publishConfig": {
|
|
81
83
|
"access": "public"
|
|
@@ -138,7 +138,7 @@ const Story = ({
|
|
|
138
138
|
translation,
|
|
139
139
|
rotation = [0, 0, 0],
|
|
140
140
|
projection,
|
|
141
|
-
styles
|
|
141
|
+
styles,
|
|
142
142
|
drag = false,
|
|
143
143
|
spin = false,
|
|
144
144
|
tour = false,
|
|
@@ -160,10 +160,7 @@ const Story = ({
|
|
|
160
160
|
|
|
161
161
|
// Control hooks.
|
|
162
162
|
const [startSpinner, stopSpinner] = useSpinner(controller.current, { disabled: !spin });
|
|
163
|
-
const [
|
|
164
|
-
disabled: !tour,
|
|
165
|
-
styles,
|
|
166
|
-
});
|
|
163
|
+
const [_running, setRunning] = useTour(controller.current, features?.points, { disabled: !tour, styles });
|
|
167
164
|
useDrag(controller.current, {
|
|
168
165
|
xAxis,
|
|
169
166
|
disabled: !drag,
|
|
@@ -171,7 +168,7 @@ const Story = ({
|
|
|
171
168
|
switch (event.type) {
|
|
172
169
|
case 'start': {
|
|
173
170
|
stopSpinner();
|
|
174
|
-
|
|
171
|
+
setRunning(false);
|
|
175
172
|
break;
|
|
176
173
|
}
|
|
177
174
|
}
|
|
@@ -186,7 +183,7 @@ const Story = ({
|
|
|
186
183
|
startSpinner();
|
|
187
184
|
}
|
|
188
185
|
if (tour) {
|
|
189
|
-
|
|
186
|
+
setRunning(true);
|
|
190
187
|
}
|
|
191
188
|
break;
|
|
192
189
|
}
|
|
@@ -205,7 +202,7 @@ const Story = ({
|
|
|
205
202
|
<Globe.Root classNames='absolute inset-0' scale={_scale} translation={translation} rotation={rotation}>
|
|
206
203
|
<Globe.Canvas
|
|
207
204
|
ref={controller}
|
|
208
|
-
topology={styles
|
|
205
|
+
topology={styles?.dots ? dots : topology}
|
|
209
206
|
projection={projection}
|
|
210
207
|
styles={styles}
|
|
211
208
|
features={tour ? { points: features?.points ?? [] } : features}
|
|
@@ -298,15 +295,15 @@ export const Globe1 = () => {
|
|
|
298
295
|
};
|
|
299
296
|
|
|
300
297
|
export const Globe2 = () => {
|
|
301
|
-
return <Story drag projection='transverse-mercator' scale={0.8} rotation={initialRotation} />;
|
|
298
|
+
return <Story drag projection='transverse-mercator' scale={0.8} rotation={initialRotation} styles={defaultStyles} />;
|
|
302
299
|
};
|
|
303
300
|
|
|
304
301
|
export const Globe3 = () => {
|
|
305
|
-
return <Story drag spin scale={1.5} rotation={initialRotation} />;
|
|
302
|
+
return <Story drag spin scale={1.5} rotation={initialRotation} styles={defaultStyles} />;
|
|
306
303
|
};
|
|
307
304
|
|
|
308
305
|
export const Globe4 = () => {
|
|
309
|
-
return <Story drag tour scale={2} rotation={initialRotation} />;
|
|
306
|
+
return <Story drag tour scale={2} rotation={initialRotation} styles={defaultStyles} />;
|
|
310
307
|
};
|
|
311
308
|
|
|
312
309
|
export const Globe5 = () => {
|
|
@@ -17,7 +17,7 @@ import React, {
|
|
|
17
17
|
import { useResizeDetector } from 'react-resize-detector';
|
|
18
18
|
import { type Topology } from 'topojson-specification';
|
|
19
19
|
|
|
20
|
-
import { type ThemedClassName, useDynamicRef } from '@dxos/react-ui';
|
|
20
|
+
import { type ThemedClassName, type ThemeMode, useDynamicRef, useThemeContext } from '@dxos/react-ui';
|
|
21
21
|
import { mx } from '@dxos/react-ui-theme';
|
|
22
22
|
|
|
23
23
|
import {
|
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
} from '../../hooks';
|
|
29
29
|
import {
|
|
30
30
|
type Features,
|
|
31
|
-
type Styles,
|
|
32
31
|
type StyleSet,
|
|
33
32
|
createLayers,
|
|
34
33
|
geoToPosition,
|
|
@@ -38,35 +37,57 @@ import {
|
|
|
38
37
|
} from '../../util';
|
|
39
38
|
import { ZoomControls, ActionControls, type ControlProps, controlPositions } from '../Toolbar';
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
40
|
+
/**
|
|
41
|
+
* https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
42
|
+
*/
|
|
43
|
+
const defaultStyles: Record<ThemeMode, StyleSet> = {
|
|
44
|
+
light: {
|
|
45
|
+
background: {
|
|
46
|
+
fillStyle: '#EEE',
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
water: {
|
|
50
|
+
fillStyle: '#555',
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
land: {
|
|
54
|
+
fillStyle: '#999',
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
line: {
|
|
58
|
+
strokeStyle: 'darkred',
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
point: {
|
|
62
|
+
fillStyle: '#111111',
|
|
63
|
+
strokeStyle: '#111111',
|
|
64
|
+
strokeWidth: 1,
|
|
65
|
+
pointRadius: 0.5,
|
|
66
|
+
},
|
|
63
67
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
dark: {
|
|
69
|
+
background: {
|
|
70
|
+
fillStyle: '#111111',
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
water: {
|
|
74
|
+
fillStyle: '#123E6A',
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
land: {
|
|
78
|
+
fillStyle: '#032153',
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
line: {
|
|
82
|
+
strokeStyle: '#111111',
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
point: {
|
|
86
|
+
fillStyle: '#111111',
|
|
87
|
+
strokeStyle: '#111111',
|
|
88
|
+
strokeWidth: 1,
|
|
89
|
+
pointRadius: 0.5,
|
|
90
|
+
},
|
|
70
91
|
},
|
|
71
92
|
};
|
|
72
93
|
|
|
@@ -125,7 +146,10 @@ type GlobeCanvasProps = {
|
|
|
125
146
|
* https://github.com/topojson/world-atlas
|
|
126
147
|
*/
|
|
127
148
|
const GlobeCanvas = forwardRef<GlobeController, GlobeCanvasProps>(
|
|
128
|
-
({ projection: _projection, topology, features, styles
|
|
149
|
+
({ projection: _projection, topology, features, styles: _styles }, forwardRef) => {
|
|
150
|
+
const { themeMode } = useThemeContext();
|
|
151
|
+
const styles = useMemo(() => _styles ?? defaultStyles[themeMode], [_styles, themeMode]);
|
|
152
|
+
|
|
129
153
|
// Canvas.
|
|
130
154
|
const [canvas, setCanvas] = useState<HTMLCanvasElement>(null);
|
|
131
155
|
const canvasRef = (canvas: HTMLCanvasElement) => setCanvas(canvas);
|
|
@@ -207,7 +231,7 @@ const GlobeCanvas = forwardRef<GlobeController, GlobeCanvasProps>(
|
|
|
207
231
|
.translate([size.width / 2 + (translation?.x ?? 0), size.height / 2 + (translation?.y ?? 0)])
|
|
208
232
|
.rotate(rotation ?? [0, 0, 0]);
|
|
209
233
|
|
|
210
|
-
renderLayers(generator, layers, scale);
|
|
234
|
+
renderLayers(generator, layers, scale, styles);
|
|
211
235
|
});
|
|
212
236
|
}
|
|
213
237
|
}, [generator, size, scale, translation, rotation, layers]);
|