@zendir/ui 0.4.1 → 0.6.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.
- package/CHANGELOG.md +34 -0
- package/README.md +640 -631
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/index.js +17 -221
- package/dist/react/3d/CesiumCaptureSource.d.ts +0 -1
- package/dist/react/3d/CesiumCaptureSource.js +364 -283
- package/dist/react/3d/CesiumCaptureSource.js.map +1 -1
- package/dist/react/3d/ZenSpace3D.d.ts +2 -3
- package/dist/react/3d/ZenSpace3D.js +1681 -1237
- package/dist/react/3d/ZenSpace3D.js.map +1 -1
- package/dist/react/3d/ZenSpace3DCesium.d.ts +0 -1
- package/dist/react/3d/ZenSpace3DCesium.js +513 -560
- package/dist/react/3d/ZenSpace3DCesium.js.map +1 -1
- package/dist/react/3d/ZenSpace3DShaders.js +61 -66
- package/dist/react/3d/ZenSpace3DShaders.js.map +1 -1
- package/dist/react/3d/ZenSpace3DTypes.d.ts +19 -20
- package/dist/react/3d/ZenSpace3DUtils.d.ts +0 -1
- package/dist/react/3d/ZenSpace3DUtils.js +37 -24
- package/dist/react/3d/ZenSpace3DUtils.js.map +1 -1
- package/dist/react/3d/capturePngAnalysis.js +42 -36
- package/dist/react/3d/capturePngAnalysis.js.map +1 -1
- package/dist/react/3d/index.d.ts +3 -3
- package/dist/react/3d/index.js +5 -53
- package/dist/react/3d/threeLoader.d.ts +1 -1
- package/dist/react/3d/threeLoader.js +23 -18
- package/dist/react/3d/threeLoader.js.map +1 -1
- package/dist/react/astro/ClassificationBanner.d.ts +2 -3
- package/dist/react/astro/ClassificationBanner.js +95 -79
- package/dist/react/astro/ClassificationBanner.js.map +1 -1
- package/dist/react/astro/GlobalStatusBar.d.ts +0 -1
- package/dist/react/astro/GlobalStatusBar.js +157 -163
- package/dist/react/astro/GlobalStatusBar.js.map +1 -1
- package/dist/react/astro/MissionClock.d.ts +7 -8
- package/dist/react/astro/MissionClock.js +377 -400
- package/dist/react/astro/MissionClock.js.map +1 -1
- package/dist/react/astro/MonitoringIcon.d.ts +1 -2
- package/dist/react/astro/MonitoringIcon.js +422 -358
- package/dist/react/astro/MonitoringIcon.js.map +1 -1
- package/dist/react/astro/Notification.d.ts +1 -2
- package/dist/react/astro/Notification.js +229 -126
- package/dist/react/astro/Notification.js.map +1 -1
- package/dist/react/astro/Progress.d.ts +0 -1
- package/dist/react/astro/Progress.js +199 -141
- package/dist/react/astro/Progress.js.map +1 -1
- package/dist/react/astro/SimulationControls.d.ts +3 -4
- package/dist/react/astro/SimulationControls.js +596 -650
- package/dist/react/astro/SimulationControls.js.map +1 -1
- package/dist/react/astro/StatusIndicator.d.ts +0 -1
- package/dist/react/astro/StatusIndicator.js +236 -170
- package/dist/react/astro/StatusIndicator.js.map +1 -1
- package/dist/react/astro/UnifiedTimeline.d.ts +9 -10
- package/dist/react/astro/UnifiedTimeline.js +2345 -2392
- package/dist/react/astro/UnifiedTimeline.js.map +1 -1
- package/dist/react/astro/index.d.ts +5 -5
- package/dist/react/astro/index.js +1 -25
- package/dist/react/cards/AccessCard.d.ts +0 -1
- package/dist/react/cards/AccessCard.js +471 -405
- package/dist/react/cards/AccessCard.js.map +1 -1
- package/dist/react/cards/OrbitCard.d.ts +0 -1
- package/dist/react/cards/OrbitCard.js +487 -364
- package/dist/react/cards/OrbitCard.js.map +1 -1
- package/dist/react/cards/SpacecraftCard.d.ts +0 -1
- package/dist/react/cards/SpacecraftCard.js +813 -925
- package/dist/react/cards/SpacecraftCard.js.map +1 -1
- package/dist/react/cards/TelemetryCard.d.ts +0 -1
- package/dist/react/cards/TelemetryCard.js +1055 -732
- package/dist/react/cards/TelemetryCard.js.map +1 -1
- package/dist/react/cards/TelemetryStreamCard.d.ts +0 -1
- package/dist/react/cards/TelemetryStreamCard.js +323 -297
- package/dist/react/cards/TelemetryStreamCard.js.map +1 -1
- package/dist/react/cards/index.d.ts +1 -1
- package/dist/react/cards/index.js +1 -8
- package/dist/react/charts/GroundTrackMap.d.ts +6 -7
- package/dist/react/charts/GroundTrackMap.js +1377 -1256
- package/dist/react/charts/GroundTrackMap.js.map +1 -1
- package/dist/react/charts/GroundTrackMapLeaflet.d.ts +1 -2
- package/dist/react/charts/GroundTrackMapLeaflet.js +1065 -987
- package/dist/react/charts/GroundTrackMapLeaflet.js.map +1 -1
- package/dist/react/charts/groundTrackMapLeafletTiles.js +34 -25
- package/dist/react/charts/groundTrackMapLeafletTiles.js.map +1 -1
- package/dist/react/charts/groundTrackMapLeafletUtils.js +70 -61
- package/dist/react/charts/groundTrackMapLeafletUtils.js.map +1 -1
- package/dist/react/charts/index.d.ts +1 -1
- package/dist/react/charts/index.js +7 -100
- package/dist/react/charts/unified/AstroChart.d.ts +1 -2
- package/dist/react/charts/unified/AstroChart.js +1331 -1411
- package/dist/react/charts/unified/AstroChart.js.map +1 -1
- package/dist/react/charts/unified/PowerOverviewChart.d.ts +3 -3
- package/dist/react/charts/unified/PowerOverviewChart.js +495 -478
- package/dist/react/charts/unified/PowerOverviewChart.js.map +1 -1
- package/dist/react/charts/unified/domain.d.ts +12 -13
- package/dist/react/charts/unified/domain.js +3999 -3145
- package/dist/react/charts/unified/domain.js.map +1 -1
- package/dist/react/charts/unified/generators.d.ts +3 -4
- package/dist/react/charts/unified/generators.js +561 -498
- package/dist/react/charts/unified/generators.js.map +1 -1
- package/dist/react/charts/unified/index.d.ts +1 -1
- package/dist/react/charts/unified/presets.d.ts +14 -15
- package/dist/react/charts/unified/presets.js +857 -994
- package/dist/react/charts/unified/presets.js.map +1 -1
- package/dist/react/charts/unified/sync.d.ts +2 -3
- package/dist/react/charts/unified/sync.js +229 -195
- package/dist/react/charts/unified/sync.js.map +1 -1
- package/dist/react/charts/unified/theme.d.ts +11 -12
- package/dist/react/charts/unified/theme.js +606 -642
- package/dist/react/charts/unified/theme.js.map +1 -1
- package/dist/react/charts/unified/types.d.ts +32 -33
- package/dist/react/charts/unified/useChartStream.d.ts +1 -2
- package/dist/react/charts/unified/useChartStream.js +203 -216
- package/dist/react/charts/unified/useChartStream.js.map +1 -1
- package/dist/react/chatgpt/AppCard.d.ts +1 -2
- package/dist/react/chatgpt/index.d.ts +7 -7
- package/dist/react/chatgpt/index.js +160 -139
- package/dist/react/chatgpt/index.js.map +1 -1
- package/dist/react/context/CategoryContext.d.ts +0 -1
- package/dist/react/context/CategoryContext.js +78 -29
- package/dist/react/context/CategoryContext.js.map +1 -1
- package/dist/react/context/DisplaySettingsContext.d.ts +1 -2
- package/dist/react/context/DisplaySettingsContext.js +205 -156
- package/dist/react/context/DisplaySettingsContext.js.map +1 -1
- package/dist/react/context/SpatialSelectionContext.d.ts +0 -1
- package/dist/react/context/SpatialSelectionContext.js +36 -7
- package/dist/react/context/SpatialSelectionContext.js.map +1 -1
- package/dist/react/core/data/DataTable.d.ts +3 -4
- package/dist/react/core/data/DataTable.js +473 -440
- package/dist/react/core/data/DataTable.js.map +1 -1
- package/dist/react/core/data/DataValue.d.ts +4 -5
- package/dist/react/core/data/DataValue.js +605 -538
- package/dist/react/core/data/DataValue.js.map +1 -1
- package/dist/react/core/data/propertyConfig.d.ts +1 -2
- package/dist/react/core/data/propertyConfig.js +446 -382
- package/dist/react/core/data/propertyConfig.js.map +1 -1
- package/dist/react/core/display/AstroIcon.d.ts +4 -5
- package/dist/react/core/display/AstroIcon.js +339 -429
- package/dist/react/core/display/AstroIcon.js.map +1 -1
- package/dist/react/core/display/Badge.d.ts +2 -3
- package/dist/react/core/display/Badge.js +131 -131
- package/dist/react/core/display/Badge.js.map +1 -1
- package/dist/react/core/display/CardHeader.d.ts +0 -1
- package/dist/react/core/display/CardHeader.js +398 -311
- package/dist/react/core/display/CardHeader.js.map +1 -1
- package/dist/react/core/display/Container.d.ts +2 -3
- package/dist/react/core/display/Container.js +640 -668
- package/dist/react/core/display/Container.js.map +1 -1
- package/dist/react/core/display/CopyButton.d.ts +1 -2
- package/dist/react/core/display/CopyButton.js +158 -101
- package/dist/react/core/display/CopyButton.js.map +1 -1
- package/dist/react/core/display/GlassCard.d.ts +3 -4
- package/dist/react/core/display/GlassCard.js +416 -369
- package/dist/react/core/display/GlassCard.js.map +1 -1
- package/dist/react/core/display/HeaderIconWithStatus.d.ts +0 -1
- package/dist/react/core/display/HeaderIconWithStatus.js +152 -152
- package/dist/react/core/display/HeaderIconWithStatus.js.map +1 -1
- package/dist/react/core/display/Icon.d.ts +2 -3
- package/dist/react/core/display/Icon.js +172 -143
- package/dist/react/core/display/Icon.js.map +1 -1
- package/dist/react/core/display/Typography.d.ts +24 -25
- package/dist/react/core/display/Typography.js +360 -178
- package/dist/react/core/display/Typography.js.map +1 -1
- package/dist/react/core/feedback/ConfirmDialog.d.ts +1 -2
- package/dist/react/core/feedback/ConfirmDialog.js +343 -304
- package/dist/react/core/feedback/ConfirmDialog.js.map +1 -1
- package/dist/react/core/feedback/Dialog.d.ts +2 -3
- package/dist/react/core/feedback/Dialog.js +189 -197
- package/dist/react/core/feedback/Dialog.js.map +1 -1
- package/dist/react/core/feedback/Toast.d.ts +2 -3
- package/dist/react/core/feedback/Toast.js +346 -207
- package/dist/react/core/feedback/Toast.js.map +1 -1
- package/dist/react/core/index.d.ts +26 -26
- package/dist/react/core/index.js +7 -119
- package/dist/react/core/inputs/Button.d.ts +2 -3
- package/dist/react/core/inputs/Button.js +281 -304
- package/dist/react/core/inputs/Button.js.map +1 -1
- package/dist/react/core/inputs/Checkbox.d.ts +2 -3
- package/dist/react/core/inputs/Checkbox.js +139 -127
- package/dist/react/core/inputs/Checkbox.js.map +1 -1
- package/dist/react/core/inputs/Input.d.ts +3 -4
- package/dist/react/core/inputs/Input.js +277 -285
- package/dist/react/core/inputs/Input.js.map +1 -1
- package/dist/react/core/inputs/LimitsBar.d.ts +1 -2
- package/dist/react/core/inputs/LimitsBar.js +271 -196
- package/dist/react/core/inputs/LimitsBar.js.map +1 -1
- package/dist/react/core/inputs/NumberInput.d.ts +2 -3
- package/dist/react/core/inputs/NumberInput.js +531 -503
- package/dist/react/core/inputs/NumberInput.js.map +1 -1
- package/dist/react/core/inputs/PinInput.d.ts +2 -3
- package/dist/react/core/inputs/PinInput.js +224 -207
- package/dist/react/core/inputs/PinInput.js.map +1 -1
- package/dist/react/core/inputs/Select.d.ts +1 -2
- package/dist/react/core/inputs/Select.js +298 -299
- package/dist/react/core/inputs/Select.js.map +1 -1
- package/dist/react/core/inputs/Toggle.d.ts +2 -3
- package/dist/react/core/inputs/Toggle.js +142 -148
- package/dist/react/core/inputs/Toggle.js.map +1 -1
- package/dist/react/core/layout/Box.d.ts +3 -4
- package/dist/react/core/layout/Box.js +118 -122
- package/dist/react/core/layout/Box.js.map +1 -1
- package/dist/react/core/layout/Center.d.ts +0 -1
- package/dist/react/core/layout/Center.js +45 -32
- package/dist/react/core/layout/Center.js.map +1 -1
- package/dist/react/core/layout/Divider.d.ts +1 -2
- package/dist/react/core/layout/Divider.js +112 -106
- package/dist/react/core/layout/Divider.js.map +1 -1
- package/dist/react/core/layout/Flex.d.ts +4 -5
- package/dist/react/core/layout/Flex.js +120 -124
- package/dist/react/core/layout/Flex.js.map +1 -1
- package/dist/react/core/layout/Grid.d.ts +5 -6
- package/dist/react/core/layout/Grid.js +131 -138
- package/dist/react/core/layout/Grid.js.map +1 -1
- package/dist/react/core/layout/Spacer.d.ts +0 -1
- package/dist/react/core/layout/Spacer.js +36 -29
- package/dist/react/core/layout/Spacer.js.map +1 -1
- package/dist/react/core/layout/Stack.d.ts +4 -5
- package/dist/react/core/layout/Stack.js +127 -70
- package/dist/react/core/layout/Stack.js.map +1 -1
- package/dist/react/core/layout/responsive.d.ts +1 -2
- package/dist/react/core/layout/responsive.js +25 -19
- package/dist/react/core/layout/responsive.js.map +1 -1
- package/dist/react/core/layout/useBreakpoint.d.ts +1 -1
- package/dist/react/core/layout/useBreakpoint.js +119 -66
- package/dist/react/core/layout/useBreakpoint.js.map +1 -1
- package/dist/react/core/navigation/AppBar.d.ts +1 -2
- package/dist/react/core/navigation/AppBar.js +827 -805
- package/dist/react/core/navigation/AppBar.js.map +1 -1
- package/dist/react/core/navigation/Pagination.d.ts +2 -3
- package/dist/react/core/navigation/Pagination.js +207 -187
- package/dist/react/core/navigation/Pagination.js.map +1 -1
- package/dist/react/core/navigation/SideNav.d.ts +11 -5
- package/dist/react/core/navigation/SideNav.js +857 -602
- package/dist/react/core/navigation/SideNav.js.map +1 -1
- package/dist/react/core/navigation/Tabs.d.ts +0 -1
- package/dist/react/core/navigation/Tabs.js +113 -119
- package/dist/react/core/navigation/Tabs.js.map +1 -1
- package/dist/react/core/overlays/Popover.d.ts +2 -3
- package/dist/react/core/overlays/Popover.js +303 -282
- package/dist/react/core/overlays/Popover.js.map +1 -1
- package/dist/react/core/overlays/SidePanel.d.ts +1 -2
- package/dist/react/core/overlays/SidePanel.js +217 -212
- package/dist/react/core/overlays/SidePanel.js.map +1 -1
- package/dist/react/core/overlays/Tooltip.d.ts +1 -2
- package/dist/react/core/overlays/Tooltip.js +170 -176
- package/dist/react/core/overlays/Tooltip.js.map +1 -1
- package/dist/react/core/widgets/ActivityPlanner.d.ts +0 -1
- package/dist/react/core/widgets/ActivityPlanner.js +855 -517
- package/dist/react/core/widgets/ActivityPlanner.js.map +1 -1
- package/dist/react/core/widgets/Capture.d.ts +2 -3
- package/dist/react/core/widgets/Capture.js +965 -779
- package/dist/react/core/widgets/Capture.js.map +1 -1
- package/dist/react/core/widgets/ChatPanel.d.ts +16 -17
- package/dist/react/core/widgets/ChatPanel.js +1734 -1034
- package/dist/react/core/widgets/ChatPanel.js.map +1 -1
- package/dist/react/core/widgets/ColorPickerPanel.d.ts +0 -1
- package/dist/react/core/widgets/ColorPickerPanel.js +298 -287
- package/dist/react/core/widgets/ColorPickerPanel.js.map +1 -1
- package/dist/react/core/widgets/CommandBuilder.d.ts +2 -3
- package/dist/react/core/widgets/CommandBuilder.js +624 -516
- package/dist/react/core/widgets/CommandBuilder.js.map +1 -1
- package/dist/react/core/widgets/ConnectionForm.d.ts +2 -3
- package/dist/react/core/widgets/ConnectionForm.js +528 -492
- package/dist/react/core/widgets/ConnectionForm.js.map +1 -1
- package/dist/react/core/widgets/FileExplorer.d.ts +3 -4
- package/dist/react/core/widgets/FileExplorer.js +617 -505
- package/dist/react/core/widgets/FileExplorer.js.map +1 -1
- package/dist/react/core/widgets/HexViewer.d.ts +2 -3
- package/dist/react/core/widgets/HexViewer.js +1353 -1091
- package/dist/react/core/widgets/HexViewer.js.map +1 -1
- package/dist/react/core/widgets/ImageFrame.d.ts +1 -2
- package/dist/react/core/widgets/ImageFrame.js +230 -193
- package/dist/react/core/widgets/ImageFrame.js.map +1 -1
- package/dist/react/core/widgets/ImageGallery.d.ts +2 -1
- package/dist/react/core/widgets/ImageGallery.js +380 -314
- package/dist/react/core/widgets/ImageGallery.js.map +1 -1
- package/dist/react/core/widgets/ImagePanel.d.ts +0 -1
- package/dist/react/core/widgets/ImagePanel.js +110 -101
- package/dist/react/core/widgets/ImagePanel.js.map +1 -1
- package/dist/react/core/widgets/LogViewer.d.ts +2 -3
- package/dist/react/core/widgets/LogViewer.js +711 -607
- package/dist/react/core/widgets/LogViewer.js.map +1 -1
- package/dist/react/core/widgets/MessageStream.d.ts +3 -4
- package/dist/react/core/widgets/MessageStream.js +514 -444
- package/dist/react/core/widgets/MessageStream.js.map +1 -1
- package/dist/react/core/widgets/MissionCalendar.d.ts +3 -4
- package/dist/react/core/widgets/MissionCalendar.js +1488 -1020
- package/dist/react/core/widgets/MissionCalendar.js.map +1 -1
- package/dist/react/core/widgets/PacketViewer.d.ts +2 -3
- package/dist/react/core/widgets/PacketViewer.js +550 -421
- package/dist/react/core/widgets/PacketViewer.js.map +1 -1
- package/dist/react/core/widgets/capture-placeholder.png.js +6 -5
- package/dist/react/core/widgets/capture-placeholder.png.js.map +1 -1
- package/dist/react/hooks/index.d.ts +5 -5
- package/dist/react/hooks/useAccessWindows.d.ts +0 -1
- package/dist/react/hooks/useCompactMode.d.ts +1 -1
- package/dist/react/hooks/useCompactMode.js +104 -58
- package/dist/react/hooks/useCompactMode.js.map +1 -1
- package/dist/react/hooks/useGroundTrackHistory.d.ts +0 -1
- package/dist/react/hooks/useSimulationScene.d.ts +1 -2
- package/dist/react/hooks/useSimulationScene.js +481 -374
- package/dist/react/hooks/useSimulationScene.js.map +1 -1
- package/dist/react/index.d.ts +3 -3
- package/dist/react/panels/LayerControlPanel.d.ts +1 -2
- package/dist/react/panels/LayerControlPanel.js +223 -180
- package/dist/react/panels/LayerControlPanel.js.map +1 -1
- package/dist/react/panels/ObjectInventoryPanel.d.ts +2 -3
- package/dist/react/panels/ObjectInventoryPanel.js +315 -250
- package/dist/react/panels/ObjectInventoryPanel.js.map +1 -1
- package/dist/react/panels/index.d.ts +1 -1
- package/dist/react/panels/index.js +1 -6
- package/dist/react/shared/ErrorBoundary.d.ts +1 -2
- package/dist/react/shared/ErrorBoundary.js +170 -139
- package/dist/react/shared/ErrorBoundary.js.map +1 -1
- package/dist/react/shared/Skeleton.d.ts +1 -2
- package/dist/react/shared/Skeleton.js +300 -301
- package/dist/react/shared/Skeleton.js.map +1 -1
- package/dist/react/theme/ThemeProvider.d.ts +2 -321
- package/dist/react/theme/ThemeProvider.js +312 -939
- package/dist/react/theme/ThemeProvider.js.map +1 -1
- package/dist/react/theme/cardAccent.d.ts +1 -2
- package/dist/react/theme/cardAccent.js +196 -126
- package/dist/react/theme/cardAccent.js.map +1 -1
- package/dist/react/theme/config.d.ts +0 -1
- package/dist/react/theme/config.js +47 -25
- package/dist/react/theme/config.js.map +1 -1
- package/dist/react/theme/index.d.ts +2 -2
- package/dist/react/theme/index.js +1 -16
- package/dist/react/theme/types.d.ts +332 -0
- package/dist/react/theme/types.js +39 -0
- package/dist/react/theme/types.js.map +1 -0
- package/dist/react/types.d.ts +8 -8
- package/dist/react/types.js +147 -47
- package/dist/react/types.js.map +1 -1
- package/dist/react/utils/categoryPalette.d.ts +0 -1
- package/dist/react/utils/categoryPalette.js +91 -102
- package/dist/react/utils/categoryPalette.js.map +1 -1
- package/dist/react/utils/index.d.ts +5 -5
- package/dist/react/utils/index.js +457 -371
- package/dist/react/utils/index.js.map +1 -1
- package/dist/react/visualizations/EclipseTimerCard.d.ts +0 -1
- package/dist/react/visualizations/LinkBudgetCard.d.ts +0 -1
- package/dist/react/visualizations/NavBallCard.d.ts +0 -1
- package/dist/react/visualizations/PropulsionCard.d.ts +1 -2
- package/dist/react/visualizations/SensorFootprintCard.d.ts +1 -2
- package/dist/react/visualizations/ThermalHeatmapCard.d.ts +0 -1
- package/dist/react/visualizations/index.d.ts +3 -3
- package/dist/react.d.ts +2 -1
- package/dist/react.js +17 -221
- package/dist/shaders/atmosphere.frag.js +6 -5
- package/dist/shaders/atmosphere.frag.js.map +1 -1
- package/dist/shaders/atmosphere.vert.js +6 -5
- package/dist/shaders/atmosphere.vert.js.map +1 -1
- package/dist/shaders/stars.frag.js +6 -5
- package/dist/shaders/stars.frag.js.map +1 -1
- package/dist/shaders/stars.vert.js +6 -5
- package/dist/shaders/stars.vert.js.map +1 -1
- package/dist/style.css +217 -194
- package/dist/tokens/core.d.ts +159 -0
- package/dist/tokens/core.js +144 -0
- package/dist/tokens/core.js.map +1 -0
- package/dist/tokens/css-vars.d.ts +213 -2
- package/dist/tokens/css-vars.js +590 -227
- package/dist/tokens/css-vars.js.map +1 -1
- package/dist/tokens/index.d.ts +31 -228
- package/dist/tokens/index.js +281 -366
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/palettes/astro.d.ts +129 -0
- package/dist/tokens/palettes/astro.js +112 -0
- package/dist/tokens/palettes/astro.js.map +1 -0
- package/dist/tokens/palettes/index.d.ts +288 -0
- package/dist/tokens/palettes/index.js +35 -0
- package/dist/tokens/palettes/index.js.map +1 -0
- package/dist/tokens/palettes/tailwind.d.ts +324 -0
- package/dist/tokens/palettes/tailwind.js +201 -0
- package/dist/tokens/palettes/tailwind.js.map +1 -0
- package/dist/tokens/palettes/zendir.d.ts +126 -0
- package/dist/tokens/palettes/zendir.js +92 -0
- package/dist/tokens/palettes/zendir.js.map +1 -0
- package/dist/tokens/themes.d.ts +30 -0
- package/dist/tokens/themes.js +704 -0
- package/dist/tokens/themes.js.map +1 -0
- package/dist/tokens/tokens.css +419 -41
- package/dist/types/index.d.ts +2 -2
- package/package.json +310 -313
- package/dist/index.js.map +0 -1
- package/dist/react/3d/index.js.map +0 -1
- package/dist/react/astro/index.js.map +0 -1
- package/dist/react/cards/index.js.map +0 -1
- package/dist/react/charts/index.js.map +0 -1
- package/dist/react/core/index.js.map +0 -1
- package/dist/react/panels/index.js.map +0 -1
- package/dist/react/theme/astro-tokens.d.ts +0 -153
- package/dist/react/theme/index.js.map +0 -1
- package/dist/react.js.map +0 -1
|
@@ -1,579 +1,532 @@
|
|
|
1
|
+
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from "react";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
//#region src/react/3d/ZenSpace3DCesium.tsx
|
|
4
|
+
/**
|
|
5
|
+
* @zendir/ui - ZenSpace3D Cesium Backend
|
|
6
|
+
*
|
|
7
|
+
* Cesium-based 3D Earth/orbit view. Entities are reconciled **in-place** on
|
|
8
|
+
* each data update (position changes only) to avoid the WebGL context churn
|
|
9
|
+
* that occurs when entities are removed and re-added every polling tick.
|
|
10
|
+
*
|
|
11
|
+
* Layer visibility is controlled via the `layers` prop
|
|
12
|
+
* (all default to "sensible" if the key is absent):
|
|
13
|
+
*
|
|
14
|
+
* layers.labels — spacecraft / GS name labels (default: false)
|
|
15
|
+
* layers.coverage — coverage footprint ellipses + cones (default: false)
|
|
16
|
+
* layers.orbits — orbit-path polylines (default: true)
|
|
17
|
+
*
|
|
18
|
+
* Coverage geometry sources (checked in order per satellite):
|
|
19
|
+
* 1. Explicit `satelliteCoverages[].footprintPolygon` — ground polygon from SDK
|
|
20
|
+
* 2. Explicit `satelliteCoverages[].halfAngle` — circular cone from half-angle
|
|
21
|
+
* 3. Auto-computed circular ellipse from altitude (when layers.coverage = true)
|
|
22
|
+
*
|
|
23
|
+
* Additional explicit coverage options per `SatelliteCoverage`:
|
|
24
|
+
* showCone — 3-D sensor cone from satellite to footprint
|
|
25
|
+
* showNadirLine — dashed line from satellite to sub-satellite point
|
|
26
|
+
*/
|
|
27
|
+
var EARTH_RADIUS_KM = 6371;
|
|
28
|
+
/**
|
|
29
|
+
* Convert an ECI / J2000 position (km, Earth-centred) into a Cesium
|
|
30
|
+
* `Cartesian3`. Cesium's Cartesian3 lives in the **ECEF (Earth-Fixed)**
|
|
31
|
+
* frame — the same frame Cesium for Unreal exposes when its
|
|
32
|
+
* `CesiumGeoreference` origin is set to `TrueOrigin (0,0,0)`. We rotate
|
|
33
|
+
* ECI → ECEF using `Transforms.computeTemeToPseudoFixedMatrix(jd)`,
|
|
34
|
+
* which is GMST-based and accurate to sub-arcsec for visualisation
|
|
35
|
+
* (no IERS data required, fully synchronous).
|
|
36
|
+
*
|
|
37
|
+
* Returns `null` for non-finite inputs so callers can skip stale ticks
|
|
38
|
+
* without crashing Cesium's Cartesian primitives.
|
|
39
|
+
*
|
|
40
|
+
* @param positionKm ECI position in km (Earth-centred).
|
|
41
|
+
* @param julianDate Cesium JulianDate at which to evaluate Earth's rotation.
|
|
42
|
+
* Caller is responsible for advancing this with sim time.
|
|
43
|
+
*/
|
|
4
44
|
function eciKmToFixedCartesian3(Cesium, positionKm, julianDate) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
positionKm.y * 1e3,
|
|
11
|
-
positionKm.z * 1e3
|
|
12
|
-
);
|
|
13
|
-
const rot = Cesium.Transforms.computeTemeToPseudoFixedMatrix(julianDate);
|
|
14
|
-
if (!rot) {
|
|
15
|
-
return eciM;
|
|
16
|
-
}
|
|
17
|
-
return Cesium.Matrix3.multiplyByVector(rot, eciM, new Cesium.Cartesian3());
|
|
45
|
+
if (!positionKm || !Number.isFinite(positionKm.x) || !Number.isFinite(positionKm.y) || !Number.isFinite(positionKm.z)) return null;
|
|
46
|
+
const eciM = new Cesium.Cartesian3(positionKm.x * 1e3, positionKm.y * 1e3, positionKm.z * 1e3);
|
|
47
|
+
const rot = Cesium.Transforms.computeTemeToPseudoFixedMatrix(julianDate);
|
|
48
|
+
if (!rot) return eciM;
|
|
49
|
+
return Cesium.Matrix3.multiplyByVector(rot, eciM, new Cesium.Cartesian3());
|
|
18
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Sub-satellite (lat/lon) point + altitude (km) of an ECI position at a
|
|
53
|
+
* given epoch. Used by coverage/cone code that needs to draw on Earth's
|
|
54
|
+
* surface beneath the satellite.
|
|
55
|
+
*/
|
|
19
56
|
function eciKmToSubSatellite(Cesium, positionKm, julianDate) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
57
|
+
const fixed = eciKmToFixedCartesian3(Cesium, positionKm, julianDate);
|
|
58
|
+
if (!fixed) return null;
|
|
59
|
+
const carto = Cesium.Cartographic.fromCartesian(fixed);
|
|
60
|
+
if (!carto || !Number.isFinite(carto.height)) return null;
|
|
61
|
+
return {
|
|
62
|
+
latitude: Cesium.Math.toDegrees(carto.latitude),
|
|
63
|
+
longitude: Cesium.Math.toDegrees(carto.longitude),
|
|
64
|
+
altitude: carto.height / 1e3
|
|
65
|
+
};
|
|
30
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Circular coverage footprint radius (m) on Earth surface.
|
|
69
|
+
*
|
|
70
|
+
* Spherical geometry:
|
|
71
|
+
* α = arcsin(R·cos(ε) / (R+h)) — nadir angle
|
|
72
|
+
* λ = π/2 − ε − α — Earth central angle
|
|
73
|
+
* radius = R · λ — arc length on surface
|
|
74
|
+
*/
|
|
31
75
|
function autoFootprintRadiusM(altitudeKm, minElevDeg) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
76
|
+
if (altitudeKm <= 0) return 0;
|
|
77
|
+
const R = EARTH_RADIUS_KM;
|
|
78
|
+
const eps = minElevDeg * Math.PI / 180;
|
|
79
|
+
const sinAlpha = R * Math.cos(eps) / (R + altitudeKm);
|
|
80
|
+
if (sinAlpha >= 1) return 0;
|
|
81
|
+
const alpha = Math.asin(sinAlpha);
|
|
82
|
+
const lambda = Math.PI / 2 - eps - alpha;
|
|
83
|
+
return R * 1e3 * lambda;
|
|
40
84
|
}
|
|
85
|
+
/** Radius (m) of the footprint circle for a sensor with the given half-angle. */
|
|
41
86
|
function halfAngleFootprintRadiusM(altitudeKm, halfAngleDeg) {
|
|
42
|
-
|
|
87
|
+
return altitudeKm * 1e3 * Math.tan(halfAngleDeg * Math.PI / 180);
|
|
43
88
|
}
|
|
44
89
|
function removeFromMap(viewer, id, map) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
90
|
+
if (map.current.has(id)) {
|
|
91
|
+
try {
|
|
92
|
+
viewer.entities.removeById(id);
|
|
93
|
+
} catch (_) {}
|
|
94
|
+
map.current.delete(id);
|
|
95
|
+
}
|
|
52
96
|
}
|
|
53
97
|
function makePointGraphics(Cesium, color, pixelSize = 8) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
98
|
+
return {
|
|
99
|
+
pixelSize,
|
|
100
|
+
color,
|
|
101
|
+
outlineColor: Cesium.Color.WHITE,
|
|
102
|
+
outlineWidth: 1,
|
|
103
|
+
scaleByDistance: new Cesium.NearFarScalar(1e6, 1.5, 5e7, .5),
|
|
104
|
+
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
105
|
+
};
|
|
63
106
|
}
|
|
64
107
|
function makeLabelOpts(Cesium, text, fillColor) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
};
|
|
108
|
+
return {
|
|
109
|
+
text,
|
|
110
|
+
font: "12px monospace",
|
|
111
|
+
fillColor: fillColor ?? Cesium.Color.WHITE,
|
|
112
|
+
outlineColor: Cesium.Color.BLACK,
|
|
113
|
+
outlineWidth: 2,
|
|
114
|
+
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
|
|
115
|
+
pixelOffset: new Cesium.Cartesian2(12, 0),
|
|
116
|
+
scaleByDistance: new Cesium.NearFarScalar(1e6, 1, 5e7, .3),
|
|
117
|
+
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 3e7),
|
|
118
|
+
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
119
|
+
};
|
|
78
120
|
}
|
|
121
|
+
/** Add or update a circular ellipse entity on the Earth surface. */
|
|
79
122
|
function upsertEllipse(viewer, Cesium, id, position, radiusM, color, map) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
123
|
+
const existing = map.current.get(id);
|
|
124
|
+
if (existing) {
|
|
125
|
+
existing.position = new Cesium.ConstantPositionProperty(position);
|
|
126
|
+
existing.ellipse.semiMajorAxis = new Cesium.ConstantProperty(radiusM);
|
|
127
|
+
existing.ellipse.semiMinorAxis = new Cesium.ConstantProperty(radiusM);
|
|
128
|
+
} else {
|
|
129
|
+
const entity = viewer.entities.add({
|
|
130
|
+
id,
|
|
131
|
+
position,
|
|
132
|
+
ellipse: {
|
|
133
|
+
semiMajorAxis: radiusM,
|
|
134
|
+
semiMinorAxis: radiusM,
|
|
135
|
+
material: color.withAlpha(.08),
|
|
136
|
+
outline: true,
|
|
137
|
+
outlineColor: color.withAlpha(.5),
|
|
138
|
+
outlineWidth: 1,
|
|
139
|
+
height: 0
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
map.current.set(id, entity);
|
|
143
|
+
}
|
|
101
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Render (or update in-place) the full coverage geometry for one satellite
|
|
147
|
+
* from an explicit `SatelliteCoverage` record supplied by the Zendir SDK.
|
|
148
|
+
*/
|
|
102
149
|
function renderExplicitCoverage(viewer, Cesium, satId, satPos3, cov, julianDate, covMap, coneMap, nadirMap) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const entity = viewer.entities.add({
|
|
182
|
-
id: nadirId,
|
|
183
|
-
polyline: {
|
|
184
|
-
positions: [satCesPos, groundPos],
|
|
185
|
-
width: 1,
|
|
186
|
-
material: new Cesium.PolylineDashMaterialProperty({
|
|
187
|
-
color: baseColor.withAlpha(0.5),
|
|
188
|
-
dashLength: 8
|
|
189
|
-
})
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
nadirMap.current.set(nadirId, entity);
|
|
193
|
-
}
|
|
194
|
-
} else {
|
|
195
|
-
removeFromMap(viewer, nadirId, nadirMap);
|
|
196
|
-
}
|
|
150
|
+
const baseColor = cov.color ? Cesium.Color.fromCssColorString(cov.color) : Cesium.Color.CYAN;
|
|
151
|
+
const opacity = cov.opacity ?? .2;
|
|
152
|
+
const resolvedPos = cov.satellitePosition ?? satPos3;
|
|
153
|
+
const satCesPos = eciKmToFixedCartesian3(Cesium, resolvedPos, julianDate);
|
|
154
|
+
const subSat = eciKmToSubSatellite(Cesium, resolvedPos, julianDate);
|
|
155
|
+
const latitude = subSat?.latitude ?? NaN;
|
|
156
|
+
const longitude = subSat?.longitude ?? NaN;
|
|
157
|
+
const altitude = subSat?.altitude ?? NaN;
|
|
158
|
+
const nadirLat = cov.nadirPoint?.latitude ?? latitude;
|
|
159
|
+
const nadirLon = cov.nadirPoint?.longitude ?? longitude;
|
|
160
|
+
const covId = `cov-${satId}`;
|
|
161
|
+
if (cov.showFootprint !== false && cov.footprintPolygon && cov.footprintPolygon.length >= 3) {
|
|
162
|
+
const positions = Cesium.Cartesian3.fromDegreesArray(cov.footprintPolygon.flatMap((pt) => [pt.longitude, pt.latitude]));
|
|
163
|
+
const existing = covMap.current.get(covId);
|
|
164
|
+
if (existing) existing.polygon.hierarchy = new Cesium.ConstantProperty(new Cesium.PolygonHierarchy(positions));
|
|
165
|
+
else {
|
|
166
|
+
const entity = viewer.entities.add({
|
|
167
|
+
id: covId,
|
|
168
|
+
polygon: {
|
|
169
|
+
hierarchy: new Cesium.PolygonHierarchy(positions),
|
|
170
|
+
material: baseColor.withAlpha(opacity),
|
|
171
|
+
outline: true,
|
|
172
|
+
outlineColor: baseColor.withAlpha(opacity * 3),
|
|
173
|
+
height: 0,
|
|
174
|
+
clampToGround: true
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
covMap.current.set(covId, entity);
|
|
178
|
+
}
|
|
179
|
+
} else if (cov.showFootprint !== false && cov.halfAngle != null && Number.isFinite(altitude) && altitude > 0) upsertEllipse(viewer, Cesium, covId, Cesium.Cartesian3.fromDegrees(nadirLon, nadirLat, 0), halfAngleFootprintRadiusM(altitude, cov.halfAngle), baseColor, covMap);
|
|
180
|
+
else removeFromMap(viewer, covId, covMap);
|
|
181
|
+
const coneId = `cone-${satId}`;
|
|
182
|
+
if (cov.showCone && satCesPos && Number.isFinite(altitude) && altitude > 0) {
|
|
183
|
+
const radius = cov.halfAngle != null ? halfAngleFootprintRadiusM(altitude, cov.halfAngle) : autoFootprintRadiusM(altitude, 5);
|
|
184
|
+
const coneLength = altitude * 1e3;
|
|
185
|
+
const midPos = Cesium.Cartesian3.fromDegrees(nadirLon, nadirLat, coneLength / 2);
|
|
186
|
+
const existing = coneMap.current.get(coneId);
|
|
187
|
+
if (existing) {
|
|
188
|
+
existing.position = new Cesium.ConstantPositionProperty(midPos);
|
|
189
|
+
existing.cylinder.length = new Cesium.ConstantProperty(coneLength);
|
|
190
|
+
existing.cylinder.bottomRadius = new Cesium.ConstantProperty(radius);
|
|
191
|
+
} else {
|
|
192
|
+
const entity = viewer.entities.add({
|
|
193
|
+
id: coneId,
|
|
194
|
+
position: midPos,
|
|
195
|
+
cylinder: {
|
|
196
|
+
length: coneLength,
|
|
197
|
+
topRadius: 0,
|
|
198
|
+
bottomRadius: radius,
|
|
199
|
+
material: baseColor.withAlpha(.06),
|
|
200
|
+
outline: true,
|
|
201
|
+
outlineColor: baseColor.withAlpha(.25),
|
|
202
|
+
numberOfVerticalLines: 12
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
coneMap.current.set(coneId, entity);
|
|
206
|
+
}
|
|
207
|
+
} else removeFromMap(viewer, coneId, coneMap);
|
|
208
|
+
const nadirId = `nadir-${satId}`;
|
|
209
|
+
if (cov.showNadirLine && satCesPos) {
|
|
210
|
+
const groundPos = Cesium.Cartesian3.fromDegrees(nadirLon, nadirLat, 0);
|
|
211
|
+
const existing = nadirMap.current.get(nadirId);
|
|
212
|
+
if (existing) existing.polyline.positions = new Cesium.ConstantProperty([satCesPos, groundPos]);
|
|
213
|
+
else {
|
|
214
|
+
const entity = viewer.entities.add({
|
|
215
|
+
id: nadirId,
|
|
216
|
+
polyline: {
|
|
217
|
+
positions: [satCesPos, groundPos],
|
|
218
|
+
width: 1,
|
|
219
|
+
material: new Cesium.PolylineDashMaterialProperty({
|
|
220
|
+
color: baseColor.withAlpha(.5),
|
|
221
|
+
dashLength: 8
|
|
222
|
+
})
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
nadirMap.current.set(nadirId, entity);
|
|
226
|
+
}
|
|
227
|
+
} else removeFromMap(viewer, nadirId, nadirMap);
|
|
197
228
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
name,
|
|
503
|
-
position: gsPos,
|
|
504
|
-
point: makePointGraphics(Cesium, Cesium.Color.YELLOW, 6),
|
|
505
|
-
label: showLabels ? new Cesium.LabelGraphics(makeLabelOpts(Cesium, name, Cesium.Color.YELLOW)) : void 0
|
|
506
|
-
});
|
|
507
|
-
gsMapRef.current.set(gs.id, entity);
|
|
508
|
-
}
|
|
509
|
-
});
|
|
510
|
-
gsMapRef.current.forEach((_, id) => {
|
|
511
|
-
if (!seenGs.has(id)) removeFromMap(viewer, id, gsMapRef);
|
|
512
|
-
});
|
|
513
|
-
if (showOrbits) {
|
|
514
|
-
const seenOrbits = /* @__PURE__ */ new Set();
|
|
515
|
-
(orbitPaths ?? []).forEach((path) => {
|
|
516
|
-
const orbitId = `orbit-${path.objectId}`;
|
|
517
|
-
seenOrbits.add(orbitId);
|
|
518
|
-
const positions = path.points.map((p) => eciKmToFixedCartesian3(Cesium, p, jd)).filter((p) => p != null);
|
|
519
|
-
if (positions.length < 2) return;
|
|
520
|
-
const orbitColor = path.color ? Cesium.Color.fromCssColorString(path.color).withAlpha(0.65) : Cesium.Color.YELLOW.withAlpha(0.55);
|
|
521
|
-
const existing = orbitMapRef.current.get(orbitId);
|
|
522
|
-
if (existing) {
|
|
523
|
-
existing.polyline.positions = new Cesium.ConstantProperty(positions);
|
|
524
|
-
} else {
|
|
525
|
-
const entity = viewer.entities.add({
|
|
526
|
-
id: orbitId,
|
|
527
|
-
name: path.objectId,
|
|
528
|
-
polyline: {
|
|
529
|
-
positions,
|
|
530
|
-
width: 1.5,
|
|
531
|
-
material: new Cesium.PolylineDashMaterialProperty({
|
|
532
|
-
color: orbitColor,
|
|
533
|
-
dashLength: 16
|
|
534
|
-
})
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
|
-
orbitMapRef.current.set(orbitId, entity);
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
orbitMapRef.current.forEach((_, id) => {
|
|
541
|
-
if (!seenOrbits.has(id)) removeFromMap(viewer, id, orbitMapRef);
|
|
542
|
-
});
|
|
543
|
-
} else {
|
|
544
|
-
orbitMapRef.current.forEach((_, id) => removeFromMap(viewer, id, orbitMapRef));
|
|
545
|
-
}
|
|
546
|
-
}, [
|
|
547
|
-
Cesium,
|
|
548
|
-
satellites,
|
|
549
|
-
stations,
|
|
550
|
-
customObjects,
|
|
551
|
-
groundStations,
|
|
552
|
-
orbitPaths,
|
|
553
|
-
satelliteCoverages,
|
|
554
|
-
showLabels,
|
|
555
|
-
showCoverage,
|
|
556
|
-
showOrbits,
|
|
557
|
-
showSpacecraft,
|
|
558
|
-
showGroundStations,
|
|
559
|
-
showCelestialBodies,
|
|
560
|
-
referenceTime
|
|
561
|
-
]);
|
|
562
|
-
useEffect(() => {
|
|
563
|
-
setView(view);
|
|
564
|
-
}, [view]);
|
|
565
|
-
const h = typeof height === "number" ? `${height}px` : height;
|
|
566
|
-
return /* @__PURE__ */ jsx(
|
|
567
|
-
"div",
|
|
568
|
-
{
|
|
569
|
-
ref: containerRef,
|
|
570
|
-
className: "zendir-zenspace3d-cesium",
|
|
571
|
-
style: { width: "100%", height: h, minHeight: 200 }
|
|
572
|
-
}
|
|
573
|
-
);
|
|
574
|
-
}
|
|
575
|
-
);
|
|
576
|
-
export {
|
|
577
|
-
ZenSpace3DCesium
|
|
578
|
-
};
|
|
579
|
-
//# sourceMappingURL=ZenSpace3DCesium.js.map
|
|
229
|
+
var ZenSpace3DCesium = forwardRef(function ZenSpace3DCesium({ satellites = [], stations = [], groundStations = [], customObjects = [], orbitPaths = [], satelliteCoverages = [], view = "earth-orbit", height = 600, callbacks, showTools = false, layers, visibility, referenceTime, cesium: Cesium }, ref) {
|
|
230
|
+
const containerRef = useRef(null);
|
|
231
|
+
const viewerRef = useRef(null);
|
|
232
|
+
const callbacksRef = useRef(callbacks);
|
|
233
|
+
useEffect(() => {
|
|
234
|
+
callbacksRef.current = callbacks;
|
|
235
|
+
}, [callbacks]);
|
|
236
|
+
const satMapRef = useRef(/* @__PURE__ */ new Map());
|
|
237
|
+
const gsMapRef = useRef(/* @__PURE__ */ new Map());
|
|
238
|
+
const covMapRef = useRef(/* @__PURE__ */ new Map());
|
|
239
|
+
const coneMapRef = useRef(/* @__PURE__ */ new Map());
|
|
240
|
+
const nadirMapRef = useRef(/* @__PURE__ */ new Map());
|
|
241
|
+
const orbitMapRef = useRef(/* @__PURE__ */ new Map());
|
|
242
|
+
const eciPositionsRef = useRef(/* @__PURE__ */ new Map());
|
|
243
|
+
const showLabels = layers?.labels === true;
|
|
244
|
+
const showCoverage = layers?.coverage === true;
|
|
245
|
+
const showOrbits = layers?.orbits !== false;
|
|
246
|
+
const showSpacecraft = visibility?.spacecraft !== false;
|
|
247
|
+
const showGroundStations = visibility?.groundStations !== false;
|
|
248
|
+
const showCelestialBodies = visibility?.celestialBodies !== false;
|
|
249
|
+
const focusOn = useCallback((objectId, options) => {
|
|
250
|
+
const viewer = viewerRef.current;
|
|
251
|
+
if (!viewer) return;
|
|
252
|
+
const entity = viewer.entities.getById(objectId);
|
|
253
|
+
if (entity) viewer.zoomTo(entity, { duration: options?.animate !== false ? 1.5 : 0 });
|
|
254
|
+
}, []);
|
|
255
|
+
const setView = useCallback((mode) => {
|
|
256
|
+
const viewer = viewerRef.current;
|
|
257
|
+
if (!viewer) return;
|
|
258
|
+
if (mode === "earth-orbit") viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(0, 0, 2e7) });
|
|
259
|
+
else if (mode === "solar-system") viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(0, 0, 5e7) });
|
|
260
|
+
}, [Cesium]);
|
|
261
|
+
useImperativeHandle(ref, () => ({
|
|
262
|
+
focusOn,
|
|
263
|
+
flyTo: focusOn,
|
|
264
|
+
setView,
|
|
265
|
+
setTime: () => {},
|
|
266
|
+
setTimeScale: () => {},
|
|
267
|
+
togglePlay: () => {},
|
|
268
|
+
setLayerVisibility: () => {},
|
|
269
|
+
getCameraState: () => ({}),
|
|
270
|
+
setCameraState: () => {},
|
|
271
|
+
exportImage: () => "",
|
|
272
|
+
exportScene: () => new Blob(),
|
|
273
|
+
getVisibleObjects: () => [],
|
|
274
|
+
findObjects: () => [],
|
|
275
|
+
addObject: () => {},
|
|
276
|
+
removeObject: () => {},
|
|
277
|
+
updateObject: () => {},
|
|
278
|
+
measureDistance: () => 0
|
|
279
|
+
}), [focusOn, setView]);
|
|
280
|
+
useEffect(() => {
|
|
281
|
+
if (!containerRef.current || !Cesium) return;
|
|
282
|
+
satMapRef.current.clear();
|
|
283
|
+
gsMapRef.current.clear();
|
|
284
|
+
covMapRef.current.clear();
|
|
285
|
+
coneMapRef.current.clear();
|
|
286
|
+
nadirMapRef.current.clear();
|
|
287
|
+
orbitMapRef.current.clear();
|
|
288
|
+
eciPositionsRef.current.clear();
|
|
289
|
+
const viewer = new Cesium.Viewer(containerRef.current, {
|
|
290
|
+
baseLayerPicker: false,
|
|
291
|
+
fullscreenButton: false,
|
|
292
|
+
vrButton: false,
|
|
293
|
+
geocoder: false,
|
|
294
|
+
homeButton: !!showTools,
|
|
295
|
+
sceneModePicker: false,
|
|
296
|
+
timeline: false,
|
|
297
|
+
navigationHelpButton: !!showTools,
|
|
298
|
+
animation: false,
|
|
299
|
+
scene3DOnly: true,
|
|
300
|
+
useDefaultRenderLoop: true,
|
|
301
|
+
requestRenderMode: false
|
|
302
|
+
});
|
|
303
|
+
viewer.scene.globe.enableLighting = true;
|
|
304
|
+
viewer.scene.backgroundColor = Cesium.Color.BLACK;
|
|
305
|
+
viewer.scene.renderError.addEventListener((scene, err) => {
|
|
306
|
+
console.error("[ZenSpace3D] Cesium render error:", err);
|
|
307
|
+
});
|
|
308
|
+
viewer.clock.currentTime = Cesium.JulianDate.now();
|
|
309
|
+
viewer.clock.multiplier = 1;
|
|
310
|
+
viewer.clock.shouldAnimate = true;
|
|
311
|
+
viewerRef.current = viewer;
|
|
312
|
+
const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
|
|
313
|
+
handler.setInputAction((movement) => {
|
|
314
|
+
const picked = viewer.scene.pick(movement.position);
|
|
315
|
+
if (Cesium.defined(picked) && picked.id && callbacksRef.current?.onSelect) callbacksRef.current.onSelect({
|
|
316
|
+
id: picked.id.id,
|
|
317
|
+
name: picked.id.name,
|
|
318
|
+
category: "satellite",
|
|
319
|
+
position: {
|
|
320
|
+
x: 0,
|
|
321
|
+
y: 0,
|
|
322
|
+
z: 0
|
|
323
|
+
},
|
|
324
|
+
visualRadius: 0
|
|
325
|
+
});
|
|
326
|
+
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
327
|
+
handler.setInputAction((movement) => {
|
|
328
|
+
const picked = viewer.scene.pick(movement.endPosition);
|
|
329
|
+
if (Cesium.defined(picked) && picked.id) callbacksRef.current?.onHover?.({
|
|
330
|
+
id: picked.id.id,
|
|
331
|
+
name: picked.id.name,
|
|
332
|
+
category: "satellite",
|
|
333
|
+
position: {
|
|
334
|
+
x: 0,
|
|
335
|
+
y: 0,
|
|
336
|
+
z: 0
|
|
337
|
+
},
|
|
338
|
+
visualRadius: 0
|
|
339
|
+
});
|
|
340
|
+
else callbacksRef.current?.onHover?.(null);
|
|
341
|
+
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
342
|
+
return () => {
|
|
343
|
+
handler.destroy();
|
|
344
|
+
satMapRef.current.clear();
|
|
345
|
+
gsMapRef.current.clear();
|
|
346
|
+
covMapRef.current.clear();
|
|
347
|
+
coneMapRef.current.clear();
|
|
348
|
+
nadirMapRef.current.clear();
|
|
349
|
+
orbitMapRef.current.clear();
|
|
350
|
+
eciPositionsRef.current.clear();
|
|
351
|
+
viewer.destroy();
|
|
352
|
+
viewerRef.current = null;
|
|
353
|
+
};
|
|
354
|
+
}, [Cesium, showTools]);
|
|
355
|
+
useEffect(() => {
|
|
356
|
+
const viewer = viewerRef.current;
|
|
357
|
+
if (!viewer || !Cesium) return;
|
|
358
|
+
const jd = referenceTime ? Cesium.JulianDate.fromDate(referenceTime) : Cesium.JulianDate.now();
|
|
359
|
+
const seenSats = /* @__PURE__ */ new Set();
|
|
360
|
+
(showSpacecraft ? [...satellites, ...stations] : []).forEach((obj) => {
|
|
361
|
+
const id = obj.id;
|
|
362
|
+
const pos3 = obj.position;
|
|
363
|
+
if (!pos3) return;
|
|
364
|
+
if (!Number.isFinite(pos3.x) || !Number.isFinite(pos3.y) || !Number.isFinite(pos3.z)) return;
|
|
365
|
+
eciPositionsRef.current.set(id, pos3);
|
|
366
|
+
seenSats.add(id);
|
|
367
|
+
const name = obj.name ?? id;
|
|
368
|
+
const existing = satMapRef.current.get(id);
|
|
369
|
+
if (existing) {
|
|
370
|
+
if (existing.label) existing.label.show = new Cesium.ConstantProperty(showLabels);
|
|
371
|
+
else if (showLabels) existing.label = new Cesium.LabelGraphics(makeLabelOpts(Cesium, name));
|
|
372
|
+
} else {
|
|
373
|
+
const capturedId = id;
|
|
374
|
+
const posProperty = new Cesium.CallbackPositionProperty((time) => {
|
|
375
|
+
try {
|
|
376
|
+
const eciKm = eciPositionsRef.current.get(capturedId);
|
|
377
|
+
if (!eciKm) return void 0;
|
|
378
|
+
const fixed = eciKmToFixedCartesian3(Cesium, eciKm, time);
|
|
379
|
+
if (!fixed || !Number.isFinite(fixed.x) || !Number.isFinite(fixed.y) || !Number.isFinite(fixed.z)) return;
|
|
380
|
+
return fixed;
|
|
381
|
+
} catch {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
}, false, Cesium.ReferenceFrame.FIXED);
|
|
385
|
+
const entity = viewer.entities.add({
|
|
386
|
+
id,
|
|
387
|
+
name,
|
|
388
|
+
position: posProperty,
|
|
389
|
+
point: makePointGraphics(Cesium, Cesium.Color.CYAN),
|
|
390
|
+
label: showLabels ? new Cesium.LabelGraphics(makeLabelOpts(Cesium, name)) : void 0
|
|
391
|
+
});
|
|
392
|
+
satMapRef.current.set(id, entity);
|
|
393
|
+
}
|
|
394
|
+
const explicitCov = (satelliteCoverages ?? []).find((c) => c.satelliteId === id);
|
|
395
|
+
if (explicitCov) renderExplicitCoverage(viewer, Cesium, id, pos3, explicitCov, jd, covMapRef, coneMapRef, nadirMapRef);
|
|
396
|
+
else if (showCoverage) {
|
|
397
|
+
const subSat = eciKmToSubSatellite(Cesium, pos3, jd);
|
|
398
|
+
if (subSat && subSat.altitude > 0) {
|
|
399
|
+
const subSatPos = Cesium.Cartesian3.fromDegrees(subSat.longitude, subSat.latitude, 0);
|
|
400
|
+
const radius = autoFootprintRadiusM(subSat.altitude, 5);
|
|
401
|
+
upsertEllipse(viewer, Cesium, `cov-${id}`, subSatPos, radius, Cesium.Color.CYAN, covMapRef);
|
|
402
|
+
}
|
|
403
|
+
} else {
|
|
404
|
+
removeFromMap(viewer, `cov-${id}`, covMapRef);
|
|
405
|
+
removeFromMap(viewer, `cone-${id}`, coneMapRef);
|
|
406
|
+
removeFromMap(viewer, `nadir-${id}`, nadirMapRef);
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
satMapRef.current.forEach((_, id) => {
|
|
410
|
+
if (!seenSats.has(id)) {
|
|
411
|
+
eciPositionsRef.current.delete(id);
|
|
412
|
+
removeFromMap(viewer, id, satMapRef);
|
|
413
|
+
removeFromMap(viewer, `cov-${id}`, covMapRef);
|
|
414
|
+
removeFromMap(viewer, `cone-${id}`, coneMapRef);
|
|
415
|
+
removeFromMap(viewer, `nadir-${id}`, nadirMapRef);
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
const seenCustom = /* @__PURE__ */ new Set();
|
|
419
|
+
(showCelestialBodies ? customObjects ?? [] : []).forEach((obj) => {
|
|
420
|
+
if (/^earth$/i.test(obj.name ?? "")) return;
|
|
421
|
+
const id = obj.id;
|
|
422
|
+
const cesPos = eciKmToFixedCartesian3(Cesium, obj.position, jd);
|
|
423
|
+
if (!cesPos) return;
|
|
424
|
+
seenCustom.add(id);
|
|
425
|
+
const existing = satMapRef.current.get(`custom-${id}`);
|
|
426
|
+
if (existing) {
|
|
427
|
+
existing.position = new Cesium.ConstantPositionProperty(cesPos);
|
|
428
|
+
if (existing.label) existing.label.show = new Cesium.ConstantProperty(showLabels);
|
|
429
|
+
else if (showLabels) existing.label = new Cesium.LabelGraphics(makeLabelOpts(Cesium, obj.name ?? id, Cesium.Color.ORANGE));
|
|
430
|
+
} else {
|
|
431
|
+
const entity = viewer.entities.add({
|
|
432
|
+
id: `custom-${id}`,
|
|
433
|
+
name: obj.name,
|
|
434
|
+
position: cesPos,
|
|
435
|
+
point: makePointGraphics(Cesium, Cesium.Color.ORANGE, 10),
|
|
436
|
+
label: showLabels ? new Cesium.LabelGraphics(makeLabelOpts(Cesium, obj.name ?? id, Cesium.Color.ORANGE)) : void 0
|
|
437
|
+
});
|
|
438
|
+
satMapRef.current.set(`custom-${id}`, entity);
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
satMapRef.current.forEach((_, key) => {
|
|
442
|
+
if (key.startsWith("custom-") && !seenCustom.has(key.slice(7))) removeFromMap(viewer, key, satMapRef);
|
|
443
|
+
});
|
|
444
|
+
const seenGs = /* @__PURE__ */ new Set();
|
|
445
|
+
(showGroundStations ? groundStations ?? [] : []).forEach((gs) => {
|
|
446
|
+
if (!Number.isFinite(gs.longitude) || !Number.isFinite(gs.latitude)) return;
|
|
447
|
+
seenGs.add(gs.id);
|
|
448
|
+
const heightM = Number.isFinite(gs.elevation) ? gs.elevation : 0;
|
|
449
|
+
const gsPos = Cesium.Cartesian3.fromDegrees(gs.longitude, gs.latitude, heightM);
|
|
450
|
+
const name = gs.name ?? gs.id;
|
|
451
|
+
const existing = gsMapRef.current.get(gs.id);
|
|
452
|
+
if (existing) {
|
|
453
|
+
existing.position = new Cesium.ConstantPositionProperty(gsPos);
|
|
454
|
+
if (existing.label) existing.label.show = new Cesium.ConstantProperty(showLabels);
|
|
455
|
+
else if (showLabels) existing.label = new Cesium.LabelGraphics(makeLabelOpts(Cesium, name, Cesium.Color.YELLOW));
|
|
456
|
+
} else {
|
|
457
|
+
const entity = viewer.entities.add({
|
|
458
|
+
id: gs.id,
|
|
459
|
+
name,
|
|
460
|
+
position: gsPos,
|
|
461
|
+
point: makePointGraphics(Cesium, Cesium.Color.YELLOW, 6),
|
|
462
|
+
label: showLabels ? new Cesium.LabelGraphics(makeLabelOpts(Cesium, name, Cesium.Color.YELLOW)) : void 0
|
|
463
|
+
});
|
|
464
|
+
gsMapRef.current.set(gs.id, entity);
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
gsMapRef.current.forEach((_, id) => {
|
|
468
|
+
if (!seenGs.has(id)) removeFromMap(viewer, id, gsMapRef);
|
|
469
|
+
});
|
|
470
|
+
if (showOrbits) {
|
|
471
|
+
const seenOrbits = /* @__PURE__ */ new Set();
|
|
472
|
+
(orbitPaths ?? []).forEach((path) => {
|
|
473
|
+
const orbitId = `orbit-${path.objectId}`;
|
|
474
|
+
seenOrbits.add(orbitId);
|
|
475
|
+
const positions = path.points.map((p) => eciKmToFixedCartesian3(Cesium, p, jd)).filter((p) => p != null);
|
|
476
|
+
if (positions.length < 2) return;
|
|
477
|
+
const orbitColor = path.color ? Cesium.Color.fromCssColorString(path.color).withAlpha(.65) : Cesium.Color.YELLOW.withAlpha(.55);
|
|
478
|
+
const existing = orbitMapRef.current.get(orbitId);
|
|
479
|
+
if (existing) existing.polyline.positions = new Cesium.ConstantProperty(positions);
|
|
480
|
+
else {
|
|
481
|
+
const entity = viewer.entities.add({
|
|
482
|
+
id: orbitId,
|
|
483
|
+
name: path.objectId,
|
|
484
|
+
polyline: {
|
|
485
|
+
positions,
|
|
486
|
+
width: 1.5,
|
|
487
|
+
material: new Cesium.PolylineDashMaterialProperty({
|
|
488
|
+
color: orbitColor,
|
|
489
|
+
dashLength: 16
|
|
490
|
+
})
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
orbitMapRef.current.set(orbitId, entity);
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
orbitMapRef.current.forEach((_, id) => {
|
|
497
|
+
if (!seenOrbits.has(id)) removeFromMap(viewer, id, orbitMapRef);
|
|
498
|
+
});
|
|
499
|
+
} else orbitMapRef.current.forEach((_, id) => removeFromMap(viewer, id, orbitMapRef));
|
|
500
|
+
}, [
|
|
501
|
+
Cesium,
|
|
502
|
+
satellites,
|
|
503
|
+
stations,
|
|
504
|
+
customObjects,
|
|
505
|
+
groundStations,
|
|
506
|
+
orbitPaths,
|
|
507
|
+
satelliteCoverages,
|
|
508
|
+
showLabels,
|
|
509
|
+
showCoverage,
|
|
510
|
+
showOrbits,
|
|
511
|
+
showSpacecraft,
|
|
512
|
+
showGroundStations,
|
|
513
|
+
showCelestialBodies,
|
|
514
|
+
referenceTime
|
|
515
|
+
]);
|
|
516
|
+
useEffect(() => {
|
|
517
|
+
setView(view);
|
|
518
|
+
}, [view]);
|
|
519
|
+
return /* @__PURE__ */ jsx("div", {
|
|
520
|
+
ref: containerRef,
|
|
521
|
+
className: "zendir-zenspace3d-cesium",
|
|
522
|
+
style: {
|
|
523
|
+
width: "100%",
|
|
524
|
+
height: typeof height === "number" ? `${height}px` : height,
|
|
525
|
+
minHeight: 200
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
});
|
|
529
|
+
//#endregion
|
|
530
|
+
export { ZenSpace3DCesium, ZenSpace3DCesium as default };
|
|
531
|
+
|
|
532
|
+
//# sourceMappingURL=ZenSpace3DCesium.js.map
|