@xyo-network/react-map 3.0.0 → 3.0.2
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/browser/index.mjs +2 -2
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +19 -19
- package/src/Components/AnimatedHeatMap.tsx +6 -5
- package/src/Components/AnimatedHeatMapLoaded.tsx +4 -3
- package/src/Components/FeaturesToLayersMap.ts +2 -2
- package/src/Components/LayerAnimator.tsx +5 -4
- package/src/Components/Legend.tsx +1 -1
- package/src/Components/Legends/ColorGradient.tsx +1 -1
- package/src/Components/MapBox.stories.tsx +1 -1
- package/src/Components/MapBox.tsx +2 -1
- package/src/Components/MapBoxHeat.tsx +1 -1
- package/src/Components/MapBoxPoints.tsx +3 -3
- package/src/Components/MapSettingsComponents/Setting.tsx +2 -1
- package/src/Components/MapSettingsComponents/SettingsBox.tsx +2 -1
- package/src/Contexts/HeatMapInitializer/Context.ts +1 -1
- package/src/Contexts/HeatMapInitializer/Provider.tsx +5 -5
- package/src/Contexts/HeatMapInitializer/State.ts +2 -2
- package/src/Contexts/MapBoxInstance/Context.ts +1 -1
- package/src/Contexts/MapBoxInstance/Provider.tsx +2 -2
- package/src/Contexts/MapBoxInstance/State.ts +2 -2
- package/src/Contexts/MapSettings/Context.ts +1 -1
- package/src/Contexts/MapSettings/Provider.tsx +3 -3
- package/src/Contexts/MapSettings/State.ts +2 -2
- package/src/Contexts/MapboxAccessToken/Context.ts +1 -1
- package/src/Contexts/MapboxAccessToken/Provider.tsx +1 -1
- package/src/Contexts/MapboxAccessToken/State.ts +2 -2
- package/src/Layers/CircleLayer.ts +1 -1
- package/src/Layers/Configs/HeatMapFillLayerConfig.ts +1 -1
- package/src/Layers/Configs/HeatMapLineLayerConfig.ts +1 -1
- package/src/Layers/Configs/HeatMapSymbolLayerConfig.ts +1 -1
- package/src/Layers/Configs/LocationPointLayerConfig.ts +1 -1
- package/src/Layers/FillLayer.ts +1 -1
- package/src/Layers/LineLayer.ts +1 -1
- package/src/Layers/MapLayer.ts +2 -2
- package/src/Layers/SymbolLayer.ts +1 -1
- package/src/MapBoxClasses/MapBase.ts +3 -3
- package/src/MapBoxClasses/MapHeat.ts +6 -4
- package/src/MapBoxClasses/MapPoints.ts +5 -3
- package/src/MapBoxClasses/MapSettings.ts +3 -2
- package/src/Settings/DefaultMapSettings.ts +1 -1
- package/src/hooks/useDynamicMapResize.tsx +3 -2
- package/src/hooks/useDynamicPositioning.tsx +1 -1
- package/src/hooks/useFindHashes.tsx +3 -2
- package/src/hooks/useHeatMapColors.tsx +1 -1
- package/src/hooks/useQuadKeyPayloadsToFeatures.tsx +4 -4
- package/src/lib/MapBoxBaseProps.ts +5 -5
- package/src/types/NetworkLocationAnswerBase.ts +3 -2
- package/xy.config.ts +1 -1
package/package.json
CHANGED
|
@@ -7,24 +7,24 @@
|
|
|
7
7
|
},
|
|
8
8
|
"bugs": {
|
|
9
9
|
"email": "support@xyo.network",
|
|
10
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
|
10
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/assert": "^4.0.
|
|
14
|
-
"@xylabs/delay": "^4.0.
|
|
15
|
-
"@xylabs/
|
|
16
|
-
"@xylabs/
|
|
17
|
-
"@xylabs/
|
|
18
|
-
"@xylabs/react-flexbox": "^4.0.
|
|
19
|
-
"@xylabs/react-shared": "^4.0.
|
|
20
|
-
"@xyo-network/payload-model": "^3.0.
|
|
21
|
-
"@xyo-network/react-app-settings": "^3.0.
|
|
22
|
-
"@xyo-network/react-archivist": "^3.0.
|
|
23
|
-
"@xyo-network/react-network": "^3.0.
|
|
24
|
-
"@xyo-network/react-shared": "^3.0.
|
|
25
|
-
"@xyo-network/sdk-geo": "^
|
|
13
|
+
"@xylabs/assert": "^4.0.2",
|
|
14
|
+
"@xylabs/delay": "^4.0.2",
|
|
15
|
+
"@xylabs/exists": "^4.0.2",
|
|
16
|
+
"@xylabs/forget": "^4.0.2",
|
|
17
|
+
"@xylabs/hex": "^4.0.2",
|
|
18
|
+
"@xylabs/react-flexbox": "^4.0.3",
|
|
19
|
+
"@xylabs/react-shared": "^4.0.3",
|
|
20
|
+
"@xyo-network/payload-model": "^3.0.3",
|
|
21
|
+
"@xyo-network/react-app-settings": "^3.0.2",
|
|
22
|
+
"@xyo-network/react-archivist": "^3.0.2",
|
|
23
|
+
"@xyo-network/react-network": "^3.0.2",
|
|
24
|
+
"@xyo-network/react-shared": "^3.0.2",
|
|
25
|
+
"@xyo-network/sdk-geo": "^3.0.1",
|
|
26
26
|
"geojson": "^0.5.0",
|
|
27
|
-
"mapbox-gl": "^3.
|
|
27
|
+
"mapbox-gl": "^3.6.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@mui/icons-material": "^5",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@storybook/react": "^8.2.9",
|
|
39
39
|
"@types/geojson": "7946.0.14",
|
|
40
|
-
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.
|
|
41
|
-
"@xylabs/tsconfig-react": "^4.0.0-rc.
|
|
40
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.20",
|
|
41
|
+
"@xylabs/tsconfig-react": "^4.0.0-rc.20",
|
|
42
42
|
"typescript": "^5.5.4"
|
|
43
43
|
},
|
|
44
44
|
"docs": "dist/docs.json",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"repository": {
|
|
69
69
|
"type": "git",
|
|
70
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
|
|
70
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"lint-pkg": "npmPkgJsonLint .",
|
|
@@ -75,6 +75,6 @@
|
|
|
75
75
|
},
|
|
76
76
|
"sideEffects": false,
|
|
77
77
|
"types": "dist/browser/index.d.ts",
|
|
78
|
-
"version": "3.0.
|
|
78
|
+
"version": "3.0.2",
|
|
79
79
|
"type": "module"
|
|
80
80
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { darken, useTheme } from '@mui/material'
|
|
2
2
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
3
|
-
import { WithChildren } from '@xylabs/react-shared'
|
|
4
|
-
import { Feature, Polygon } from 'geojson'
|
|
3
|
+
import type { WithChildren } from '@xylabs/react-shared'
|
|
4
|
+
import type { Feature, Polygon } from 'geojson'
|
|
5
5
|
import React, { useState } from 'react'
|
|
6
6
|
|
|
7
|
-
import { AnimatedHeatMapColorProps } from '../Colors/index.ts'
|
|
7
|
+
import type { AnimatedHeatMapColorProps } from '../Colors/index.ts'
|
|
8
8
|
import { HeatMapInitializerProvider, MapBoxInstanceProvider, MapSettingsProvider } from '../Contexts/index.ts'
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import type { MapLayer } from '../Layers/index.ts'
|
|
10
|
+
import { LocationHeatMapLayerBuilderAnimated, MapHeatConstants } from '../Layers/index.ts'
|
|
11
|
+
import type { MapSetting } from '../Settings/index.ts'
|
|
11
12
|
import { MapboxHeatFlexBox } from './MapBoxHeat.tsx'
|
|
12
13
|
|
|
13
14
|
export interface AnimatedHeatMapProps {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Alert, AlertTitle } from '@mui/material'
|
|
2
|
-
import { FlexBoxProps
|
|
2
|
+
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
3
|
+
import { FlexCol } from '@xylabs/react-flexbox'
|
|
3
4
|
import { useWeakArchivistFromNode, useWeakArchivistGet } from '@xyo-network/react-archivist'
|
|
4
|
-
import { Feature, Polygon } from 'geojson'
|
|
5
|
+
import type { Feature, Polygon } from 'geojson'
|
|
5
6
|
import React from 'react'
|
|
6
7
|
|
|
7
8
|
import { AnimatedHeatMapSettings } from '../AnimatedHeatMapSettings.ts'
|
|
8
9
|
import { useFindHashes, useHeatMapColors, useQuadKeyPayloadsToFeatures } from '../hooks/index.ts'
|
|
9
|
-
import { NetworkLocationHeatmapQuadkeyAnswerPayload } from '../types/index.ts'
|
|
10
|
+
import type { NetworkLocationHeatmapQuadkeyAnswerPayload } from '../types/index.ts'
|
|
10
11
|
import { AnimatedHeatMap } from './AnimatedHeatMap.tsx'
|
|
11
12
|
import { AnimatedHeatMapLegend } from './Legend.tsx'
|
|
12
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Feature, Polygon } from 'geojson'
|
|
1
|
+
import type { Feature, Polygon } from 'geojson'
|
|
2
2
|
|
|
3
|
-
import { MapLayer } from '../Layers/index.ts'
|
|
3
|
+
import type { MapLayer } from '../Layers/index.ts'
|
|
4
4
|
|
|
5
5
|
export interface FeaturesToLayersMap {
|
|
6
6
|
features: Feature<Polygon>[]
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { WithChildren } from '@xylabs/react-shared'
|
|
2
|
+
import { useInterval } from '@xylabs/react-shared'
|
|
3
|
+
import type { Map } from 'mapbox-gl'
|
|
3
4
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
4
5
|
|
|
5
|
-
import { MapLayer } from '../Layers/index.ts'
|
|
6
|
-
import { MapboxFlexBoxProps } from '../lib/index.ts'
|
|
6
|
+
import type { MapLayer } from '../Layers/index.ts'
|
|
7
|
+
import type { MapboxFlexBoxProps } from '../lib/index.ts'
|
|
7
8
|
|
|
8
9
|
export interface LayerAnimatorProps {
|
|
9
10
|
animateLayers?: boolean
|
|
@@ -2,7 +2,7 @@ import { useMediaQuery, useTheme } from '@mui/material'
|
|
|
2
2
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
|
|
5
|
-
import { ColorGradientLegendProps } from '../Colors/index.ts'
|
|
5
|
+
import type { ColorGradientLegendProps } from '../Colors/index.ts'
|
|
6
6
|
import { ColorGradientLegend } from './Legends/index.ts'
|
|
7
7
|
|
|
8
8
|
const AnimatedHeatMapLegend: React.FC<ColorGradientLegendProps> = ({ ...legendProps }) => {
|
|
@@ -2,7 +2,7 @@ import { Typography, useTheme } from '@mui/material'
|
|
|
2
2
|
import { FlexCol, FlexRow } from '@xylabs/react-flexbox'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
|
|
5
|
-
import { ColorGradientLegendProps } from '../../Colors/index.ts'
|
|
5
|
+
import type { ColorGradientLegendProps } from '../../Colors/index.ts'
|
|
6
6
|
|
|
7
7
|
const ColorGradientLegend: React.FC<ColorGradientLegendProps> = ({ startColor, endColor, startLabel, endLabel, heading, textColor, ...props }) => {
|
|
8
8
|
const theme = useTheme()
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// eslint-disable-next-line import-x/no-internal-modules
|
|
2
2
|
import 'mapbox-gl/dist/mapbox-gl.css'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import type { MapOptions } from 'mapbox-gl'
|
|
5
|
+
import { Map } from 'mapbox-gl'
|
|
5
6
|
import React, { useEffect, useRef, useState } from 'react'
|
|
6
7
|
|
|
7
8
|
import { useMapBoxInstance, useMapSettings } from '../Contexts/index.ts'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
|
-
import { MapboxFlexBoxProps } from '../lib/index.ts'
|
|
4
|
+
import type { MapboxFlexBoxProps } from '../lib/index.ts'
|
|
5
5
|
import { MapBox } from './MapBox.tsx'
|
|
6
6
|
import { MapSettingsBox } from './MapSettingsComponents/index.ts'
|
|
7
7
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Alert } from '@mui/material'
|
|
2
2
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
3
|
-
import { Feature, Point } from 'geojson'
|
|
4
|
-
import { MapOptions } from 'mapbox-gl'
|
|
3
|
+
import type { Feature, Point } from 'geojson'
|
|
4
|
+
import type { MapOptions } from 'mapbox-gl'
|
|
5
5
|
import React, { useCallback, useEffect, useState } from 'react'
|
|
6
6
|
|
|
7
7
|
import { useMapBoxInstance, useMapSettings } from '../Contexts/index.ts'
|
|
8
|
-
import { MapboxFlexBoxProps } from '../lib/index.ts'
|
|
8
|
+
import type { MapboxFlexBoxProps } from '../lib/index.ts'
|
|
9
9
|
import { MapPoints } from '../MapBoxClasses/index.ts'
|
|
10
10
|
import { MapBox } from './MapBox.tsx'
|
|
11
11
|
import { MapSettingsBox } from './MapSettingsComponents/index.ts'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Paper, Stack } from '@mui/material'
|
|
2
|
-
import { FlexBoxProps
|
|
2
|
+
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
3
|
+
import { FlexGrowRow, FlexRow } from '@xylabs/react-flexbox'
|
|
3
4
|
import { useAppSettings } from '@xyo-network/react-app-settings'
|
|
4
5
|
import React from 'react'
|
|
5
6
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { forget } from '@xylabs/forget'
|
|
2
|
-
import { WithChildren } from '@xylabs/react-shared'
|
|
3
|
-
import { Feature, Polygon } from 'geojson'
|
|
2
|
+
import type { WithChildren } from '@xylabs/react-shared'
|
|
3
|
+
import type { Feature, Polygon } from 'geojson'
|
|
4
4
|
import React, { useEffect, useMemo, useState } from 'react'
|
|
5
5
|
|
|
6
|
-
import { AnimatedHeatMapColorProps, HeatMapColorProps } from '../../Colors/index.ts'
|
|
6
|
+
import type { AnimatedHeatMapColorProps, HeatMapColorProps } from '../../Colors/index.ts'
|
|
7
7
|
import { useDynamicPositioning } from '../../hooks/index.ts'
|
|
8
|
-
import { MapLayer } from '../../Layers/index.ts'
|
|
8
|
+
import type { MapLayer } from '../../Layers/index.ts'
|
|
9
9
|
import { MapHeat } from '../../MapBoxClasses/index.ts'
|
|
10
10
|
import { useMapBoxInstance } from '../MapBoxInstance/index.ts'
|
|
11
11
|
import { useMapSettings } from '../MapSettings/index.ts'
|
|
12
12
|
import { HeatMapInitializerContext } from './Context.ts'
|
|
13
|
-
import { HeatMapInitializerState } from './State.ts'
|
|
13
|
+
import type { HeatMapInitializerState } from './State.ts'
|
|
14
14
|
|
|
15
15
|
export interface MapInitializerProviderProps {
|
|
16
16
|
featureSets?: Feature<Polygon>[][]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HeatMapColorProps } from '../../Colors/index.ts'
|
|
2
|
-
import { MapHeat } from '../../MapBoxClasses/index.ts'
|
|
1
|
+
import type { HeatMapColorProps } from '../../Colors/index.ts'
|
|
2
|
+
import type { MapHeat } from '../../MapBoxClasses/index.ts'
|
|
3
3
|
|
|
4
4
|
export interface HeatMapInitializerState {
|
|
5
5
|
MapHeat?: MapHeat
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WithChildren } from '@xylabs/react-shared'
|
|
2
|
-
import { Map } from 'mapbox-gl'
|
|
1
|
+
import type { WithChildren } from '@xylabs/react-shared'
|
|
2
|
+
import type { Map } from 'mapbox-gl'
|
|
3
3
|
import React, { useEffect, useMemo, useState } from 'react'
|
|
4
4
|
|
|
5
5
|
import { MapBoxInstanceContext } from './Context.ts'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { WithChildren } from '@xylabs/react-shared'
|
|
1
|
+
import type { WithChildren } from '@xylabs/react-shared'
|
|
2
2
|
import React, { useEffect, useMemo, useState } from 'react'
|
|
3
3
|
|
|
4
4
|
import { MapSettings } from '../../MapBoxClasses/index.ts'
|
|
5
|
-
import { MapSetting } from '../../Settings/index.ts'
|
|
5
|
+
import type { MapSetting } from '../../Settings/index.ts'
|
|
6
6
|
import { useMapBoxInstance } from '../MapBoxInstance/index.ts'
|
|
7
7
|
import { MapSettingsContext } from './Context.ts'
|
|
8
|
-
import { MapSettingsState } from './State.ts'
|
|
8
|
+
import type { MapSettingsState } from './State.ts'
|
|
9
9
|
|
|
10
10
|
export interface MapSettingsProviderProps {
|
|
11
11
|
debugLayerName?: string
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContextEx } from '@xyo-network/react-shared'
|
|
2
2
|
|
|
3
|
-
import { MapboxAccessTokenContextState } from './State.ts'
|
|
3
|
+
import type { MapboxAccessTokenContextState } from './State.ts'
|
|
4
4
|
|
|
5
5
|
export const MapboxAccessTokenContext = createContextEx<MapboxAccessTokenContextState>()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContextExState } from '@xyo-network/react-shared'
|
|
2
|
-
import { Dispatch } from 'react'
|
|
1
|
+
import type { ContextExState } from '@xyo-network/react-shared'
|
|
2
|
+
import type { Dispatch } from 'react'
|
|
3
3
|
|
|
4
4
|
export interface MapboxAccessTokenContextState extends ContextExState {
|
|
5
5
|
accessToken?: string
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LayerBase } from '@xyo-network/sdk-geo'
|
|
2
|
-
import { CircleLayerSpecification } from 'mapbox-gl'
|
|
2
|
+
import type { CircleLayerSpecification } from 'mapbox-gl'
|
|
3
3
|
|
|
4
4
|
export class CircleLayerBuilder extends LayerBase<CircleLayerSpecification> {
|
|
5
5
|
CircleLayerOptions: Partial<CircleLayerSpecification>
|
package/src/Layers/FillLayer.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LayerBase } from '@xyo-network/sdk-geo'
|
|
2
|
-
import { FillLayerSpecification } from 'mapbox-gl'
|
|
2
|
+
import type { FillLayerSpecification } from 'mapbox-gl'
|
|
3
3
|
|
|
4
4
|
export class FillLayerBuilder extends LayerBase<FillLayerSpecification> {
|
|
5
5
|
FillLayerOptions: Partial<FillLayerSpecification>
|
package/src/Layers/LineLayer.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LayerBase } from '@xyo-network/sdk-geo'
|
|
2
|
-
import { LineLayerSpecification } from 'mapbox-gl'
|
|
2
|
+
import type { LineLayerSpecification } from 'mapbox-gl'
|
|
3
3
|
|
|
4
4
|
export class LineLayerBuilder extends LayerBase<LineLayerSpecification> {
|
|
5
5
|
LineLayerOptions: Partial<LineLayerSpecification>
|
package/src/Layers/MapLayer.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LayerBase } from '@xyo-network/sdk-geo'
|
|
2
|
-
import { Layer, LayerSpecification } from 'mapbox-gl'
|
|
1
|
+
import type { LayerBase } from '@xyo-network/sdk-geo'
|
|
2
|
+
import type { Layer, LayerSpecification } from 'mapbox-gl'
|
|
3
3
|
|
|
4
4
|
export interface MapLayer extends Layer {
|
|
5
5
|
update: LayerBase<LayerSpecification>['update']
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LayerBase } from '@xyo-network/sdk-geo'
|
|
2
|
-
import { SymbolLayerSpecification } from 'mapbox-gl'
|
|
2
|
+
import type { SymbolLayerSpecification } from 'mapbox-gl'
|
|
3
3
|
|
|
4
4
|
export class SymbolLayerBuilder extends LayerBase<SymbolLayerSpecification> {
|
|
5
5
|
SymbolLayerOptions: Partial<SymbolLayerSpecification>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { GeoJson } from '@xyo-network/sdk-geo'
|
|
3
|
-
import { Feature, Geometry } from 'geojson'
|
|
4
|
-
import { GeoJSONSource, Map } from 'mapbox-gl'
|
|
3
|
+
import type { Feature, Geometry } from 'geojson'
|
|
4
|
+
import type { GeoJSONSource, Map } from 'mapbox-gl'
|
|
5
5
|
|
|
6
|
-
import { MapLayer } from '../Layers/index.ts'
|
|
6
|
+
import type { MapLayer } from '../Layers/index.ts'
|
|
7
7
|
|
|
8
8
|
export interface MapBaseConfig<T extends Geometry> {
|
|
9
9
|
features: Feature<T>[]
|
|
@@ -2,11 +2,13 @@ import { assertEx } from '@xylabs/assert'
|
|
|
2
2
|
import { delay } from '@xylabs/delay'
|
|
3
3
|
import { forget } from '@xylabs/forget'
|
|
4
4
|
import { GeoJson } from '@xyo-network/sdk-geo'
|
|
5
|
-
import { Feature, Polygon } from 'geojson'
|
|
6
|
-
import { GeoJSONSource, GeoJSONSourceSpecification,
|
|
5
|
+
import type { Feature, Polygon } from 'geojson'
|
|
6
|
+
import type { GeoJSONSource, GeoJSONSourceSpecification, Map, MapOptions } from 'mapbox-gl'
|
|
7
|
+
import { LngLatBounds } from 'mapbox-gl'
|
|
7
8
|
|
|
8
|
-
import { MapLayer } from '../Layers/index.ts'
|
|
9
|
-
import {
|
|
9
|
+
import type { MapLayer } from '../Layers/index.ts'
|
|
10
|
+
import type { MapBaseConfig } from './MapBase.ts'
|
|
11
|
+
import { MapBase } from './MapBase.ts'
|
|
10
12
|
|
|
11
13
|
export class MapHeat extends MapBase<Polygon> {
|
|
12
14
|
static animationStarted = false
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Feature, Point } from 'geojson'
|
|
2
|
-
import {
|
|
1
|
+
import type { Feature, Point } from 'geojson'
|
|
2
|
+
import type { MapOptions } from 'mapbox-gl'
|
|
3
|
+
import { LngLatBounds } from 'mapbox-gl'
|
|
3
4
|
|
|
4
|
-
import {
|
|
5
|
+
import type { MapBaseConfig } from './MapBase.ts'
|
|
6
|
+
import { MapBase } from './MapBase.ts'
|
|
5
7
|
|
|
6
8
|
export interface MapPointsConfig extends MapBaseConfig<Point> {
|
|
7
9
|
features: Feature<Point>[]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Map, MapEventOf, MapEventType } from 'mapbox-gl'
|
|
2
|
+
import { GeolocateControl, NavigationControl } from 'mapbox-gl'
|
|
2
3
|
|
|
3
|
-
import { MapSetting } from '../Settings/index.ts'
|
|
4
|
+
import type { MapSetting } from '../Settings/index.ts'
|
|
4
5
|
|
|
5
6
|
export interface MapSettingsConfig {
|
|
6
7
|
debugLayerName?: string
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Map } from 'mapbox-gl'
|
|
2
|
-
import { MutableRefObject
|
|
1
|
+
import type { Map } from 'mapbox-gl'
|
|
2
|
+
import type { MutableRefObject } from 'react'
|
|
3
|
+
import { useEffect, useMemo, useState } from 'react'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Inspired by - https://bl.ocks.org/danswick/fc56f37c10d40be62e4feac5984250d2
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Hash } from '@xylabs/hex'
|
|
2
|
-
import { ArchivistPreset
|
|
1
|
+
import type { Hash } from '@xylabs/hex'
|
|
2
|
+
import type { ArchivistPreset } from '@xyo-network/react-network'
|
|
3
|
+
import { useNetwork } from '@xyo-network/react-network'
|
|
3
4
|
import { useMemo } from 'react'
|
|
4
5
|
|
|
5
6
|
const animatedAnswerHashesConst: Hash[] = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTheme } from '@mui/material'
|
|
2
2
|
|
|
3
|
-
import { AnimatedHeatMapColorProps, ColorGradientLegendProps } from '../Colors/index.ts'
|
|
3
|
+
import type { AnimatedHeatMapColorProps, ColorGradientLegendProps } from '../Colors/index.ts'
|
|
4
4
|
|
|
5
5
|
const useHeatMapColors = () => {
|
|
6
6
|
const theme = useTheme()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { exists } from '@xylabs/exists'
|
|
2
2
|
import { GeoJson } from '@xyo-network/sdk-geo'
|
|
3
|
-
import { Feature, Geometry } from 'geojson'
|
|
3
|
+
import type { Feature, Geometry } from 'geojson'
|
|
4
4
|
import { useEffect, useState } from 'react'
|
|
5
5
|
|
|
6
|
-
import { NetworkLocationHeatmapQuadkeyAnswerPayload } from '../types/index.ts'
|
|
6
|
+
import type { NetworkLocationHeatmapQuadkeyAnswerPayload } from '../types/index.ts'
|
|
7
7
|
|
|
8
8
|
const quadKeyToFeature = ({ density, quadkey }: { density: number; quadkey: string }) => {
|
|
9
9
|
const polygonFeature = new GeoJson(quadkey).polygonFeature()
|
|
@@ -29,7 +29,7 @@ const useQuadKeyPayloadsToFeatures = (payloads?: NetworkLocationHeatmapQuadkeyAn
|
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
// Convert Multiple Payloads from Quadkey to GeoJson
|
|
31
31
|
if (Array.isArray(payloads)) {
|
|
32
|
-
if (
|
|
32
|
+
if ((payloads)?.filter(exists).length > 0) {
|
|
33
33
|
const mappedFeatures = payloads?.map(payload => payload?.result.map(quadKeyToFeature))
|
|
34
34
|
|
|
35
35
|
setMultipleFeatureSets(mappedFeatures.map(features => features?.map(setDensity) ?? []))
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
2
|
-
import { Feature } from 'geojson'
|
|
3
|
-
import { MapOptions } from 'mapbox-gl'
|
|
4
|
-
import { ReactNode } from 'react'
|
|
1
|
+
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
2
|
+
import type { Feature } from 'geojson'
|
|
3
|
+
import type { MapOptions } from 'mapbox-gl'
|
|
4
|
+
import type { ReactNode } from 'react'
|
|
5
5
|
|
|
6
|
-
import { MapLayer } from '../Layers/index.ts'
|
|
6
|
+
import type { MapLayer } from '../Layers/index.ts'
|
|
7
7
|
|
|
8
8
|
export interface MapboxFlexBoxProps extends FlexBoxProps {
|
|
9
9
|
accessToken: string
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Payload } from '@xyo-network/payload-model'
|
|
2
|
+
import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
3
|
+
import type { Feature, Point, Polygon } from 'geojson'
|
|
3
4
|
|
|
4
5
|
export interface NetworkLocationAnswerBase<T> {
|
|
5
6
|
result: T
|
package/xy.config.ts
CHANGED