@xyo-network/react-map 7.6.2 → 8.0.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"AnimatedHeatMap.d.ts","sourceRoot":"","sources":["../../../src/Components/AnimatedHeatMap.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAmB,MAAM,OAAO,CAAA;AASvC,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,mBAAmB,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,CAAA;IACzC,kBAAkB,CAAC,EAAE,UAAU,CAAA;IAC/B,iBAAiB,EAAE,yBAAyB,CAAA;IAC5C,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAA;CACrC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAqC7E,CAAA"}
1
+ {"version":3,"file":"AnimatedHeatMap.d.ts","sourceRoot":"","sources":["../../../src/Components/AnimatedHeatMap.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAmB,MAAM,OAAO,CAAA;AASvC,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,mBAAmB,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,CAAA;IACzC,kBAAkB,CAAC,EAAE,UAAU,CAAA;IAC/B,iBAAiB,EAAE,yBAAyB,CAAA;IAC5C,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAA;CACrC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CA6C7E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnimatedHeatMapLoaded.d.ts","sourceRoot":"","sources":["../../../src/Components/AnimatedHeatMapLoaded.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AASzD,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,MAAM,WAAW,0BAA2B,SAAQ,YAAY;IAC9D,WAAW,EAAE,MAAM,CAAA;IACnB,sBAAsB,EAAE,MAAM,CAAA;CAC/B;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAuCtE,CAAA"}
1
+ {"version":3,"file":"AnimatedHeatMapLoaded.d.ts","sourceRoot":"","sources":["../../../src/Components/AnimatedHeatMapLoaded.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AASzD,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,MAAM,WAAW,0BAA2B,SAAQ,YAAY;IAC9D,WAAW,EAAE,MAAM,CAAA;IACnB,sBAAsB,EAAE,MAAM,CAAA;CAC/B;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA0CtE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../../src/Components/Legend.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AAC5E,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA0B7D,CAAA;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
1
+ {"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../../src/Components/Legend.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AAC5E,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgC7D,CAAA;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ColorGradient.d.ts","sourceRoot":"","sources":["../../../../src/Components/Legends/ColorGradient.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AAC5E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA2B3D,CAAA;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
1
+ {"version":3,"file":"ColorGradient.d.ts","sourceRoot":"","sources":["../../../../src/Components/Legends/ColorGradient.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AAC5E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgD3D,CAAA;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"MapBoxPoints.d.ts","sourceRoot":"","sources":["../../../src/Components/MapBoxPoints.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAKzD,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAA;CAC5B;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA6DlE,CAAA"}
1
+ {"version":3,"file":"MapBoxPoints.d.ts","sourceRoot":"","sources":["../../../src/Components/MapBoxPoints.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAKzD,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAA;CAC5B;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAiElE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsBox.d.ts","sourceRoot":"","sources":["../../../../src/Components/MapSettingsComponents/SettingsBox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAoBxD,CAAA"}
1
+ {"version":3,"file":"SettingsBox.d.ts","sourceRoot":"","sources":["../../../../src/Components/MapSettingsComponents/SettingsBox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+BxD,CAAA"}
@@ -874,9 +874,28 @@ var MapSettingsBox = ({ developerMode, ...props }) => {
874
874
  const { mapSettings } = useMapSettings();
875
875
  const { developerMode: devModeFromContext } = useAppSettings();
876
876
  const resolveDeveloperMode = developerMode ?? devModeFromContext;
877
- return mapSettings && resolveDeveloperMode ? /* @__PURE__ */ jsx6(FlexGrowRow, { bottom: 36, left: 10, position: "absolute", ...props, children: /* @__PURE__ */ jsx6(FlexRow, { paddingX: 2, children: /* @__PURE__ */ jsx6(Paper, { children: /* @__PURE__ */ jsx6(Stack, { direction: "row", spacing: 1, marginX: 1, children: Object.keys(mapSettings).map((key) => {
878
- return /* @__PURE__ */ jsx6(MapSettingSwitch, { field: mapSettings[key].field, developerMode }, key);
879
- }) }) }) }) }) : null;
877
+ return mapSettings && resolveDeveloperMode ? /* @__PURE__ */ jsx6(
878
+ FlexGrowRow,
879
+ {
880
+ ...props,
881
+ sx: [{
882
+ bottom: 36,
883
+ left: 10,
884
+ position: "absolute"
885
+ }, ...Array.isArray(props.sx) ? props.sx : [props.sx]],
886
+ children: /* @__PURE__ */ jsx6(FlexRow, { sx: { paddingX: 2 }, children: /* @__PURE__ */ jsx6(Paper, { children: /* @__PURE__ */ jsx6(
887
+ Stack,
888
+ {
889
+ direction: "row",
890
+ spacing: 1,
891
+ sx: { marginX: 1 },
892
+ children: Object.keys(mapSettings).map((key) => {
893
+ return /* @__PURE__ */ jsx6(MapSettingSwitch, { field: mapSettings[key].field, developerMode }, key);
894
+ })
895
+ }
896
+ ) }) })
897
+ }
898
+ ) : null;
880
899
  };
881
900
 
882
901
  // src/Components/MapBoxHeat.tsx
@@ -930,7 +949,16 @@ var AnimatedHeatMap = ({
930
949
  heatMapColorProps,
931
950
  children: /* @__PURE__ */ jsx8(MapboxHeatFlexBox, { accessToken, ...props })
932
951
  }
933
- ) }) }) : /* @__PURE__ */ jsx8(FlexCol2, { minHeight: 160, minWidth: 160, busy: true });
952
+ ) }) }) : /* @__PURE__ */ jsx8(
953
+ FlexCol2,
954
+ {
955
+ busy: true,
956
+ sx: {
957
+ minHeight: 160,
958
+ minWidth: 160
959
+ }
960
+ }
961
+ );
934
962
  };
935
963
 
936
964
  // src/Components/AnimatedHeatMapLoaded.tsx
@@ -962,19 +990,52 @@ var ColorGradientLegend = ({
962
990
  }) => {
963
991
  const theme = useTheme2();
964
992
  return /* @__PURE__ */ jsxs2(FlexCol3, { ...props, children: [
965
- /* @__PURE__ */ jsx9(Typography, { mb: theme.spacing(0.25), color: textColor, variant: "caption", textAlign: "center", children: heading }),
966
- /* @__PURE__ */ jsx9(FlexCol3, { flexGrow: 1, alignItems: "stretch", paddingX: theme.spacing(1), mb: theme.spacing(0.25), children: /* @__PURE__ */ jsx9(
993
+ /* @__PURE__ */ jsx9(
994
+ Typography,
995
+ {
996
+ color: textColor,
997
+ variant: "caption",
998
+ sx: {
999
+ mb: theme.spacing(0.25),
1000
+ textAlign: "center"
1001
+ },
1002
+ children: heading
1003
+ }
1004
+ ),
1005
+ /* @__PURE__ */ jsx9(
967
1006
  FlexCol3,
968
1007
  {
969
- height: theme.spacing(0.75),
970
- border: `1px solid ${textColor}`,
971
- sx: { backgroundImage: `linear-gradient(to right, ${startColor},${endColor})` }
1008
+ sx: {
1009
+ flexGrow: 1,
1010
+ alignItems: "stretch",
1011
+ paddingX: theme.spacing(1),
1012
+ mb: theme.spacing(0.25)
1013
+ },
1014
+ children: /* @__PURE__ */ jsx9(
1015
+ FlexCol3,
1016
+ {
1017
+ sx: {
1018
+ height: theme.spacing(0.75),
1019
+ border: `1px solid ${textColor}`,
1020
+ backgroundImage: `linear-gradient(to right, ${startColor},${endColor})`
1021
+ }
1022
+ }
1023
+ )
1024
+ }
1025
+ ),
1026
+ /* @__PURE__ */ jsxs2(
1027
+ FlexRow2,
1028
+ {
1029
+ sx: {
1030
+ flexGrow: 1,
1031
+ justifyContent: "space-between"
1032
+ },
1033
+ children: [
1034
+ /* @__PURE__ */ jsx9(Typography, { color: textColor, variant: "caption", children: startLabel }),
1035
+ /* @__PURE__ */ jsx9(Typography, { color: textColor, variant: "caption", children: endLabel })
1036
+ ]
972
1037
  }
973
- ) }),
974
- /* @__PURE__ */ jsxs2(FlexRow2, { flexGrow: 1, justifyContent: "space-between", children: [
975
- /* @__PURE__ */ jsx9(Typography, { color: textColor, variant: "caption", children: startLabel }),
976
- /* @__PURE__ */ jsx9(Typography, { color: textColor, variant: "caption", children: endLabel })
977
- ] })
1038
+ )
978
1039
  ] });
979
1040
  };
980
1041
 
@@ -991,24 +1052,34 @@ var AnimatedHeatMapLegend = ({ ...legendProps }) => {
991
1052
  } = legendProps;
992
1053
  const theme = useTheme3();
993
1054
  const isSmall = useMediaQuery(theme.breakpoints.down("sm"));
994
- return /* @__PURE__ */ jsx10(FlexCol4, { position: "absolute", bottom: 0, right: 0, children: /* @__PURE__ */ jsx10(
995
- ColorGradientLegend,
1055
+ return /* @__PURE__ */ jsx10(
1056
+ FlexCol4,
996
1057
  {
997
- startColor,
998
- endColor,
999
- startLabel,
1000
- endLabel,
1001
- heading,
1002
- textColor,
1003
- ...{
1004
- alignItems: "stretch",
1005
- marginBottom: theme.spacing(4),
1006
- marginLeft: isSmall ? theme.spacing(3) : 0,
1007
- marginRight: isSmall ? theme.spacing(2) : theme.spacing(3),
1008
- width: isSmall ? "40vw" : theme.spacing(18)
1009
- }
1058
+ sx: {
1059
+ position: "absolute",
1060
+ bottom: 0,
1061
+ right: 0
1062
+ },
1063
+ children: /* @__PURE__ */ jsx10(
1064
+ ColorGradientLegend,
1065
+ {
1066
+ startColor,
1067
+ endColor,
1068
+ startLabel,
1069
+ endLabel,
1070
+ heading,
1071
+ textColor,
1072
+ ...{
1073
+ alignItems: "stretch",
1074
+ marginBottom: theme.spacing(4),
1075
+ marginLeft: isSmall ? theme.spacing(3) : 0,
1076
+ marginRight: isSmall ? theme.spacing(2) : theme.spacing(3),
1077
+ width: isSmall ? "40vw" : theme.spacing(18)
1078
+ }
1079
+ }
1080
+ )
1010
1081
  }
1011
- ) });
1082
+ );
1012
1083
  };
1013
1084
 
1014
1085
  // src/Components/AnimatedHeatMapLoaded.tsx
@@ -1027,24 +1098,31 @@ var AnimatedHeatMapLoaded = ({
1027
1098
  flexGrow: 1,
1028
1099
  legend: legendProps ? /* @__PURE__ */ jsx11(AnimatedHeatMapLegend, { ...legendProps }) : null
1029
1100
  };
1030
- return /* @__PURE__ */ jsxs3(FlexCol5, { alignItems: "stretch", ...props, children: [
1031
- xyoError ? /* @__PURE__ */ jsxs3(Alert, { sx: { mt: 2 }, children: [
1032
- /* @__PURE__ */ jsx11(AlertTitle, { children: "Error Loading Map" }),
1033
- xyoError.message ? `Error: ${xyoError.message}` : null,
1034
- "You might try authenticating again."
1035
- ] }) : null,
1036
- hashes === void 0 ? /* @__PURE__ */ jsx11(Alert, { children: "Missing answer hash for heat map query" }) : /* @__PURE__ */ jsx11(
1037
- AnimatedHeatMap,
1038
- {
1039
- accessToken,
1040
- defaultMapSettings: AnimatedHeatMapSettings,
1041
- animatedFeatureSets: multipleFeatureSets.slice(1),
1042
- staticFeatureSet: multipleFeatureSets[0],
1043
- heatMapColorProps,
1044
- ...MapBoxHeatProps
1045
- }
1046
- )
1047
- ] });
1101
+ return /* @__PURE__ */ jsxs3(
1102
+ FlexCol5,
1103
+ {
1104
+ ...props,
1105
+ sx: [{ alignItems: "stretch" }, ...Array.isArray(props.sx) ? props.sx : [props.sx]],
1106
+ children: [
1107
+ xyoError ? /* @__PURE__ */ jsxs3(Alert, { sx: { mt: 2 }, children: [
1108
+ /* @__PURE__ */ jsx11(AlertTitle, { children: "Error Loading Map" }),
1109
+ xyoError.message ? `Error: ${xyoError.message}` : null,
1110
+ "You might try authenticating again."
1111
+ ] }) : null,
1112
+ hashes === void 0 ? /* @__PURE__ */ jsx11(Alert, { children: "Missing answer hash for heat map query" }) : /* @__PURE__ */ jsx11(
1113
+ AnimatedHeatMap,
1114
+ {
1115
+ accessToken,
1116
+ defaultMapSettings: AnimatedHeatMapSettings,
1117
+ animatedFeatureSets: multipleFeatureSets.slice(1),
1118
+ staticFeatureSet: multipleFeatureSets[0],
1119
+ heatMapColorProps,
1120
+ ...MapBoxHeatProps
1121
+ }
1122
+ )
1123
+ ]
1124
+ }
1125
+ );
1048
1126
  };
1049
1127
 
1050
1128
  // src/Components/HeatMapSettings.ts
@@ -1206,10 +1284,18 @@ var MapboxPointsFlexBox = ({
1206
1284
  }
1207
1285
  }
1208
1286
  }, [mapInitialized, mapSettings, map, fitToPointsPadding, zoom, features, layers]);
1209
- return /* @__PURE__ */ jsx13(FlexCol6, { alignItems: "stretch", id: "xyo-mapbox-wrap", ...props, children: features ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
1210
- /* @__PURE__ */ jsx13(MapBox, { accessToken, zoom }),
1211
- /* @__PURE__ */ jsx13(MapSettingsBox, {})
1212
- ] }) : /* @__PURE__ */ jsx13(Alert2, { severity: "error", children: "No data to show" }) });
1287
+ return /* @__PURE__ */ jsx13(
1288
+ FlexCol6,
1289
+ {
1290
+ id: "xyo-mapbox-wrap",
1291
+ ...props,
1292
+ sx: [{ alignItems: "stretch" }, ...Array.isArray(props.sx) ? props.sx : [props.sx]],
1293
+ children: features ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
1294
+ /* @__PURE__ */ jsx13(MapBox, { accessToken, zoom }),
1295
+ /* @__PURE__ */ jsx13(MapSettingsBox, {})
1296
+ ] }) : /* @__PURE__ */ jsx13(Alert2, { severity: "error", children: "No data to show" })
1297
+ }
1298
+ );
1213
1299
  };
1214
1300
  export {
1215
1301
  AnimatedHeatMap,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Components/AnimatedHeatMap.tsx","../../src/Contexts/HeatMapInitializer/Provider.tsx","../../src/hooks/useDynamicMapResize.tsx","../../src/hooks/useDynamicPositioning.tsx","../../src/hooks/useQuadKeyPayloadsToFeatures.tsx","../../src/MapBoxClasses/MapBase.ts","../../src/MapBoxClasses/MapHeat.ts","../../src/MapBoxClasses/MapPoints.ts","../../src/MapBoxClasses/MapSettings.ts","../../src/Contexts/MapBoxInstance/Provider.tsx","../../src/Contexts/MapBoxInstance/Context.ts","../../src/Contexts/MapBoxInstance/useMapBoxInstance.tsx","../../src/Contexts/MapSettings/Provider.tsx","../../src/Contexts/MapSettings/Context.ts","../../src/Contexts/MapSettings/useMapSettings.tsx","../../src/Contexts/HeatMapInitializer/Context.ts","../../src/Contexts/HeatMapInitializer/useHeatMapInitializer.tsx","../../src/Layers/Configs/HeatMapFillLayerConfig.ts","../../src/Layers/Configs/HeatMapLineLayerConfig.ts","../../src/Layers/Configs/HeatMapSymbolLayerConfig.ts","../../src/Layers/Configs/LocationPointLayerConfig.ts","../../src/Layers/FillLayer.ts","../../src/Layers/LineLayer.ts","../../src/Layers/SymbolLayer.ts","../../src/Layers/Builders/LocationHeatMapLayerBuilder.ts","../../src/Layers/Builders/LocationHeatMapLayerBuilderAnimated.ts","../../src/Layers/CircleLayer.ts","../../src/Layers/Builders/LocationPointsMapLayerBuilder.ts","../../src/Components/MapBoxHeat.tsx","../../src/Components/MapBox.tsx","../../src/Components/MapSettingsComponents/Setting.tsx","../../src/Components/MapSettingsComponents/SettingsBox.tsx","../../src/Components/AnimatedHeatMapLoaded.tsx","../../src/Components/Legend.tsx","../../src/Components/Legends/ColorGradient.tsx","../../src/Components/HeatMapSettings.ts","../../src/Components/LayerAnimator.tsx","../../src/Components/MapBoxPoints.tsx"],"sourcesContent":["import { useTheme } from '@mui/material'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { darkenCss } from '@xylabs/react-theme'\nimport type { AnimatedHeatMapColorProps, MapSetting } from '@xyo-network/react-map-model'\nimport type { Feature, Polygon } from 'geojson'\nimport type { PropsWithChildren } from 'react'\nimport React, { useState } from 'react'\n\nimport {\n HeatMapInitializerProvider, MapBoxInstanceProvider, MapSettingsProvider,\n} from '../Contexts/index.ts'\nimport type { MapLayer } from '../Layers/index.ts'\nimport { LocationHeatMapLayerBuilderAnimated, MapHeatConstants } from '../Layers/index.ts'\nimport { MapboxHeatFlexBox } from './MapBoxHeat.tsx'\n\nexport interface AnimatedHeatMapProps {\n accessToken: string\n animatedFeatureSets: Feature<Polygon>[][]\n defaultMapSettings?: MapSetting\n heatMapColorProps: AnimatedHeatMapColorProps\n staticFeatureSet: Feature<Polygon>[]\n}\n\nexport const AnimatedHeatMap: React.FC<PropsWithChildren<AnimatedHeatMapProps>> = ({\n accessToken,\n animatedFeatureSets,\n defaultMapSettings,\n heatMapColorProps,\n staticFeatureSet,\n ...props\n}) => {\n const theme = useTheme()\n const {\n staticMapColor, lowUsageColor, highUsageColor,\n } = heatMapColorProps || {}\n const localStaticMapColor = staticMapColor ?? theme.vars.palette.primary.light\n\n const [layers] = useState<MapLayer[]>(() => [\n LocationHeatMapLayerBuilderAnimated(localStaticMapColor, 0, 'static'),\n LocationHeatMapLayerBuilderAnimated(lowUsageColor || localStaticMapColor, 0, 'animated'),\n LocationHeatMapLayerBuilderAnimated(highUsageColor || darkenCss(localStaticMapColor, 0.9), 1, 'animated'),\n ])\n\n return animatedFeatureSets?.length\n ? (\n <MapBoxInstanceProvider>\n <MapSettingsProvider defaultMapSettings={defaultMapSettings} debugLayerName={MapHeatConstants.LocationDebugLayerId}>\n <HeatMapInitializerProvider\n features={staticFeatureSet}\n layers={[layers[0]]}\n featureSets={animatedFeatureSets}\n featureSetsLayers={layers.slice(1, 3)}\n heatMapColorProps={heatMapColorProps}\n >\n <MapboxHeatFlexBox accessToken={accessToken} {...props}></MapboxHeatFlexBox>\n </HeatMapInitializerProvider>\n </MapSettingsProvider>\n </MapBoxInstanceProvider>\n )\n : <FlexCol minHeight={160} minWidth={160} busy />\n}\n","import { forget } from '@xylabs/sdk-js'\nimport type { AnimatedHeatMapColorProps, HeatMapColorProps } from '@xyo-network/react-map-model'\nimport type { Feature, Polygon } from 'geojson'\nimport type { PropsWithChildren } from 'react'\nimport React, { useEffect, useMemo } from 'react'\n\nimport { useDynamicPositioning } from '../../hooks/index.ts'\nimport type { MapLayer } from '../../Layers/index.ts'\nimport { MapHeat } from '../../MapBoxClasses/index.ts'\nimport { useMapBoxInstance } from '../MapBoxInstance/index.ts'\nimport { useMapSettings } from '../MapSettings/index.ts'\nimport { HeatMapInitializerContext } from './Context.ts'\nimport type { HeatMapInitializerState } from './State.ts'\n\nexport interface MapInitializerProviderProps {\n featureSets?: Feature<Polygon>[][]\n featureSetsLayers?: MapLayer[]\n features?: Feature<Polygon>[]\n fitToPadding?: number\n heatMapColorProps: HeatMapColorProps | AnimatedHeatMapColorProps\n layers?: MapLayer[]\n zoom?: number\n}\n\nexport const HeatMapInitializerProvider: React.FC<PropsWithChildren<MapInitializerProviderProps>> = ({\n children,\n featureSets,\n featureSetsLayers,\n features,\n fitToPadding,\n heatMapColorProps,\n layers,\n zoom,\n}) => {\n const { options } = useDynamicPositioning()\n const { mapSettings } = useMapSettings()\n const { map, mapInitialized } = useMapBoxInstance()\n\n const mapHeat = useMemo(() => {\n return (map && features?.length)\n ? new MapHeat({\n features, map, zoom,\n })\n : undefined\n }, [map, features, zoom])\n\n const value: HeatMapInitializerState = useMemo(() => ({\n MapHeat: mapHeat,\n heatMapColorProps,\n }), [mapHeat, heatMapColorProps])\n\n useEffect(() => {\n if (mapInitialized && featureSets?.length && featureSets[0].length > 0 && map && featureSetsLayers?.length) {\n const { lowUsageColor, highUsageColor } = heatMapColorProps as AnimatedHeatMapColorProps\n forget(MapHeat.initializeAnimatedHeatMapSource(featureSetsLayers, featureSets, map, lowUsageColor, highUsageColor))\n }\n\n return () => {\n MapHeat.animationStarted = false\n }\n }, [featureSets, featureSetsLayers, mapInitialized, map, heatMapColorProps])\n\n useEffect(() => {\n if (mapHeat && mapInitialized && features?.length && layers?.length) {\n mapHeat.initializeHeatMapSource(layers)\n }\n }, [mapHeat, features?.length, layers, mapInitialized])\n\n useEffect(() => {\n if (mapInitialized) {\n const { fitToPoints } = mapSettings || {}\n\n if (map) {\n if (fitToPoints?.value === true) {\n MapHeat.initialMapPositioning(\n {\n padding: {\n bottom: fitToPadding, left: fitToPadding, right: fitToPadding, top: fitToPadding,\n },\n },\n map,\n features,\n )\n } else if (options?.zoom && options.center) {\n map.setZoom(options.zoom)\n map.setCenter(options.center)\n }\n }\n }\n }, [mapHeat, map, mapSettings, fitToPadding, options, mapInitialized, features])\n\n return <HeatMapInitializerContext value={value}>{children}</HeatMapInitializerContext>\n}\n","import type { Map } from 'mapbox-gl'\nimport type { RefObject } from 'react'\nimport { useEffect } from 'react'\n\n/**\n * Inspired by - https://bl.ocks.org/danswick/fc56f37c10d40be62e4feac5984250d2\n */\nexport const useDynamicMapResize = (\n mapContainerRef: RefObject<HTMLDivElement | null>,\n mapCanvasRef: RefObject<HTMLCanvasElement | null>,\n mapInstance?: Map,\n active = true,\n) => {\n useEffect(() => {\n if (active && mapInstance) {\n const container = mapContainerRef.current\n if (container) {\n let timerId: ReturnType<typeof setTimeout> | undefined\n const resizer = new ResizeObserver(() => {\n const width = container.getBoundingClientRect().width\n const canvas = mapCanvasRef.current\n if (width && canvas) {\n canvas.style.width = `${width}px`\n timerId = setTimeout(() => mapInstance.resize())\n }\n })\n resizer.observe(container)\n return () => {\n clearTimeout(timerId)\n resizer.disconnect()\n }\n }\n }\n }, [active, mapCanvasRef, mapContainerRef, mapInstance])\n}\n","import { useWindowSize } from '@xylabs/react-shared'\nimport type { MapOptions } from 'mapbox-gl'\nimport { useMemo } from 'react'\n\n/**\n * Zoom level for the map\n *\n * Note: Changing zoom will require changes to Lat/Lng Ranges\n */\nconst defaultZoom = 1.6\n\n/**\n * Range of aspect ratio values (width / height = aspect ratio) to scale against degrees\n * On lower aspect ratios, the width is larger than the height and vice-versa for higher\n */\nconst defaultAspectRatioRange = [0.5, 2]\n\n/**\n * Lat/Lng ranges, the first index is the minimum and the second is the maximum\n * Index 0 is for portrait screens and centers on the Eastern Hemisphere\n * Index 1 is for wider screens near the Prime Meridian and north of the Equator\n *\n * Note: Values are based off the zoom level\n */\nconst latRange = [0.912_164_420_526_366_4, 1.717_850_315_594_39]\nconst lngRange = [-81.474_201_485_195_9, 12.788_958_675_506_933]\n\n/**\n * Function to interpolate an aspect ratio value across a range of degrees and aspect ratios\n *\n * Inspired by - https://stackoverflow.com/questions/14224535/scaling-between-two-number-ranges\n *\n * @param aspectRatio aspect ratio to scale\n * @param degreeRange A latitude or longitude range (i.e. [minLat, maxLat])\n * @param aspectRatioRange A range of aspect ratios to scale against degreeRange parameter\n * @returns number\n */\nconst linearInterpolate = (aspectRatio: number, degreeRange: number[], aspectRatioRange?: number[]): number => {\n const [degreeMin, degreeMax] = degreeRange\n const [aspectRatioMin, aspectRatioMax] = aspectRatioRange || defaultAspectRatioRange\n\n const aspectRatioRangeSpan = aspectRatioMax - aspectRatioMin\n const degreeRangeSpan = degreeMax - degreeMin\n\n const percent = (aspectRatio - aspectRatioMin) / aspectRatioRangeSpan\n const scaledDegree = percent * degreeRangeSpan + degreeMin\n\n return scaledDegree\n}\n\nconst useDynamicPositioning = () => {\n const { width, height } = useWindowSize()\n\n const options = useMemo(() => {\n if (width && height) {\n const aspectRatio = width / height\n\n return {\n center: [linearInterpolate(aspectRatio, lngRange), linearInterpolate(aspectRatio, latRange)],\n zoom: defaultZoom,\n } as Partial<MapOptions>\n }\n }, [height, width])\n\n return { options }\n}\n\nexport { useDynamicPositioning }\n","import { GeoJson } from '@xylabs/geo'\nimport { exists } from '@xylabs/sdk-js'\nimport type { NetworkLocationHeatmapQuadkeyAnswerPayload } from '@xyo-network/react-map-model'\nimport type { Feature, Geometry } from 'geojson'\nimport { useMemo } from 'react'\n\nconst quadKeyToFeature = ({ density, quadkey }: { density: number; quadkey: string }) => {\n const polygonFeature = new GeoJson(quadkey).polygonFeature()\n polygonFeature.properties = {\n count: density,\n density,\n }\n return polygonFeature\n}\n\nconst setDensity = (feature: Feature) => {\n if (feature.properties) {\n feature.properties.value = feature.properties.density / 5\n }\n return feature\n}\n\nconst useQuadKeyPayloadsToFeatures = (payloads?: NetworkLocationHeatmapQuadkeyAnswerPayload[] | NetworkLocationHeatmapQuadkeyAnswerPayload) => {\n const {\n multipleFeatureSets, features, error,\n } = useMemo(() => {\n let multipleFeatureSets: Feature<Geometry>[][] = [[]]\n let features: Feature<Geometry>[] = []\n let error: Error | undefined\n\n // Convert Multiple Payloads from Quadkey to GeoJson\n if (Array.isArray(payloads)) {\n if ((payloads)?.filter(exists).length > 0) {\n const mappedFeatures = payloads?.map(payload => payload?.result.map(quadKeyToFeature))\n multipleFeatureSets = mappedFeatures.map(f => f?.map(setDensity) ?? [])\n } else {\n error = new Error('Cannot find payloads for provided hashes')\n }\n }\n\n // Convert Single Payload from Quadkey to GeoJson\n if (payloads && (payloads as NetworkLocationHeatmapQuadkeyAnswerPayload).result) {\n const singlePayload = payloads as NetworkLocationHeatmapQuadkeyAnswerPayload\n const mappedFeatures = singlePayload.result.map(quadKeyToFeature)\n features = mappedFeatures.map(setDensity)\n }\n\n return {\n multipleFeatureSets, features, error,\n }\n }, [payloads])\n\n return {\n error, features, multipleFeatureSets,\n }\n}\n\nexport { useQuadKeyPayloadsToFeatures }\n","import { GeoJson } from '@xylabs/geo'\nimport { assertEx } from '@xylabs/sdk-js'\nimport type { Feature, Geometry } from 'geojson'\nimport type { GeoJSONSource, Map } from 'mapbox-gl'\n\nimport type { MapLayer } from '../Layers/index.ts'\n\nexport interface MapBaseConfig<T extends Geometry> {\n features: Feature<T>[]\n map: Map\n requestLocation?: boolean\n zoom?: number\n}\n\nexport abstract class MapBase<T extends Geometry> {\n private _config: MapBaseConfig<T>\n\n constructor(config: MapBaseConfig<T>) {\n this._config = {\n requestLocation: true, zoom: 2, ...config,\n }\n }\n\n get isMapReady() {\n return !!this._config.map\n }\n\n initializeMapSource(layer: MapLayer) {\n const getSource = () => {\n const featuresCollection = GeoJson.featureCollection(this._config.features)\n return GeoJson.featuresSource(featuresCollection)\n }\n\n const existingSource = this._config.map.getSource(layer.source as string) as GeoJSONSource\n const source = getSource()\n if (existingSource) {\n existingSource.setData(assertEx(source.data as GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry>))\n } else {\n this._config.map.addSource(layer.source as string, source)\n }\n layer.update(this._config.map, true)\n\n return this\n }\n}\n","import { GeoJson } from '@xylabs/geo'\nimport {\n assertEx, delay, forget,\n} from '@xylabs/sdk-js'\nimport type { Feature, Polygon } from 'geojson'\nimport type {\n DataDrivenPropertyValueSpecification,\n GeoJSONSource, GeoJSONSourceSpecification, Map, MapOptions,\n} from 'mapbox-gl'\nimport { LngLatBounds } from 'mapbox-gl'\n\nimport type { MapLayer } from '../Layers/index.ts'\nimport type { MapBaseConfig } from './MapBase.ts'\nimport { MapBase } from './MapBase.ts'\n\nexport class MapHeat extends MapBase<Polygon> {\n static animationStarted = false\n\n config: MapBaseConfig<Polygon>\n constructor(config: MapBaseConfig<Polygon>) {\n super(config)\n this.config = config\n }\n\n static initialMapPositioning(options: MapOptions['fitBoundsOptions'], map: Map, features?: Feature<Polygon>[], initialBounds?: LngLatBounds) {\n if (!features) {\n return\n }\n\n let bounds: LngLatBounds\n\n if (initialBounds) {\n bounds = initialBounds\n } else {\n bounds = new LngLatBounds()\n\n // eslint-disable-next-line unicorn/no-array-for-each\n features.forEach((feature: Feature<Polygon>) => {\n for (const coordinates of feature.geometry.coordinates) {\n for (const position of coordinates) {\n bounds.extend(position as [number, number])\n }\n }\n })\n }\n\n map.setCenter(bounds.getCenter())\n map.fitBounds(bounds, options)\n return this\n }\n\n static async initializeAnimatedHeatMapSource(\n layers: MapLayer[],\n featureSet: Feature<Polygon>[][],\n map: Map,\n startColor?: string,\n endColor?: string,\n ) {\n this.animationStarted = true\n let layerTick = 0\n let sourceTick = 0\n\n const sources = featureSet.map((feature) => {\n const featuresCollection = GeoJson.featureCollection(feature)\n return GeoJson.featuresSource(featuresCollection)\n })\n this.updateLayer(map, layers[0], sources[0])\n this.updateLayer(map, layers[1], sources[1])\n\n for (const layer of layers) {\n map.setPaintProperty(layer.id, 'fill-opacity', 0)\n }\n\n const frameLength = 3000\n const initialPad = 0.5\n const factor = 10\n const steps = 30\n const stepLength = frameLength / steps\n const lowUsageColor = startColor ?? '#FFB3B3'\n const highUsageColor = endColor ?? '#FF0000'\n\n // Max density at i=0, min density at i=steps\n const dynamicFillColor = (factor: number, initialPad: number, i: number): DataDrivenPropertyValueSpecification<string> => {\n const sinFade = Math.sin(((i / steps) * Math.PI) / 2)\n const cosFade = Math.cos(((i / steps) * Math.PI) / 2)\n // we want the divisor to always be at least 1x the desired factor but will go up to\n // 2x factor to account for combinative effect of the overlay of two layers at once\n const divisor = factor + factor * sinFade\n const offset = initialPad * cosFade\n return [\n 'let',\n 'density',\n ['+', ['/', ['number', ['get', 'value']], divisor], offset],\n ['interpolate', ['linear'], ['var', 'density'], 0, lowUsageColor, 0.5, highUsageColor],\n ]\n }\n\n const fadedIn: boolean[] = layers.map(_ => false)\n\n const fadeIn = async (id: string, index: number) => {\n for (let i = steps; i >= 1; i--) {\n map.setPaintProperty(id, 'fill-color', dynamicFillColor(factor, initialPad, i * (180 / stepLength)))\n await delay(stepLength)\n }\n fadedIn[index] = true\n }\n\n const fadeOut = async (id: string, index: number) => {\n for (let i = 1; i <= steps; i++) {\n map.setPaintProperty(id, 'fill-color', dynamicFillColor(factor, initialPad, i * (180 / stepLength)))\n await delay(stepLength)\n }\n fadedIn[index] = false\n }\n\n let started = false\n const startAnimation = async () => {\n assertEx(!started, () => 'Animation Already Started')\n started = true\n while (this.animationStarted) {\n const upLayer = layerTick % layers.length\n const downLayer = (layerTick + 1) % layers.length\n\n const incomingSource = sourceTick % featureSet.length\n const outgoingSource = (sourceTick + 1) % featureSet.length\n\n // console.log('incoming / outgoing source', incomingSource, outgoingSource)\n\n // console.log(`animate: [${upLayer}, ${downLayer}]`)\n if (fadedIn[upLayer]) {\n this.updateLayer(map, layers[upLayer], sources[incomingSource])\n forget(fadeOut(layers[upLayer].id, upLayer))\n }\n if (!fadedIn[downLayer]) {\n this.updateLayer(map, layers[downLayer], sources[outgoingSource])\n forget(fadeIn(layers[downLayer].id, downLayer))\n }\n while ((fadedIn[upLayer] || !fadedIn[downLayer]) && this.animationStarted) {\n // console.log(`checking: [${fadedIn[upLayer]}, ${!fadedIn[downLayer]}]`)\n await delay(1000)\n }\n layerTick++\n sourceTick++\n\n // console.log(`this.layerTick: ${layerTick}`)\n // console.log(`this.sourceTick: ${sourceTick}`)\n }\n }\n\n await startAnimation()\n }\n\n private static updateLayer(map: Map, layer: MapLayer, source: GeoJSONSourceSpecification) {\n const existingSource = map.getSource(layer.source as string) as GeoJSONSource\n if (existingSource && source.data) {\n existingSource.setData(source.data as GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry>)\n } else if (source) {\n map.addSource(layer.source as string, source)\n }\n layer.update(map, true)\n }\n\n // Build layers each with the same features\n initializeHeatMapSource(layers: MapLayer[]) {\n const getSource = (_: number) => {\n const featuresCollection = GeoJson.featureCollection(this.config.features)\n return GeoJson.featuresSource(featuresCollection)\n }\n\n for (const [index, layer] of layers.entries()) {\n const existingSource = this.config.map.getSource(layer.source as string) as GeoJSONSource\n const source = getSource(index)\n if (existingSource) {\n existingSource.setData(assertEx(source.data) as GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry>)\n } else {\n this.config.map.addSource(layer.source as string, source)\n }\n layer.update(this.config.map, true)\n }\n\n return this\n }\n}\n","import type { Feature, Point } from 'geojson'\nimport type { MapOptions } from 'mapbox-gl'\nimport { LngLatBounds } from 'mapbox-gl'\n\nimport type { MapBaseConfig } from './MapBase.ts'\nimport { MapBase } from './MapBase.ts'\n\nexport interface MapPointsConfig extends MapBaseConfig<Point> {\n features: Feature<Point>[]\n}\n\nexport class MapPoints extends MapBase<Point> {\n private config: MapPointsConfig\n\n constructor(config: MapPointsConfig) {\n super(config)\n this.config = config\n }\n\n initialMapPositioning(options: MapOptions['fitBoundsOptions'], initialBounds?: LngLatBounds) {\n let bounds: LngLatBounds\n\n if (initialBounds) {\n bounds = initialBounds\n } else {\n bounds = new LngLatBounds()\n\n // eslint-disable-next-line unicorn/no-array-for-each\n this.config.features.forEach((feature: Feature<Point>) => {\n bounds.extend(feature.geometry.coordinates as [number, number])\n })\n }\n\n this.config.map.setCenter(bounds.getCenter())\n this.config.map.fitBounds(bounds, options)\n\n return this.config.map\n }\n}\n","import type { MapSetting } from '@xyo-network/react-map-model'\nimport type {\n Map, MapEventOf, MapEventType,\n} from 'mapbox-gl'\nimport { GeolocateControl, NavigationControl } from 'mapbox-gl'\n\nexport interface MapSettingsConfig {\n debugLayerName?: string\n map: Map\n requestLocation?: boolean\n settings: MapSetting\n zoom?: number\n}\n\n/**\n * Utility class to handle changes in settings\n *\n * Methods are pure functions dedicated to map manipulation\n */\nexport class MapSettings {\n static geoLocateControl: GeolocateControl | undefined\n\n static mapListeners = {\n logData: (ev?: MapEventOf<MapEventType>, map?: Map) => {\n const target = map || ev?.target\n if (target) {\n console.log('zoom', target.getZoom())\n console.log('center', target.getCenter())\n }\n },\n }\n\n static navControl: NavigationControl | undefined\n\n static requestLocation: boolean | undefined\n\n static toggleControls(value: boolean | undefined, map: Map, zoom?: number, requestLocation?: boolean) {\n if (value) {\n MapSettings.addControls(map, zoom, requestLocation)\n } else {\n MapSettings.removeControls(map)\n }\n\n return this\n }\n\n static toggleDebugLayer(value: boolean | undefined, map: Map, layerName: string) {\n const debugLayer = map.getLayer(layerName)\n if (debugLayer) {\n if (value) {\n map.setLayoutProperty(layerName, 'visibility', 'visible')\n } else {\n map.setLayoutProperty(layerName, 'visibility', 'none')\n }\n }\n\n return this\n }\n\n static toggleDebugLogging(value: boolean | undefined, map: Map) {\n const debugEvents: MapEventType[] = ['resize', 'zoomend', 'dragend']\n if (value) {\n // initial values\n this.mapListeners.logData(undefined, map)\n for (const event of debugEvents) map.on(event, this.mapListeners.logData)\n } else {\n for (const event of debugEvents) map.off(event, this.mapListeners.logData)\n }\n }\n\n static toggleScrollToZoom(value: boolean | undefined, map: Map) {\n if (value) {\n map.scrollZoom.enable()\n } else {\n map.scrollZoom.disable()\n }\n\n return this\n }\n\n static updateSettings(config: MapSettingsConfig) {\n const {\n settings, map, zoom, requestLocation, debugLayerName = '',\n } = config\n const {\n scrollToZoom, enableControls, debugLayer, debugLogging,\n } = settings\n\n MapSettings.toggleControls(enableControls?.value, map, zoom, requestLocation)\n .toggleScrollToZoom(scrollToZoom?.value, map)\n .toggleDebugLayer(debugLayer?.value, map, debugLayerName)\n .toggleDebugLogging(debugLogging.value, map)\n }\n\n // Needs to be static so we ensure controls are only instantiated once\n private static addControls(map: Map, zoom?: number, requestLocation?: boolean) {\n const geolocateControl = new GeolocateControl({\n fitBoundsOptions: { zoom: zoom || 2 },\n positionOptions: { enableHighAccuracy: true },\n trackUserLocation: true,\n })\n\n const navControl = new NavigationControl({ showCompass: false })\n\n this.geoLocateControl = this.geoLocateControl || geolocateControl\n this.navControl = this.navControl || navControl\n\n if (!map.hasControl(this.geoLocateControl) && requestLocation) {\n map.addControl(this.geoLocateControl)\n }\n\n if (!map.hasControl(this.navControl)) {\n map.addControl(this.navControl, 'top-left')\n }\n\n return this\n }\n\n private static removeControls(map: Map) {\n if (this.geoLocateControl && map.hasControl(this.geoLocateControl) && this.requestLocation) {\n map.removeControl(this.geoLocateControl)\n }\n\n if (this.navControl && map.hasControl(this.navControl)) {\n map.removeControl(this.navControl)\n }\n\n return this\n }\n}\n","import type { Map } from 'mapbox-gl'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useEffect, useMemo, useState,\n} from 'react'\n\nimport { MapBoxInstanceContext } from './Context.ts'\n\nexport const MapBoxInstanceProvider: React.FC<PropsWithChildren> = ({ children }) => {\n const [map, setMap] = useState<Map>()\n const [mapInitialized, setMapInitialized] = useState(false)\n\n const value = useMemo(() => ({\n map, mapInitialized, setMapBoxInstance: setMap,\n }), [map, mapInitialized])\n\n useEffect(() => {\n if (!mapInitialized && map) {\n map?.on('load', () => {\n setMapInitialized(true)\n })\n }\n }, [map, mapInitialized, setMapInitialized])\n\n return <MapBoxInstanceContext value={value}>{children}</MapBoxInstanceContext>\n}\n","import { createContext } from 'react'\n\nimport type { MapBoxInstanceState } from './State.ts'\n\nconst MapBoxInstanceContext = createContext<MapBoxInstanceState>({})\n\nexport { MapBoxInstanceContext }\n","import { assertEx } from '@xylabs/sdk-js'\nimport { use } from 'react'\n\nimport { MapBoxInstanceContext } from './Context.ts'\n\nconst useMapBoxInstance = () => {\n const context = use(MapBoxInstanceContext)\n assertEx('map' in context, () => 'useMapBoxInstance must be used within a MapBoxInstanceContext')\n\n return context\n}\n\nexport { useMapBoxInstance }\n","import type { MapSetting } from '@xyo-network/react-map-model'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useEffect, useMemo, useState,\n} from 'react'\n\nimport { MapSettings } from '../../MapBoxClasses/index.ts'\nimport { useMapBoxInstance } from '../MapBoxInstance/index.ts'\nimport { MapSettingsContext } from './Context.ts'\nimport type { MapSettingsState } from './State.ts'\n\nexport interface MapSettingsProviderProps {\n debugLayerName?: string\n defaultMapSettings?: MapSetting\n requestLocation?: boolean\n zoom?: number\n}\n\nexport const MapSettingsProvider: React.FC<PropsWithChildren<MapSettingsProviderProps>> = ({\n children,\n debugLayerName,\n defaultMapSettings,\n requestLocation,\n zoom = 1,\n}) => {\n const [mapSettings, setMapSettings] = useState<MapSetting>(defaultMapSettings || {})\n const { map, mapInitialized } = useMapBoxInstance()\n\n const value: MapSettingsState = useMemo(() => ({\n mapSettings,\n setMapSettings,\n }), [mapSettings, setMapSettings])\n\n useEffect(() => {\n if (mapSettings && map && mapInitialized) {\n MapSettings.updateSettings({\n debugLayerName, map, requestLocation, settings: mapSettings, zoom,\n })\n }\n }, [debugLayerName, map, mapInitialized, mapSettings, requestLocation, zoom])\n\n return <MapSettingsContext value={value}>{children}</MapSettingsContext>\n}\n","import { createContext } from 'react'\n\nimport type { MapSettingsState } from './State.ts'\n\nconst MapSettingsContext = createContext<MapSettingsState>({})\n\nexport { MapSettingsContext }\n","import { use } from 'react'\n\nimport { MapSettingsContext } from './Context.ts'\n\nconst useMapSettings = () => {\n const context = use(MapSettingsContext)\n\n return context\n}\n\nexport { useMapSettings }\n","import { createContext } from 'react'\n\nimport type { HeatMapInitializerState } from './State.ts'\n\nconst HeatMapInitializerContext = createContext<HeatMapInitializerState>({})\n\nexport { HeatMapInitializerContext }\n","import { assertEx } from '@xylabs/sdk-js'\nimport { use } from 'react'\n\nimport { HeatMapInitializerContext } from './Context.ts'\n\nconst useHeatMapInitializer = () => {\n const context = use(HeatMapInitializerContext)\n assertEx('heatMapInitialized' in context, () => 'useHeatMapInitializer must be used within a HeatMapInitializerContext')\n\n return context\n}\n\nexport { useHeatMapInitializer }\n","import type { FillLayerSpecification } from 'mapbox-gl'\n\nexport const HeatMapFillLayerConfig: (color: string) => Partial<FillLayerSpecification> = color => ({\n paint: {\n 'fill-color': color,\n 'fill-opacity': [\n 'let',\n 'density',\n ['+', ['/', ['number', ['get', 'value']], 4], 0.125],\n ['interpolate', ['linear'], ['var', 'density'], 0.8, ['var', 'density'], 1, 0.85],\n ],\n },\n})\n","import type { LineLayerSpecification } from 'mapbox-gl'\n\nexport const HeatMapLineLayerConfig: (color: string) => Partial<LineLayerSpecification> = color => ({\n layout: {\n // Enable for debugging\n visibility: 'none',\n },\n paint: {\n 'line-color': color,\n 'line-opacity': ['let', 'density', 0, ['interpolate', ['linear'], ['var', 'density'], 0.8, ['var', 'density'], 1, 0.85]],\n 'line-width': 0.5,\n },\n})\n","import type { SymbolLayerSpecification } from 'mapbox-gl'\n\nexport const HeatMapSymbolLayerConfig: (color: string) => Partial<SymbolLayerSpecification> = color => ({\n layout: {\n 'text-anchor': 'center',\n 'text-field': [\n 'concat',\n 'value: ',\n ['to-string', ['+', ['/', ['number', ['get', 'value']], 2], 0.25]],\n '\\n',\n 'count: ',\n ['to-string', ['get', 'count']],\n ],\n 'text-size': 10,\n 'visibility': 'none',\n },\n paint: { 'text-color': color },\n})\n","import type { CircleLayerSpecification } from 'mapbox-gl'\n\nexport const LocationPointLayerConfig: (color: string, circleRadius: number, circleOpacity: number) => Partial<CircleLayerSpecification> = (\n color,\n circleRadius,\n circleOpacity,\n) => {\n return {\n paint: {\n 'circle-color': color,\n 'circle-opacity': circleOpacity,\n 'circle-radius': circleRadius,\n },\n }\n}\n","import { LayerBase } from '@xylabs/geo'\nimport type { FillLayerSpecification } from 'mapbox-gl'\n\nexport class FillLayerBuilder extends LayerBase<FillLayerSpecification> {\n FillLayerOptions: Partial<FillLayerSpecification>\n\n // ensures this class passes for `AnyLayer` type in MapBox\n type: 'fill' = 'fill' as const\n\n constructor(id: string, source: string, FillLayerOptions?: Partial<FillLayerSpecification>) {\n super(id, source)\n this.FillLayerOptions = FillLayerOptions || { id: this.id, source: this.source }\n }\n\n buildLayer(): FillLayerSpecification {\n return {\n ...this.FillLayerOptions,\n id: this.id,\n source: this.source,\n type: this.type,\n }\n }\n}\n","import { LayerBase } from '@xylabs/geo'\nimport type { LineLayerSpecification } from 'mapbox-gl'\n\nexport class LineLayerBuilder extends LayerBase<LineLayerSpecification> {\n LineLayerOptions: Partial<LineLayerSpecification>\n\n // ensures this class passes for `AnyLayer` type in MapBox\n type: 'line' = 'line' as const\n\n constructor(id: string, source: string, LineLayerOptions?: Partial<LineLayerSpecification>) {\n super(id, source)\n this.LineLayerOptions = LineLayerOptions || { id: this.id, source: this.source }\n }\n\n buildLayer(): LineLayerSpecification {\n return {\n ...this.LineLayerOptions,\n id: this.id,\n layout: {},\n source: this.source,\n type: this.type,\n }\n }\n}\n","import { LayerBase } from '@xylabs/geo'\nimport type { SymbolLayerSpecification } from 'mapbox-gl'\n\nexport class SymbolLayerBuilder extends LayerBase<SymbolLayerSpecification> {\n SymbolLayerOptions: Partial<SymbolLayerSpecification>\n\n // ensures this class passes for `AnyLayer` type in MapBox\n type: 'symbol' = 'symbol' as const\n\n constructor(id: string, source: string, SymbolLayerOptions?: Partial<SymbolLayerSpecification>) {\n super(id, source)\n this.SymbolLayerOptions = SymbolLayerOptions || { id: this.id, source: this.source }\n }\n\n buildLayer(): SymbolLayerSpecification {\n return {\n ...this.SymbolLayerOptions,\n id: this.id,\n source: this.source,\n type: this.type,\n }\n }\n}\n","import {\n HeatMapFillLayerConfig, HeatMapLineLayerConfig, HeatMapSymbolLayerConfig,\n} from '../Configs/index.ts'\nimport { FillLayerBuilder } from '../FillLayer.ts'\nimport { LineLayerBuilder } from '../LineLayer.ts'\nimport { SymbolLayerBuilder } from '../SymbolLayer.ts'\n\nexport const MapHeatConstants = {\n LocationDebugLayerId: 'location-debug-id',\n LocationDebugLayerSource: 'location-debug-source',\n LocationFillLayerId: 'location-fill-id',\n LocationFillLayerSource: 'location-fill-source',\n LocationLineLayerId: 'location-line-id',\n LocationLineLayerSource: 'location-line-source',\n}\n\nexport const LocationHeatMapLayerBuilder = (color: string, alternateColor = '#000') => {\n const {\n LocationFillLayerId,\n LocationFillLayerSource,\n LocationLineLayerId,\n LocationLineLayerSource,\n LocationDebugLayerId,\n LocationDebugLayerSource,\n } = MapHeatConstants\n\n const fillLayerConfig = HeatMapFillLayerConfig(color)\n const lineLayerConfig = HeatMapLineLayerConfig(color)\n const debugLayerConfig = HeatMapSymbolLayerConfig(alternateColor)\n\n const fillLayer = new FillLayerBuilder(LocationFillLayerId, LocationFillLayerSource, fillLayerConfig)\n const lineLayer = new LineLayerBuilder(LocationLineLayerId, LocationLineLayerSource, lineLayerConfig)\n const debugLayer = new SymbolLayerBuilder(LocationDebugLayerId, LocationDebugLayerSource, debugLayerConfig)\n\n return [fillLayer, lineLayer, debugLayer]\n}\n","import { HeatMapFillLayerConfig } from '../Configs/index.ts'\nimport { FillLayerBuilder } from '../FillLayer.ts'\n\nconst MapHeatConstants = (index: number, type: string) => ({\n LocationDebugLayerId: `location-${type}-debug-id-${index}`,\n LocationDebugLayerSource: `location-${type}-debug-source-${index}`,\n LocationFillLayerId: `location-${type}-fill-id-${index}`,\n LocationFillLayerSource: `location-${type}-fill-source-${index}`,\n LocationLineLayerId: `location-${type}-line-id-${index}`,\n LocationLineLayerSource: `location-${type}-line-source-${index}`,\n})\n\nexport const LocationHeatMapLayerBuilderAnimated = (color: string, index: number, type = '') => {\n const { LocationFillLayerId, LocationFillLayerSource } = MapHeatConstants(index, type)\n\n const fillLayerConfig = HeatMapFillLayerConfig(color)\n\n const fillLayer = new FillLayerBuilder(LocationFillLayerId, LocationFillLayerSource, fillLayerConfig)\n\n return fillLayer\n}\n","import { LayerBase } from '@xylabs/geo'\nimport type { CircleLayerSpecification } from 'mapbox-gl'\n\nexport class CircleLayerBuilder extends LayerBase<CircleLayerSpecification> {\n CircleLayerOptions: Partial<CircleLayerSpecification>\n\n // ensures this class passes for `AnyLayer` type in MapBox\n type: 'circle' = 'circle' as const\n\n constructor(id: string, source: string, CircleLayerOptions?: Partial<CircleLayerSpecification>) {\n super(id, source)\n this.CircleLayerOptions = CircleLayerOptions || {\n id: this.id, source: this.source, type: 'circle',\n }\n }\n\n buildLayer(): CircleLayerSpecification {\n return {\n filter: ['==', '$type', 'Point'],\n layout: {},\n paint: {\n 'circle-color': '#ff0000',\n 'circle-radius': 6,\n },\n type: this.type,\n ...this.CircleLayerOptions,\n id: this.id,\n source: this.source,\n }\n }\n}\n","import { CircleLayerBuilder } from '../CircleLayer.ts'\nimport { LocationPointLayerConfig } from '../Configs/index.ts'\n\nexport const MapPointsConstants = {\n LocationDotsLayerId: 'location-dots',\n LocationDotsLayerSource: 'location-dots-source',\n}\n\nexport const LocationPointsMapLayerBuilder = (color: string, circleRadius = 6, circleOpacity = 0.8) => {\n const { LocationDotsLayerId, LocationDotsLayerSource } = MapPointsConstants\n\n const dotLayerConfig = LocationPointLayerConfig(color, circleRadius, circleOpacity)\n\n const dotLayer = new CircleLayerBuilder(LocationDotsLayerId, LocationDotsLayerSource, dotLayerConfig)\n\n return [dotLayer]\n}\n","import { FlexCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport type { MapboxFlexBoxProps } from '../lib/index.ts'\nimport { MapBox } from './MapBox.tsx'\nimport { MapSettingsBox } from './MapSettingsComponents/index.ts'\n\nexport const MapboxHeatFlexBox: React.FC<MapboxFlexBoxProps> = ({\n accessToken, children, mapBoxOptions, zoom, legend, developerMode, ...props\n}) => {\n return (\n <FlexCol {...props}>\n <MapBox accessToken={accessToken} options={mapBoxOptions} zoom={zoom} />\n <MapSettingsBox developerMode={developerMode} />\n {legend}\n {children}\n </FlexCol>\n )\n}\n","// eslint-disable-next-line import-x/no-internal-modules\nimport 'mapbox-gl/dist/mapbox-gl.css'\n\nimport { MapStyle } from '@xyo-network/react-map-model'\nimport type { MapOptions } from 'mapbox-gl'\nimport { Map } from 'mapbox-gl'\nimport React, { useEffect, useRef } from 'react'\n\nimport { useMapBoxInstance, useMapSettings } from '../Contexts/index.ts'\nimport { useDynamicMapResize } from '../hooks/index.ts'\n\nexport interface MapBoxProps {\n accessToken: string\n darkMode?: boolean\n options?: Partial<MapOptions>\n zoom?: number\n}\n\nexport const MapBox: React.FC<MapBoxProps> = ({\n accessToken, darkMode = false, options, zoom = 2, ...props\n}) => {\n const mapRef = useRef<Map>(undefined)\n const mapContainerRef = useRef<HTMLDivElement>(null)\n const mapCanvasRef = useRef<HTMLCanvasElement>(null)\n const { setMapBoxInstance, map: mapInstance } = useMapBoxInstance()\n const { mapSettings } = useMapSettings()\n\n const activeResize = mapSettings?.dynamicMapResize.value\n useDynamicMapResize(mapContainerRef, mapCanvasRef, mapInstance, activeResize)\n\n useEffect(() => {\n if (mapSettings?.preferDark?.value === true) {\n mapRef.current?.setStyle(`mapbox://styles/${MapStyle.Dark}`)\n } else {\n mapRef.current?.setStyle(`mapbox://styles/${darkMode ? MapStyle.Dark : MapStyle.Light}`)\n }\n }, [darkMode, mapSettings])\n\n useEffect(() => {\n const map = new Map({\n accessToken,\n center: [0, 0],\n container: mapContainerRef.current ?? '',\n style: `mapbox://styles/${MapStyle.Light}`,\n zoom,\n ...options,\n })\n\n // Allow external components to control the map\n mapRef.current = map\n setMapBoxInstance?.(map)\n\n // save the map canvas ref to help with resizing\n mapCanvasRef.current = document.querySelector('.mapboxgl-canvas') as HTMLCanvasElement | null\n\n console.log('Created Map')\n\n return () => {\n console.log('Removing Map')\n map.remove()\n }\n }, [mapContainerRef, options, zoom, setMapBoxInstance, accessToken])\n\n return (\n <div\n ref={(el) => { mapContainerRef.current = el }}\n style={{\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n ...props,\n }}\n />\n )\n}\n","import type { SwitchProps } from '@mui/material'\nimport { FormControlLabel, Switch } from '@mui/material'\nimport React from 'react'\n\nimport { useMapSettings } from '../../Contexts/index.ts'\n\nexport interface MapSettingSwitchProps extends SwitchProps {\n developerMode?: boolean\n field: string\n}\n\nexport const MapSettingSwitch: React.FC<MapSettingSwitchProps> = ({\n developerMode, field, ...props\n}) => {\n const { mapSettings, setMapSettings } = useMapSettings()\n const setting = mapSettings?.[field]\n\n const onLocalChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (setting) {\n setMapSettings?.((previous) => {\n previous[setting.field].value = event.target.checked\n return { ...previous }\n })\n }\n }\n\n if (setting?.devMode && developerMode === false) {\n return null\n }\n\n return setting?.hidden\n ? null\n : (\n <FormControlLabel label={setting?.label} control={<Switch checked={setting?.value} onChange={onLocalChange} {...props} />} />\n )\n}\n","import { Paper, Stack } from '@mui/material'\nimport { useAppSettings } from '@xylabs/react-app-settings'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowRow, FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { useMapSettings } from '../../Contexts/index.ts'\nimport { MapSettingSwitch } from './Setting.tsx'\n\nexport interface MapSettingsBoxProps extends FlexBoxProps {\n developerMode?: boolean\n}\n\nexport const MapSettingsBox: React.FC<MapSettingsBoxProps> = ({ developerMode, ...props }) => {\n const { mapSettings } = useMapSettings()\n const { developerMode: devModeFromContext } = useAppSettings()\n const resolveDeveloperMode = developerMode ?? devModeFromContext\n\n return mapSettings && resolveDeveloperMode\n ? (\n <FlexGrowRow bottom={36} left={10} position=\"absolute\" {...props}>\n <FlexRow paddingX={2}>\n <Paper>\n <Stack direction=\"row\" spacing={1} marginX={1}>\n {Object.keys(mapSettings).map((key) => {\n return <MapSettingSwitch key={key} field={mapSettings[key].field} developerMode={developerMode} />\n })}\n </Stack>\n </Paper>\n </FlexRow>\n </FlexGrowRow>\n )\n : null\n}\n","import { Alert, AlertTitle } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { useWeakArchivistFromNode, useWeakArchivistGet } from '@xyo-network/react-archivist'\nimport type { NetworkLocationHeatmapQuadkeyAnswerPayload } from '@xyo-network/react-map-model'\nimport {\n AnimatedHeatMapSettings,\n useFindHashes, useHeatMapColors,\n} from '@xyo-network/react-map-model'\nimport type { Feature, Polygon } from 'geojson'\nimport React from 'react'\n\nimport { useQuadKeyPayloadsToFeatures } from '../hooks/index.ts'\nimport { AnimatedHeatMap } from './AnimatedHeatMap.tsx'\nimport { AnimatedHeatMapLegend } from './Legend.tsx'\n\nexport interface AnimatedHeatMapLoadedProps extends FlexBoxProps {\n accessToken: string\n archivistNameOrAddress: string\n}\n\nexport const AnimatedHeatMapLoaded: React.FC<AnimatedHeatMapLoadedProps> = ({\n accessToken, archivistNameOrAddress, ...props\n}) => {\n const hashes = useFindHashes()\n const [archivist] = useWeakArchivistFromNode(archivistNameOrAddress)\n const [payloads, xyoError] = useWeakArchivistGet<NetworkLocationHeatmapQuadkeyAnswerPayload>(archivist, hashes)\n const { multipleFeatureSets } = useQuadKeyPayloadsToFeatures(payloads)\n const { heatMapColorProps, legendProps } = useHeatMapColors()\n\n const MapBoxHeatProps = {\n flexGrow: 1,\n legend: legendProps ? <AnimatedHeatMapLegend {...legendProps} /> : null,\n }\n\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n {xyoError\n ? (\n <Alert sx={{ mt: 2 }}>\n <AlertTitle>Error Loading Map</AlertTitle>\n {xyoError.message ? `Error: ${xyoError.message}` : null}\n You might try authenticating again.\n </Alert>\n )\n : null}\n {hashes === undefined\n ? <Alert>Missing answer hash for heat map query</Alert>\n : (\n <AnimatedHeatMap\n accessToken={accessToken}\n defaultMapSettings={AnimatedHeatMapSettings}\n animatedFeatureSets={multipleFeatureSets.slice(1) as Feature<Polygon>[][]}\n staticFeatureSet={multipleFeatureSets[0] as Feature<Polygon>[]}\n heatMapColorProps={heatMapColorProps}\n {...MapBoxHeatProps}\n />\n )}\n </FlexCol>\n )\n}\n","import { useMediaQuery, useTheme } from '@mui/material'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport type { ColorGradientLegendProps } from '@xyo-network/react-map-model'\nimport React from 'react'\n\nimport { ColorGradientLegend } from './Legends/index.ts'\n\nconst AnimatedHeatMapLegend: React.FC<ColorGradientLegendProps> = ({ ...legendProps }) => {\n const {\n startColor, endColor, startLabel, endLabel, heading, textColor,\n } = legendProps\n const theme = useTheme()\n const isSmall = useMediaQuery(theme.breakpoints.down('sm'))\n\n return (\n <FlexCol position=\"absolute\" bottom={0} right={0}>\n <ColorGradientLegend\n startColor={startColor}\n endColor={endColor}\n startLabel={startLabel}\n endLabel={endLabel}\n heading={heading}\n textColor={textColor}\n {...{\n alignItems: 'stretch',\n marginBottom: theme.spacing(4),\n marginLeft: isSmall ? theme.spacing(3) : 0,\n marginRight: isSmall ? theme.spacing(2) : theme.spacing(3),\n width: isSmall ? '40vw' : theme.spacing(18),\n }}\n />\n </FlexCol>\n )\n}\n\nexport { AnimatedHeatMapLegend }\n","import { Typography, useTheme } from '@mui/material'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport type { ColorGradientLegendProps } from '@xyo-network/react-map-model'\nimport React from 'react'\n\nconst ColorGradientLegend: React.FC<ColorGradientLegendProps> = ({\n startColor, endColor, startLabel, endLabel, heading, textColor, ...props\n}) => {\n const theme = useTheme()\n\n return (\n <FlexCol {...props}>\n <Typography mb={theme.spacing(0.25)} color={textColor} variant=\"caption\" textAlign=\"center\">\n {heading}\n </Typography>\n <FlexCol flexGrow={1} alignItems=\"stretch\" paddingX={theme.spacing(1)} mb={theme.spacing(0.25)}>\n <FlexCol\n height={theme.spacing(0.75)}\n border={`1px solid ${textColor}`}\n sx={{ backgroundImage: `linear-gradient(to right, ${startColor},${endColor})` }}\n />\n </FlexCol>\n <FlexRow flexGrow={1} justifyContent=\"space-between\">\n <Typography color={textColor} variant=\"caption\">\n {startLabel}\n </Typography>\n <Typography color={textColor} variant=\"caption\">\n {endLabel}\n </Typography>\n </FlexRow>\n </FlexCol>\n )\n}\n\nexport { ColorGradientLegend }\n","import { DefaultMapSettings } from '@xyo-network/react-map-model'\n\nconst HeatMapSettings = DefaultMapSettings()\nconst {\n debugLayer, scrollToZoom, fitToPoints,\n} = HeatMapSettings\ndebugLayer.hidden = false\nscrollToZoom.value = true\nfitToPoints.value = true\n\nexport { HeatMapSettings }\n","import { useInterval } from '@xylabs/react-shared'\nimport type { Map } from 'mapbox-gl'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useCallback, useEffect, useMemo, useRef,\n} from 'react'\n\nimport type { MapLayer } from '../Layers/index.ts'\nimport type { MapboxFlexBoxProps } from '../lib/index.ts'\n\nexport interface LayerAnimatorProps {\n animateLayers?: boolean\n layers: MapboxFlexBoxProps['layers']\n layersInitialized: boolean\n map: Map | undefined\n}\n\nconst timeIncrement = 2000\nconst animatedLayerCount = 3\n\nexport const LayerAnimator: React.FC<PropsWithChildren<LayerAnimatorProps>> = ({\n animateLayers, children, layers, layersInitialized, map,\n}) => {\n const layerIndexQueueRef = useRef<number[]>([])\n\n const fillLayers: MapLayer[] = useMemo(() => {\n if (layers?.length && map && layersInitialized) {\n return layers.filter((layer) => {\n const fillLayer = layer.id.startsWith('location-fill')\n if (fillLayer) {\n map.setPaintProperty(layer.id, 'fill-opacity-transition', { delay: 0, duration: 4000 })\n }\n return fillLayer\n })\n }\n return []\n }, [layers, layersInitialized, map])\n\n const incrementQueue = useCallback(\n (index: number) => {\n if (fillLayers[index]) {\n layerIndexQueueRef.current.push(index)\n } else {\n layerIndexQueueRef.current.push(0)\n }\n return layerIndexQueueRef.current.at(-1)\n },\n [fillLayers],\n )\n\n const lastQueuedIndex = useCallback(() => {\n const last = layerIndexQueueRef.current.at(-1)\n if (last === undefined) {\n incrementQueue(0)\n return 0\n } else {\n return last\n }\n }, [incrementQueue])\n\n const unshiftQueue = useCallback(() => {\n layerIndexQueueRef.current.shift()\n }, [])\n\n const getNextLayer = useCallback(() => {\n const nextLayer = fillLayers[lastQueuedIndex()]\n incrementQueue(lastQueuedIndex() + 1)\n return nextLayer\n }, [fillLayers, incrementQueue, lastQueuedIndex])\n\n const layerAnimateWorker = useCallback(\n (layer: MapLayer) => {\n if (layer) {\n map?.setPaintProperty(layer.id, 'fill-opacity', 0.85)\n setTimeout(() => {\n map?.setPaintProperty(layer.id, 'fill-opacity', 0)\n unshiftQueue()\n }, timeIncrement * 2)\n } else {\n console.warn('tried to queue an empty layer')\n }\n },\n [map, unshiftQueue],\n )\n\n //\n const queueLayerAnimation = useCallback(() => {\n const animatedLayers: MapLayer[] = []\n\n for (let i = 0; i < animatedLayerCount; i++) {\n animatedLayers.push(getNextLayer())\n }\n\n for (const [index, layer] of animatedLayers.entries()) {\n if (index === 0) {\n layerAnimateWorker(layer)\n } else {\n setTimeout(() => {\n layerAnimateWorker(layer)\n }, timeIncrement * index)\n }\n }\n }, [getNextLayer, layerAnimateWorker])\n\n // Run a single layer animation before the interval kicks in\n useEffect(() => {\n if (animateLayers && layersInitialized && map && fillLayers.length > 0) {\n queueLayerAnimation()\n }\n }, [animateLayers, fillLayers.length, layersInitialized, map, queueLayerAnimation])\n\n useInterval(() => {\n if (animateLayers && layersInitialized && map && fillLayers.length > 0) {\n queueLayerAnimation()\n }\n }, timeIncrement * animatedLayerCount)\n\n return <>{children}</>\n}\n","import { Alert } from '@mui/material'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport type { Feature, Point } from 'geojson'\nimport type { MapOptions } from 'mapbox-gl'\nimport React, { useEffect } from 'react'\n\nimport { useMapBoxInstance, useMapSettings } from '../Contexts/index.ts'\nimport type { MapboxFlexBoxProps } from '../lib/index.ts'\nimport { MapPoints } from '../MapBoxClasses/index.ts'\nimport { MapBox } from './MapBox.tsx'\nimport { MapSettingsBox } from './MapSettingsComponents/index.ts'\n\nexport interface MapboxPointsFlexBoxProps extends MapboxFlexBoxProps {\n accessToken: string\n features?: Feature<Point>[]\n}\n\nexport const MapboxPointsFlexBox: React.FC<MapboxPointsFlexBoxProps> = ({\n accessToken,\n features,\n fitToPointsPadding = 20,\n layers,\n zoom,\n ...props\n}) => {\n const { mapSettings } = useMapSettings()\n const { map, mapInitialized } = useMapBoxInstance()\n\n /**\n * Needed because of a bug in mapbox taking undefined values for the config options of fitToBounds\n * see - https://github.com/mapbox/mapbox-gl-js/issues/10013\n */\n const customFitToBoundsOptions = (zoom?: number): MapOptions['fitBoundsOptions'] => {\n if (zoom !== undefined) {\n return { maxZoom: zoom }\n }\n return {}\n }\n\n useEffect(() => {\n if (mapInitialized) {\n const mapPoints = (map && features?.length)\n ? new MapPoints({\n features, map, zoom,\n })\n : undefined\n\n const { fitToPoints } = mapSettings || {}\n const padding = {\n bottom: fitToPointsPadding, left: fitToPointsPadding, right: fitToPointsPadding, top: fitToPointsPadding,\n }\n\n if (mapPoints && map && fitToPoints?.value === true) {\n mapPoints.initialMapPositioning({ padding, ...customFitToBoundsOptions(zoom) })\n }\n\n mapPoints?.initialMapPositioning({ padding, ...customFitToBoundsOptions(zoom) })\n\n if (mapPoints?.isMapReady && features?.length && layers) {\n for (const layer of layers) {\n mapPoints.initializeMapSource(layer)\n }\n }\n }\n }, [mapInitialized, mapSettings, map, fitToPointsPadding, zoom, features, layers])\n\n return (\n <FlexCol alignItems=\"stretch\" id=\"xyo-mapbox-wrap\" {...props}>\n {features\n ? (\n <>\n <MapBox accessToken={accessToken} zoom={zoom} />\n <MapSettingsBox />\n </>\n )\n : <Alert severity=\"error\">No data to show</Alert>}\n </FlexCol>\n )\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,WAAAA,gBAAe;AACxB,SAAS,iBAAiB;AAI1B,SAAgB,YAAAC,iBAAgB;;;ACNhC,SAAS,UAAAC,eAAc;AAIvB,SAAgB,aAAAC,YAAW,WAAAC,gBAAe;;;ACF1C,SAAS,iBAAiB;AAKnB,IAAM,sBAAsB,CACjC,iBACA,cACA,aACA,SAAS,SACN;AACH,YAAU,MAAM;AACd,QAAI,UAAU,aAAa;AACzB,YAAM,YAAY,gBAAgB;AAClC,UAAI,WAAW;AACb,YAAI;AACJ,cAAM,UAAU,IAAI,eAAe,MAAM;AACvC,gBAAM,QAAQ,UAAU,sBAAsB,EAAE;AAChD,gBAAM,SAAS,aAAa;AAC5B,cAAI,SAAS,QAAQ;AACnB,mBAAO,MAAM,QAAQ,GAAG,KAAK;AAC7B,sBAAU,WAAW,MAAM,YAAY,OAAO,CAAC;AAAA,UACjD;AAAA,QACF,CAAC;AACD,gBAAQ,QAAQ,SAAS;AACzB,eAAO,MAAM;AACX,uBAAa,OAAO;AACpB,kBAAQ,WAAW;AAAA,QACrB;AAAA,MACF;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,iBAAiB,WAAW,CAAC;AACzD;;;AClCA,SAAS,qBAAqB;AAE9B,SAAS,eAAe;AAOxB,IAAM,cAAc;AAMpB,IAAM,0BAA0B,CAAC,KAAK,CAAC;AASvC,IAAM,WAAW,CAAC,o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AM,UAAU,MAAM,CAAC;AAEjF,SACE,gBAAAJ,MAACK,UAAA,EAAQ,YAAW,WAAU,IAAG,mBAAmB,GAAG,OACpD,qBAEK,gBAAAJ,MAAAF,WAAA,EACE;AAAA,oBAAAC,MAAC,UAAO,aAA0B,MAAY;AAAA,IAC9C,gBAAAA,MAAC,kBAAe;AAAA,KAClB,IAEF,gBAAAA,MAACM,QAAA,EAAM,UAAS,SAAQ,6BAAe,GAC7C;AAEJ;","names":["FlexCol","useState","forget","useEffect","useMemo","useMemo","multipleFeatureSets","features","error","GeoJson","GeoJson","assertEx","GeoJson","factor","initialPad","assertEx","LngLatBounds","LngLatBounds","debugLayer","scrollToZoom","useEffect","useMemo","useMemo","useEffect","assertEx","assertEx","useEffect","useMemo","useState","createContext","jsx","useState","useMemo","useEffect","use","use","createContext","jsx","useMemo","useEffect","forget","fitToPoints","assertEx","use","use","assertEx","LayerBase","LayerBase","debugLayer","MapHeatConstants","LayerBase","useEffect","jsx","useEffect","jsx","jsx","jsx","jsx","useState","FlexCol","FlexCol","useTheme","FlexCol","useTheme","FlexCol","FlexRow","jsx","jsxs","jsx","useTheme","FlexCol","jsx","jsxs","FlexCol","useEffect","useMemo","useRef","jsx","Alert","FlexCol","useEffect","Fragment","jsx","jsxs","zoom","useEffect","fitToPoints","FlexCol","Alert"]}
1
+ {"version":3,"sources":["../../src/Components/AnimatedHeatMap.tsx","../../src/Contexts/HeatMapInitializer/Provider.tsx","../../src/hooks/useDynamicMapResize.tsx","../../src/hooks/useDynamicPositioning.tsx","../../src/hooks/useQuadKeyPayloadsToFeatures.tsx","../../src/MapBoxClasses/MapBase.ts","../../src/MapBoxClasses/MapHeat.ts","../../src/MapBoxClasses/MapPoints.ts","../../src/MapBoxClasses/MapSettings.ts","../../src/Contexts/MapBoxInstance/Provider.tsx","../../src/Contexts/MapBoxInstance/Context.ts","../../src/Contexts/MapBoxInstance/useMapBoxInstance.tsx","../../src/Contexts/MapSettings/Provider.tsx","../../src/Contexts/MapSettings/Context.ts","../../src/Contexts/MapSettings/useMapSettings.tsx","../../src/Contexts/HeatMapInitializer/Context.ts","../../src/Contexts/HeatMapInitializer/useHeatMapInitializer.tsx","../../src/Layers/Configs/HeatMapFillLayerConfig.ts","../../src/Layers/Configs/HeatMapLineLayerConfig.ts","../../src/Layers/Configs/HeatMapSymbolLayerConfig.ts","../../src/Layers/Configs/LocationPointLayerConfig.ts","../../src/Layers/FillLayer.ts","../../src/Layers/LineLayer.ts","../../src/Layers/SymbolLayer.ts","../../src/Layers/Builders/LocationHeatMapLayerBuilder.ts","../../src/Layers/Builders/LocationHeatMapLayerBuilderAnimated.ts","../../src/Layers/CircleLayer.ts","../../src/Layers/Builders/LocationPointsMapLayerBuilder.ts","../../src/Components/MapBoxHeat.tsx","../../src/Components/MapBox.tsx","../../src/Components/MapSettingsComponents/Setting.tsx","../../src/Components/MapSettingsComponents/SettingsBox.tsx","../../src/Components/AnimatedHeatMapLoaded.tsx","../../src/Components/Legend.tsx","../../src/Components/Legends/ColorGradient.tsx","../../src/Components/HeatMapSettings.ts","../../src/Components/LayerAnimator.tsx","../../src/Components/MapBoxPoints.tsx"],"sourcesContent":["import { useTheme } from '@mui/material'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { darkenCss } from '@xylabs/react-theme'\nimport type { AnimatedHeatMapColorProps, MapSetting } from '@xyo-network/react-map-model'\nimport type { Feature, Polygon } from 'geojson'\nimport type { PropsWithChildren } from 'react'\nimport React, { useState } from 'react'\n\nimport {\n HeatMapInitializerProvider, MapBoxInstanceProvider, MapSettingsProvider,\n} from '../Contexts/index.ts'\nimport type { MapLayer } from '../Layers/index.ts'\nimport { LocationHeatMapLayerBuilderAnimated, MapHeatConstants } from '../Layers/index.ts'\nimport { MapboxHeatFlexBox } from './MapBoxHeat.tsx'\n\nexport interface AnimatedHeatMapProps {\n accessToken: string\n animatedFeatureSets: Feature<Polygon>[][]\n defaultMapSettings?: MapSetting\n heatMapColorProps: AnimatedHeatMapColorProps\n staticFeatureSet: Feature<Polygon>[]\n}\n\nexport const AnimatedHeatMap: React.FC<PropsWithChildren<AnimatedHeatMapProps>> = ({\n accessToken,\n animatedFeatureSets,\n defaultMapSettings,\n heatMapColorProps,\n staticFeatureSet,\n ...props\n}) => {\n const theme = useTheme()\n const {\n staticMapColor, lowUsageColor, highUsageColor,\n } = heatMapColorProps || {}\n const localStaticMapColor = staticMapColor ?? theme.vars.palette.primary.light\n\n const [layers] = useState<MapLayer[]>(() => [\n LocationHeatMapLayerBuilderAnimated(localStaticMapColor, 0, 'static'),\n LocationHeatMapLayerBuilderAnimated(lowUsageColor || localStaticMapColor, 0, 'animated'),\n LocationHeatMapLayerBuilderAnimated(highUsageColor || darkenCss(localStaticMapColor, 0.9), 1, 'animated'),\n ])\n\n return animatedFeatureSets?.length\n ? (\n <MapBoxInstanceProvider>\n <MapSettingsProvider defaultMapSettings={defaultMapSettings} debugLayerName={MapHeatConstants.LocationDebugLayerId}>\n <HeatMapInitializerProvider\n features={staticFeatureSet}\n layers={[layers[0]]}\n featureSets={animatedFeatureSets}\n featureSetsLayers={layers.slice(1, 3)}\n heatMapColorProps={heatMapColorProps}\n >\n <MapboxHeatFlexBox accessToken={accessToken} {...props}></MapboxHeatFlexBox>\n </HeatMapInitializerProvider>\n </MapSettingsProvider>\n </MapBoxInstanceProvider>\n )\n : (\n <FlexCol\n busy\n sx={{\n minHeight: 160,\n minWidth: 160,\n }}\n />\n )\n}\n","import { forget } from '@xylabs/sdk-js'\nimport type { AnimatedHeatMapColorProps, HeatMapColorProps } from '@xyo-network/react-map-model'\nimport type { Feature, Polygon } from 'geojson'\nimport type { PropsWithChildren } from 'react'\nimport React, { useEffect, useMemo } from 'react'\n\nimport { useDynamicPositioning } from '../../hooks/index.ts'\nimport type { MapLayer } from '../../Layers/index.ts'\nimport { MapHeat } from '../../MapBoxClasses/index.ts'\nimport { useMapBoxInstance } from '../MapBoxInstance/index.ts'\nimport { useMapSettings } from '../MapSettings/index.ts'\nimport { HeatMapInitializerContext } from './Context.ts'\nimport type { HeatMapInitializerState } from './State.ts'\n\nexport interface MapInitializerProviderProps {\n featureSets?: Feature<Polygon>[][]\n featureSetsLayers?: MapLayer[]\n features?: Feature<Polygon>[]\n fitToPadding?: number\n heatMapColorProps: HeatMapColorProps | AnimatedHeatMapColorProps\n layers?: MapLayer[]\n zoom?: number\n}\n\nexport const HeatMapInitializerProvider: React.FC<PropsWithChildren<MapInitializerProviderProps>> = ({\n children,\n featureSets,\n featureSetsLayers,\n features,\n fitToPadding,\n heatMapColorProps,\n layers,\n zoom,\n}) => {\n const { options } = useDynamicPositioning()\n const { mapSettings } = useMapSettings()\n const { map, mapInitialized } = useMapBoxInstance()\n\n const mapHeat = useMemo(() => {\n return (map && features?.length)\n ? new MapHeat({\n features, map, zoom,\n })\n : undefined\n }, [map, features, zoom])\n\n const value: HeatMapInitializerState = useMemo(() => ({\n MapHeat: mapHeat,\n heatMapColorProps,\n }), [mapHeat, heatMapColorProps])\n\n useEffect(() => {\n if (mapInitialized && featureSets?.length && featureSets[0].length > 0 && map && featureSetsLayers?.length) {\n const { lowUsageColor, highUsageColor } = heatMapColorProps as AnimatedHeatMapColorProps\n forget(MapHeat.initializeAnimatedHeatMapSource(featureSetsLayers, featureSets, map, lowUsageColor, highUsageColor))\n }\n\n return () => {\n MapHeat.animationStarted = false\n }\n }, [featureSets, featureSetsLayers, mapInitialized, map, heatMapColorProps])\n\n useEffect(() => {\n if (mapHeat && mapInitialized && features?.length && layers?.length) {\n mapHeat.initializeHeatMapSource(layers)\n }\n }, [mapHeat, features?.length, layers, mapInitialized])\n\n useEffect(() => {\n if (mapInitialized) {\n const { fitToPoints } = mapSettings || {}\n\n if (map) {\n if (fitToPoints?.value === true) {\n MapHeat.initialMapPositioning(\n {\n padding: {\n bottom: fitToPadding, left: fitToPadding, right: fitToPadding, top: fitToPadding,\n },\n },\n map,\n features,\n )\n } else if (options?.zoom && options.center) {\n map.setZoom(options.zoom)\n map.setCenter(options.center)\n }\n }\n }\n }, [mapHeat, map, mapSettings, fitToPadding, options, mapInitialized, features])\n\n return <HeatMapInitializerContext value={value}>{children}</HeatMapInitializerContext>\n}\n","import type { Map } from 'mapbox-gl'\nimport type { RefObject } from 'react'\nimport { useEffect } from 'react'\n\n/**\n * Inspired by - https://bl.ocks.org/danswick/fc56f37c10d40be62e4feac5984250d2\n */\nexport const useDynamicMapResize = (\n mapContainerRef: RefObject<HTMLDivElement | null>,\n mapCanvasRef: RefObject<HTMLCanvasElement | null>,\n mapInstance?: Map,\n active = true,\n) => {\n useEffect(() => {\n if (active && mapInstance) {\n const container = mapContainerRef.current\n if (container) {\n let timerId: ReturnType<typeof setTimeout> | undefined\n const resizer = new ResizeObserver(() => {\n const width = container.getBoundingClientRect().width\n const canvas = mapCanvasRef.current\n if (width && canvas) {\n canvas.style.width = `${width}px`\n timerId = setTimeout(() => mapInstance.resize())\n }\n })\n resizer.observe(container)\n return () => {\n clearTimeout(timerId)\n resizer.disconnect()\n }\n }\n }\n }, [active, mapCanvasRef, mapContainerRef, mapInstance])\n}\n","import { useWindowSize } from '@xylabs/react-shared'\nimport type { MapOptions } from 'mapbox-gl'\nimport { useMemo } from 'react'\n\n/**\n * Zoom level for the map\n *\n * Note: Changing zoom will require changes to Lat/Lng Ranges\n */\nconst defaultZoom = 1.6\n\n/**\n * Range of aspect ratio values (width / height = aspect ratio) to scale against degrees\n * On lower aspect ratios, the width is larger than the height and vice-versa for higher\n */\nconst defaultAspectRatioRange = [0.5, 2]\n\n/**\n * Lat/Lng ranges, the first index is the minimum and the second is the maximum\n * Index 0 is for portrait screens and centers on the Eastern Hemisphere\n * Index 1 is for wider screens near the Prime Meridian and north of the Equator\n *\n * Note: Values are based off the zoom level\n */\nconst latRange = [0.912_164_420_526_366_4, 1.717_850_315_594_39]\nconst lngRange = [-81.474_201_485_195_9, 12.788_958_675_506_933]\n\n/**\n * Function to interpolate an aspect ratio value across a range of degrees and aspect ratios\n *\n * Inspired by - https://stackoverflow.com/questions/14224535/scaling-between-two-number-ranges\n *\n * @param aspectRatio aspect ratio to scale\n * @param degreeRange A latitude or longitude range (i.e. [minLat, maxLat])\n * @param aspectRatioRange A range of aspect ratios to scale against degreeRange parameter\n * @returns number\n */\nconst linearInterpolate = (aspectRatio: number, degreeRange: number[], aspectRatioRange?: number[]): number => {\n const [degreeMin, degreeMax] = degreeRange\n const [aspectRatioMin, aspectRatioMax] = aspectRatioRange || defaultAspectRatioRange\n\n const aspectRatioRangeSpan = aspectRatioMax - aspectRatioMin\n const degreeRangeSpan = degreeMax - degreeMin\n\n const percent = (aspectRatio - aspectRatioMin) / aspectRatioRangeSpan\n const scaledDegree = percent * degreeRangeSpan + degreeMin\n\n return scaledDegree\n}\n\nconst useDynamicPositioning = () => {\n const { width, height } = useWindowSize()\n\n const options = useMemo(() => {\n if (width && height) {\n const aspectRatio = width / height\n\n return {\n center: [linearInterpolate(aspectRatio, lngRange), linearInterpolate(aspectRatio, latRange)],\n zoom: defaultZoom,\n } as Partial<MapOptions>\n }\n }, [height, width])\n\n return { options }\n}\n\nexport { useDynamicPositioning }\n","import { GeoJson } from '@xylabs/geo'\nimport { exists } from '@xylabs/sdk-js'\nimport type { NetworkLocationHeatmapQuadkeyAnswerPayload } from '@xyo-network/react-map-model'\nimport type { Feature, Geometry } from 'geojson'\nimport { useMemo } from 'react'\n\nconst quadKeyToFeature = ({ density, quadkey }: { density: number; quadkey: string }) => {\n const polygonFeature = new GeoJson(quadkey).polygonFeature()\n polygonFeature.properties = {\n count: density,\n density,\n }\n return polygonFeature\n}\n\nconst setDensity = (feature: Feature) => {\n if (feature.properties) {\n feature.properties.value = feature.properties.density / 5\n }\n return feature\n}\n\nconst useQuadKeyPayloadsToFeatures = (payloads?: NetworkLocationHeatmapQuadkeyAnswerPayload[] | NetworkLocationHeatmapQuadkeyAnswerPayload) => {\n const {\n multipleFeatureSets, features, error,\n } = useMemo(() => {\n let multipleFeatureSets: Feature<Geometry>[][] = [[]]\n let features: Feature<Geometry>[] = []\n let error: Error | undefined\n\n // Convert Multiple Payloads from Quadkey to GeoJson\n if (Array.isArray(payloads)) {\n if ((payloads)?.filter(exists).length > 0) {\n const mappedFeatures = payloads?.map(payload => payload?.result.map(quadKeyToFeature))\n multipleFeatureSets = mappedFeatures.map(f => f?.map(setDensity) ?? [])\n } else {\n error = new Error('Cannot find payloads for provided hashes')\n }\n }\n\n // Convert Single Payload from Quadkey to GeoJson\n if (payloads && (payloads as NetworkLocationHeatmapQuadkeyAnswerPayload).result) {\n const singlePayload = payloads as NetworkLocationHeatmapQuadkeyAnswerPayload\n const mappedFeatures = singlePayload.result.map(quadKeyToFeature)\n features = mappedFeatures.map(setDensity)\n }\n\n return {\n multipleFeatureSets, features, error,\n }\n }, [payloads])\n\n return {\n error, features, multipleFeatureSets,\n }\n}\n\nexport { useQuadKeyPayloadsToFeatures }\n","import { GeoJson } from '@xylabs/geo'\nimport { assertEx } from '@xylabs/sdk-js'\nimport type { Feature, Geometry } from 'geojson'\nimport type { GeoJSONSource, Map } from 'mapbox-gl'\n\nimport type { MapLayer } from '../Layers/index.ts'\n\nexport interface MapBaseConfig<T extends Geometry> {\n features: Feature<T>[]\n map: Map\n requestLocation?: boolean\n zoom?: number\n}\n\nexport abstract class MapBase<T extends Geometry> {\n private _config: MapBaseConfig<T>\n\n constructor(config: MapBaseConfig<T>) {\n this._config = {\n requestLocation: true, zoom: 2, ...config,\n }\n }\n\n get isMapReady() {\n return !!this._config.map\n }\n\n initializeMapSource(layer: MapLayer) {\n const getSource = () => {\n const featuresCollection = GeoJson.featureCollection(this._config.features)\n return GeoJson.featuresSource(featuresCollection)\n }\n\n const existingSource = this._config.map.getSource(layer.source as string) as GeoJSONSource\n const source = getSource()\n if (existingSource) {\n existingSource.setData(assertEx(source.data as GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry>))\n } else {\n this._config.map.addSource(layer.source as string, source)\n }\n layer.update(this._config.map, true)\n\n return this\n }\n}\n","import { GeoJson } from '@xylabs/geo'\nimport {\n assertEx, delay, forget,\n} from '@xylabs/sdk-js'\nimport type { Feature, Polygon } from 'geojson'\nimport type {\n DataDrivenPropertyValueSpecification,\n GeoJSONSource, GeoJSONSourceSpecification, Map, MapOptions,\n} from 'mapbox-gl'\nimport { LngLatBounds } from 'mapbox-gl'\n\nimport type { MapLayer } from '../Layers/index.ts'\nimport type { MapBaseConfig } from './MapBase.ts'\nimport { MapBase } from './MapBase.ts'\n\nexport class MapHeat extends MapBase<Polygon> {\n static animationStarted = false\n\n config: MapBaseConfig<Polygon>\n constructor(config: MapBaseConfig<Polygon>) {\n super(config)\n this.config = config\n }\n\n static initialMapPositioning(options: MapOptions['fitBoundsOptions'], map: Map, features?: Feature<Polygon>[], initialBounds?: LngLatBounds) {\n if (!features) {\n return\n }\n\n let bounds: LngLatBounds\n\n if (initialBounds) {\n bounds = initialBounds\n } else {\n bounds = new LngLatBounds()\n\n // eslint-disable-next-line unicorn/no-array-for-each\n features.forEach((feature: Feature<Polygon>) => {\n for (const coordinates of feature.geometry.coordinates) {\n for (const position of coordinates) {\n bounds.extend(position as [number, number])\n }\n }\n })\n }\n\n map.setCenter(bounds.getCenter())\n map.fitBounds(bounds, options)\n return this\n }\n\n static async initializeAnimatedHeatMapSource(\n layers: MapLayer[],\n featureSet: Feature<Polygon>[][],\n map: Map,\n startColor?: string,\n endColor?: string,\n ) {\n this.animationStarted = true\n let layerTick = 0\n let sourceTick = 0\n\n const sources = featureSet.map((feature) => {\n const featuresCollection = GeoJson.featureCollection(feature)\n return GeoJson.featuresSource(featuresCollection)\n })\n this.updateLayer(map, layers[0], sources[0])\n this.updateLayer(map, layers[1], sources[1])\n\n for (const layer of layers) {\n map.setPaintProperty(layer.id, 'fill-opacity', 0)\n }\n\n const frameLength = 3000\n const initialPad = 0.5\n const factor = 10\n const steps = 30\n const stepLength = frameLength / steps\n const lowUsageColor = startColor ?? '#FFB3B3'\n const highUsageColor = endColor ?? '#FF0000'\n\n // Max density at i=0, min density at i=steps\n const dynamicFillColor = (factor: number, initialPad: number, i: number): DataDrivenPropertyValueSpecification<string> => {\n const sinFade = Math.sin(((i / steps) * Math.PI) / 2)\n const cosFade = Math.cos(((i / steps) * Math.PI) / 2)\n // we want the divisor to always be at least 1x the desired factor but will go up to\n // 2x factor to account for combinative effect of the overlay of two layers at once\n const divisor = factor + factor * sinFade\n const offset = initialPad * cosFade\n return [\n 'let',\n 'density',\n ['+', ['/', ['number', ['get', 'value']], divisor], offset],\n ['interpolate', ['linear'], ['var', 'density'], 0, lowUsageColor, 0.5, highUsageColor],\n ]\n }\n\n const fadedIn: boolean[] = layers.map(_ => false)\n\n const fadeIn = async (id: string, index: number) => {\n for (let i = steps; i >= 1; i--) {\n map.setPaintProperty(id, 'fill-color', dynamicFillColor(factor, initialPad, i * (180 / stepLength)))\n await delay(stepLength)\n }\n fadedIn[index] = true\n }\n\n const fadeOut = async (id: string, index: number) => {\n for (let i = 1; i <= steps; i++) {\n map.setPaintProperty(id, 'fill-color', dynamicFillColor(factor, initialPad, i * (180 / stepLength)))\n await delay(stepLength)\n }\n fadedIn[index] = false\n }\n\n let started = false\n const startAnimation = async () => {\n assertEx(!started, () => 'Animation Already Started')\n started = true\n while (this.animationStarted) {\n const upLayer = layerTick % layers.length\n const downLayer = (layerTick + 1) % layers.length\n\n const incomingSource = sourceTick % featureSet.length\n const outgoingSource = (sourceTick + 1) % featureSet.length\n\n // console.log('incoming / outgoing source', incomingSource, outgoingSource)\n\n // console.log(`animate: [${upLayer}, ${downLayer}]`)\n if (fadedIn[upLayer]) {\n this.updateLayer(map, layers[upLayer], sources[incomingSource])\n forget(fadeOut(layers[upLayer].id, upLayer))\n }\n if (!fadedIn[downLayer]) {\n this.updateLayer(map, layers[downLayer], sources[outgoingSource])\n forget(fadeIn(layers[downLayer].id, downLayer))\n }\n while ((fadedIn[upLayer] || !fadedIn[downLayer]) && this.animationStarted) {\n // console.log(`checking: [${fadedIn[upLayer]}, ${!fadedIn[downLayer]}]`)\n await delay(1000)\n }\n layerTick++\n sourceTick++\n\n // console.log(`this.layerTick: ${layerTick}`)\n // console.log(`this.sourceTick: ${sourceTick}`)\n }\n }\n\n await startAnimation()\n }\n\n private static updateLayer(map: Map, layer: MapLayer, source: GeoJSONSourceSpecification) {\n const existingSource = map.getSource(layer.source as string) as GeoJSONSource\n if (existingSource && source.data) {\n existingSource.setData(source.data as GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry>)\n } else if (source) {\n map.addSource(layer.source as string, source)\n }\n layer.update(map, true)\n }\n\n // Build layers each with the same features\n initializeHeatMapSource(layers: MapLayer[]) {\n const getSource = (_: number) => {\n const featuresCollection = GeoJson.featureCollection(this.config.features)\n return GeoJson.featuresSource(featuresCollection)\n }\n\n for (const [index, layer] of layers.entries()) {\n const existingSource = this.config.map.getSource(layer.source as string) as GeoJSONSource\n const source = getSource(index)\n if (existingSource) {\n existingSource.setData(assertEx(source.data) as GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry>)\n } else {\n this.config.map.addSource(layer.source as string, source)\n }\n layer.update(this.config.map, true)\n }\n\n return this\n }\n}\n","import type { Feature, Point } from 'geojson'\nimport type { MapOptions } from 'mapbox-gl'\nimport { LngLatBounds } from 'mapbox-gl'\n\nimport type { MapBaseConfig } from './MapBase.ts'\nimport { MapBase } from './MapBase.ts'\n\nexport interface MapPointsConfig extends MapBaseConfig<Point> {\n features: Feature<Point>[]\n}\n\nexport class MapPoints extends MapBase<Point> {\n private config: MapPointsConfig\n\n constructor(config: MapPointsConfig) {\n super(config)\n this.config = config\n }\n\n initialMapPositioning(options: MapOptions['fitBoundsOptions'], initialBounds?: LngLatBounds) {\n let bounds: LngLatBounds\n\n if (initialBounds) {\n bounds = initialBounds\n } else {\n bounds = new LngLatBounds()\n\n // eslint-disable-next-line unicorn/no-array-for-each\n this.config.features.forEach((feature: Feature<Point>) => {\n bounds.extend(feature.geometry.coordinates as [number, number])\n })\n }\n\n this.config.map.setCenter(bounds.getCenter())\n this.config.map.fitBounds(bounds, options)\n\n return this.config.map\n }\n}\n","import type { MapSetting } from '@xyo-network/react-map-model'\nimport type {\n Map, MapEventOf, MapEventType,\n} from 'mapbox-gl'\nimport { GeolocateControl, NavigationControl } from 'mapbox-gl'\n\nexport interface MapSettingsConfig {\n debugLayerName?: string\n map: Map\n requestLocation?: boolean\n settings: MapSetting\n zoom?: number\n}\n\n/**\n * Utility class to handle changes in settings\n *\n * Methods are pure functions dedicated to map manipulation\n */\nexport class MapSettings {\n static geoLocateControl: GeolocateControl | undefined\n\n static mapListeners = {\n logData: (ev?: MapEventOf<MapEventType>, map?: Map) => {\n const target = map || ev?.target\n if (target) {\n console.log('zoom', target.getZoom())\n console.log('center', target.getCenter())\n }\n },\n }\n\n static navControl: NavigationControl | undefined\n\n static requestLocation: boolean | undefined\n\n static toggleControls(value: boolean | undefined, map: Map, zoom?: number, requestLocation?: boolean) {\n if (value) {\n MapSettings.addControls(map, zoom, requestLocation)\n } else {\n MapSettings.removeControls(map)\n }\n\n return this\n }\n\n static toggleDebugLayer(value: boolean | undefined, map: Map, layerName: string) {\n const debugLayer = map.getLayer(layerName)\n if (debugLayer) {\n if (value) {\n map.setLayoutProperty(layerName, 'visibility', 'visible')\n } else {\n map.setLayoutProperty(layerName, 'visibility', 'none')\n }\n }\n\n return this\n }\n\n static toggleDebugLogging(value: boolean | undefined, map: Map) {\n const debugEvents: MapEventType[] = ['resize', 'zoomend', 'dragend']\n if (value) {\n // initial values\n this.mapListeners.logData(undefined, map)\n for (const event of debugEvents) map.on(event, this.mapListeners.logData)\n } else {\n for (const event of debugEvents) map.off(event, this.mapListeners.logData)\n }\n }\n\n static toggleScrollToZoom(value: boolean | undefined, map: Map) {\n if (value) {\n map.scrollZoom.enable()\n } else {\n map.scrollZoom.disable()\n }\n\n return this\n }\n\n static updateSettings(config: MapSettingsConfig) {\n const {\n settings, map, zoom, requestLocation, debugLayerName = '',\n } = config\n const {\n scrollToZoom, enableControls, debugLayer, debugLogging,\n } = settings\n\n MapSettings.toggleControls(enableControls?.value, map, zoom, requestLocation)\n .toggleScrollToZoom(scrollToZoom?.value, map)\n .toggleDebugLayer(debugLayer?.value, map, debugLayerName)\n .toggleDebugLogging(debugLogging.value, map)\n }\n\n // Needs to be static so we ensure controls are only instantiated once\n private static addControls(map: Map, zoom?: number, requestLocation?: boolean) {\n const geolocateControl = new GeolocateControl({\n fitBoundsOptions: { zoom: zoom || 2 },\n positionOptions: { enableHighAccuracy: true },\n trackUserLocation: true,\n })\n\n const navControl = new NavigationControl({ showCompass: false })\n\n this.geoLocateControl = this.geoLocateControl || geolocateControl\n this.navControl = this.navControl || navControl\n\n if (!map.hasControl(this.geoLocateControl) && requestLocation) {\n map.addControl(this.geoLocateControl)\n }\n\n if (!map.hasControl(this.navControl)) {\n map.addControl(this.navControl, 'top-left')\n }\n\n return this\n }\n\n private static removeControls(map: Map) {\n if (this.geoLocateControl && map.hasControl(this.geoLocateControl) && this.requestLocation) {\n map.removeControl(this.geoLocateControl)\n }\n\n if (this.navControl && map.hasControl(this.navControl)) {\n map.removeControl(this.navControl)\n }\n\n return this\n }\n}\n","import type { Map } from 'mapbox-gl'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useEffect, useMemo, useState,\n} from 'react'\n\nimport { MapBoxInstanceContext } from './Context.ts'\n\nexport const MapBoxInstanceProvider: React.FC<PropsWithChildren> = ({ children }) => {\n const [map, setMap] = useState<Map>()\n const [mapInitialized, setMapInitialized] = useState(false)\n\n const value = useMemo(() => ({\n map, mapInitialized, setMapBoxInstance: setMap,\n }), [map, mapInitialized])\n\n useEffect(() => {\n if (!mapInitialized && map) {\n map?.on('load', () => {\n setMapInitialized(true)\n })\n }\n }, [map, mapInitialized, setMapInitialized])\n\n return <MapBoxInstanceContext value={value}>{children}</MapBoxInstanceContext>\n}\n","import { createContext } from 'react'\n\nimport type { MapBoxInstanceState } from './State.ts'\n\nconst MapBoxInstanceContext = createContext<MapBoxInstanceState>({})\n\nexport { MapBoxInstanceContext }\n","import { assertEx } from '@xylabs/sdk-js'\nimport { use } from 'react'\n\nimport { MapBoxInstanceContext } from './Context.ts'\n\nconst useMapBoxInstance = () => {\n const context = use(MapBoxInstanceContext)\n assertEx('map' in context, () => 'useMapBoxInstance must be used within a MapBoxInstanceContext')\n\n return context\n}\n\nexport { useMapBoxInstance }\n","import type { MapSetting } from '@xyo-network/react-map-model'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useEffect, useMemo, useState,\n} from 'react'\n\nimport { MapSettings } from '../../MapBoxClasses/index.ts'\nimport { useMapBoxInstance } from '../MapBoxInstance/index.ts'\nimport { MapSettingsContext } from './Context.ts'\nimport type { MapSettingsState } from './State.ts'\n\nexport interface MapSettingsProviderProps {\n debugLayerName?: string\n defaultMapSettings?: MapSetting\n requestLocation?: boolean\n zoom?: number\n}\n\nexport const MapSettingsProvider: React.FC<PropsWithChildren<MapSettingsProviderProps>> = ({\n children,\n debugLayerName,\n defaultMapSettings,\n requestLocation,\n zoom = 1,\n}) => {\n const [mapSettings, setMapSettings] = useState<MapSetting>(defaultMapSettings || {})\n const { map, mapInitialized } = useMapBoxInstance()\n\n const value: MapSettingsState = useMemo(() => ({\n mapSettings,\n setMapSettings,\n }), [mapSettings, setMapSettings])\n\n useEffect(() => {\n if (mapSettings && map && mapInitialized) {\n MapSettings.updateSettings({\n debugLayerName, map, requestLocation, settings: mapSettings, zoom,\n })\n }\n }, [debugLayerName, map, mapInitialized, mapSettings, requestLocation, zoom])\n\n return <MapSettingsContext value={value}>{children}</MapSettingsContext>\n}\n","import { createContext } from 'react'\n\nimport type { MapSettingsState } from './State.ts'\n\nconst MapSettingsContext = createContext<MapSettingsState>({})\n\nexport { MapSettingsContext }\n","import { use } from 'react'\n\nimport { MapSettingsContext } from './Context.ts'\n\nconst useMapSettings = () => {\n const context = use(MapSettingsContext)\n\n return context\n}\n\nexport { useMapSettings }\n","import { createContext } from 'react'\n\nimport type { HeatMapInitializerState } from './State.ts'\n\nconst HeatMapInitializerContext = createContext<HeatMapInitializerState>({})\n\nexport { HeatMapInitializerContext }\n","import { assertEx } from '@xylabs/sdk-js'\nimport { use } from 'react'\n\nimport { HeatMapInitializerContext } from './Context.ts'\n\nconst useHeatMapInitializer = () => {\n const context = use(HeatMapInitializerContext)\n assertEx('heatMapInitialized' in context, () => 'useHeatMapInitializer must be used within a HeatMapInitializerContext')\n\n return context\n}\n\nexport { useHeatMapInitializer }\n","import type { FillLayerSpecification } from 'mapbox-gl'\n\nexport const HeatMapFillLayerConfig: (color: string) => Partial<FillLayerSpecification> = color => ({\n paint: {\n 'fill-color': color,\n 'fill-opacity': [\n 'let',\n 'density',\n ['+', ['/', ['number', ['get', 'value']], 4], 0.125],\n ['interpolate', ['linear'], ['var', 'density'], 0.8, ['var', 'density'], 1, 0.85],\n ],\n },\n})\n","import type { LineLayerSpecification } from 'mapbox-gl'\n\nexport const HeatMapLineLayerConfig: (color: string) => Partial<LineLayerSpecification> = color => ({\n layout: {\n // Enable for debugging\n visibility: 'none',\n },\n paint: {\n 'line-color': color,\n 'line-opacity': ['let', 'density', 0, ['interpolate', ['linear'], ['var', 'density'], 0.8, ['var', 'density'], 1, 0.85]],\n 'line-width': 0.5,\n },\n})\n","import type { SymbolLayerSpecification } from 'mapbox-gl'\n\nexport const HeatMapSymbolLayerConfig: (color: string) => Partial<SymbolLayerSpecification> = color => ({\n layout: {\n 'text-anchor': 'center',\n 'text-field': [\n 'concat',\n 'value: ',\n ['to-string', ['+', ['/', ['number', ['get', 'value']], 2], 0.25]],\n '\\n',\n 'count: ',\n ['to-string', ['get', 'count']],\n ],\n 'text-size': 10,\n 'visibility': 'none',\n },\n paint: { 'text-color': color },\n})\n","import type { CircleLayerSpecification } from 'mapbox-gl'\n\nexport const LocationPointLayerConfig: (color: string, circleRadius: number, circleOpacity: number) => Partial<CircleLayerSpecification> = (\n color,\n circleRadius,\n circleOpacity,\n) => {\n return {\n paint: {\n 'circle-color': color,\n 'circle-opacity': circleOpacity,\n 'circle-radius': circleRadius,\n },\n }\n}\n","import { LayerBase } from '@xylabs/geo'\nimport type { FillLayerSpecification } from 'mapbox-gl'\n\nexport class FillLayerBuilder extends LayerBase<FillLayerSpecification> {\n FillLayerOptions: Partial<FillLayerSpecification>\n\n // ensures this class passes for `AnyLayer` type in MapBox\n type: 'fill' = 'fill' as const\n\n constructor(id: string, source: string, FillLayerOptions?: Partial<FillLayerSpecification>) {\n super(id, source)\n this.FillLayerOptions = FillLayerOptions || { id: this.id, source: this.source }\n }\n\n buildLayer(): FillLayerSpecification {\n return {\n ...this.FillLayerOptions,\n id: this.id,\n source: this.source,\n type: this.type,\n }\n }\n}\n","import { LayerBase } from '@xylabs/geo'\nimport type { LineLayerSpecification } from 'mapbox-gl'\n\nexport class LineLayerBuilder extends LayerBase<LineLayerSpecification> {\n LineLayerOptions: Partial<LineLayerSpecification>\n\n // ensures this class passes for `AnyLayer` type in MapBox\n type: 'line' = 'line' as const\n\n constructor(id: string, source: string, LineLayerOptions?: Partial<LineLayerSpecification>) {\n super(id, source)\n this.LineLayerOptions = LineLayerOptions || { id: this.id, source: this.source }\n }\n\n buildLayer(): LineLayerSpecification {\n return {\n ...this.LineLayerOptions,\n id: this.id,\n layout: {},\n source: this.source,\n type: this.type,\n }\n }\n}\n","import { LayerBase } from '@xylabs/geo'\nimport type { SymbolLayerSpecification } from 'mapbox-gl'\n\nexport class SymbolLayerBuilder extends LayerBase<SymbolLayerSpecification> {\n SymbolLayerOptions: Partial<SymbolLayerSpecification>\n\n // ensures this class passes for `AnyLayer` type in MapBox\n type: 'symbol' = 'symbol' as const\n\n constructor(id: string, source: string, SymbolLayerOptions?: Partial<SymbolLayerSpecification>) {\n super(id, source)\n this.SymbolLayerOptions = SymbolLayerOptions || { id: this.id, source: this.source }\n }\n\n buildLayer(): SymbolLayerSpecification {\n return {\n ...this.SymbolLayerOptions,\n id: this.id,\n source: this.source,\n type: this.type,\n }\n }\n}\n","import {\n HeatMapFillLayerConfig, HeatMapLineLayerConfig, HeatMapSymbolLayerConfig,\n} from '../Configs/index.ts'\nimport { FillLayerBuilder } from '../FillLayer.ts'\nimport { LineLayerBuilder } from '../LineLayer.ts'\nimport { SymbolLayerBuilder } from '../SymbolLayer.ts'\n\nexport const MapHeatConstants = {\n LocationDebugLayerId: 'location-debug-id',\n LocationDebugLayerSource: 'location-debug-source',\n LocationFillLayerId: 'location-fill-id',\n LocationFillLayerSource: 'location-fill-source',\n LocationLineLayerId: 'location-line-id',\n LocationLineLayerSource: 'location-line-source',\n}\n\nexport const LocationHeatMapLayerBuilder = (color: string, alternateColor = '#000') => {\n const {\n LocationFillLayerId,\n LocationFillLayerSource,\n LocationLineLayerId,\n LocationLineLayerSource,\n LocationDebugLayerId,\n LocationDebugLayerSource,\n } = MapHeatConstants\n\n const fillLayerConfig = HeatMapFillLayerConfig(color)\n const lineLayerConfig = HeatMapLineLayerConfig(color)\n const debugLayerConfig = HeatMapSymbolLayerConfig(alternateColor)\n\n const fillLayer = new FillLayerBuilder(LocationFillLayerId, LocationFillLayerSource, fillLayerConfig)\n const lineLayer = new LineLayerBuilder(LocationLineLayerId, LocationLineLayerSource, lineLayerConfig)\n const debugLayer = new SymbolLayerBuilder(LocationDebugLayerId, LocationDebugLayerSource, debugLayerConfig)\n\n return [fillLayer, lineLayer, debugLayer]\n}\n","import { HeatMapFillLayerConfig } from '../Configs/index.ts'\nimport { FillLayerBuilder } from '../FillLayer.ts'\n\nconst MapHeatConstants = (index: number, type: string) => ({\n LocationDebugLayerId: `location-${type}-debug-id-${index}`,\n LocationDebugLayerSource: `location-${type}-debug-source-${index}`,\n LocationFillLayerId: `location-${type}-fill-id-${index}`,\n LocationFillLayerSource: `location-${type}-fill-source-${index}`,\n LocationLineLayerId: `location-${type}-line-id-${index}`,\n LocationLineLayerSource: `location-${type}-line-source-${index}`,\n})\n\nexport const LocationHeatMapLayerBuilderAnimated = (color: string, index: number, type = '') => {\n const { LocationFillLayerId, LocationFillLayerSource } = MapHeatConstants(index, type)\n\n const fillLayerConfig = HeatMapFillLayerConfig(color)\n\n const fillLayer = new FillLayerBuilder(LocationFillLayerId, LocationFillLayerSource, fillLayerConfig)\n\n return fillLayer\n}\n","import { LayerBase } from '@xylabs/geo'\nimport type { CircleLayerSpecification } from 'mapbox-gl'\n\nexport class CircleLayerBuilder extends LayerBase<CircleLayerSpecification> {\n CircleLayerOptions: Partial<CircleLayerSpecification>\n\n // ensures this class passes for `AnyLayer` type in MapBox\n type: 'circle' = 'circle' as const\n\n constructor(id: string, source: string, CircleLayerOptions?: Partial<CircleLayerSpecification>) {\n super(id, source)\n this.CircleLayerOptions = CircleLayerOptions || {\n id: this.id, source: this.source, type: 'circle',\n }\n }\n\n buildLayer(): CircleLayerSpecification {\n return {\n filter: ['==', '$type', 'Point'],\n layout: {},\n paint: {\n 'circle-color': '#ff0000',\n 'circle-radius': 6,\n },\n type: this.type,\n ...this.CircleLayerOptions,\n id: this.id,\n source: this.source,\n }\n }\n}\n","import { CircleLayerBuilder } from '../CircleLayer.ts'\nimport { LocationPointLayerConfig } from '../Configs/index.ts'\n\nexport const MapPointsConstants = {\n LocationDotsLayerId: 'location-dots',\n LocationDotsLayerSource: 'location-dots-source',\n}\n\nexport const LocationPointsMapLayerBuilder = (color: string, circleRadius = 6, circleOpacity = 0.8) => {\n const { LocationDotsLayerId, LocationDotsLayerSource } = MapPointsConstants\n\n const dotLayerConfig = LocationPointLayerConfig(color, circleRadius, circleOpacity)\n\n const dotLayer = new CircleLayerBuilder(LocationDotsLayerId, LocationDotsLayerSource, dotLayerConfig)\n\n return [dotLayer]\n}\n","import { FlexCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport type { MapboxFlexBoxProps } from '../lib/index.ts'\nimport { MapBox } from './MapBox.tsx'\nimport { MapSettingsBox } from './MapSettingsComponents/index.ts'\n\nexport const MapboxHeatFlexBox: React.FC<MapboxFlexBoxProps> = ({\n accessToken, children, mapBoxOptions, zoom, legend, developerMode, ...props\n}) => {\n return (\n <FlexCol {...props}>\n <MapBox accessToken={accessToken} options={mapBoxOptions} zoom={zoom} />\n <MapSettingsBox developerMode={developerMode} />\n {legend}\n {children}\n </FlexCol>\n )\n}\n","// eslint-disable-next-line import-x/no-internal-modules\nimport 'mapbox-gl/dist/mapbox-gl.css'\n\nimport { MapStyle } from '@xyo-network/react-map-model'\nimport type { MapOptions } from 'mapbox-gl'\nimport { Map } from 'mapbox-gl'\nimport React, { useEffect, useRef } from 'react'\n\nimport { useMapBoxInstance, useMapSettings } from '../Contexts/index.ts'\nimport { useDynamicMapResize } from '../hooks/index.ts'\n\nexport interface MapBoxProps {\n accessToken: string\n darkMode?: boolean\n options?: Partial<MapOptions>\n zoom?: number\n}\n\nexport const MapBox: React.FC<MapBoxProps> = ({\n accessToken, darkMode = false, options, zoom = 2, ...props\n}) => {\n const mapRef = useRef<Map>(undefined)\n const mapContainerRef = useRef<HTMLDivElement>(null)\n const mapCanvasRef = useRef<HTMLCanvasElement>(null)\n const { setMapBoxInstance, map: mapInstance } = useMapBoxInstance()\n const { mapSettings } = useMapSettings()\n\n const activeResize = mapSettings?.dynamicMapResize.value\n useDynamicMapResize(mapContainerRef, mapCanvasRef, mapInstance, activeResize)\n\n useEffect(() => {\n if (mapSettings?.preferDark?.value === true) {\n mapRef.current?.setStyle(`mapbox://styles/${MapStyle.Dark}`)\n } else {\n mapRef.current?.setStyle(`mapbox://styles/${darkMode ? MapStyle.Dark : MapStyle.Light}`)\n }\n }, [darkMode, mapSettings])\n\n useEffect(() => {\n const map = new Map({\n accessToken,\n center: [0, 0],\n container: mapContainerRef.current ?? '',\n style: `mapbox://styles/${MapStyle.Light}`,\n zoom,\n ...options,\n })\n\n // Allow external components to control the map\n mapRef.current = map\n setMapBoxInstance?.(map)\n\n // save the map canvas ref to help with resizing\n mapCanvasRef.current = document.querySelector('.mapboxgl-canvas') as HTMLCanvasElement | null\n\n console.log('Created Map')\n\n return () => {\n console.log('Removing Map')\n map.remove()\n }\n }, [mapContainerRef, options, zoom, setMapBoxInstance, accessToken])\n\n return (\n <div\n ref={(el) => { mapContainerRef.current = el }}\n style={{\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n ...props,\n }}\n />\n )\n}\n","import type { SwitchProps } from '@mui/material'\nimport { FormControlLabel, Switch } from '@mui/material'\nimport React from 'react'\n\nimport { useMapSettings } from '../../Contexts/index.ts'\n\nexport interface MapSettingSwitchProps extends SwitchProps {\n developerMode?: boolean\n field: string\n}\n\nexport const MapSettingSwitch: React.FC<MapSettingSwitchProps> = ({\n developerMode, field, ...props\n}) => {\n const { mapSettings, setMapSettings } = useMapSettings()\n const setting = mapSettings?.[field]\n\n const onLocalChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (setting) {\n setMapSettings?.((previous) => {\n previous[setting.field].value = event.target.checked\n return { ...previous }\n })\n }\n }\n\n if (setting?.devMode && developerMode === false) {\n return null\n }\n\n return setting?.hidden\n ? null\n : (\n <FormControlLabel label={setting?.label} control={<Switch checked={setting?.value} onChange={onLocalChange} {...props} />} />\n )\n}\n","import { Paper, Stack } from '@mui/material'\nimport { useAppSettings } from '@xylabs/react-app-settings'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowRow, FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { useMapSettings } from '../../Contexts/index.ts'\nimport { MapSettingSwitch } from './Setting.tsx'\n\nexport interface MapSettingsBoxProps extends FlexBoxProps {\n developerMode?: boolean\n}\n\nexport const MapSettingsBox: React.FC<MapSettingsBoxProps> = ({ developerMode, ...props }) => {\n const { mapSettings } = useMapSettings()\n const { developerMode: devModeFromContext } = useAppSettings()\n const resolveDeveloperMode = developerMode ?? devModeFromContext\n\n return mapSettings && resolveDeveloperMode\n ? (\n <FlexGrowRow\n {...props}\n sx={[{\n bottom: 36,\n left: 10,\n position: 'absolute',\n }, ...(Array.isArray(props.sx) ? props.sx : [props.sx])]}\n >\n <FlexRow sx={{ paddingX: 2 }}>\n <Paper>\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{ marginX: 1 }}\n >\n {Object.keys(mapSettings).map((key) => {\n return <MapSettingSwitch key={key} field={mapSettings[key].field} developerMode={developerMode} />\n })}\n </Stack>\n </Paper>\n </FlexRow>\n </FlexGrowRow>\n )\n : null\n}\n","import { Alert, AlertTitle } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { useWeakArchivistFromNode, useWeakArchivistGet } from '@xyo-network/react-archivist'\nimport type { NetworkLocationHeatmapQuadkeyAnswerPayload } from '@xyo-network/react-map-model'\nimport {\n AnimatedHeatMapSettings,\n useFindHashes, useHeatMapColors,\n} from '@xyo-network/react-map-model'\nimport type { Feature, Polygon } from 'geojson'\nimport React from 'react'\n\nimport { useQuadKeyPayloadsToFeatures } from '../hooks/index.ts'\nimport { AnimatedHeatMap } from './AnimatedHeatMap.tsx'\nimport { AnimatedHeatMapLegend } from './Legend.tsx'\n\nexport interface AnimatedHeatMapLoadedProps extends FlexBoxProps {\n accessToken: string\n archivistNameOrAddress: string\n}\n\nexport const AnimatedHeatMapLoaded: React.FC<AnimatedHeatMapLoadedProps> = ({\n accessToken, archivistNameOrAddress, ...props\n}) => {\n const hashes = useFindHashes()\n const [archivist] = useWeakArchivistFromNode(archivistNameOrAddress)\n const [payloads, xyoError] = useWeakArchivistGet<NetworkLocationHeatmapQuadkeyAnswerPayload>(archivist, hashes)\n const { multipleFeatureSets } = useQuadKeyPayloadsToFeatures(payloads)\n const { heatMapColorProps, legendProps } = useHeatMapColors()\n\n const MapBoxHeatProps = {\n flexGrow: 1,\n legend: legendProps ? <AnimatedHeatMapLegend {...legendProps} /> : null,\n }\n\n return (\n <FlexCol\n {...props}\n sx={[{ alignItems: 'stretch' }, ...(Array.isArray(props.sx) ? props.sx : [props.sx])]}\n >\n {xyoError\n ? (\n <Alert sx={{ mt: 2 }}>\n <AlertTitle>Error Loading Map</AlertTitle>\n {xyoError.message ? `Error: ${xyoError.message}` : null}\n You might try authenticating again.\n </Alert>\n )\n : null}\n {hashes === undefined\n ? <Alert>Missing answer hash for heat map query</Alert>\n : (\n <AnimatedHeatMap\n accessToken={accessToken}\n defaultMapSettings={AnimatedHeatMapSettings}\n animatedFeatureSets={multipleFeatureSets.slice(1) as Feature<Polygon>[][]}\n staticFeatureSet={multipleFeatureSets[0] as Feature<Polygon>[]}\n heatMapColorProps={heatMapColorProps}\n {...MapBoxHeatProps}\n />\n )}\n </FlexCol>\n )\n}\n","import { useMediaQuery, useTheme } from '@mui/material'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport type { ColorGradientLegendProps } from '@xyo-network/react-map-model'\nimport React from 'react'\n\nimport { ColorGradientLegend } from './Legends/index.ts'\n\nconst AnimatedHeatMapLegend: React.FC<ColorGradientLegendProps> = ({ ...legendProps }) => {\n const {\n startColor, endColor, startLabel, endLabel, heading, textColor,\n } = legendProps\n const theme = useTheme()\n const isSmall = useMediaQuery(theme.breakpoints.down('sm'))\n\n return (\n <FlexCol\n sx={{\n position: 'absolute',\n bottom: 0,\n right: 0,\n }}\n >\n <ColorGradientLegend\n startColor={startColor}\n endColor={endColor}\n startLabel={startLabel}\n endLabel={endLabel}\n heading={heading}\n textColor={textColor}\n {...{\n alignItems: 'stretch',\n marginBottom: theme.spacing(4),\n marginLeft: isSmall ? theme.spacing(3) : 0,\n marginRight: isSmall ? theme.spacing(2) : theme.spacing(3),\n width: isSmall ? '40vw' : theme.spacing(18),\n }}\n />\n </FlexCol>\n )\n}\n\nexport { AnimatedHeatMapLegend }\n","import { Typography, useTheme } from '@mui/material'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport type { ColorGradientLegendProps } from '@xyo-network/react-map-model'\nimport React from 'react'\n\nconst ColorGradientLegend: React.FC<ColorGradientLegendProps> = ({\n startColor, endColor, startLabel, endLabel, heading, textColor, ...props\n}) => {\n const theme = useTheme()\n\n return (\n <FlexCol {...props}>\n <Typography\n color={textColor}\n variant=\"caption\"\n sx={{\n mb: theme.spacing(0.25),\n textAlign: 'center',\n }}\n >\n {heading}\n </Typography>\n <FlexCol\n sx={{\n flexGrow: 1,\n alignItems: 'stretch',\n paddingX: theme.spacing(1),\n mb: theme.spacing(0.25),\n }}\n >\n <FlexCol\n sx={{\n height: theme.spacing(0.75),\n border: `1px solid ${textColor}`,\n backgroundImage: `linear-gradient(to right, ${startColor},${endColor})`,\n }}\n />\n </FlexCol>\n <FlexRow\n sx={{\n flexGrow: 1,\n justifyContent: 'space-between',\n }}\n >\n <Typography color={textColor} variant=\"caption\">\n {startLabel}\n </Typography>\n <Typography color={textColor} variant=\"caption\">\n {endLabel}\n </Typography>\n </FlexRow>\n </FlexCol>\n )\n}\n\nexport { ColorGradientLegend }\n","import { DefaultMapSettings } from '@xyo-network/react-map-model'\n\nconst HeatMapSettings = DefaultMapSettings()\nconst {\n debugLayer, scrollToZoom, fitToPoints,\n} = HeatMapSettings\ndebugLayer.hidden = false\nscrollToZoom.value = true\nfitToPoints.value = true\n\nexport { HeatMapSettings }\n","import { useInterval } from '@xylabs/react-shared'\nimport type { Map } from 'mapbox-gl'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useCallback, useEffect, useMemo, useRef,\n} from 'react'\n\nimport type { MapLayer } from '../Layers/index.ts'\nimport type { MapboxFlexBoxProps } from '../lib/index.ts'\n\nexport interface LayerAnimatorProps {\n animateLayers?: boolean\n layers: MapboxFlexBoxProps['layers']\n layersInitialized: boolean\n map: Map | undefined\n}\n\nconst timeIncrement = 2000\nconst animatedLayerCount = 3\n\nexport const LayerAnimator: React.FC<PropsWithChildren<LayerAnimatorProps>> = ({\n animateLayers, children, layers, layersInitialized, map,\n}) => {\n const layerIndexQueueRef = useRef<number[]>([])\n\n const fillLayers: MapLayer[] = useMemo(() => {\n if (layers?.length && map && layersInitialized) {\n return layers.filter((layer) => {\n const fillLayer = layer.id.startsWith('location-fill')\n if (fillLayer) {\n map.setPaintProperty(layer.id, 'fill-opacity-transition', { delay: 0, duration: 4000 })\n }\n return fillLayer\n })\n }\n return []\n }, [layers, layersInitialized, map])\n\n const incrementQueue = useCallback(\n (index: number) => {\n if (fillLayers[index]) {\n layerIndexQueueRef.current.push(index)\n } else {\n layerIndexQueueRef.current.push(0)\n }\n return layerIndexQueueRef.current.at(-1)\n },\n [fillLayers],\n )\n\n const lastQueuedIndex = useCallback(() => {\n const last = layerIndexQueueRef.current.at(-1)\n if (last === undefined) {\n incrementQueue(0)\n return 0\n } else {\n return last\n }\n }, [incrementQueue])\n\n const unshiftQueue = useCallback(() => {\n layerIndexQueueRef.current.shift()\n }, [])\n\n const getNextLayer = useCallback(() => {\n const nextLayer = fillLayers[lastQueuedIndex()]\n incrementQueue(lastQueuedIndex() + 1)\n return nextLayer\n }, [fillLayers, incrementQueue, lastQueuedIndex])\n\n const layerAnimateWorker = useCallback(\n (layer: MapLayer) => {\n if (layer) {\n map?.setPaintProperty(layer.id, 'fill-opacity', 0.85)\n setTimeout(() => {\n map?.setPaintProperty(layer.id, 'fill-opacity', 0)\n unshiftQueue()\n }, timeIncrement * 2)\n } else {\n console.warn('tried to queue an empty layer')\n }\n },\n [map, unshiftQueue],\n )\n\n //\n const queueLayerAnimation = useCallback(() => {\n const animatedLayers: MapLayer[] = []\n\n for (let i = 0; i < animatedLayerCount; i++) {\n animatedLayers.push(getNextLayer())\n }\n\n for (const [index, layer] of animatedLayers.entries()) {\n if (index === 0) {\n layerAnimateWorker(layer)\n } else {\n setTimeout(() => {\n layerAnimateWorker(layer)\n }, timeIncrement * index)\n }\n }\n }, [getNextLayer, layerAnimateWorker])\n\n // Run a single layer animation before the interval kicks in\n useEffect(() => {\n if (animateLayers && layersInitialized && map && fillLayers.length > 0) {\n queueLayerAnimation()\n }\n }, [animateLayers, fillLayers.length, layersInitialized, map, queueLayerAnimation])\n\n useInterval(() => {\n if (animateLayers && layersInitialized && map && fillLayers.length > 0) {\n queueLayerAnimation()\n }\n }, timeIncrement * animatedLayerCount)\n\n return <>{children}</>\n}\n","import { Alert } from '@mui/material'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport type { Feature, Point } from 'geojson'\nimport type { MapOptions } from 'mapbox-gl'\nimport React, { useEffect } from 'react'\n\nimport { useMapBoxInstance, useMapSettings } from '../Contexts/index.ts'\nimport type { MapboxFlexBoxProps } from '../lib/index.ts'\nimport { MapPoints } from '../MapBoxClasses/index.ts'\nimport { MapBox } from './MapBox.tsx'\nimport { MapSettingsBox } from './MapSettingsComponents/index.ts'\n\nexport interface MapboxPointsFlexBoxProps extends MapboxFlexBoxProps {\n accessToken: string\n features?: Feature<Point>[]\n}\n\nexport const MapboxPointsFlexBox: React.FC<MapboxPointsFlexBoxProps> = ({\n accessToken,\n features,\n fitToPointsPadding = 20,\n layers,\n zoom,\n ...props\n}) => {\n const { mapSettings } = useMapSettings()\n const { map, mapInitialized } = useMapBoxInstance()\n\n /**\n * Needed because of a bug in mapbox taking undefined values for the config options of fitToBounds\n * see - https://github.com/mapbox/mapbox-gl-js/issues/10013\n */\n const customFitToBoundsOptions = (zoom?: number): MapOptions['fitBoundsOptions'] => {\n if (zoom !== undefined) {\n return { maxZoom: zoom }\n }\n return {}\n }\n\n useEffect(() => {\n if (mapInitialized) {\n const mapPoints = (map && features?.length)\n ? new MapPoints({\n features, map, zoom,\n })\n : undefined\n\n const { fitToPoints } = mapSettings || {}\n const padding = {\n bottom: fitToPointsPadding, left: fitToPointsPadding, right: fitToPointsPadding, top: fitToPointsPadding,\n }\n\n if (mapPoints && map && fitToPoints?.value === true) {\n mapPoints.initialMapPositioning({ padding, ...customFitToBoundsOptions(zoom) })\n }\n\n mapPoints?.initialMapPositioning({ padding, ...customFitToBoundsOptions(zoom) })\n\n if (mapPoints?.isMapReady && features?.length && layers) {\n for (const layer of layers) {\n mapPoints.initializeMapSource(layer)\n }\n }\n }\n }, [mapInitialized, mapSettings, map, fitToPointsPadding, zoom, features, layers])\n\n return (\n <FlexCol\n id=\"xyo-mapbox-wrap\"\n {...props}\n sx={[{ alignItems: 'stretch' }, ...(Array.isArray(props.sx) ? props.sx : [props.sx])]}\n >\n {features\n ? (\n <>\n <MapBox accessToken={accessToken} zoom={zoom} />\n <MapSettingsBox />\n </>\n )\n : <Alert severity=\"error\">No data to show</Alert>}\n </FlexCol>\n )\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,WAAAA,gBAAe;AACxB,SAAS,iBAAiB;AAI1B,SAAgB,YAAAC,iBAAgB;;;ACNhC,SAAS,UAAAC,eAAc;AAIvB,SAAgB,aAAAC,YAAW,WAAAC,gBAAe;;;ACF1C,SAAS,iBAAiB;AAKnB,IAAM,sBAAsB,CACjC,iBACA,cACA,aACA,SAAS,SACN;AACH,YAAU,MAAM;AACd,QAAI,UAAU,aAAa;AACzB,YAAM,YAAY,gBAAgB;AAClC,UAAI,WAAW;AACb,YAAI;AACJ,cAAM,UAAU,IAAI,eAAe,MAAM;AACvC,gBAAM,QAAQ,UAAU,sBAAsB,EAAE;AAChD,gBAAM,SAAS,aAAa;AAC5B,cAAI,SAAS,QAAQ;AACnB,mBAAO,MAAM,QAAQ,GAAG,KAAK;AAC7B,sBAAU,WAAW,MAAM,YAAY,OAAO,CAAC;AAAA,UACjD;AAAA,QACF,CAAC;AACD,gBAAQ,QAAQ,SAAS;AACzB,eAAO,MAAM;AACX,uBAAa,OAAO;AACpB,kBAAQ,WAAW;AAAA,QACrB;AAAA,MACF;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,iBAAiB,WAAW,CAAC;AACzD;;;AClCA,SAAS,qBAAqB;AAE9B,SAAS,eAAe;AAOxB,IAAM,cAAc;AAMpB,IAAM,0BAA0B,CAAC,KAAK,CAAC;AASvC,IAAM,WAAW,CAAC,oBAAyB,gBAAoB;AAC/D,IAAM,WAAW,CAAC,mBAAuB,kBAAsB;AAY/D,IAAM,oBAAoB,CAAC,aAAqB,aAA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WAAU,MAAM;AACd,QAAI,gBAAgB;AAClB,YAAM,YAAa,OAAO,UAAU,SAChC,IAAI,UAAU;AAAA,QACZ;AAAA,QAAU;AAAA,QAAK;AAAA,MACjB,CAAC,IACD;AAEJ,YAAM,EAAE,aAAAC,aAAY,IAAI,eAAe,CAAC;AACxC,YAAM,UAAU;AAAA,QACd,QAAQ;AAAA,QAAoB,MAAM;AAAA,QAAoB,OAAO;AAAA,QAAoB,KAAK;AAAA,MACxF;AAEA,UAAI,aAAa,OAAOA,cAAa,UAAU,MAAM;AACnD,kBAAU,sBAAsB,EAAE,SAAS,GAAG,yBAAyB,IAAI,EAAE,CAAC;AAAA,MAChF;AAEA,iBAAW,sBAAsB,EAAE,SAAS,GAAG,yBAAyB,IAAI,EAAE,CAAC;AAE/E,UAAI,WAAW,cAAc,UAAU,UAAU,QAAQ;AACvD,mBAAW,SAAS,QAAQ;AAC1B,oBAAU,oBAAoB,KAAK;AAAA,QACrC;AAAA,MACF;AAAA,IACF;AAAA,EACF,GAAG,CAAC,gBAAgB,aAAa,KAAK,oBAAoB,MAAM,UAAU,MAAM,CAAC;AAEjF,SACE,gBAAAJ;AAAA,IAACK;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACF,GAAG;AAAA,MACJ,IAAI,CAAC,EAAE,YAAY,UAAU,GAAG,GAAI,MAAM,QAAQ,MAAM,EAAE,IAAI,MAAM,KAAK,CAAC,MAAM,EAAE,CAAE;AAAA,MAEnF,qBAEK,gBAAAJ,MAAAF,WAAA,EACE;AAAA,wBAAAC,MAAC,UAAO,aAA0B,MAAY;AAAA,QAC9C,gBAAAA,MAAC,kBAAe;AAAA,SAClB,IAEF,gBAAAA,MAACM,QAAA,EAAM,UAAS,SAAQ,6BAAe;AAAA;AAAA,EAC7C;AAEJ;","names":["FlexCol","useState","forget","useEffect","useMemo","useMemo","multipleFeatureSets","features","error","GeoJson","GeoJson","assertEx","GeoJson","factor","initialPad","assertEx","LngLatBounds","LngLatBounds","debugLayer","scrollToZoom","useEffect","useMemo","useMemo","useEffect","assertEx","assertEx","useEffect","useMemo","useState","createContext","jsx","useState","useMemo","useEffect","use","use","createContext","jsx","useMemo","useEffect","forget","fitToPoints","assertEx","use","use","assertEx","LayerBase","LayerBase","debugLayer","MapHeatConstants","LayerBase","useEffect","jsx","useEffect","jsx","jsx","jsx","jsx","useState","FlexCol","FlexCol","useTheme","FlexCol","useTheme","FlexCol","FlexRow","jsx","jsxs","jsx","useTheme","FlexCol","jsx","jsxs","FlexCol","useEffect","useMemo","useRef","jsx","Alert","FlexCol","useEffect","Fragment","jsx","jsxs","zoom","useEffect","fitToPoints","FlexCol","Alert"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-map",
3
- "version": "7.6.2",
3
+ "version": "8.0.0",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -41,15 +41,15 @@
41
41
  "README.md"
42
42
  ],
43
43
  "dependencies": {
44
- "@xyo-network/react-map-model": "~7.6.2",
45
- "@xyo-network/react-archivist": "~7.6.2"
44
+ "@xyo-network/react-archivist": "~8.0.0",
45
+ "@xyo-network/react-map-model": "~8.0.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@bitauth/libauth": "~3.0.0",
49
- "@mui/icons-material": "^7.3.10",
50
- "@mui/material": "^7.3.10",
51
- "@mui/system": "^7.3.10",
52
- "@mui/x-tree-view": "~8.27.2",
49
+ "@mui/icons-material": "~9.0",
50
+ "@mui/material": "~9.0",
51
+ "@mui/system": "~9.0",
52
+ "@mui/x-tree-view": "~9.1",
53
53
  "@opentelemetry/api": "^1.9.1",
54
54
  "@opentelemetry/sdk-trace-base": "^2.7.1",
55
55
  "@react-spring/web": "~10.0.3",
@@ -58,50 +58,49 @@
58
58
  "@storybook/react-vite": "~10.3.6",
59
59
  "@types/geojson": "~7946.0.16",
60
60
  "@types/react": "^19.2.14",
61
- "@xylabs/geo": "^5.1.1",
62
- "@xylabs/pixel": "~5.1.1",
63
- "@xylabs/react-app-settings": "~7.2.3",
64
- "@xylabs/react-async-effect": "~7.2.3",
65
- "@xylabs/react-button": "~7.2.3",
66
- "@xylabs/react-crypto": "~7.2.3",
67
- "@xylabs/react-flexbox": "~7.2.3",
68
- "@xylabs/react-hooks": "~7.2.3",
69
- "@xylabs/react-identicon": "~7.2.3",
70
- "@xylabs/react-link": "~7.2.3",
71
- "@xylabs/react-number-status": "~7.2.3",
72
- "@xylabs/react-promise": "~7.2.3",
73
- "@xylabs/react-select": "~7.2.3",
74
- "@xylabs/react-shared": "~7.2.3",
75
- "@xylabs/react-theme": "~7.2.3",
76
- "@xylabs/sdk-js": "^5.1.1",
77
- "@xylabs/threads": "~5.1.1",
78
- "@xylabs/toolchain": "~7.13.7",
79
- "@xylabs/tsconfig": "^7.13.7",
80
- "@xylabs/tsconfig-dom": "^7.13.7",
81
- "@xylabs/tsconfig-react": "~7.13.7",
82
- "@xyo-network/account": "~5.6.1",
83
- "@xyo-network/account-model": "^5.6.2",
84
- "@xyo-network/archivist-memory": "~5.6.3",
85
- "@xyo-network/archivist-model": "^5.6.3",
86
- "@xyo-network/boundwitness-builder": "^5.6.1",
87
- "@xyo-network/boundwitness-model": "^5.6.2",
88
- "@xyo-network/boundwitness-validator": "^5.6.1",
89
- "@xyo-network/boundwitness-wrapper": "~5.6.1",
90
- "@xyo-network/config-payload-plugin": "~5.6.2",
91
- "@xyo-network/diviner-model": "^5.6.3",
92
- "@xyo-network/manifest-model": "~5.6.2",
93
- "@xyo-network/module-abstract": "^5.6.3",
94
- "@xyo-network/module-model": "^5.6.3",
95
- "@xyo-network/module-wrapper": "~5.6.3",
96
- "@xyo-network/network": "~5.6.2",
97
- "@xyo-network/node-memory": "~5.6.3",
98
- "@xyo-network/node-model": "^5.6.3",
99
- "@xyo-network/payload-builder": "^5.6.1",
100
- "@xyo-network/payload-model": "^5.6.2",
101
- "@xyo-network/query-payload-plugin": "~5.6.2",
61
+ "@xylabs/geo": "^5.1.2",
62
+ "@xylabs/pixel": "~5.1.2",
63
+ "@xylabs/react-app-settings": "~8.0",
64
+ "@xylabs/react-async-effect": "~8.0",
65
+ "@xylabs/react-button": "~8.0",
66
+ "@xylabs/react-crypto": "~8.0",
67
+ "@xylabs/react-flexbox": "~8.0",
68
+ "@xylabs/react-hooks": "~8.0",
69
+ "@xylabs/react-identicon": "~8.0",
70
+ "@xylabs/react-link": "~8.0",
71
+ "@xylabs/react-number-status": "~8.0",
72
+ "@xylabs/react-promise": "~8.0",
73
+ "@xylabs/react-select": "~8.0",
74
+ "@xylabs/react-shared": "~8.0",
75
+ "@xylabs/react-theme": "~8.0",
76
+ "@xylabs/sdk-js": "^5.1.2",
77
+ "@xylabs/threads": "~5.1.2",
78
+ "@xylabs/toolchain": "~7.13.22",
79
+ "@xylabs/tsconfig": "^7.13.22",
80
+ "@xylabs/tsconfig-dom": "^7.13.22",
81
+ "@xylabs/tsconfig-react": "~7.13.22",
82
+ "@xyo-network/account": "~5.6.2",
83
+ "@xyo-network/account-model": "^5.6.3",
84
+ "@xyo-network/archivist-memory": "~5.6.4",
85
+ "@xyo-network/archivist-model": "^5.6.4",
86
+ "@xyo-network/boundwitness-builder": "^5.6.2",
87
+ "@xyo-network/boundwitness-model": "^5.6.3",
88
+ "@xyo-network/boundwitness-validator": "^5.6.2",
89
+ "@xyo-network/boundwitness-wrapper": "~5.6.2",
90
+ "@xyo-network/config-payload-plugin": "~5.6.3",
91
+ "@xyo-network/diviner-model": "^5.6.4",
92
+ "@xyo-network/manifest-model": "~5.6.3",
93
+ "@xyo-network/module-model": "^5.6.4",
94
+ "@xyo-network/module-wrapper": "~5.6.4",
95
+ "@xyo-network/network": "~5.6.3",
96
+ "@xyo-network/node-memory": "~5.6.4",
97
+ "@xyo-network/node-model": "^5.6.4",
98
+ "@xyo-network/payload-builder": "^5.6.2",
99
+ "@xyo-network/payload-model": "^5.6.3",
100
+ "@xyo-network/query-payload-plugin": "~5.6.3",
102
101
  "@xyo-network/sdk-geo": "~3.0.3",
103
- "@xyo-network/wallet": "~5.6.1",
104
- "@xyo-network/wallet-model": "^5.6.2",
102
+ "@xyo-network/wallet": "~5.6.2",
103
+ "@xyo-network/wallet-model": "^5.6.3",
105
104
  "async-mutex": "^0.5.0",
106
105
  "bn.js": "^5.2.3",
107
106
  "bowser": "^2.14.1",
@@ -122,99 +121,99 @@
122
121
  "observable-fns": "~0.6.1",
123
122
  "pako": "^2.1.0",
124
123
  "query-string": "~9.3.1",
125
- "react": "^19.2.5",
126
- "react-dom": "^19.2.5",
124
+ "react": "^19.2.6",
125
+ "react-dom": "^19.2.6",
127
126
  "react-icons": "~5.6.0",
128
- "react-is": "^19.2.5",
127
+ "react-is": "^19.2.6",
129
128
  "react-router-dom": "^7.15.0",
130
129
  "recharts": "~3.8.1",
131
130
  "spark-md5": "~3.0.2",
132
131
  "storybook": "^10.3.6",
133
132
  "typescript": "^5.9.3",
134
- "viem": "~2.48.8",
135
- "vite": "^8.0.10",
133
+ "viem": "~2.48.11",
134
+ "vite": "^8.0.11",
136
135
  "wasm-feature-detect": "~1.8.0",
137
136
  "zod": "^4.4.3"
138
137
  },
139
138
  "peerDependencies": {
140
- "@bitauth/libauth": ">=3.0.0 <3.1",
141
- "@mui/icons-material": ">=7.3.10 <8",
142
- "@mui/material": ">=7.3.10 <8",
143
- "@mui/system": ">=7.3.10 <8",
144
- "@mui/x-tree-view": ">=8.27.2 <8.28",
145
- "@opentelemetry/api": ">=1.9.1 <2",
146
- "@opentelemetry/sdk-trace-base": ">=2.7.1 <3",
147
- "@react-spring/web": ">=10.0.3 <10.1",
148
- "@scure/base": ">=2.2.0 <2.3",
149
- "@scure/bip39": ">=2.2.0 <2.3",
150
- "@xylabs/geo": ">=5.1.1 <6",
151
- "@xylabs/pixel": ">=5.1.1 <5.2",
152
- "@xylabs/react-app-settings": ">=7.2.3 <7.3",
153
- "@xylabs/react-async-effect": ">=7.2.3 <7.3",
154
- "@xylabs/react-button": ">=7.2.3 <7.3",
155
- "@xylabs/react-crypto": ">=7.2.3 <7.3",
156
- "@xylabs/react-flexbox": ">=7.2.3 <7.3",
157
- "@xylabs/react-hooks": ">=7.2.3 <7.3",
158
- "@xylabs/react-identicon": ">=7.2.3 <7.3",
159
- "@xylabs/react-link": ">=7.2.3 <7.3",
160
- "@xylabs/react-number-status": ">=7.2.3 <7.3",
161
- "@xylabs/react-promise": ">=7.2.3 <7.3",
162
- "@xylabs/react-select": ">=7.2.3 <7.3",
163
- "@xylabs/react-shared": ">=7.2.3 <7.3",
164
- "@xylabs/react-theme": ">=7.2.3 <7.3",
165
- "@xylabs/sdk-js": ">=5.1.1 <6",
166
- "@xylabs/threads": ">=5.1.1 <5.2",
167
- "@xyo-network/account": ">=5.6.1 <5.7",
168
- "@xyo-network/account-model": ">=5.6.2 <6",
169
- "@xyo-network/archivist-memory": ">=5.6.3 <5.7",
170
- "@xyo-network/archivist-model": ">=5.6.3 <6",
171
- "@xyo-network/boundwitness-builder": ">=5.6.1 <6",
172
- "@xyo-network/boundwitness-model": ">=5.6.2 <6",
173
- "@xyo-network/boundwitness-validator": ">=5.6.1 <6",
174
- "@xyo-network/boundwitness-wrapper": ">=5.6.1 <5.7",
175
- "@xyo-network/config-payload-plugin": ">=5.6.2 <5.7",
176
- "@xyo-network/diviner-model": ">=5.6.3 <6",
177
- "@xyo-network/manifest-model": ">=5.6.2 <5.7",
178
- "@xyo-network/module-abstract": ">=5.6.3 <6",
179
- "@xyo-network/module-model": ">=5.6.3 <6",
180
- "@xyo-network/module-wrapper": ">=5.6.3 <5.7",
181
- "@xyo-network/network": ">=5.6.2 <5.7",
182
- "@xyo-network/node-memory": ">=5.6.3 <5.7",
183
- "@xyo-network/node-model": ">=5.6.3 <6",
184
- "@xyo-network/payload-builder": ">=5.6.1 <6",
185
- "@xyo-network/payload-model": ">=5.6.2 <6",
186
- "@xyo-network/query-payload-plugin": ">=5.6.2 <5.7",
187
- "@xyo-network/sdk-geo": ">=3.0.3 <3.1",
188
- "@xyo-network/wallet": ">=5.6.1 <5.7",
189
- "@xyo-network/wallet-model": ">=5.6.2 <6",
190
- "async-mutex": ">=0.5.0 <1",
191
- "bn.js": ">=5.2.3 <6",
192
- "bowser": ">=2.14.1 <3",
193
- "buffer": ">=6.0.3 <7",
194
- "chalk": ">=5.6.2 <6",
195
- "debug": ">=4.4.3 <4.5",
196
- "ethers": ">=6.16.0 <7",
197
- "fast-deep-equal": ">=3.1.3 <3.2",
198
- "hash-wasm": ">=4.12.0 <4.13",
199
- "js-cookie": ">=3.0.5 <3.1",
200
- "lru-cache": ">=11.3.6 <12",
201
- "mapbox-gl": ">=3.23.1 <4",
202
- "md5": ">=2.3.0 <2.4",
203
- "mixpanel-browser": ">=2.78.0 <2.79",
204
- "numeral": ">=2.0.6 <2.1",
205
- "observable-fns": ">=0.6.1 <0.7",
206
- "pako": ">=2.1.0 <3",
207
- "query-string": ">=9.3.1 <9.4",
208
- "react": ">=19.2.5 <20",
209
- "react-dom": ">=19.2.5 <20",
210
- "react-icons": ">=5.6.0 <5.7",
211
- "react-is": ">=19.2.5 <20",
212
- "react-router-dom": ">=7.15.0 <8",
213
- "recharts": ">=3.8.1 <3.9",
214
- "spark-md5": ">=3.0.2 <3.1",
215
- "viem": ">=2.48.8 <2.49",
216
- "wasm-feature-detect": ">=1.8.0 <1.9",
217
- "zod": ">=4.4.3 <5"
139
+ "@bitauth/libauth": "~3.0",
140
+ "@mui/icons-material": "~9.0",
141
+ "@mui/material": "~9.0",
142
+ "@mui/system": "~9.0",
143
+ "@mui/x-tree-view": "~9.1",
144
+ "@opentelemetry/api": "^1.9",
145
+ "@opentelemetry/sdk-trace-base": "^2.7",
146
+ "@react-spring/web": "~10.0",
147
+ "@scure/base": "~2.2",
148
+ "@scure/bip39": "~2.2",
149
+ "@xylabs/geo": "^5.1",
150
+ "@xylabs/pixel": "~5.1",
151
+ "@xylabs/react-app-settings": "~8.0",
152
+ "@xylabs/react-async-effect": "~8.0",
153
+ "@xylabs/react-button": "~8.0",
154
+ "@xylabs/react-crypto": "~8.0",
155
+ "@xylabs/react-flexbox": "~8.0",
156
+ "@xylabs/react-hooks": "~8.0",
157
+ "@xylabs/react-identicon": "~8.0",
158
+ "@xylabs/react-link": "~8.0",
159
+ "@xylabs/react-number-status": "~8.0",
160
+ "@xylabs/react-promise": "~8.0",
161
+ "@xylabs/react-select": "~8.0",
162
+ "@xylabs/react-shared": "~8.0",
163
+ "@xylabs/react-theme": "~8.0",
164
+ "@xylabs/sdk-js": "^5.1",
165
+ "@xylabs/threads": "~5.1",
166
+ "@xyo-network/account": "~5.6",
167
+ "@xyo-network/account-model": "^5.6",
168
+ "@xyo-network/archivist-memory": "~5.6",
169
+ "@xyo-network/archivist-model": "^5.6",
170
+ "@xyo-network/boundwitness-builder": "^5.6",
171
+ "@xyo-network/boundwitness-model": "^5.6",
172
+ "@xyo-network/boundwitness-validator": "^5.6",
173
+ "@xyo-network/boundwitness-wrapper": "~5.6",
174
+ "@xyo-network/config-payload-plugin": "~5.6",
175
+ "@xyo-network/diviner-model": "^5.6",
176
+ "@xyo-network/manifest-model": "~5.6",
177
+ "@xyo-network/module-model": "^5.6",
178
+ "@xyo-network/module-wrapper": "~5.6",
179
+ "@xyo-network/network": "~5.6",
180
+ "@xyo-network/node-memory": "~5.6",
181
+ "@xyo-network/node-model": "^5.6",
182
+ "@xyo-network/payload-builder": "^5.6",
183
+ "@xyo-network/payload-model": "^5.6",
184
+ "@xyo-network/query-payload-plugin": "~5.6",
185
+ "@xyo-network/sdk-geo": "~3.0",
186
+ "@xyo-network/wallet": "~5.6",
187
+ "@xyo-network/wallet-model": "^5.6",
188
+ "async-mutex": "^0.5",
189
+ "bn.js": "^5.2",
190
+ "bowser": "^2.14",
191
+ "buffer": "^6.0",
192
+ "chalk": "^5.6",
193
+ "debug": "~4.4",
194
+ "ethers": "^6.16",
195
+ "fast-deep-equal": "~3.1",
196
+ "hash-wasm": "~4.12",
197
+ "js-cookie": "~3.0",
198
+ "lru-cache": "^11.3",
199
+ "mapbox-gl": "^3.23",
200
+ "md5": "~2.3",
201
+ "mixpanel-browser": "~2.78",
202
+ "numeral": "~2.0",
203
+ "observable-fns": "~0.6",
204
+ "pako": "^2.1",
205
+ "query-string": "~9.3",
206
+ "react": "^19.2",
207
+ "react-dom": "^19.2",
208
+ "react-icons": "~5.6",
209
+ "react-is": "^19.2",
210
+ "react-router-dom": "^7.15",
211
+ "recharts": "~3.8",
212
+ "spark-md5": "~3.0",
213
+ "typescript": "^5.9",
214
+ "viem": "~2.48",
215
+ "wasm-feature-detect": "~1.8",
216
+ "zod": "^4.4"
218
217
  },
219
218
  "publishConfig": {
220
219
  "access": "public"