@xyo-network/react-map 4.1.20 → 4.2.1
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/Components/AnimatedHeatMap.d.ts +1 -2
- package/dist/browser/Components/AnimatedHeatMap.d.ts.map +1 -1
- package/dist/browser/Components/AnimatedHeatMapLoaded.d.ts.map +1 -1
- package/dist/browser/Components/HeatMapSettings.d.ts +1 -1
- package/dist/browser/Components/HeatMapSettings.d.ts.map +1 -1
- package/dist/browser/Components/Legend.d.ts +1 -1
- package/dist/browser/Components/Legend.d.ts.map +1 -1
- package/dist/browser/Components/Legends/ColorGradient.d.ts +1 -1
- package/dist/browser/Components/Legends/ColorGradient.d.ts.map +1 -1
- package/dist/browser/Components/MapBox.d.ts.map +1 -1
- package/dist/browser/Contexts/HeatMapInitializer/Provider.d.ts +1 -1
- package/dist/browser/Contexts/HeatMapInitializer/Provider.d.ts.map +1 -1
- package/dist/browser/Contexts/HeatMapInitializer/State.d.ts +1 -1
- package/dist/browser/Contexts/HeatMapInitializer/State.d.ts.map +1 -1
- package/dist/browser/Contexts/MapSettings/Provider.d.ts +1 -1
- package/dist/browser/Contexts/MapSettings/Provider.d.ts.map +1 -1
- package/dist/browser/Contexts/MapSettings/State.d.ts +1 -1
- package/dist/browser/Contexts/MapSettings/State.d.ts.map +1 -1
- package/dist/browser/Contexts/index.d.ts +0 -1
- package/dist/browser/Contexts/index.d.ts.map +1 -1
- package/dist/browser/MapBoxClasses/MapSettings.d.ts +1 -1
- package/dist/browser/MapBoxClasses/MapSettings.d.ts.map +1 -1
- package/dist/browser/hooks/index.d.ts +0 -3
- package/dist/browser/hooks/index.d.ts.map +1 -1
- package/dist/browser/index.d.ts +0 -5
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +85 -314
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/lib/index.d.ts +0 -1
- package/dist/browser/lib/index.d.ts.map +1 -1
- package/package.json +11 -15
- package/src/Components/AnimatedHeatMap.tsx +1 -2
- package/src/Components/AnimatedHeatMapLoaded.tsx +5 -5
- package/src/Components/HeatMapSettings.ts +1 -1
- package/src/Components/Legend.tsx +1 -1
- package/src/Components/Legends/ColorGradient.tsx +1 -2
- package/src/Components/MapBox.stories.tsx +3 -2
- package/src/Components/MapBox.tsx +1 -1
- package/src/Contexts/HeatMapInitializer/Provider.tsx +1 -1
- package/src/Contexts/HeatMapInitializer/State.ts +2 -1
- package/src/Contexts/MapSettings/Provider.tsx +1 -1
- package/src/Contexts/MapSettings/State.ts +1 -2
- package/src/Contexts/index.ts +0 -1
- package/src/MapBoxClasses/MapSettings.ts +1 -2
- package/src/hooks/index.ts +0 -3
- package/src/index.ts +0 -5
- package/src/lib/index.ts +0 -1
- package/dist/browser/AnimatedHeatMapSettings.d.ts +0 -2
- package/dist/browser/AnimatedHeatMapSettings.d.ts.map +0 -1
- package/dist/browser/Colors/MapColorProps.d.ts +0 -17
- package/dist/browser/Colors/MapColorProps.d.ts.map +0 -1
- package/dist/browser/Colors/index.d.ts +0 -2
- package/dist/browser/Colors/index.d.ts.map +0 -1
- package/dist/browser/Contexts/MapboxAccessToken/Context.d.ts +0 -3
- package/dist/browser/Contexts/MapboxAccessToken/Context.d.ts.map +0 -1
- package/dist/browser/Contexts/MapboxAccessToken/Provider.d.ts +0 -7
- package/dist/browser/Contexts/MapboxAccessToken/Provider.d.ts.map +0 -1
- package/dist/browser/Contexts/MapboxAccessToken/State.d.ts +0 -7
- package/dist/browser/Contexts/MapboxAccessToken/State.d.ts.map +0 -1
- package/dist/browser/Contexts/MapboxAccessToken/index.d.ts +0 -5
- package/dist/browser/Contexts/MapboxAccessToken/index.d.ts.map +0 -1
- package/dist/browser/Contexts/MapboxAccessToken/use.d.ts +0 -2
- package/dist/browser/Contexts/MapboxAccessToken/use.d.ts.map +0 -1
- package/dist/browser/Settings/DefaultMapSettings.d.ts +0 -3
- package/dist/browser/Settings/DefaultMapSettings.d.ts.map +0 -1
- package/dist/browser/Settings/MapSetting.d.ts +0 -16
- package/dist/browser/Settings/MapSetting.d.ts.map +0 -1
- package/dist/browser/Settings/index.d.ts +0 -3
- package/dist/browser/Settings/index.d.ts.map +0 -1
- package/dist/browser/hooks/useFindHashes.d.ts +0 -2
- package/dist/browser/hooks/useFindHashes.d.ts.map +0 -1
- package/dist/browser/hooks/useHeatMapColors.d.ts +0 -7
- package/dist/browser/hooks/useHeatMapColors.d.ts.map +0 -1
- package/dist/browser/hooks/useQuadKeyPayloadsToFeatures.d.ts +0 -9
- package/dist/browser/hooks/useQuadKeyPayloadsToFeatures.d.ts.map +0 -1
- package/dist/browser/lib/MapStyle.d.ts +0 -9
- package/dist/browser/lib/MapStyle.d.ts.map +0 -1
- package/dist/browser/types/NetworkLocationAnswerBase.d.ts +0 -37
- package/dist/browser/types/NetworkLocationAnswerBase.d.ts.map +0 -1
- package/dist/browser/types/index.d.ts +0 -2
- package/dist/browser/types/index.d.ts.map +0 -1
- package/src/AnimatedHeatMapSettings.ts +0 -10
- package/src/Colors/MapColorProps.ts +0 -19
- package/src/Colors/index.ts +0 -1
- package/src/Contexts/MapboxAccessToken/Context.ts +0 -5
- package/src/Contexts/MapboxAccessToken/Provider.tsx +0 -23
- package/src/Contexts/MapboxAccessToken/State.ts +0 -7
- package/src/Contexts/MapboxAccessToken/index.ts +0 -4
- package/src/Contexts/MapboxAccessToken/use.ts +0 -7
- package/src/Settings/DefaultMapSettings.ts +0 -53
- package/src/Settings/MapSetting.ts +0 -16
- package/src/Settings/index.ts +0 -2
- package/src/hooks/useFindHashes.tsx +0 -29
- package/src/hooks/useHeatMapColors.tsx +0 -28
- package/src/hooks/useQuadKeyPayloadsToFeatures.tsx +0 -55
- package/src/lib/MapStyle.ts +0 -8
- package/src/types/NetworkLocationAnswerBase.ts +0 -32
- package/src/types/index.ts +0 -1
|
@@ -2,14 +2,14 @@ import { Alert, AlertTitle } from '@mui/material'
|
|
|
2
2
|
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
3
3
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
4
4
|
import { useWeakArchivistFromNode, useWeakArchivistGet } from '@xyo-network/react-archivist'
|
|
5
|
+
import type { NetworkLocationHeatmapQuadkeyAnswerPayload } from '@xyo-network/react-map-model'
|
|
6
|
+
import {
|
|
7
|
+
AnimatedHeatMapSettings,
|
|
8
|
+
useFindHashes, useHeatMapColors, useQuadKeyPayloadsToFeatures,
|
|
9
|
+
} from '@xyo-network/react-map-model'
|
|
5
10
|
import type { Feature, Polygon } from 'geojson'
|
|
6
11
|
import React from 'react'
|
|
7
12
|
|
|
8
|
-
import { AnimatedHeatMapSettings } from '../AnimatedHeatMapSettings.ts'
|
|
9
|
-
import {
|
|
10
|
-
useFindHashes, useHeatMapColors, useQuadKeyPayloadsToFeatures,
|
|
11
|
-
} from '../hooks/index.ts'
|
|
12
|
-
import type { NetworkLocationHeatmapQuadkeyAnswerPayload } from '../types/index.ts'
|
|
13
13
|
import { AnimatedHeatMap } from './AnimatedHeatMap.tsx'
|
|
14
14
|
import { AnimatedHeatMapLegend } from './Legend.tsx'
|
|
15
15
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useMediaQuery, useTheme } from '@mui/material'
|
|
2
2
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
3
|
+
import type { ColorGradientLegendProps } from '@xyo-network/react-map-model'
|
|
3
4
|
import React from 'react'
|
|
4
5
|
|
|
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 }) => {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Typography, useTheme } from '@mui/material'
|
|
2
2
|
import { FlexCol, FlexRow } from '@xylabs/react-flexbox'
|
|
3
|
+
import type { ColorGradientLegendProps } from '@xyo-network/react-map-model'
|
|
3
4
|
import React from 'react'
|
|
4
5
|
|
|
5
|
-
import type { ColorGradientLegendProps } from '../../Colors/index.ts'
|
|
6
|
-
|
|
7
6
|
const ColorGradientLegend: React.FC<ColorGradientLegendProps> = ({
|
|
8
7
|
startColor, endColor, startLabel, endLabel, heading, textColor, ...props
|
|
9
8
|
}) => {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
1
2
|
import { Button } from '@mui/material'
|
|
2
3
|
import type {
|
|
3
4
|
Decorator, Meta, StoryFn,
|
|
4
5
|
} from '@storybook/react'
|
|
5
6
|
import { FlexGrowCol } from '@xylabs/react-flexbox'
|
|
7
|
+
import { DefaultMapSettings } from '@xyo-network/react-map-model'
|
|
6
8
|
import React, { useRef } from 'react'
|
|
7
9
|
|
|
8
10
|
import { MapBoxInstanceProvider, MapSettingsProvider } from '../Contexts/index.ts'
|
|
9
|
-
import { DefaultMapSettings } from '../Settings/index.ts'
|
|
10
11
|
import { MapBox } from './MapBox.tsx'
|
|
11
12
|
import { MapSettingsBox } from './MapSettingsComponents/index.ts'
|
|
12
13
|
|
|
@@ -34,7 +35,7 @@ const WithMapSettingsDecorator: Decorator = (Story, args) => {
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export default {
|
|
37
|
-
args: { accessToken:
|
|
38
|
+
args: { accessToken: import.meta.env.VITE_MAPBOX_TOKEN },
|
|
38
39
|
component: MapBox,
|
|
39
40
|
decorators: [WithMapboxProviders],
|
|
40
41
|
parameters: { docs: { page: null } },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// eslint-disable-next-line import-x/no-internal-modules
|
|
2
2
|
import 'mapbox-gl/dist/mapbox-gl.css'
|
|
3
3
|
|
|
4
|
+
import { MapStyle } from '@xyo-network/react-map-model'
|
|
4
5
|
import type { MapOptions } from 'mapbox-gl'
|
|
5
6
|
import { Map } from 'mapbox-gl'
|
|
6
7
|
import React, {
|
|
@@ -9,7 +10,6 @@ import React, {
|
|
|
9
10
|
|
|
10
11
|
import { useMapBoxInstance, useMapSettings } from '../Contexts/index.ts'
|
|
11
12
|
import { useDynamicMapResize } from '../hooks/index.ts'
|
|
12
|
-
import { MapStyle } from '../lib/index.ts'
|
|
13
13
|
|
|
14
14
|
export interface MapBoxProps {
|
|
15
15
|
accessToken: string
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { forget } from '@xylabs/forget'
|
|
2
|
+
import type { AnimatedHeatMapColorProps, HeatMapColorProps } from '@xyo-network/react-map-model'
|
|
2
3
|
import type { Feature, Polygon } from 'geojson'
|
|
3
4
|
import type { PropsWithChildren } from 'react'
|
|
4
5
|
import React, { useEffect, useMemo } from 'react'
|
|
5
6
|
|
|
6
|
-
import type { AnimatedHeatMapColorProps, HeatMapColorProps } from '../../Colors/index.ts'
|
|
7
7
|
import { useDynamicPositioning } from '../../hooks/index.ts'
|
|
8
8
|
import type { MapLayer } from '../../Layers/index.ts'
|
|
9
9
|
import { MapHeat } from '../../MapBoxClasses/index.ts'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { MapSetting } from '@xyo-network/react-map-model'
|
|
1
2
|
import type { PropsWithChildren } from 'react'
|
|
2
3
|
import React, {
|
|
3
4
|
useEffect, useMemo, useState,
|
|
4
5
|
} from 'react'
|
|
5
6
|
|
|
6
7
|
import { MapSettings } from '../../MapBoxClasses/index.ts'
|
|
7
|
-
import type { MapSetting } from '../../Settings/index.ts'
|
|
8
8
|
import { useMapBoxInstance } from '../MapBoxInstance/index.ts'
|
|
9
9
|
import { MapSettingsContext } from './Context.ts'
|
|
10
10
|
import type { MapSettingsState } from './State.ts'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type { MapSetting } from '@xyo-network/react-map-model'
|
|
1
2
|
import type { Dispatch } from 'react'
|
|
2
3
|
|
|
3
|
-
import type { MapSetting } from '../../Settings/index.ts'
|
|
4
|
-
|
|
5
4
|
export interface MapSettingsState {
|
|
6
5
|
mapSettings?: MapSetting
|
|
7
6
|
setMapSettings?: Dispatch<React.SetStateAction<MapSetting>>
|
package/src/Contexts/index.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import type { MapSetting } from '@xyo-network/react-map-model'
|
|
1
2
|
import type {
|
|
2
3
|
Map, MapEventOf, MapEventType,
|
|
3
4
|
} from 'mapbox-gl'
|
|
4
5
|
import { GeolocateControl, NavigationControl } from 'mapbox-gl'
|
|
5
6
|
|
|
6
|
-
import type { MapSetting } from '../Settings/index.ts'
|
|
7
|
-
|
|
8
7
|
export interface MapSettingsConfig {
|
|
9
8
|
debugLayerName?: string
|
|
10
9
|
map: Map
|
package/src/hooks/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
export * from './AnimatedHeatMapSettings.ts'
|
|
2
|
-
export * from './Colors/index.ts'
|
|
3
1
|
export * from './Components/index.ts'
|
|
4
2
|
export * from './Contexts/index.ts'
|
|
5
3
|
export * from './hooks/index.ts'
|
|
6
4
|
export * from './Layers/index.ts'
|
|
7
|
-
export * from './lib/index.ts'
|
|
8
5
|
export * from './MapBoxClasses/index.ts'
|
|
9
|
-
export * from './Settings/index.ts'
|
|
10
|
-
export * from './types/index.ts'
|
package/src/lib/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedHeatMapSettings.d.ts","sourceRoot":"","sources":["../../src/AnimatedHeatMapSettings.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,+CAAuB,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface HeatMapColorProps {
|
|
2
|
-
staticMapColor: string;
|
|
3
|
-
}
|
|
4
|
-
export interface AnimatedHeatMapColorProps extends HeatMapColorProps {
|
|
5
|
-
highUsageColor: string;
|
|
6
|
-
lowUsageColor: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ColorGradientLegendProps {
|
|
9
|
-
endColor: string;
|
|
10
|
-
endLabel: string;
|
|
11
|
-
heading: string;
|
|
12
|
-
startColor: string;
|
|
13
|
-
startLabel: string;
|
|
14
|
-
textColor: string;
|
|
15
|
-
}
|
|
16
|
-
export type LegendProps = ColorGradientLegendProps;
|
|
17
|
-
//# sourceMappingURL=MapColorProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MapColorProps.d.ts","sourceRoot":"","sources":["../../../src/Colors/MapColorProps.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,MAAM,WAAW,GAAG,wBAAwB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Colors/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/Contexts/MapboxAccessToken/Context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAE/D,eAAO,MAAM,wBAAwB,6GAAmD,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface MapboxAccessTokenProviderProps {
|
|
4
|
-
defaultAccessToken?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const MapboxAccessTokenProvider: React.FC<PropsWithChildren<MapboxAccessTokenProviderProps>>;
|
|
7
|
-
//# sourceMappingURL=Provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/Contexts/MapboxAccessToken/Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAA4B,MAAM,OAAO,CAAA;AAIhD,MAAM,WAAW,8BAA8B;IAC7C,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,8BAA8B,CAAC,CAajG,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ContextExState } from '@xyo-network/react-shared';
|
|
2
|
-
import type { Dispatch } from 'react';
|
|
3
|
-
export interface MapboxAccessTokenContextState extends ContextExState {
|
|
4
|
-
accessToken?: string;
|
|
5
|
-
setAccessToken?: Dispatch<string>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=State.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/Contexts/MapboxAccessToken/State.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAErC,MAAM,WAAW,6BAA8B,SAAQ,cAAc;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;CAClC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Contexts/MapboxAccessToken/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/Contexts/MapboxAccessToken/use.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,mJAEhC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultMapSettings.d.ts","sourceRoot":"","sources":["../../../src/Settings/DefaultMapSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,eAAO,MAAM,kBAAkB,EAAE,MAAM,UAkDrC,CAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type MapSettingFields = 'debugLayer' | 'fitToPoints' | 'scrollToZoom' | 'enableControls' | 'debugLogging' | 'preferDark' | 'dynamicMapResize';
|
|
2
|
-
export type MapSetting = {
|
|
3
|
-
[field in MapSettingFields | string]: {
|
|
4
|
-
/** Setting only available when application is in developerMode */
|
|
5
|
-
devMode?: boolean;
|
|
6
|
-
/** Machine-readable string to reference setting */
|
|
7
|
-
field: string;
|
|
8
|
-
/** Hide the setting from the UI */
|
|
9
|
-
hidden?: boolean;
|
|
10
|
-
/** Label in the UI */
|
|
11
|
-
label: string;
|
|
12
|
-
/** Initial toggle value for a setting */
|
|
13
|
-
value: boolean;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=MapSetting.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MapSetting.d.ts","sourceRoot":"","sources":["../../../src/Settings/MapSetting.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,aAAa,GAAG,cAAc,GAAG,gBAAgB,GAAG,cAAc,GAAG,YAAY,GAAG,kBAAkB,CAAA;AAEpJ,MAAM,MAAM,UAAU,GAAG;KACtB,KAAK,IAAI,gBAAgB,GAAG,MAAM,GAAG;QACpC,kEAAkE;QAClE,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,mDAAmD;QACnD,KAAK,EAAE,MAAM,CAAA;QACb,mCAAmC;QACnC,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,sBAAsB;QACtB,KAAK,EAAE,MAAM,CAAA;QACb,yCAAyC;QACzC,KAAK,EAAE,OAAO,CAAA;KACf;CACF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Settings/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFindHashes.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFindHashes.tsx"],"names":[],"mappings":"AAqBA,eAAO,MAAM,aAAa,2BAOzB,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { AnimatedHeatMapColorProps, ColorGradientLegendProps } from '../Colors/index.ts';
|
|
2
|
-
declare const useHeatMapColors: () => {
|
|
3
|
-
heatMapColorProps: AnimatedHeatMapColorProps;
|
|
4
|
-
legendProps: ColorGradientLegendProps;
|
|
5
|
-
};
|
|
6
|
-
export { useHeatMapColors };
|
|
7
|
-
//# sourceMappingURL=useHeatMapColors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useHeatMapColors.d.ts","sourceRoot":"","sources":["../../../src/hooks/useHeatMapColors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7F,QAAA,MAAM,gBAAgB;;;CAqBrB,CAAA;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Feature, Geometry } from 'geojson';
|
|
2
|
-
import type { NetworkLocationHeatmapQuadkeyAnswerPayload } from '../types/index.ts';
|
|
3
|
-
declare const useQuadKeyPayloadsToFeatures: (payloads?: NetworkLocationHeatmapQuadkeyAnswerPayload[] | NetworkLocationHeatmapQuadkeyAnswerPayload) => {
|
|
4
|
-
error: Error | undefined;
|
|
5
|
-
features: Feature<Geometry, import("geojson").GeoJsonProperties>[];
|
|
6
|
-
multipleFeatureSets: Feature<Geometry, import("geojson").GeoJsonProperties>[][];
|
|
7
|
-
};
|
|
8
|
-
export { useQuadKeyPayloadsToFeatures };
|
|
9
|
-
//# sourceMappingURL=useQuadKeyPayloadsToFeatures.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useQuadKeyPayloadsToFeatures.d.ts","sourceRoot":"","sources":["../../../src/hooks/useQuadKeyPayloadsToFeatures.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAGhD,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,mBAAmB,CAAA;AAkBnF,QAAA,MAAM,4BAA4B,cAAe,0CAA0C,EAAE,GAAG,0CAA0C;;;;CA6BzI,CAAA;AAED,OAAO,EAAE,4BAA4B,EAAE,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare enum MapStyle {
|
|
2
|
-
Dark = "mapbox/dark-v10",
|
|
3
|
-
Light = "mapbox/light-v10",
|
|
4
|
-
Outdoors = "mapbox/outdoors-v11",
|
|
5
|
-
Satellite = "mapbox/satellite-v9",
|
|
6
|
-
SatelliteStreets = "mapbox/satellite-streets-v11",
|
|
7
|
-
Streets = "mapbox/streets-v11"
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=MapStyle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MapStyle.d.ts","sourceRoot":"","sources":["../../../src/lib/MapStyle.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,IAAI,oBAAoB;IACxB,KAAK,qBAAqB;IAC1B,QAAQ,wBAAwB;IAChC,SAAS,wBAAwB;IACjC,gBAAgB,iCAAiC;IACjD,OAAO,uBAAuB;CAC/B"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
2
|
-
import type { Feature, Point, Polygon } from 'geojson';
|
|
3
|
-
export interface NetworkLocationAnswerBase<T> {
|
|
4
|
-
result: T;
|
|
5
|
-
}
|
|
6
|
-
export declare const NetworkLocationAnswerSchema = "network.xyo.location.range.answer";
|
|
7
|
-
export type NetworkLocationAnswerSchema = 'network.xyo.location.range.answer';
|
|
8
|
-
export type NetworkLocationAnswerPayload = Payload<NetworkLocationAnswerBase<{
|
|
9
|
-
features: Feature<Point>[];
|
|
10
|
-
}>, NetworkLocationAnswerSchema>;
|
|
11
|
-
export declare const isNetworkLocationAnswer: (x?: unknown | null) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & NetworkLocationAnswerBase<{
|
|
12
|
-
features: Feature<Point>[];
|
|
13
|
-
}> & {
|
|
14
|
-
schema: "network.xyo.location.range.answer";
|
|
15
|
-
};
|
|
16
|
-
export declare const NetworkLocationHeatmapAnswerSchema = "network.xyo.location.heatmap.answer";
|
|
17
|
-
export type NetworkLocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer';
|
|
18
|
-
export type NetworkLocationHeatmapAnswerPayload = Payload<NetworkLocationAnswerBase<{
|
|
19
|
-
features: Feature<Polygon>[];
|
|
20
|
-
}>, NetworkLocationHeatmapAnswerSchema>;
|
|
21
|
-
export declare const isNetworkLocationHeatmapAnswer: (x?: unknown | null) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & NetworkLocationAnswerBase<{
|
|
22
|
-
features: Feature<Polygon>[];
|
|
23
|
-
}> & {
|
|
24
|
-
schema: "network.xyo.location.heatmap.answer";
|
|
25
|
-
};
|
|
26
|
-
export declare const NetworkLocationHeatmapQuadkeyAnswerSchema = "network.xyo.location.heatmap.quadkey.answer";
|
|
27
|
-
export type NetworkLocationHeatmapQuadkeyAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer';
|
|
28
|
-
export type NetworkLocationHeatmapQuadkeyAnswerPayload = Payload<NetworkLocationAnswerBase<{
|
|
29
|
-
density: number;
|
|
30
|
-
quadkey: string;
|
|
31
|
-
}[]>, NetworkLocationHeatmapQuadkeyAnswerSchema>;
|
|
32
|
-
export declare const isNetworkLocationHeatmapQuadkeyAnswer: (x?: unknown | null) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & NetworkLocationAnswerBase<{
|
|
33
|
-
features: Feature<Polygon>[];
|
|
34
|
-
}> & {
|
|
35
|
-
schema: "network.xyo.location.heatmap.answer";
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=NetworkLocationAnswerBase.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkLocationAnswerBase.d.ts","sourceRoot":"","sources":["../../../src/types/NetworkLocationAnswerBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EACV,OAAO,EAAE,KAAK,EAAE,OAAO,EACxB,MAAM,SAAS,CAAA;AAEhB,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAA;CACV;AAED,eAAO,MAAM,2BAA2B,sCAAsC,CAAA;AAC9E,MAAM,MAAM,2BAA2B,GAAG,mCAAmC,CAAA;AAC7E,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAAE,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAA;CAAE,CAAC,EAAE,2BAA2B,CAAC,CAAA;AAC1I,eAAO,MAAM,uBAAuB;cADqD,OAAO,CAAC,KAAK,CAAC,EAAE;;;CACc,CAAA;AAEvH,eAAO,MAAM,kCAAkC,wCAAwC,CAAA;AACvF,MAAM,MAAM,kCAAkC,GAAG,qCAAqC,CAAA;AACtF,MAAM,MAAM,mCAAmC,GAAG,OAAO,CACvD,yBAAyB,CAAC;IAAE,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAA;CAAE,CAAC,EAC3D,kCAAkC,CACnC,CAAA;AACD,eAAO,MAAM,8BAA8B;cAHH,OAAO,CAAC,OAAO,CAAC,EAAE;;;CAGkF,CAAA;AAE5I,eAAO,MAAM,yCAAyC,gDAAgD,CAAA;AACtG,MAAM,MAAM,yCAAyC,GAAG,6CAA6C,CAAA;AACrG,MAAM,MAAM,0CAA0C,GAAG,OAAO,CAC9D,yBAAyB,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,EACjE,yCAAyC,CAC1C,CAAA;AACD,eAAO,MAAM,qCAAqC;cAXV,OAAO,CAAC,OAAO,CAAC,EAAE;;;CAazD,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DefaultMapSettings } from './Settings/index.ts'
|
|
2
|
-
|
|
3
|
-
export const AnimatedHeatMapSettings = DefaultMapSettings()
|
|
4
|
-
const {
|
|
5
|
-
debugLayer, scrollToZoom, fitToPoints, preferDark,
|
|
6
|
-
} = AnimatedHeatMapSettings
|
|
7
|
-
debugLayer.hidden = false
|
|
8
|
-
scrollToZoom.value = true
|
|
9
|
-
fitToPoints.value = false
|
|
10
|
-
preferDark.value = true
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface HeatMapColorProps {
|
|
2
|
-
staticMapColor: string
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export interface AnimatedHeatMapColorProps extends HeatMapColorProps {
|
|
6
|
-
highUsageColor: string
|
|
7
|
-
lowUsageColor: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface ColorGradientLegendProps {
|
|
11
|
-
endColor: string
|
|
12
|
-
endLabel: string
|
|
13
|
-
heading: string
|
|
14
|
-
startColor: string
|
|
15
|
-
startLabel: string
|
|
16
|
-
textColor: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type LegendProps = ColorGradientLegendProps
|
package/src/Colors/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './MapColorProps.ts'
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { PropsWithChildren } from 'react'
|
|
2
|
-
import React, { useMemo, useState } from 'react'
|
|
3
|
-
|
|
4
|
-
import { MapboxAccessTokenContext } from './Context.ts'
|
|
5
|
-
|
|
6
|
-
export interface MapboxAccessTokenProviderProps {
|
|
7
|
-
defaultAccessToken?: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const MapboxAccessTokenProvider: React.FC<PropsWithChildren<MapboxAccessTokenProviderProps>> = ({ defaultAccessToken, ...props }) => {
|
|
11
|
-
const [accessToken, setAccessToken] = useState<string>()
|
|
12
|
-
|
|
13
|
-
const value = useMemo(() => ({
|
|
14
|
-
accessToken: accessToken ?? defaultAccessToken, provided: true, setAccessToken,
|
|
15
|
-
}), [accessToken, defaultAccessToken, setAccessToken])
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<MapboxAccessTokenContext.Provider
|
|
19
|
-
value={value}
|
|
20
|
-
{...props}
|
|
21
|
-
/>
|
|
22
|
-
)
|
|
23
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { MapSetting } from './MapSetting.ts'
|
|
2
|
-
|
|
3
|
-
export const DefaultMapSettings: () => MapSetting = () => ({
|
|
4
|
-
debugLayer: {
|
|
5
|
-
devMode: true,
|
|
6
|
-
field: 'debugLayer',
|
|
7
|
-
hidden: true,
|
|
8
|
-
label: 'Debug Layer',
|
|
9
|
-
value: false,
|
|
10
|
-
},
|
|
11
|
-
debugLogging: {
|
|
12
|
-
devMode: true,
|
|
13
|
-
field: 'debugLogging',
|
|
14
|
-
hidden: true,
|
|
15
|
-
label: 'Debug Logging',
|
|
16
|
-
value: false,
|
|
17
|
-
},
|
|
18
|
-
dynamicMapResize: {
|
|
19
|
-
devMode: true,
|
|
20
|
-
field: 'dynamicMapResize',
|
|
21
|
-
hidden: true,
|
|
22
|
-
label: 'Auto Map Resize',
|
|
23
|
-
value: true,
|
|
24
|
-
},
|
|
25
|
-
enableControls: {
|
|
26
|
-
devMode: true,
|
|
27
|
-
field: 'enableControls',
|
|
28
|
-
hidden: true,
|
|
29
|
-
label: 'Map Controls',
|
|
30
|
-
value: false,
|
|
31
|
-
},
|
|
32
|
-
fitToPoints: {
|
|
33
|
-
devMode: true,
|
|
34
|
-
field: 'fitToPoints',
|
|
35
|
-
hidden: true,
|
|
36
|
-
label: 'Fit To Points',
|
|
37
|
-
value: false,
|
|
38
|
-
},
|
|
39
|
-
preferDark: {
|
|
40
|
-
devMode: false,
|
|
41
|
-
field: 'preferDark',
|
|
42
|
-
hidden: true,
|
|
43
|
-
label: 'Prefer dark',
|
|
44
|
-
value: false,
|
|
45
|
-
},
|
|
46
|
-
scrollToZoom: {
|
|
47
|
-
devMode: true,
|
|
48
|
-
field: 'scrollToZoom',
|
|
49
|
-
hidden: true,
|
|
50
|
-
label: 'Scroll To Zoom',
|
|
51
|
-
value: false,
|
|
52
|
-
},
|
|
53
|
-
})
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type MapSettingFields = 'debugLayer' | 'fitToPoints' | 'scrollToZoom' | 'enableControls' | 'debugLogging' | 'preferDark' | 'dynamicMapResize'
|
|
2
|
-
|
|
3
|
-
export type MapSetting = {
|
|
4
|
-
[field in MapSettingFields | string]: {
|
|
5
|
-
/** Setting only available when application is in developerMode */
|
|
6
|
-
devMode?: boolean
|
|
7
|
-
/** Machine-readable string to reference setting */
|
|
8
|
-
field: string
|
|
9
|
-
/** Hide the setting from the UI */
|
|
10
|
-
hidden?: boolean
|
|
11
|
-
/** Label in the UI */
|
|
12
|
-
label: string
|
|
13
|
-
/** Initial toggle value for a setting */
|
|
14
|
-
value: boolean
|
|
15
|
-
}
|
|
16
|
-
}
|
package/src/Settings/index.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/hex'
|
|
2
|
-
import type { ArchivistPreset } from '@xyo-network/react-network'
|
|
3
|
-
import { useNetwork } from '@xyo-network/react-network'
|
|
4
|
-
import { useMemo } from 'react'
|
|
5
|
-
|
|
6
|
-
const animatedAnswerHashesConst: Hash[] = [
|
|
7
|
-
'79af071f451fc7af10d009dc63236ef9a9b211732c1ee0c06f028fcecf2336c5',
|
|
8
|
-
'531bfba6d8dfefd3bcc888aca54cdbbd4574ed2b3ec551b230845a1f9a608898',
|
|
9
|
-
'c874412b4faa4947de81372fd1ba12fdd6f43f5e408622b7f357cb2bcb3f17cb',
|
|
10
|
-
'29d3f8b882c61a82a1a1675782a27e797ea7196f45a23b4409680ab8b8d5f14e',
|
|
11
|
-
'cfd20f80ac073fd9518f4ef3f43d2a1f5e4e56e40c2677f38d6f6fecd05df60c',
|
|
12
|
-
'1354fa73497519a39aed19fc99bdbae78a880a1eafb2f7898d607e07db36528d',
|
|
13
|
-
'1043b0d25eacfc5013ae9dba780305a6fbf01a43543bd871d7c00537fca142a9',
|
|
14
|
-
'973dfc5df142851ced258d52d0ac2784e814000ac22e35776f772256b0d4dde9',
|
|
15
|
-
'463808eb74d3d87e6563970e0301a493577f8cd1b501e6e0ffa5e027ad2cea95',
|
|
16
|
-
'15b21acea2e3fd9d1ace3768a72636ee7bdf67a6f8e0807bfa2273dea2207555',
|
|
17
|
-
'32d377bfe7ebe382598c54dd13f8af7510e0a1e2fd2e913311fdd58e517e5e2e,',
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
const staticAnswerHashConst: Hash = 'c7bbf61f61cfd4a1b2def160c28136fc1d100d39fbdb67b227a2c6e558d9d3a5'
|
|
21
|
-
|
|
22
|
-
export const useFindHashes = () => {
|
|
23
|
-
const { network } = useNetwork()
|
|
24
|
-
const exploreMapHashes = (network?.nodes?.find(node => node.type === 'archivist') as ArchivistPreset)?.explorerMapHashes
|
|
25
|
-
const animatedAnswerHashes = exploreMapHashes?.animatedAnswerHashes || animatedAnswerHashesConst
|
|
26
|
-
const staticAnswerHash = exploreMapHashes?.staticAnswerHash || staticAnswerHashConst
|
|
27
|
-
const foundHashes = useMemo(() => [staticAnswerHash, ...animatedAnswerHashes], [animatedAnswerHashes, staticAnswerHash])
|
|
28
|
-
return foundHashes
|
|
29
|
-
}
|