visualizer-components 0.1.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.
Files changed (259) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -0
  3. package/dist/assets/RudderIcon.d.ts +23 -0
  4. package/dist/assets/RudderIcon.d.ts.map +1 -0
  5. package/dist/assets/RudderIcon.js +23 -0
  6. package/dist/assets/RudderIcon.js.map +1 -0
  7. package/dist/assets/svgSources.d.ts +18 -0
  8. package/dist/assets/svgSources.d.ts.map +1 -0
  9. package/dist/assets/svgSources.js +18 -0
  10. package/dist/assets/svgSources.js.map +1 -0
  11. package/dist/components/Joystick.d.ts +23 -0
  12. package/dist/components/Joystick.d.ts.map +1 -0
  13. package/dist/components/Joystick.js +114 -0
  14. package/dist/components/Joystick.js.map +1 -0
  15. package/dist/components/TelemetryDashboard.d.ts +31 -0
  16. package/dist/components/TelemetryDashboard.d.ts.map +1 -0
  17. package/dist/components/TelemetryDashboard.js +127 -0
  18. package/dist/components/TelemetryDashboard.js.map +1 -0
  19. package/dist/components/controls/ControlOverlay.d.ts +64 -0
  20. package/dist/components/controls/ControlOverlay.d.ts.map +1 -0
  21. package/dist/components/controls/ControlOverlay.js +88 -0
  22. package/dist/components/controls/ControlOverlay.js.map +1 -0
  23. package/dist/components/controls/ControlsDrawer.d.ts +37 -0
  24. package/dist/components/controls/ControlsDrawer.d.ts.map +1 -0
  25. package/dist/components/controls/ControlsDrawer.js +93 -0
  26. package/dist/components/controls/ControlsDrawer.js.map +1 -0
  27. package/dist/components/controls/ForceVectorsPanel.d.ts +37 -0
  28. package/dist/components/controls/ForceVectorsPanel.d.ts.map +1 -0
  29. package/dist/components/controls/ForceVectorsPanel.js +76 -0
  30. package/dist/components/controls/ForceVectorsPanel.js.map +1 -0
  31. package/dist/components/controls/InfoPopover.d.ts +34 -0
  32. package/dist/components/controls/InfoPopover.d.ts.map +1 -0
  33. package/dist/components/controls/InfoPopover.js +41 -0
  34. package/dist/components/controls/InfoPopover.js.map +1 -0
  35. package/dist/components/controls/Legend.d.ts +29 -0
  36. package/dist/components/controls/Legend.d.ts.map +1 -0
  37. package/dist/components/controls/Legend.js +74 -0
  38. package/dist/components/controls/Legend.js.map +1 -0
  39. package/dist/components/controls/MobileBottomNav.d.ts +17 -0
  40. package/dist/components/controls/MobileBottomNav.d.ts.map +1 -0
  41. package/dist/components/controls/MobileBottomNav.js +46 -0
  42. package/dist/components/controls/MobileBottomNav.js.map +1 -0
  43. package/dist/components/hud/SceneHUD.d.ts +100 -0
  44. package/dist/components/hud/SceneHUD.d.ts.map +1 -0
  45. package/dist/components/hud/SceneHUD.js +216 -0
  46. package/dist/components/hud/SceneHUD.js.map +1 -0
  47. package/dist/components/hud/telemetry/Batteries.d.ts +40 -0
  48. package/dist/components/hud/telemetry/Batteries.d.ts.map +1 -0
  49. package/dist/components/hud/telemetry/Batteries.js +137 -0
  50. package/dist/components/hud/telemetry/Batteries.js.map +1 -0
  51. package/dist/components/hud/telemetry/Compass.d.ts +2 -0
  52. package/dist/components/hud/telemetry/Compass.d.ts.map +1 -0
  53. package/dist/components/hud/telemetry/Compass.js +147 -0
  54. package/dist/components/hud/telemetry/Compass.js.map +1 -0
  55. package/dist/components/hud/telemetry/Log.d.ts +2 -0
  56. package/dist/components/hud/telemetry/Log.d.ts.map +1 -0
  57. package/dist/components/hud/telemetry/Log.js +65 -0
  58. package/dist/components/hud/telemetry/Log.js.map +1 -0
  59. package/dist/components/hud/telemetry/Map.d.ts +4 -0
  60. package/dist/components/hud/telemetry/Map.d.ts.map +1 -0
  61. package/dist/components/hud/telemetry/Map.js +293 -0
  62. package/dist/components/hud/telemetry/Map.js.map +1 -0
  63. package/dist/components/hud/telemetry/PowerRudderPanel.d.ts +2 -0
  64. package/dist/components/hud/telemetry/PowerRudderPanel.d.ts.map +1 -0
  65. package/dist/components/hud/telemetry/PowerRudderPanel.js +115 -0
  66. package/dist/components/hud/telemetry/PowerRudderPanel.js.map +1 -0
  67. package/dist/components/hud/telemetry/RadiusVisualizer.d.ts +63 -0
  68. package/dist/components/hud/telemetry/RadiusVisualizer.d.ts.map +1 -0
  69. package/dist/components/hud/telemetry/RadiusVisualizer.js +139 -0
  70. package/dist/components/hud/telemetry/RadiusVisualizer.js.map +1 -0
  71. package/dist/components/hud/telemetry/RadiusVisualizerPanel.d.ts +31 -0
  72. package/dist/components/hud/telemetry/RadiusVisualizerPanel.d.ts.map +1 -0
  73. package/dist/components/hud/telemetry/RadiusVisualizerPanel.js +37 -0
  74. package/dist/components/hud/telemetry/RadiusVisualizerPanel.js.map +1 -0
  75. package/dist/components/hud/telemetry/ShipRudderVisualizer.d.ts +43 -0
  76. package/dist/components/hud/telemetry/ShipRudderVisualizer.d.ts.map +1 -0
  77. package/dist/components/hud/telemetry/ShipRudderVisualizer.js +121 -0
  78. package/dist/components/hud/telemetry/ShipRudderVisualizer.js.map +1 -0
  79. package/dist/components/hud/telemetry/ShipRudderVisualizerPanel.d.ts +26 -0
  80. package/dist/components/hud/telemetry/ShipRudderVisualizerPanel.d.ts.map +1 -0
  81. package/dist/components/hud/telemetry/ShipRudderVisualizerPanel.js +29 -0
  82. package/dist/components/hud/telemetry/ShipRudderVisualizerPanel.js.map +1 -0
  83. package/dist/components/hud/telemetry/SignalLog.d.ts +7 -0
  84. package/dist/components/hud/telemetry/SignalLog.d.ts.map +1 -0
  85. package/dist/components/hud/telemetry/SignalLog.js +28 -0
  86. package/dist/components/hud/telemetry/SignalLog.js.map +1 -0
  87. package/dist/components/hud/telemetry/SignalStrength.d.ts +9 -0
  88. package/dist/components/hud/telemetry/SignalStrength.d.ts.map +1 -0
  89. package/dist/components/hud/telemetry/SignalStrength.js +53 -0
  90. package/dist/components/hud/telemetry/SignalStrength.js.map +1 -0
  91. package/dist/components/hud/telemetry/Speedometer.d.ts +2 -0
  92. package/dist/components/hud/telemetry/Speedometer.d.ts.map +1 -0
  93. package/dist/components/hud/telemetry/Speedometer.js +70 -0
  94. package/dist/components/hud/telemetry/Speedometer.js.map +1 -0
  95. package/dist/components/hud/telemetry/Task.d.ts +2 -0
  96. package/dist/components/hud/telemetry/Task.d.ts.map +1 -0
  97. package/dist/components/hud/telemetry/Task.js +61 -0
  98. package/dist/components/hud/telemetry/Task.js.map +1 -0
  99. package/dist/components/hud/telemetry/TaskData.d.ts +2 -0
  100. package/dist/components/hud/telemetry/TaskData.d.ts.map +1 -0
  101. package/dist/components/hud/telemetry/TaskData.js +62 -0
  102. package/dist/components/hud/telemetry/TaskData.js.map +1 -0
  103. package/dist/components/hud/telemetry/index.d.ts +40 -0
  104. package/dist/components/hud/telemetry/index.d.ts.map +1 -0
  105. package/dist/components/hud/telemetry/index.js +40 -0
  106. package/dist/components/hud/telemetry/index.js.map +1 -0
  107. package/dist/components/hud/telemetry/powerColor.d.ts +16 -0
  108. package/dist/components/hud/telemetry/powerColor.d.ts.map +1 -0
  109. package/dist/components/hud/telemetry/powerColor.js +15 -0
  110. package/dist/components/hud/telemetry/powerColor.js.map +1 -0
  111. package/dist/components/scenes/MappingScene.d.ts +19 -0
  112. package/dist/components/scenes/MappingScene.d.ts.map +1 -0
  113. package/dist/components/scenes/MappingScene.js +353 -0
  114. package/dist/components/scenes/MappingScene.js.map +1 -0
  115. package/dist/components/scenes/SceneCanvas.d.ts +96 -0
  116. package/dist/components/scenes/SceneCanvas.d.ts.map +1 -0
  117. package/dist/components/scenes/SceneCanvas.js +151 -0
  118. package/dist/components/scenes/SceneCanvas.js.map +1 -0
  119. package/dist/components/scenes/SceneRenderer.d.ts +16 -0
  120. package/dist/components/scenes/SceneRenderer.d.ts.map +1 -0
  121. package/dist/components/scenes/SceneRenderer.js +60 -0
  122. package/dist/components/scenes/SceneRenderer.js.map +1 -0
  123. package/dist/components/scenes/TelemetryScene.d.ts +6 -0
  124. package/dist/components/scenes/TelemetryScene.d.ts.map +1 -0
  125. package/dist/components/scenes/TelemetryScene.js +6 -0
  126. package/dist/components/scenes/TelemetryScene.js.map +1 -0
  127. package/dist/components/svg/CompassRose.d.ts +129 -0
  128. package/dist/components/svg/CompassRose.d.ts.map +1 -0
  129. package/dist/components/svg/CompassRose.js +221 -0
  130. package/dist/components/svg/CompassRose.js.map +1 -0
  131. package/dist/connection/config.d.ts +41 -0
  132. package/dist/connection/config.d.ts.map +1 -0
  133. package/dist/connection/config.js +44 -0
  134. package/dist/connection/config.js.map +1 -0
  135. package/dist/contexts/SceneContext.d.ts +35 -0
  136. package/dist/contexts/SceneContext.d.ts.map +1 -0
  137. package/dist/contexts/SceneContext.js +24 -0
  138. package/dist/contexts/SceneContext.js.map +1 -0
  139. package/dist/hooks/useAutoPathAnimation.d.ts +22 -0
  140. package/dist/hooks/useAutoPathAnimation.d.ts.map +1 -0
  141. package/dist/hooks/useAutoPathAnimation.js +102 -0
  142. package/dist/hooks/useAutoPathAnimation.js.map +1 -0
  143. package/dist/hooks/useLayoutConfig.d.ts +29 -0
  144. package/dist/hooks/useLayoutConfig.d.ts.map +1 -0
  145. package/dist/hooks/useLayoutConfig.js +30 -0
  146. package/dist/hooks/useLayoutConfig.js.map +1 -0
  147. package/dist/hooks/useSceneContext.d.ts +64 -0
  148. package/dist/hooks/useSceneContext.d.ts.map +1 -0
  149. package/dist/hooks/useSceneContext.js +37 -0
  150. package/dist/hooks/useSceneContext.js.map +1 -0
  151. package/dist/index.d.ts +44 -0
  152. package/dist/index.d.ts.map +1 -0
  153. package/dist/index.js +57 -0
  154. package/dist/index.js.map +1 -0
  155. package/dist/providers/TelemetryProvider.d.ts +27 -0
  156. package/dist/providers/TelemetryProvider.d.ts.map +1 -0
  157. package/dist/providers/TelemetryProvider.js +50 -0
  158. package/dist/providers/TelemetryProvider.js.map +1 -0
  159. package/dist/providers/TelemetryThemeProvider.d.ts +25 -0
  160. package/dist/providers/TelemetryThemeProvider.d.ts.map +1 -0
  161. package/dist/providers/TelemetryThemeProvider.js +54 -0
  162. package/dist/providers/TelemetryThemeProvider.js.map +1 -0
  163. package/dist/store/actions/connectionActions.d.ts +39 -0
  164. package/dist/store/actions/connectionActions.d.ts.map +1 -0
  165. package/dist/store/actions/connectionActions.js +162 -0
  166. package/dist/store/actions/connectionActions.js.map +1 -0
  167. package/dist/store/actions/fetchTelemetry.d.ts +51 -0
  168. package/dist/store/actions/fetchTelemetry.d.ts.map +1 -0
  169. package/dist/store/actions/fetchTelemetry.js +135 -0
  170. package/dist/store/actions/fetchTelemetry.js.map +1 -0
  171. package/dist/store/index.d.ts +23 -0
  172. package/dist/store/index.d.ts.map +1 -0
  173. package/dist/store/index.js +22 -0
  174. package/dist/store/index.js.map +1 -0
  175. package/dist/store/slices/connectionSlice.d.ts +15 -0
  176. package/dist/store/slices/connectionSlice.d.ts.map +1 -0
  177. package/dist/store/slices/connectionSlice.js +39 -0
  178. package/dist/store/slices/connectionSlice.js.map +1 -0
  179. package/dist/store/slices/discoveredGridSlice.d.ts +168 -0
  180. package/dist/store/slices/discoveredGridSlice.d.ts.map +1 -0
  181. package/dist/store/slices/discoveredGridSlice.js +146 -0
  182. package/dist/store/slices/discoveredGridSlice.js.map +1 -0
  183. package/dist/store/slices/sceneSlice.d.ts +185 -0
  184. package/dist/store/slices/sceneSlice.d.ts.map +1 -0
  185. package/dist/store/slices/sceneSlice.js +95 -0
  186. package/dist/store/slices/sceneSlice.js.map +1 -0
  187. package/dist/store/slices/simulationSlice.d.ts +87 -0
  188. package/dist/store/slices/simulationSlice.d.ts.map +1 -0
  189. package/dist/store/slices/simulationSlice.js +55 -0
  190. package/dist/store/slices/simulationSlice.js.map +1 -0
  191. package/dist/store/slices/telemetrySlice.d.ts +10 -0
  192. package/dist/store/slices/telemetrySlice.d.ts.map +1 -0
  193. package/dist/store/slices/telemetrySlice.js +88 -0
  194. package/dist/store/slices/telemetrySlice.js.map +1 -0
  195. package/dist/store/slices/videoSlice.d.ts +12 -0
  196. package/dist/store/slices/videoSlice.d.ts.map +1 -0
  197. package/dist/store/slices/videoSlice.js +27 -0
  198. package/dist/store/slices/videoSlice.js.map +1 -0
  199. package/dist/store/slices/visualizationSlice.d.ts +152 -0
  200. package/dist/store/slices/visualizationSlice.d.ts.map +1 -0
  201. package/dist/store/slices/visualizationSlice.js +58 -0
  202. package/dist/store/slices/visualizationSlice.js.map +1 -0
  203. package/dist/store/store.d.ts +61 -0
  204. package/dist/store/store.d.ts.map +1 -0
  205. package/dist/store/store.js +78 -0
  206. package/dist/store/store.js.map +1 -0
  207. package/dist/theme/index.d.ts +14 -0
  208. package/dist/theme/index.d.ts.map +1 -0
  209. package/dist/theme/index.js +14 -0
  210. package/dist/theme/index.js.map +1 -0
  211. package/dist/theme/lightTheme.d.ts +151 -0
  212. package/dist/theme/lightTheme.d.ts.map +1 -0
  213. package/dist/theme/lightTheme.js +194 -0
  214. package/dist/theme/lightTheme.js.map +1 -0
  215. package/dist/theme/telemetryTheme.d.ts +90 -0
  216. package/dist/theme/telemetryTheme.d.ts.map +1 -0
  217. package/dist/theme/telemetryTheme.js +157 -0
  218. package/dist/theme/telemetryTheme.js.map +1 -0
  219. package/dist/types/detectedObjectsTypes.d.ts +18 -0
  220. package/dist/types/detectedObjectsTypes.d.ts.map +1 -0
  221. package/dist/types/detectedObjectsTypes.js +8 -0
  222. package/dist/types/detectedObjectsTypes.js.map +1 -0
  223. package/dist/types/index.d.ts +16 -0
  224. package/dist/types/index.d.ts.map +1 -0
  225. package/dist/types/index.js +16 -0
  226. package/dist/types/index.js.map +1 -0
  227. package/dist/types/ros.d.ts +87 -0
  228. package/dist/types/ros.d.ts.map +1 -0
  229. package/dist/types/ros.js +17 -0
  230. package/dist/types/ros.js.map +1 -0
  231. package/dist/types/statusTypes.d.ts +81 -0
  232. package/dist/types/statusTypes.d.ts.map +1 -0
  233. package/dist/types/statusTypes.js +52 -0
  234. package/dist/types/statusTypes.js.map +1 -0
  235. package/dist/types/taskTypes.d.ts +65 -0
  236. package/dist/types/taskTypes.d.ts.map +1 -0
  237. package/dist/types/taskTypes.js +18 -0
  238. package/dist/types/taskTypes.js.map +1 -0
  239. package/dist/types/telemetryInterfaces.d.ts +81 -0
  240. package/dist/types/telemetryInterfaces.d.ts.map +1 -0
  241. package/dist/types/telemetryInterfaces.js +30 -0
  242. package/dist/types/telemetryInterfaces.js.map +1 -0
  243. package/dist/utils/basestation.d.ts +7 -0
  244. package/dist/utils/basestation.d.ts.map +1 -0
  245. package/dist/utils/basestation.js +49 -0
  246. package/dist/utils/basestation.js.map +1 -0
  247. package/dist/utils/batteryUtil.d.ts +8 -0
  248. package/dist/utils/batteryUtil.d.ts.map +1 -0
  249. package/dist/utils/batteryUtil.js +32 -0
  250. package/dist/utils/batteryUtil.js.map +1 -0
  251. package/dist/utils/telemetry/index.d.ts +13 -0
  252. package/dist/utils/telemetry/index.d.ts.map +1 -0
  253. package/dist/utils/telemetry/index.js +13 -0
  254. package/dist/utils/telemetry/index.js.map +1 -0
  255. package/dist/utils/telemetry/telemetryFactory.d.ts +48 -0
  256. package/dist/utils/telemetry/telemetryFactory.d.ts.map +1 -0
  257. package/dist/utils/telemetry/telemetryFactory.js +390 -0
  258. package/dist/utils/telemetry/telemetryFactory.js.map +1 -0
  259. package/package.json +91 -0
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @file SceneRenderer.tsx
3
+ * @description Thin connected wrapper around `react-isometric-engine`'s `SceneRenderer`.
4
+ * Reads Redux state and the MUI theme, then hands both to the portable, prop-driven engine
5
+ * component as `sceneState` / `colors`. Keeps the same external prop contract as before so
6
+ * `SceneCanvas.tsx` needs no changes.
7
+ */
8
+ import React from 'react';
9
+ import { type SceneRendererProps as IsometricSceneRendererProps } from 'react-isometric-engine';
10
+ export type SceneRendererProps = Pick<IsometricSceneRendererProps, 'width' | 'height' | 'scale' | 'offset' | 'interactionProps' | 'preserveAspectRatio' | 'mappingData' | 'forcesData'>;
11
+ /**
12
+ * Unified isometric SVG engine for mapping and force visualization scenes, connected to Redux
13
+ * and the MUI theme.
14
+ */
15
+ export declare const SceneRenderer: React.FC<SceneRendererProps>;
16
+ //# sourceMappingURL=SceneRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/scenes/SceneRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEH,KAAK,kBAAkB,IAAI,2BAA2B,EACzD,MAAM,wBAAwB,CAAC;AAOhC,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACjC,2BAA2B,EAC3B,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,kBAAkB,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY,CACtH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAiEtD,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * @file SceneRenderer.tsx
4
+ * @description Thin connected wrapper around `react-isometric-engine`'s `SceneRenderer`.
5
+ * Reads Redux state and the MUI theme, then hands both to the portable, prop-driven engine
6
+ * component as `sceneState` / `colors`. Keeps the same external prop contract as before so
7
+ * `SceneCanvas.tsx` needs no changes.
8
+ */
9
+ import React from 'react';
10
+ import { useTheme } from '@mui/material';
11
+ import { SceneRenderer as IsometricSceneRenderer, } from 'react-isometric-engine';
12
+ import { useAppSelector } from '../../store';
13
+ import { selectActiveScene } from '../../store/slices/sceneSlice';
14
+ import { selectDiscoveredCells, selectObstacleOverrides } from '../../store/slices/discoveredGridSlice';
15
+ /**
16
+ * Unified isometric SVG engine for mapping and force visualization scenes, connected to Redux
17
+ * and the MUI theme.
18
+ */
19
+ export const SceneRenderer = (props) => {
20
+ const theme = useTheme();
21
+ const { showGlobalGrid, showGlobalAxes, showLocalAxes, showLocalGrid, showCourseTrail, showFogOfWar, } = useAppSelector((state) => state.visualization);
22
+ const { currentHeading, currentSpeed, fineGrid, } = useAppSelector((state) => state.simulation);
23
+ const { speed: effectiveSpeed, heading: effectiveHeading } = useAppSelector((state) => state.telemetry.asv);
24
+ const occupancyGrid = useAppSelector((state) => state.telemetry.map.occupancyGrid);
25
+ const navigationGrid = useAppSelector((state) => state.telemetry.map.navigationGrid);
26
+ const courseTrail = useAppSelector((state) => state.telemetry.map.courseTrail ?? []);
27
+ const discoveredCells = useAppSelector(selectDiscoveredCells);
28
+ const obstacleOverrides = useAppSelector(selectObstacleOverrides);
29
+ const activeSceneId = useAppSelector(selectActiveScene);
30
+ return (_jsx(IsometricSceneRenderer, { ...props, sceneState: {
31
+ activeSceneId,
32
+ showGlobalGrid,
33
+ showGlobalAxes,
34
+ showLocalAxes,
35
+ showLocalGrid,
36
+ currentHeading,
37
+ currentSpeed,
38
+ effectiveSpeed,
39
+ effectiveHeading,
40
+ fineGrid,
41
+ courseTrail,
42
+ showCourseTrail,
43
+ occupancyGrid,
44
+ navigationGrid,
45
+ discoveredCells,
46
+ obstacleOverrides,
47
+ showFogOfWar,
48
+ }, colors: {
49
+ map: theme.palette.map,
50
+ water: theme.palette.water,
51
+ scene: theme.palette.scene,
52
+ error: theme.palette.error,
53
+ warning: theme.palette.warning,
54
+ success: theme.palette.success,
55
+ info: theme.palette.info,
56
+ common: theme.palette.common,
57
+ textPrimary: theme.palette.text.primary,
58
+ } }));
59
+ };
60
+ //# sourceMappingURL=SceneRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneRenderer.js","sourceRoot":"","sources":["../../../src/components/scenes/SceneRenderer.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACH,aAAa,IAAI,sBAAsB,GAE1C,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CA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f,KAAK,EACT,UAAU,EAAE;YACR,aAAa;YACb,cAAc;YACd,cAAc;YACd,aAAa;YACb,aAAa;YACb,cAAc;YACd,YAAY;YACZ,cAAc;YACd,gBAAgB;YAChB,QAAQ;YACR,WAAW;YACX,eAAe;YACf,aAAa;YACb,cAAc;YACd,eAAe;YACf,iBAAiB;YACjB,YAAY;SACf,EACD,MAAM,EAAE;YACJ,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG;YACtB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;YAC1B,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;YAC1B,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;YAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO;YAC9B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO;YAC9B,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;YACxB,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM;YAC5B,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO;SAC1C,GACH,CACL,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @file TelemetryScene.tsx
3
+ * @description Re-exports the telemetry dashboard as a scene.
4
+ */
5
+ export { default } from '../TelemetryDashboard';
6
+ //# sourceMappingURL=TelemetryScene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TelemetryScene.d.ts","sourceRoot":"","sources":["../../../src/components/scenes/TelemetryScene.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @file TelemetryScene.tsx
3
+ * @description Re-exports the telemetry dashboard as a scene.
4
+ */
5
+ export { default } from '../TelemetryDashboard';
6
+ //# sourceMappingURL=TelemetryScene.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TelemetryScene.js","sourceRoot":"","sources":["../../../src/components/scenes/TelemetryScene.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * @file CompassRose.tsx
3
+ * @description Renders a compass rose and directional grid for the map visualizer.
4
+ *
5
+ * @remarks
6
+ * The {@link CompassRose} component displays a circular compass with a needle that smoothly animates to indicate the current heading.
7
+ * The {@link DirectionalGrid} component renders a ring of clickable arc segments for selecting a compass heading in 45° increments.
8
+ * The {@link InteractiveCompass} component combines both the {@link CompassRose} and {@link DirectionalGrid} into a single interactive control.
9
+ * Supports interactive heading selection and smooth needle animation.
10
+ *
11
+ * @author Carson Fujita
12
+ * @license MIT
13
+ *
14
+ * @example
15
+ * <InteractiveCompass
16
+ * heading={currentHeading}
17
+ * onHeadingChange={(newHeading) => setCurrentHeading(newHeading)}
18
+ * size={160}
19
+ * outerRadius={60}
20
+ * innerRadius={45}
21
+ * hideCardinalLabels={false}
22
+ * />
23
+ *
24
+ */
25
+ import React from 'react';
26
+ /**
27
+ * @interface CompassRoseProps
28
+ * @description Properties for the {@link CompassRose} component.
29
+ * @see {@link CompassRose}
30
+ * @property {number} cx - X-coordinate of the center of the compass rose.
31
+ * @property {number} cy - Y-coordinate of the center of the compass rose.
32
+ * @property {number} radius - Radius of the compass rose circle.
33
+ * @property {number} heading - Current heading in degrees (0° = North, 90° = East).
34
+ * @property {string} [color] - Optional color for the compass needle. Defaults to theme palette info.main.
35
+ * @property {boolean} [hideCardinalLabels] - Whether to hide cardinal direction labels (N, E, S, W). Defaults to true.
36
+ */
37
+ export interface CompassRoseProps {
38
+ cx: number;
39
+ cy: number;
40
+ radius: number;
41
+ heading: number;
42
+ color?: string;
43
+ hideCardinalLabels?: boolean;
44
+ }
45
+ /**
46
+ * @function CompassRose
47
+ * @description Renders an animated compass needle that smoothly tracks heading changes using a spring.
48
+ * @param {CompassRoseProps} props - Properties for the compass rose.
49
+ * @returns {JSX.Element} The rendered compass rose SVG group.
50
+ * @remarks
51
+ * The needle color can be specified via the `color` prop or will default to the theme palette info.main.
52
+ * The needle smoothly animates to the new heading using a spring animation, and the color interpolates based on cardinal directions
53
+ * if no color is provided.
54
+ */
55
+ export declare const CompassRose: React.FC<CompassRoseProps>;
56
+ /**
57
+ * @interface DirectionalGridProps
58
+ * @description Properties for the {@link DirectionalGrid} component.
59
+ * @see {@link DirectionalGrid}
60
+ * @property {number} cx - X-coordinate of the center of the directional grid.
61
+ * @property {number} cy - Y-coordinate of the center of the directional grid.
62
+ * @property {number} radius - Radius of the directional grid ring.
63
+ * @property {number} currentHeading - Current heading in degrees (0° = North, 90° = East).
64
+ * @property {(heading: number) => void} [onSelect] - Optional callback fired when a direction segment is clicked.
65
+ * @property {boolean} [hideCardinalLabels] - Whether to hide cardinal direction labels (N, E, S, W). Defaults to false.
66
+ */
67
+ export interface DirectionalGridProps {
68
+ cx: number;
69
+ cy: number;
70
+ radius: number;
71
+ currentHeading: number;
72
+ onSelect?: (heading: number) => void;
73
+ hideCardinalLabels?: boolean;
74
+ }
75
+ /**
76
+ * @type DirectionButtonsProps
77
+ * @description Alias for {@link DirectionalGridProps} to maintain backward compatibility with the `DirectionButtons` component.
78
+ * @see {@link DirectionalGridProps}
79
+ * @remarks
80
+ * The `DirectionButtons` component is now an alias for `DirectionalGrid`, and both share the same props interface.
81
+ * This allows for consistent usage and easier migration from the older `DirectionButtons` component to the newer `DirectionalGrid`.
82
+ */
83
+ export type DirectionButtonsProps = DirectionalGridProps;
84
+ /**
85
+ * @function DirectionalGrid
86
+ * @description Renders a ring of clickable arc segments for selecting a compass heading in 45° increments.
87
+ * @param {DirectionalGridProps} props - Properties for the directional grid.
88
+ * @returns {JSX.Element} The rendered directional grid SVG group.
89
+ * @remarks
90
+ * Each segment represents a cardinal or intercardinal direction and can be clicked to select a heading.
91
+ * The currently selected heading is highlighted with a glow effect, and the segment color can be customized via the theme palette.
92
+ * The `hideCardinalLabels` prop allows for hiding the N, E, S, W labels if desired.
93
+ */
94
+ export declare const DirectionalGrid: React.FC<DirectionalGridProps>;
95
+ export declare const DirectionButtons: React.FC<DirectionalGridProps>;
96
+ /**
97
+ * @interface InteractiveCompassProps
98
+ * @description Properties for the {@link InteractiveCompass} component.
99
+ * @see {@link InteractiveCompass}
100
+ * @property {number} heading - Current heading in degrees (0° = North, 90° = East).
101
+ * @property {(heading: number) => void} [onHeadingChange] - Optional callback fired when the heading is changed via dragging or clicking.
102
+ * @property {number} [size] - Size of the SVG canvas. Defaults to 160.
103
+ * @property {number} [outerRadius] - Outer radius of the directional grid. Defaults to 60.
104
+ * @property {number} [innerRadius] - Inner radius of the compass rose. Defaults to 45.
105
+ * @property {boolean} [isConnected] - Whether the compass is connected (disables interaction). Defaults to false.
106
+ * @property {boolean} [hideCardinalLabels] - Whether to hide cardinal direction labels (N, E, S, W). Defaults to false.
107
+ */
108
+ export interface InteractiveCompassProps {
109
+ heading: number;
110
+ onHeadingChange?: (heading: number) => void;
111
+ size?: number;
112
+ outerRadius?: number;
113
+ innerRadius?: number;
114
+ isConnected?: boolean;
115
+ hideCardinalLabels?: boolean;
116
+ }
117
+ /**
118
+ * @function InteractiveCompass
119
+ * @description Composites a {@link DirectionalGrid} and a {@link CompassRose} into a drag-to-set heading control.
120
+ * @param {InteractiveCompassProps} props - Properties for the interactive compass.
121
+ * @returns {JSX.Element} The rendered interactive compass SVG.
122
+ * @remarks
123
+ * The {@link InteractiveCompass} component allows users to set a heading by dragging or clicking on the directional grid.
124
+ * It combines the visual representation of the {@link CompassRose} with the interactive functionality of the {@link DirectionalGrid}.
125
+ * The `onHeadingChange` callback is fired whenever the heading is updated, allowing parent components to respond to changes.
126
+ * The component supports customization of size, radii, and visibility of cardinal labels.
127
+ */
128
+ export declare const InteractiveCompass: React.FC<InteractiveCompassProps>;
129
+ //# sourceMappingURL=CompassRose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3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AW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA0EhE,CAAC"}
@@ -0,0 +1,221 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @file CompassRose.tsx
4
+ * @description Renders a compass rose and directional grid for the map visualizer.
5
+ *
6
+ * @remarks
7
+ * The {@link CompassRose} component displays a circular compass with a needle that smoothly animates to indicate the current heading.
8
+ * The {@link DirectionalGrid} component renders a ring of clickable arc segments for selecting a compass heading in 45° increments.
9
+ * The {@link InteractiveCompass} component combines both the {@link CompassRose} and {@link DirectionalGrid} into a single interactive control.
10
+ * Supports interactive heading selection and smooth needle animation.
11
+ *
12
+ * @author Carson Fujita
13
+ * @license MIT
14
+ *
15
+ * @example
16
+ * <InteractiveCompass
17
+ * heading={currentHeading}
18
+ * onHeadingChange={(newHeading) => setCurrentHeading(newHeading)}
19
+ * size={160}
20
+ * outerRadius={60}
21
+ * innerRadius={45}
22
+ * hideCardinalLabels={false}
23
+ * />
24
+ *
25
+ */
26
+ import React from 'react';
27
+ import { useTheme, alpha, Box } from '@mui/material';
28
+ import { useSpring, animated } from '@react-spring/web';
29
+ import { useDrag } from '@use-gesture/react';
30
+ const COMPASS_ROSE_SPRING = { tension: 200, friction: 25 };
31
+ /**
32
+ * @function CompassRose
33
+ * @description Renders an animated compass needle that smoothly tracks heading changes using a spring.
34
+ * @param {CompassRoseProps} props - Properties for the compass rose.
35
+ * @returns {JSX.Element} The rendered compass rose SVG group.
36
+ * @remarks
37
+ * The needle color can be specified via the `color` prop or will default to the theme palette info.main.
38
+ * The needle smoothly animates to the new heading using a spring animation, and the color interpolates based on cardinal directions
39
+ * if no color is provided.
40
+ */
41
+ export const CompassRose = ({ cx, cy, radius, heading, color, hideCardinalLabels = true }) => {
42
+ const theme = useTheme();
43
+ const resolvedColor = color || theme.palette.info.main;
44
+ const compassColors = theme.palette.compass;
45
+ // Track accumulated rotation so the spring always takes the shortest arc
46
+ // (e.g. 350°→10° animates +20°, not −340°).
47
+ const prevHeadingRef = React.useRef(heading);
48
+ const accumulatedRef = React.useRef(heading);
49
+ const [{ rot }, springApi] = useSpring(() => ({ rot: heading, config: COMPASS_ROSE_SPRING }));
50
+ /**
51
+ * @description Updates the accumulated rotation and spring target whenever the heading prop changes.
52
+ * @remarks
53
+ * This effect calculates the shortest rotation delta between the previous heading and the new heading,
54
+ * updates the accumulated rotation, and starts the spring to animate the needle smoothly.
55
+ * The accumulated rotation is stored in a ref to maintain continuity across renders.
56
+ */
57
+ React.useEffect(() => {
58
+ const delta = ((heading - prevHeadingRef.current + 540) % 360) - 180;
59
+ accumulatedRef.current += delta;
60
+ prevHeadingRef.current = heading;
61
+ springApi.start({ rot: accumulatedRef.current });
62
+ }, [heading, springApi]);
63
+ /**
64
+ * @description Animated needle color for the current heading.
65
+ * @remarks
66
+ * If a color prop is provided, it is used directly. Otherwise the rotation value is normalized to
67
+ * 0–360° and mapped through the theme's compass palette, linearly blending between the cardinal and
68
+ * intercardinal colors as the needle rotates. Falls back to the resolved theme color when the palette
69
+ * defines no compass colors.
70
+ */
71
+ const needleColor = React.useMemo(() => {
72
+ if (color)
73
+ return color;
74
+ if (!compassColors)
75
+ return resolvedColor;
76
+ return rot
77
+ .to((v) => ((v % 360) + 360) % 360)
78
+ .to({
79
+ range: [0, 45, 90, 135, 180, 225, 270, 315, 360],
80
+ output: [
81
+ compassColors.north, compassColors.northEast, compassColors.east, compassColors.southEast,
82
+ compassColors.south, compassColors.southWest, compassColors.west, compassColors.northWest,
83
+ compassColors.north,
84
+ ],
85
+ });
86
+ }, [color, compassColors, resolvedColor, rot]);
87
+ return (_jsxs("g", { transform: `translate(${cx}, ${cy})`, children: [_jsx("circle", { cx: "0", cy: "0", r: radius, fill: alpha(theme.palette.common.black, 0.4), stroke: theme.palette.divider, strokeWidth: "2" }), hideCardinalLabels && [
88
+ { deg: 0, label: 'N', cardinalColor: compassColors?.north },
89
+ { deg: 90, label: 'E', cardinalColor: compassColors?.east },
90
+ { deg: 180, label: 'S', cardinalColor: compassColors?.south },
91
+ { deg: 270, label: 'W', cardinalColor: compassColors?.west },
92
+ ].map(({ deg, label, cardinalColor }) => {
93
+ const rad = (-deg + 90) * Math.PI / 180;
94
+ const cx = Math.cos(rad);
95
+ const cy = -Math.sin(rad);
96
+ return (_jsxs("g", { children: [_jsx("line", { x1: cx * (radius - 8), y1: cy * (radius - 8), x2: cx * radius, y2: cy * radius, stroke: theme.palette.text.secondary, strokeWidth: "2" }), hideCardinalLabels && (_jsx("text", { x: cx * (radius - 14), y: cy * (radius - 14) + 4, fill: cardinalColor || resolvedColor, fontSize: "9", fontWeight: "bold", textAnchor: "middle", pointerEvents: "none", children: label }))] }, deg));
97
+ }), [45, 135, 225, 315].map((deg) => {
98
+ const rad = (-deg + 90) * Math.PI / 180;
99
+ return (_jsx("line", { x1: Math.cos(rad) * (radius - 5), y1: -Math.sin(rad) * (radius - 5), x2: Math.cos(rad) * radius, y2: -Math.sin(rad) * radius, stroke: theme.palette.text.disabled, strokeWidth: "1" }, deg));
100
+ }), _jsxs(animated.g, { transform: rot.to((v) => `rotate(${v})`), children: [_jsx(animated.line, { x1: "0", y1: "0", x2: "0", y2: -(radius - 12), stroke: needleColor, strokeWidth: "4", strokeLinecap: "round" }), _jsx(animated.circle, { cx: "0", cy: "0", r: "4", fill: needleColor })] }), _jsx("circle", { cx: "0", cy: "0", r: "3", fill: theme.palette.primary.dark })] }));
101
+ };
102
+ /**
103
+ * @function DirectionalGrid
104
+ * @description Renders a ring of clickable arc segments for selecting a compass heading in 45° increments.
105
+ * @param {DirectionalGridProps} props - Properties for the directional grid.
106
+ * @returns {JSX.Element} The rendered directional grid SVG group.
107
+ * @remarks
108
+ * Each segment represents a cardinal or intercardinal direction and can be clicked to select a heading.
109
+ * The currently selected heading is highlighted with a glow effect, and the segment color can be customized via the theme palette.
110
+ * The `hideCardinalLabels` prop allows for hiding the N, E, S, W labels if desired.
111
+ */
112
+ export const DirectionalGrid = ({ cx, cy, radius, currentHeading, onSelect, hideCardinalLabels = false }) => {
113
+ const theme = useTheme();
114
+ const compass = theme.palette.compass;
115
+ const directions = [
116
+ { label: 'N', heading: 0, angle: 90, color: compass.north || theme.palette.info.main, cardinal: true },
117
+ { label: 'NE', heading: 45, angle: 45, color: compass.northEast || theme.palette.info.main, cardinal: false },
118
+ { label: 'E', heading: 90, angle: 0, color: compass.east || theme.palette.info.main, cardinal: true },
119
+ { label: 'SE', heading: 135, angle: -45, color: compass.southEast || theme.palette.info.main, cardinal: false },
120
+ { label: 'S', heading: 180, angle: -90, color: compass.south || theme.palette.info.main, cardinal: true },
121
+ { label: 'SW', heading: 225, angle: -135, color: compass.southWest || theme.palette.info.main, cardinal: false },
122
+ { label: 'W', heading: 270, angle: 180, color: compass.west || theme.palette.info.main, cardinal: true },
123
+ { label: 'NW', heading: 315, angle: 135, color: compass.northWest || theme.palette.info.main, cardinal: false },
124
+ ];
125
+ const arcWidth = 16;
126
+ const innerRadius = radius - arcWidth / 2;
127
+ const outerRadius = radius + arcWidth / 2;
128
+ const gapAngle = 4;
129
+ const segmentAngle = 45;
130
+ // Snap to nearest 45° segment so the glow follows the needle even when
131
+ // currentHeading is a non-discrete angle set by dragging.
132
+ const activeHeading = (Math.round(currentHeading / 45) * 45) % 360;
133
+ /** Returns an SVG arc path for a single direction segment between inner and outer radii. */
134
+ const createArcPath = (centerAngle, inner, outer) => {
135
+ const halfSpan = segmentAngle / 2 - gapAngle / 2;
136
+ const startRad = ((centerAngle + halfSpan) * Math.PI) / 180;
137
+ const endRad = ((centerAngle - halfSpan) * Math.PI) / 180;
138
+ const outerStart = { x: Math.cos(startRad) * outer, y: -Math.sin(startRad) * outer };
139
+ const outerEnd = { x: Math.cos(endRad) * outer, y: -Math.sin(endRad) * outer };
140
+ const innerStart = { x: Math.cos(startRad) * inner, y: -Math.sin(startRad) * inner };
141
+ const innerEnd = { x: Math.cos(endRad) * inner, y: -Math.sin(endRad) * inner };
142
+ return `M ${outerStart.x} ${outerStart.y} A ${outer} ${outer} 0 0 1 ${outerEnd.x} ${outerEnd.y} L ${innerEnd.x} ${innerEnd.y} A ${inner} ${inner} 0 0 0 ${innerStart.x} ${innerStart.y} Z`;
143
+ };
144
+ return (_jsxs("g", { transform: `translate(${cx}, ${cy})`, children: [_jsx("circle", { cx: "0", cy: "0", r: innerRadius, fill: "none", stroke: alpha(theme.palette.divider, 0.4), strokeWidth: "1" }), [45, 135, 225, 315].map((deg) => {
145
+ const rad = ((-deg + 90) * Math.PI) / 180;
146
+ return (_jsx("line", { x1: Math.cos(rad) * (innerRadius - 6), y1: -Math.sin(rad) * (innerRadius - 6), x2: Math.cos(rad) * (innerRadius - 1), y2: -Math.sin(rad) * (innerRadius - 1), stroke: theme.palette.text.disabled, strokeWidth: "1" }, deg));
147
+ }), directions.map(({ label, heading, angle, color, cardinal }) => {
148
+ const isSelected = activeHeading === heading;
149
+ const midRad = (angle * Math.PI) / 180;
150
+ // All labels sit on the arc midpoint
151
+ const labelR = radius;
152
+ const lx = Math.cos(midRad) * labelR;
153
+ const ly = -Math.sin(midRad) * labelR + 4;
154
+ return (_jsxs("g", { cursor: "pointer", filter: isSelected ? `drop-shadow(0 0 6px ${color})` : undefined, onClick: () => onSelect?.(heading), children: [_jsx("path", { d: createArcPath(angle, innerRadius, outerRadius), fill: isSelected ? color : alpha(theme.palette.background.paper, 0.1), stroke: isSelected ? theme.palette.common.white : alpha(theme.palette.divider, 0.5), strokeWidth: isSelected ? 3 : 2 }), !hideCardinalLabels && (_jsx("text", { x: lx, y: ly, fill: isSelected ? theme.palette.common.white : color, fontSize: cardinal ? '11' : '7', fontWeight: "bold", textAnchor: "middle", pointerEvents: "none", children: label }))] }, label));
155
+ })] }));
156
+ };
157
+ export const DirectionButtons = DirectionalGrid;
158
+ /**
159
+ * @function InteractiveCompass
160
+ * @description Composites a {@link DirectionalGrid} and a {@link CompassRose} into a drag-to-set heading control.
161
+ * @param {InteractiveCompassProps} props - Properties for the interactive compass.
162
+ * @returns {JSX.Element} The rendered interactive compass SVG.
163
+ * @remarks
164
+ * The {@link InteractiveCompass} component allows users to set a heading by dragging or clicking on the directional grid.
165
+ * It combines the visual representation of the {@link CompassRose} with the interactive functionality of the {@link DirectionalGrid}.
166
+ * The `onHeadingChange` callback is fired whenever the heading is updated, allowing parent components to respond to changes.
167
+ * The component supports customization of size, radii, and visibility of cardinal labels.
168
+ */
169
+ export const InteractiveCompass = ({ heading, onHeadingChange, size = 160, outerRadius = 60, innerRadius = 45, isConnected = false, hideCardinalLabels = false, }) => {
170
+ // The SVG reference is used to calculate the center of the compass for drag interactions.
171
+ const svgRef = React.useRef(null);
172
+ const center = size / 2;
173
+ /**
174
+ * @function handleUpdate
175
+ * @description Converts a screen-space pointer position to a compass heading and fires `onHeadingChange`.
176
+ * @param {number} x - The x-coordinate of the pointer in screen space.
177
+ * @param {number} y - The y-coordinate of the pointer in screen space.
178
+ * @remarks
179
+ * This function calculates the angle between the center of the compass and the pointer position using `Math.atan2`.
180
+ * The resulting angle is converted to degrees and adjusted so that 0° corresponds to North.
181
+ * The heading is normalized to a value between 0° and 360° before invoking the `onHeadingChange` callback.
182
+ * If the SVG reference is not available or the compass is connected (disabling interaction), the function will return early without firing the callback.
183
+ */
184
+ const handleUpdate = (x, y) => {
185
+ if (!svgRef.current || isConnected || !onHeadingChange)
186
+ return;
187
+ const rect = svgRef.current.getBoundingClientRect();
188
+ const centerX = rect.left + rect.width / 2;
189
+ const centerY = rect.top + rect.height / 2;
190
+ const h = (Math.atan2(y - centerY, x - centerX) * 180 / Math.PI) + 90;
191
+ onHeadingChange((Math.round(h) + 360) % 360);
192
+ };
193
+ /**
194
+ * @description Sets up a drag gesture on the SVG element to allow users to change the heading by dragging.
195
+ * @remarks
196
+ * The `useDrag` hook from `@use-gesture/react` is used to handle pointer events.
197
+ * The `handleUpdate` function is called with the pointer's screen coordinates whenever a drag event occurs.
198
+ * The `event.stopPropagation()` call prevents the drag event from bubbling up to parent elements,
199
+ * ensuring that only the compass responds to the interaction.
200
+ * The `threshold` option is set to 0 to allow immediate response to pointer movement,
201
+ * and `passive: false` is specified to allow calling `preventDefault()` if needed.
202
+ * If the compass is connected (disabling interaction), dragging will have no effect.
203
+ */
204
+ useDrag(({ xy: [x, y], event }) => {
205
+ if (event)
206
+ event.stopPropagation();
207
+ handleUpdate(x, y);
208
+ }, {
209
+ target: svgRef,
210
+ threshold: 0,
211
+ eventOptions: { passive: false }
212
+ });
213
+ return (_jsxs(Box, { ref: svgRef, component: "svg", width: size, height: size, viewBox: `0 0 ${size} ${size}`, sx: {
214
+ cursor: isConnected ? 'default' : 'crosshair',
215
+ touchAction: 'none',
216
+ display: 'block',
217
+ overflow: 'visible',
218
+ userSelect: 'none'
219
+ }, children: [!hideCardinalLabels && (_jsx(DirectionButtons, { cx: center, cy: center, radius: outerRadius, currentHeading: heading, onSelect: onHeadingChange })), _jsx(CompassRose, { cx: center, cy: center, radius: hideCardinalLabels ? outerRadius : innerRadius, heading: heading, hideCardinalLabels: hideCardinalLabels })] }));
220
+ };
221
+ //# sourceMappingURL=CompassRose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompassRose.js","sourceRoot":"","sources":["../../../src/components/svg/CompassRose.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,MAAM,mBAAmB,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAA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ASV basestation.
4
+ *
5
+ * A published library cannot assume the basestation lives at localhost:8080, so
6
+ * instead of hardcoded constants the connection endpoints are held in a mutable
7
+ * module-level config. Call {@link configureTelemetryConnection} once at app
8
+ * startup (before dispatching `initConnection`) to point the visualizer at the
9
+ * right basestation. Thunks and utilities read the config at call time via
10
+ * {@link getTelemetryConnectionConfig}, so overrides applied before a connection
11
+ * attempt are always honored.
12
+ *
13
+ * @author Carson Fujita
14
+ * @license MIT
15
+ *
16
+ * @example
17
+ * configureTelemetryConnection({
18
+ * httpBase: 'http://192.168.1.50:8080',
19
+ * wsUrl: 'ws://192.168.1.50:8080/telemetry',
20
+ * });
21
+ * store.dispatch(initConnection());
22
+ */
23
+ /** Connection endpoints and timeouts for the ASV basestation. */
24
+ export interface TelemetryConnectionConfig {
25
+ /** Base HTTP URL for the ASV basestation REST endpoints (health check, relative stream URLs). */
26
+ httpBase: string;
27
+ /** WebSocket URL for the ASV basestation telemetry stream. */
28
+ wsUrl: string;
29
+ /** Milliseconds to wait for a WebSocket handshake before falling back to simulation. */
30
+ timeoutMs: number;
31
+ }
32
+ /**
33
+ * Overrides one or more connection settings. Unspecified fields keep their
34
+ * current values.
35
+ */
36
+ export declare function configureTelemetryConnection(overrides: Partial<TelemetryConnectionConfig>): void;
37
+ /** Returns the current connection settings (read at call time by the thunks). */
38
+ export declare function getTelemetryConnectionConfig(): TelemetryConnectionConfig;
39
+ /** Resets the connection settings to the localhost defaults. Primarily for tests. */
40
+ export declare function resetTelemetryConnectionConfig(): void;
41
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/connection/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,iEAAiE;AACjE,MAAM,WAAW,yBAAyB;IACtC,iGAAiG;IACjG,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,SAAS,EAAE,MAAM,CAAC;CACrB;AAUD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,IAAI,CAEhG;AAED,iFAAiF;AACjF,wBAAgB,4BAA4B,IAAI,yBAAyB,CAExE;AAED,qFAAqF;AACrF,wBAAgB,8BAA8B,IAAI,IAAI,CAErD"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @file connection/config.ts
3
+ * @description Runtime-configurable connection settings for the ASV basestation.
4
+ *
5
+ * A published library cannot assume the basestation lives at localhost:8080, so
6
+ * instead of hardcoded constants the connection endpoints are held in a mutable
7
+ * module-level config. Call {@link configureTelemetryConnection} once at app
8
+ * startup (before dispatching `initConnection`) to point the visualizer at the
9
+ * right basestation. Thunks and utilities read the config at call time via
10
+ * {@link getTelemetryConnectionConfig}, so overrides applied before a connection
11
+ * attempt are always honored.
12
+ *
13
+ * @author Carson Fujita
14
+ * @license MIT
15
+ *
16
+ * @example
17
+ * configureTelemetryConnection({
18
+ * httpBase: 'http://192.168.1.50:8080',
19
+ * wsUrl: 'ws://192.168.1.50:8080/telemetry',
20
+ * });
21
+ * store.dispatch(initConnection());
22
+ */
23
+ const DEFAULT_CONFIG = {
24
+ httpBase: 'http://localhost:8080',
25
+ wsUrl: 'ws://localhost:8080/telemetry',
26
+ timeoutMs: 5000,
27
+ };
28
+ let config = { ...DEFAULT_CONFIG };
29
+ /**
30
+ * Overrides one or more connection settings. Unspecified fields keep their
31
+ * current values.
32
+ */
33
+ export function configureTelemetryConnection(overrides) {
34
+ config = { ...config, ...overrides };
35
+ }
36
+ /** Returns the current connection settings (read at call time by the thunks). */
37
+ export function getTelemetryConnectionConfig() {
38
+ return { ...config };
39
+ }
40
+ /** Resets the connection settings to the localhost defaults. Primarily for tests. */
41
+ export function resetTelemetryConnectionConfig() {
42
+ config = { ...DEFAULT_CONFIG };
43
+ }
44
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/connection/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAYH,MAAM,cAAc,GAA8B;IAC9C,QAAQ,EAAE,uBAAuB;IACjC,KAAK,EAAE,+BAA+B;IACtC,SAAS,EAAE,IAAI;CAClB,CAAC;AAEF,IAAI,MAAM,GAA8B,EAAE,GAAG,cAAc,EAAE,CAAC;AAE9D;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,SAA6C;IACtF,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;AACzC,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,4BAA4B;IACxC,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC;AACzB,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,8BAA8B;IAC1C,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,CAAC;AACnC,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @file SceneContext.tsx
3
+ * @description Provider for the scene viewport context. Renamed from MapCanvasContext.tsx.
4
+ */
5
+ import React from 'react';
6
+ import { type SceneContextValue } from '../hooks/useSceneContext';
7
+ /**
8
+ * @interface SceneProviderProps
9
+ * @description Properties for the {@link SceneProvider} component.
10
+ * @see {@link SceneProvider}
11
+ * @property {SceneContextValue} value - The value to be provided to the {@link SceneContext}.
12
+ * @property {React.ReactNode} children - The child components that will have access to the {@link SceneContext}.
13
+ * @remarks
14
+ * This component wraps its children with a {@link SceneContext.Provider}, allowing them to access the scene viewport context values and callbacks. It is typically used at a high level in the component tree to provide context to all components that need it.
15
+ */
16
+ interface SceneProviderProps {
17
+ value: SceneContextValue;
18
+ children: React.ReactNode;
19
+ }
20
+ /**
21
+ * @component SceneProvider
22
+ * @description Provides the {@link SceneContext} to its child components.
23
+ * @param {SceneProviderProps} props - Properties for the component.
24
+ * @returns {JSX.Element} A React element that provides the {@link SceneContext} to its children.
25
+ * @remarks
26
+ * This component should be used at a high level in the component tree to ensure that all child components that need access to the scene viewport context can do so. It takes a {@link SceneContextValue} and makes it available to all descendants via the {@link SceneContext}.
27
+ * @example
28
+ * <SceneProvider value={sceneContextValue}>
29
+ * <ChildComponent />
30
+ * </SceneProvider>
31
+ * @see {@link SceneContext} for the context definition.
32
+ */
33
+ export declare function SceneProvider({ value, children }: SceneProviderProps): React.JSX.Element;
34
+ export {};
35
+ //# sourceMappingURL=SceneContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneContext.d.ts","sourceRoot":"","sources":["../../src/contexts/SceneContext.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAEhF;;;;;;;;GAQG;AACH,UAAU,kBAAkB;IACxB,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,qBAEpE"}