@zendir/ui 0.5.0 → 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.
Files changed (391) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +640 -631
  3. package/dist/_virtual/_rolldown/runtime.js +13 -0
  4. package/dist/index.js +17 -221
  5. package/dist/react/3d/CesiumCaptureSource.d.ts +0 -1
  6. package/dist/react/3d/CesiumCaptureSource.js +364 -283
  7. package/dist/react/3d/CesiumCaptureSource.js.map +1 -1
  8. package/dist/react/3d/ZenSpace3D.d.ts +2 -3
  9. package/dist/react/3d/ZenSpace3D.js +1681 -1237
  10. package/dist/react/3d/ZenSpace3D.js.map +1 -1
  11. package/dist/react/3d/ZenSpace3DCesium.d.ts +0 -1
  12. package/dist/react/3d/ZenSpace3DCesium.js +513 -560
  13. package/dist/react/3d/ZenSpace3DCesium.js.map +1 -1
  14. package/dist/react/3d/ZenSpace3DShaders.js +61 -66
  15. package/dist/react/3d/ZenSpace3DShaders.js.map +1 -1
  16. package/dist/react/3d/ZenSpace3DTypes.d.ts +19 -20
  17. package/dist/react/3d/ZenSpace3DUtils.d.ts +0 -1
  18. package/dist/react/3d/ZenSpace3DUtils.js +37 -24
  19. package/dist/react/3d/ZenSpace3DUtils.js.map +1 -1
  20. package/dist/react/3d/capturePngAnalysis.js +42 -36
  21. package/dist/react/3d/capturePngAnalysis.js.map +1 -1
  22. package/dist/react/3d/index.d.ts +3 -3
  23. package/dist/react/3d/index.js +5 -53
  24. package/dist/react/3d/threeLoader.d.ts +1 -1
  25. package/dist/react/3d/threeLoader.js +23 -18
  26. package/dist/react/3d/threeLoader.js.map +1 -1
  27. package/dist/react/astro/ClassificationBanner.d.ts +2 -3
  28. package/dist/react/astro/ClassificationBanner.js +95 -79
  29. package/dist/react/astro/ClassificationBanner.js.map +1 -1
  30. package/dist/react/astro/GlobalStatusBar.d.ts +0 -1
  31. package/dist/react/astro/GlobalStatusBar.js +157 -163
  32. package/dist/react/astro/GlobalStatusBar.js.map +1 -1
  33. package/dist/react/astro/MissionClock.d.ts +7 -8
  34. package/dist/react/astro/MissionClock.js +377 -400
  35. package/dist/react/astro/MissionClock.js.map +1 -1
  36. package/dist/react/astro/MonitoringIcon.d.ts +1 -2
  37. package/dist/react/astro/MonitoringIcon.js +422 -358
  38. package/dist/react/astro/MonitoringIcon.js.map +1 -1
  39. package/dist/react/astro/Notification.d.ts +1 -2
  40. package/dist/react/astro/Notification.js +229 -126
  41. package/dist/react/astro/Notification.js.map +1 -1
  42. package/dist/react/astro/Progress.d.ts +0 -1
  43. package/dist/react/astro/Progress.js +199 -141
  44. package/dist/react/astro/Progress.js.map +1 -1
  45. package/dist/react/astro/SimulationControls.d.ts +3 -4
  46. package/dist/react/astro/SimulationControls.js +596 -650
  47. package/dist/react/astro/SimulationControls.js.map +1 -1
  48. package/dist/react/astro/StatusIndicator.d.ts +0 -1
  49. package/dist/react/astro/StatusIndicator.js +236 -170
  50. package/dist/react/astro/StatusIndicator.js.map +1 -1
  51. package/dist/react/astro/UnifiedTimeline.d.ts +9 -10
  52. package/dist/react/astro/UnifiedTimeline.js +2345 -2392
  53. package/dist/react/astro/UnifiedTimeline.js.map +1 -1
  54. package/dist/react/astro/index.d.ts +5 -5
  55. package/dist/react/astro/index.js +1 -25
  56. package/dist/react/cards/AccessCard.d.ts +0 -1
  57. package/dist/react/cards/AccessCard.js +471 -405
  58. package/dist/react/cards/AccessCard.js.map +1 -1
  59. package/dist/react/cards/OrbitCard.d.ts +0 -1
  60. package/dist/react/cards/OrbitCard.js +487 -364
  61. package/dist/react/cards/OrbitCard.js.map +1 -1
  62. package/dist/react/cards/SpacecraftCard.d.ts +0 -1
  63. package/dist/react/cards/SpacecraftCard.js +813 -925
  64. package/dist/react/cards/SpacecraftCard.js.map +1 -1
  65. package/dist/react/cards/TelemetryCard.d.ts +0 -1
  66. package/dist/react/cards/TelemetryCard.js +1055 -732
  67. package/dist/react/cards/TelemetryCard.js.map +1 -1
  68. package/dist/react/cards/TelemetryStreamCard.d.ts +0 -1
  69. package/dist/react/cards/TelemetryStreamCard.js +323 -297
  70. package/dist/react/cards/TelemetryStreamCard.js.map +1 -1
  71. package/dist/react/cards/index.d.ts +1 -1
  72. package/dist/react/cards/index.js +1 -8
  73. package/dist/react/charts/GroundTrackMap.d.ts +6 -7
  74. package/dist/react/charts/GroundTrackMap.js +1377 -1256
  75. package/dist/react/charts/GroundTrackMap.js.map +1 -1
  76. package/dist/react/charts/GroundTrackMapLeaflet.d.ts +1 -2
  77. package/dist/react/charts/GroundTrackMapLeaflet.js +1065 -987
  78. package/dist/react/charts/GroundTrackMapLeaflet.js.map +1 -1
  79. package/dist/react/charts/groundTrackMapLeafletTiles.js +34 -25
  80. package/dist/react/charts/groundTrackMapLeafletTiles.js.map +1 -1
  81. package/dist/react/charts/groundTrackMapLeafletUtils.js +70 -61
  82. package/dist/react/charts/groundTrackMapLeafletUtils.js.map +1 -1
  83. package/dist/react/charts/index.d.ts +1 -1
  84. package/dist/react/charts/index.js +7 -100
  85. package/dist/react/charts/unified/AstroChart.d.ts +1 -2
  86. package/dist/react/charts/unified/AstroChart.js +1331 -1411
  87. package/dist/react/charts/unified/AstroChart.js.map +1 -1
  88. package/dist/react/charts/unified/PowerOverviewChart.d.ts +3 -3
  89. package/dist/react/charts/unified/PowerOverviewChart.js +495 -478
  90. package/dist/react/charts/unified/PowerOverviewChart.js.map +1 -1
  91. package/dist/react/charts/unified/domain.d.ts +12 -13
  92. package/dist/react/charts/unified/domain.js +3999 -3145
  93. package/dist/react/charts/unified/domain.js.map +1 -1
  94. package/dist/react/charts/unified/generators.d.ts +3 -4
  95. package/dist/react/charts/unified/generators.js +561 -498
  96. package/dist/react/charts/unified/generators.js.map +1 -1
  97. package/dist/react/charts/unified/index.d.ts +1 -1
  98. package/dist/react/charts/unified/presets.d.ts +14 -15
  99. package/dist/react/charts/unified/presets.js +857 -994
  100. package/dist/react/charts/unified/presets.js.map +1 -1
  101. package/dist/react/charts/unified/sync.d.ts +2 -3
  102. package/dist/react/charts/unified/sync.js +229 -195
  103. package/dist/react/charts/unified/sync.js.map +1 -1
  104. package/dist/react/charts/unified/theme.d.ts +11 -12
  105. package/dist/react/charts/unified/theme.js +606 -642
  106. package/dist/react/charts/unified/theme.js.map +1 -1
  107. package/dist/react/charts/unified/types.d.ts +32 -33
  108. package/dist/react/charts/unified/useChartStream.d.ts +1 -2
  109. package/dist/react/charts/unified/useChartStream.js +203 -216
  110. package/dist/react/charts/unified/useChartStream.js.map +1 -1
  111. package/dist/react/chatgpt/AppCard.d.ts +1 -2
  112. package/dist/react/chatgpt/index.d.ts +7 -7
  113. package/dist/react/chatgpt/index.js +160 -139
  114. package/dist/react/chatgpt/index.js.map +1 -1
  115. package/dist/react/context/CategoryContext.d.ts +0 -1
  116. package/dist/react/context/CategoryContext.js +78 -29
  117. package/dist/react/context/CategoryContext.js.map +1 -1
  118. package/dist/react/context/DisplaySettingsContext.d.ts +1 -2
  119. package/dist/react/context/DisplaySettingsContext.js +205 -156
  120. package/dist/react/context/DisplaySettingsContext.js.map +1 -1
  121. package/dist/react/context/SpatialSelectionContext.d.ts +0 -1
  122. package/dist/react/context/SpatialSelectionContext.js +36 -7
  123. package/dist/react/context/SpatialSelectionContext.js.map +1 -1
  124. package/dist/react/core/data/DataTable.d.ts +3 -4
  125. package/dist/react/core/data/DataTable.js +473 -440
  126. package/dist/react/core/data/DataTable.js.map +1 -1
  127. package/dist/react/core/data/DataValue.d.ts +4 -5
  128. package/dist/react/core/data/DataValue.js +605 -571
  129. package/dist/react/core/data/DataValue.js.map +1 -1
  130. package/dist/react/core/data/propertyConfig.d.ts +1 -2
  131. package/dist/react/core/data/propertyConfig.js +446 -382
  132. package/dist/react/core/data/propertyConfig.js.map +1 -1
  133. package/dist/react/core/display/AstroIcon.d.ts +4 -5
  134. package/dist/react/core/display/AstroIcon.js +339 -429
  135. package/dist/react/core/display/AstroIcon.js.map +1 -1
  136. package/dist/react/core/display/Badge.d.ts +2 -3
  137. package/dist/react/core/display/Badge.js +131 -131
  138. package/dist/react/core/display/Badge.js.map +1 -1
  139. package/dist/react/core/display/CardHeader.d.ts +0 -1
  140. package/dist/react/core/display/CardHeader.js +398 -311
  141. package/dist/react/core/display/CardHeader.js.map +1 -1
  142. package/dist/react/core/display/Container.d.ts +2 -3
  143. package/dist/react/core/display/Container.js +640 -668
  144. package/dist/react/core/display/Container.js.map +1 -1
  145. package/dist/react/core/display/CopyButton.d.ts +1 -2
  146. package/dist/react/core/display/CopyButton.js +158 -101
  147. package/dist/react/core/display/CopyButton.js.map +1 -1
  148. package/dist/react/core/display/GlassCard.d.ts +3 -4
  149. package/dist/react/core/display/GlassCard.js +416 -369
  150. package/dist/react/core/display/GlassCard.js.map +1 -1
  151. package/dist/react/core/display/HeaderIconWithStatus.d.ts +0 -1
  152. package/dist/react/core/display/HeaderIconWithStatus.js +152 -152
  153. package/dist/react/core/display/HeaderIconWithStatus.js.map +1 -1
  154. package/dist/react/core/display/Icon.d.ts +2 -3
  155. package/dist/react/core/display/Icon.js +172 -143
  156. package/dist/react/core/display/Icon.js.map +1 -1
  157. package/dist/react/core/display/Typography.d.ts +24 -25
  158. package/dist/react/core/display/Typography.js +360 -178
  159. package/dist/react/core/display/Typography.js.map +1 -1
  160. package/dist/react/core/feedback/ConfirmDialog.d.ts +1 -2
  161. package/dist/react/core/feedback/ConfirmDialog.js +343 -304
  162. package/dist/react/core/feedback/ConfirmDialog.js.map +1 -1
  163. package/dist/react/core/feedback/Dialog.d.ts +2 -3
  164. package/dist/react/core/feedback/Dialog.js +189 -197
  165. package/dist/react/core/feedback/Dialog.js.map +1 -1
  166. package/dist/react/core/feedback/Toast.d.ts +2 -3
  167. package/dist/react/core/feedback/Toast.js +346 -207
  168. package/dist/react/core/feedback/Toast.js.map +1 -1
  169. package/dist/react/core/index.d.ts +26 -26
  170. package/dist/react/core/index.js +7 -119
  171. package/dist/react/core/inputs/Button.d.ts +2 -3
  172. package/dist/react/core/inputs/Button.js +281 -304
  173. package/dist/react/core/inputs/Button.js.map +1 -1
  174. package/dist/react/core/inputs/Checkbox.d.ts +2 -3
  175. package/dist/react/core/inputs/Checkbox.js +139 -127
  176. package/dist/react/core/inputs/Checkbox.js.map +1 -1
  177. package/dist/react/core/inputs/Input.d.ts +3 -4
  178. package/dist/react/core/inputs/Input.js +277 -285
  179. package/dist/react/core/inputs/Input.js.map +1 -1
  180. package/dist/react/core/inputs/LimitsBar.d.ts +1 -2
  181. package/dist/react/core/inputs/LimitsBar.js +271 -196
  182. package/dist/react/core/inputs/LimitsBar.js.map +1 -1
  183. package/dist/react/core/inputs/NumberInput.d.ts +2 -3
  184. package/dist/react/core/inputs/NumberInput.js +531 -503
  185. package/dist/react/core/inputs/NumberInput.js.map +1 -1
  186. package/dist/react/core/inputs/PinInput.d.ts +2 -3
  187. package/dist/react/core/inputs/PinInput.js +224 -207
  188. package/dist/react/core/inputs/PinInput.js.map +1 -1
  189. package/dist/react/core/inputs/Select.d.ts +1 -2
  190. package/dist/react/core/inputs/Select.js +298 -299
  191. package/dist/react/core/inputs/Select.js.map +1 -1
  192. package/dist/react/core/inputs/Toggle.d.ts +2 -3
  193. package/dist/react/core/inputs/Toggle.js +142 -148
  194. package/dist/react/core/inputs/Toggle.js.map +1 -1
  195. package/dist/react/core/layout/Box.d.ts +3 -4
  196. package/dist/react/core/layout/Box.js +118 -122
  197. package/dist/react/core/layout/Box.js.map +1 -1
  198. package/dist/react/core/layout/Center.d.ts +0 -1
  199. package/dist/react/core/layout/Center.js +45 -32
  200. package/dist/react/core/layout/Center.js.map +1 -1
  201. package/dist/react/core/layout/Divider.d.ts +1 -2
  202. package/dist/react/core/layout/Divider.js +112 -106
  203. package/dist/react/core/layout/Divider.js.map +1 -1
  204. package/dist/react/core/layout/Flex.d.ts +4 -5
  205. package/dist/react/core/layout/Flex.js +120 -124
  206. package/dist/react/core/layout/Flex.js.map +1 -1
  207. package/dist/react/core/layout/Grid.d.ts +5 -6
  208. package/dist/react/core/layout/Grid.js +131 -138
  209. package/dist/react/core/layout/Grid.js.map +1 -1
  210. package/dist/react/core/layout/Spacer.d.ts +0 -1
  211. package/dist/react/core/layout/Spacer.js +36 -29
  212. package/dist/react/core/layout/Spacer.js.map +1 -1
  213. package/dist/react/core/layout/Stack.d.ts +4 -5
  214. package/dist/react/core/layout/Stack.js +127 -70
  215. package/dist/react/core/layout/Stack.js.map +1 -1
  216. package/dist/react/core/layout/responsive.d.ts +1 -2
  217. package/dist/react/core/layout/responsive.js +25 -19
  218. package/dist/react/core/layout/responsive.js.map +1 -1
  219. package/dist/react/core/layout/useBreakpoint.d.ts +1 -1
  220. package/dist/react/core/layout/useBreakpoint.js +119 -66
  221. package/dist/react/core/layout/useBreakpoint.js.map +1 -1
  222. package/dist/react/core/navigation/AppBar.d.ts +1 -2
  223. package/dist/react/core/navigation/AppBar.js +827 -805
  224. package/dist/react/core/navigation/AppBar.js.map +1 -1
  225. package/dist/react/core/navigation/Pagination.d.ts +2 -3
  226. package/dist/react/core/navigation/Pagination.js +207 -187
  227. package/dist/react/core/navigation/Pagination.js.map +1 -1
  228. package/dist/react/core/navigation/SideNav.d.ts +5 -6
  229. package/dist/react/core/navigation/SideNav.js +855 -629
  230. package/dist/react/core/navigation/SideNav.js.map +1 -1
  231. package/dist/react/core/navigation/Tabs.d.ts +0 -1
  232. package/dist/react/core/navigation/Tabs.js +113 -119
  233. package/dist/react/core/navigation/Tabs.js.map +1 -1
  234. package/dist/react/core/overlays/Popover.d.ts +2 -3
  235. package/dist/react/core/overlays/Popover.js +303 -282
  236. package/dist/react/core/overlays/Popover.js.map +1 -1
  237. package/dist/react/core/overlays/SidePanel.d.ts +1 -2
  238. package/dist/react/core/overlays/SidePanel.js +217 -212
  239. package/dist/react/core/overlays/SidePanel.js.map +1 -1
  240. package/dist/react/core/overlays/Tooltip.d.ts +1 -2
  241. package/dist/react/core/overlays/Tooltip.js +170 -176
  242. package/dist/react/core/overlays/Tooltip.js.map +1 -1
  243. package/dist/react/core/widgets/ActivityPlanner.d.ts +0 -1
  244. package/dist/react/core/widgets/ActivityPlanner.js +855 -517
  245. package/dist/react/core/widgets/ActivityPlanner.js.map +1 -1
  246. package/dist/react/core/widgets/Capture.d.ts +2 -3
  247. package/dist/react/core/widgets/Capture.js +965 -779
  248. package/dist/react/core/widgets/Capture.js.map +1 -1
  249. package/dist/react/core/widgets/ChatPanel.d.ts +16 -17
  250. package/dist/react/core/widgets/ChatPanel.js +1734 -1034
  251. package/dist/react/core/widgets/ChatPanel.js.map +1 -1
  252. package/dist/react/core/widgets/ColorPickerPanel.d.ts +0 -1
  253. package/dist/react/core/widgets/ColorPickerPanel.js +298 -287
  254. package/dist/react/core/widgets/ColorPickerPanel.js.map +1 -1
  255. package/dist/react/core/widgets/CommandBuilder.d.ts +2 -3
  256. package/dist/react/core/widgets/CommandBuilder.js +624 -516
  257. package/dist/react/core/widgets/CommandBuilder.js.map +1 -1
  258. package/dist/react/core/widgets/ConnectionForm.d.ts +2 -3
  259. package/dist/react/core/widgets/ConnectionForm.js +528 -492
  260. package/dist/react/core/widgets/ConnectionForm.js.map +1 -1
  261. package/dist/react/core/widgets/FileExplorer.d.ts +3 -4
  262. package/dist/react/core/widgets/FileExplorer.js +617 -505
  263. package/dist/react/core/widgets/FileExplorer.js.map +1 -1
  264. package/dist/react/core/widgets/HexViewer.d.ts +2 -3
  265. package/dist/react/core/widgets/HexViewer.js +1353 -1091
  266. package/dist/react/core/widgets/HexViewer.js.map +1 -1
  267. package/dist/react/core/widgets/ImageFrame.d.ts +1 -2
  268. package/dist/react/core/widgets/ImageFrame.js +230 -193
  269. package/dist/react/core/widgets/ImageFrame.js.map +1 -1
  270. package/dist/react/core/widgets/ImageGallery.d.ts +2 -1
  271. package/dist/react/core/widgets/ImageGallery.js +380 -314
  272. package/dist/react/core/widgets/ImageGallery.js.map +1 -1
  273. package/dist/react/core/widgets/ImagePanel.d.ts +0 -1
  274. package/dist/react/core/widgets/ImagePanel.js +110 -101
  275. package/dist/react/core/widgets/ImagePanel.js.map +1 -1
  276. package/dist/react/core/widgets/LogViewer.d.ts +2 -3
  277. package/dist/react/core/widgets/LogViewer.js +711 -607
  278. package/dist/react/core/widgets/LogViewer.js.map +1 -1
  279. package/dist/react/core/widgets/MessageStream.d.ts +3 -4
  280. package/dist/react/core/widgets/MessageStream.js +514 -444
  281. package/dist/react/core/widgets/MessageStream.js.map +1 -1
  282. package/dist/react/core/widgets/MissionCalendar.d.ts +3 -4
  283. package/dist/react/core/widgets/MissionCalendar.js +1488 -1020
  284. package/dist/react/core/widgets/MissionCalendar.js.map +1 -1
  285. package/dist/react/core/widgets/PacketViewer.d.ts +2 -3
  286. package/dist/react/core/widgets/PacketViewer.js +550 -421
  287. package/dist/react/core/widgets/PacketViewer.js.map +1 -1
  288. package/dist/react/core/widgets/capture-placeholder.png.js +6 -5
  289. package/dist/react/core/widgets/capture-placeholder.png.js.map +1 -1
  290. package/dist/react/hooks/index.d.ts +5 -5
  291. package/dist/react/hooks/useAccessWindows.d.ts +0 -1
  292. package/dist/react/hooks/useCompactMode.d.ts +1 -1
  293. package/dist/react/hooks/useCompactMode.js +104 -58
  294. package/dist/react/hooks/useCompactMode.js.map +1 -1
  295. package/dist/react/hooks/useGroundTrackHistory.d.ts +0 -1
  296. package/dist/react/hooks/useSimulationScene.d.ts +1 -2
  297. package/dist/react/hooks/useSimulationScene.js +481 -374
  298. package/dist/react/hooks/useSimulationScene.js.map +1 -1
  299. package/dist/react/index.d.ts +3 -3
  300. package/dist/react/panels/LayerControlPanel.d.ts +1 -2
  301. package/dist/react/panels/LayerControlPanel.js +223 -180
  302. package/dist/react/panels/LayerControlPanel.js.map +1 -1
  303. package/dist/react/panels/ObjectInventoryPanel.d.ts +2 -3
  304. package/dist/react/panels/ObjectInventoryPanel.js +315 -250
  305. package/dist/react/panels/ObjectInventoryPanel.js.map +1 -1
  306. package/dist/react/panels/index.d.ts +1 -1
  307. package/dist/react/panels/index.js +1 -6
  308. package/dist/react/shared/ErrorBoundary.d.ts +1 -2
  309. package/dist/react/shared/ErrorBoundary.js +170 -139
  310. package/dist/react/shared/ErrorBoundary.js.map +1 -1
  311. package/dist/react/shared/Skeleton.d.ts +1 -2
  312. package/dist/react/shared/Skeleton.js +300 -301
  313. package/dist/react/shared/Skeleton.js.map +1 -1
  314. package/dist/react/theme/ThemeProvider.d.ts +2 -321
  315. package/dist/react/theme/ThemeProvider.js +312 -939
  316. package/dist/react/theme/ThemeProvider.js.map +1 -1
  317. package/dist/react/theme/cardAccent.d.ts +1 -2
  318. package/dist/react/theme/cardAccent.js +196 -126
  319. package/dist/react/theme/cardAccent.js.map +1 -1
  320. package/dist/react/theme/config.d.ts +0 -1
  321. package/dist/react/theme/config.js +47 -25
  322. package/dist/react/theme/config.js.map +1 -1
  323. package/dist/react/theme/index.d.ts +2 -2
  324. package/dist/react/theme/index.js +1 -16
  325. package/dist/react/theme/types.d.ts +332 -0
  326. package/dist/react/theme/types.js +39 -0
  327. package/dist/react/theme/types.js.map +1 -0
  328. package/dist/react/types.d.ts +8 -8
  329. package/dist/react/types.js +147 -47
  330. package/dist/react/types.js.map +1 -1
  331. package/dist/react/utils/categoryPalette.d.ts +0 -1
  332. package/dist/react/utils/categoryPalette.js +91 -102
  333. package/dist/react/utils/categoryPalette.js.map +1 -1
  334. package/dist/react/utils/index.d.ts +5 -5
  335. package/dist/react/utils/index.js +457 -371
  336. package/dist/react/utils/index.js.map +1 -1
  337. package/dist/react/visualizations/EclipseTimerCard.d.ts +0 -1
  338. package/dist/react/visualizations/LinkBudgetCard.d.ts +0 -1
  339. package/dist/react/visualizations/NavBallCard.d.ts +0 -1
  340. package/dist/react/visualizations/PropulsionCard.d.ts +1 -2
  341. package/dist/react/visualizations/SensorFootprintCard.d.ts +1 -2
  342. package/dist/react/visualizations/ThermalHeatmapCard.d.ts +0 -1
  343. package/dist/react/visualizations/index.d.ts +3 -3
  344. package/dist/react.d.ts +2 -1
  345. package/dist/react.js +17 -221
  346. package/dist/shaders/atmosphere.frag.js +6 -5
  347. package/dist/shaders/atmosphere.frag.js.map +1 -1
  348. package/dist/shaders/atmosphere.vert.js +6 -5
  349. package/dist/shaders/atmosphere.vert.js.map +1 -1
  350. package/dist/shaders/stars.frag.js +6 -5
  351. package/dist/shaders/stars.frag.js.map +1 -1
  352. package/dist/shaders/stars.vert.js +6 -5
  353. package/dist/shaders/stars.vert.js.map +1 -1
  354. package/dist/style.css +217 -194
  355. package/dist/tokens/core.d.ts +159 -0
  356. package/dist/tokens/core.js +144 -0
  357. package/dist/tokens/core.js.map +1 -0
  358. package/dist/tokens/css-vars.d.ts +213 -2
  359. package/dist/tokens/css-vars.js +590 -227
  360. package/dist/tokens/css-vars.js.map +1 -1
  361. package/dist/tokens/index.d.ts +31 -228
  362. package/dist/tokens/index.js +281 -366
  363. package/dist/tokens/index.js.map +1 -1
  364. package/dist/tokens/palettes/astro.d.ts +129 -0
  365. package/dist/tokens/palettes/astro.js +112 -0
  366. package/dist/tokens/palettes/astro.js.map +1 -0
  367. package/dist/tokens/palettes/index.d.ts +288 -0
  368. package/dist/tokens/palettes/index.js +35 -0
  369. package/dist/tokens/palettes/index.js.map +1 -0
  370. package/dist/tokens/palettes/tailwind.d.ts +324 -0
  371. package/dist/tokens/palettes/tailwind.js +201 -0
  372. package/dist/tokens/palettes/tailwind.js.map +1 -0
  373. package/dist/tokens/palettes/zendir.d.ts +126 -0
  374. package/dist/tokens/palettes/zendir.js +92 -0
  375. package/dist/tokens/palettes/zendir.js.map +1 -0
  376. package/dist/tokens/themes.d.ts +30 -0
  377. package/dist/tokens/themes.js +704 -0
  378. package/dist/tokens/themes.js.map +1 -0
  379. package/dist/tokens/tokens.css +419 -41
  380. package/dist/types/index.d.ts +2 -2
  381. package/package.json +310 -313
  382. package/dist/index.js.map +0 -1
  383. package/dist/react/3d/index.js.map +0 -1
  384. package/dist/react/astro/index.js.map +0 -1
  385. package/dist/react/cards/index.js.map +0 -1
  386. package/dist/react/charts/index.js.map +0 -1
  387. package/dist/react/core/index.js.map +0 -1
  388. package/dist/react/panels/index.js.map +0 -1
  389. package/dist/react/theme/astro-tokens.d.ts +0 -153
  390. package/dist/react/theme/index.js.map +0 -1
  391. package/dist/react.js.map +0 -1
@@ -1,1000 +1,863 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { memo, forwardRef } from "react";
3
- import { AstroChart } from "./AstroChart.js";
4
- import { ASTRO_DATA_VIZ_COLORS } from "./theme.js";
5
1
  import { useTheme } from "../../theme/ThemeProvider.js";
6
- const SOFT_STATUS_COLORS = {
7
- normal: "#6ed86e",
8
- caution: "#ffd54f",
9
- critical: "#e57373"
2
+ import { ASTRO_DATA_VIZ_COLORS } from "./theme.js";
3
+ import { AstroChart } from "./AstroChart.js";
4
+ import { forwardRef, memo } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/react/charts/unified/presets.tsx
7
+ /**
8
+ * @zendir/ui - Chart Presets
9
+ *
10
+ * Pre-configured chart components for common use cases.
11
+ * Each preset wraps AstroChart with sensible defaults.
12
+ */
13
+ var SOFT_STATUS_COLORS = {
14
+ normal: "#6ed86e",
15
+ caution: "#ffd54f",
16
+ serious: "#ffa726",
17
+ critical: "#e57373",
18
+ off: "#90a4ae",
19
+ standby: "#4fc3f7"
10
20
  };
11
- const LineChart = memo(forwardRef(
12
- function LineChart2({ smooth = true, showPoints = false, showArea = false, series = [], ...props }, ref) {
13
- const transformedSeries = series.map((s) => ({
14
- ...s,
15
- type: showArea ? "area" : "line",
16
- smooth,
17
- symbol: showPoints ? { type: "circle", size: 6 } : { type: "none" }
18
- }));
19
- return /* @__PURE__ */ jsx(
20
- AstroChart,
21
- {
22
- ref,
23
- type: showArea ? "area" : "line",
24
- series: transformedSeries,
25
- tooltip: { trigger: "axis", crosshair: "x" },
26
- ...props
27
- }
28
- );
29
- }
30
- ));
31
- const AreaChart = memo(forwardRef(
32
- function AreaChart2({ stacked = false, smooth = true, series = [], ...props }, ref) {
33
- const transformedSeries = series.map((s, _i) => ({
34
- ...s,
35
- type: "area",
36
- smooth,
37
- stack: stacked ? "total" : void 0,
38
- areaStyle: { opacity: stacked ? 0.8 : 0.3 }
39
- }));
40
- return /* @__PURE__ */ jsx(
41
- AstroChart,
42
- {
43
- ref,
44
- type: "area",
45
- series: transformedSeries,
46
- tooltip: { trigger: "axis", crosshair: "x" },
47
- ...props
48
- }
49
- );
50
- }
51
- ));
52
- const BarChart = memo(forwardRef(
53
- function BarChart2({ stacked = false, horizontal = false, series = [], xAxis, yAxis, ...props }, ref) {
54
- const transformedSeries = series.map((s) => ({
55
- ...s,
56
- type: "bar",
57
- stack: stacked ? "total" : void 0
58
- }));
59
- const finalXAxis = horizontal ? { type: "value", ...yAxis } : { type: "category", ...xAxis };
60
- const finalYAxis = horizontal ? { type: "category", ...xAxis } : { type: "value", ...yAxis };
61
- return /* @__PURE__ */ jsx(
62
- AstroChart,
63
- {
64
- ref,
65
- type: "bar",
66
- series: transformedSeries,
67
- xAxis: finalXAxis,
68
- yAxis: finalYAxis,
69
- tooltip: { trigger: "axis" },
70
- ...props
71
- }
72
- );
73
- }
74
- ));
75
- const ScatterChart = memo(forwardRef(
76
- function ScatterChart2({ symbolSize = 10, series = [], ...props }, ref) {
77
- const transformedSeries = series.map((s) => ({
78
- ...s,
79
- type: "scatter",
80
- symbol: {
81
- type: "circle",
82
- size: typeof symbolSize === "number" ? symbolSize : 10
83
- }
84
- }));
85
- return /* @__PURE__ */ jsx(
86
- AstroChart,
87
- {
88
- ref,
89
- type: "scatter",
90
- series: transformedSeries,
91
- tooltip: { trigger: "item" },
92
- xAxis: { type: "value" },
93
- yAxis: { type: "value" },
94
- ...props
95
- }
96
- );
97
- }
98
- ));
99
- const PieChart = memo(forwardRef(
100
- function PieChart2({
101
- donut = false,
102
- innerRadius = "40%",
103
- outerRadius = "70%",
104
- showLabels = true,
105
- series = [],
106
- ...props
107
- }, ref) {
108
- const transformedSeries = series.map((s) => ({
109
- ...s,
110
- type: donut ? "donut" : "pie"
111
- }));
112
- return /* @__PURE__ */ jsx(
113
- AstroChart,
114
- {
115
- ref,
116
- type: donut ? "donut" : "pie",
117
- series: transformedSeries,
118
- tooltip: { trigger: "item" },
119
- echartsOptions: {
120
- series: [{
121
- radius: donut ? [innerRadius, outerRadius] : outerRadius,
122
- label: {
123
- show: showLabels,
124
- formatter: "{b}: {d}%"
125
- }
126
- }]
127
- },
128
- ...props
129
- }
130
- );
131
- }
132
- ));
133
- const DonutChart = memo(forwardRef(
134
- function DonutChart2(props, ref) {
135
- return /* @__PURE__ */ jsx(PieChart, { ref, donut: true, ...props });
136
- }
137
- ));
138
- const GaugeChart = memo(forwardRef(
139
- function GaugeChart2({
140
- value,
141
- min = 0,
142
- max = 100,
143
- unit = "%",
144
- label,
145
- thresholds,
146
- progress = true,
147
- showPointer = true,
148
- width = 220,
149
- height = 220,
150
- ...props
151
- }, ref) {
152
- var _a;
153
- const { tokens } = useTheme();
154
- const range = max - min;
155
- const safeRange = range === 0 ? 1 : range;
156
- const clampedValue = Math.max(min, Math.min(max, value));
157
- const widthPx = typeof width === "number" ? width : typeof height === "number" ? height : 220;
158
- const heightPx = typeof height === "number" ? height : 220;
159
- const gaugeSize = Math.max(120, Math.min(widthPx, heightPx));
160
- const compactGauge = gaugeSize < 170;
161
- const arcWidth = Math.max(8, Math.round(gaugeSize * 0.07));
162
- const valueFontSize = Math.max(16, Math.round(gaugeSize * 0.15));
163
- const labelFontSize = Math.max(10, Math.round(gaugeSize * 0.07));
164
- const unitSuffix = (unit == null ? void 0 : unit.trim()) ?? "";
165
- const longUnit = unitSuffix.length > 4;
166
- const series = [{
167
- id: "gauge",
168
- name: label || "Value",
169
- type: "gauge",
170
- data: [{ x: 0, y: clampedValue }]
171
- }];
172
- const normalizedThresholds = [...thresholds ?? []].filter((t) => Number.isFinite(t.value)).sort((a, b) => a.value - b.value);
173
- const colorStops = normalizedThresholds.map((t) => [
174
- Math.max(0, Math.min(1, (t.value - min) / safeRange)),
175
- t.color
176
- ]);
177
- if (colorStops.length === 0) {
178
- colorStops.push(
179
- [0.3, SOFT_STATUS_COLORS.normal],
180
- [0.7, SOFT_STATUS_COLORS.caution],
181
- [1, SOFT_STATUS_COLORS.critical]
182
- );
183
- } else if (colorStops[colorStops.length - 1][0] < 1) {
184
- colorStops.push([1, colorStops[colorStops.length - 1][1]]);
185
- }
186
- const activeColor = ((_a = [...colorStops].reverse().find(([stop]) => stop <= (clampedValue - min) / safeRange)) == null ? void 0 : _a[1]) ?? SOFT_STATUS_COLORS.normal;
187
- return /* @__PURE__ */ jsx(
188
- AstroChart,
189
- {
190
- ref,
191
- type: "gauge",
192
- series,
193
- width,
194
- height,
195
- echartsOptions: {
196
- series: [{
197
- type: "gauge",
198
- min,
199
- max,
200
- progress: {
201
- show: progress,
202
- width: arcWidth,
203
- roundCap: true
204
- },
205
- axisLine: {
206
- lineStyle: {
207
- width: arcWidth,
208
- color: colorStops
209
- }
210
- },
211
- axisTick: { show: false },
212
- splitLine: { show: false },
213
- axisLabel: { show: false },
214
- pointer: {
215
- show: showPointer,
216
- length: compactGauge ? "56%" : "60%",
217
- width: Math.max(3, Math.round(arcWidth * 0.38))
218
- },
219
- title: {
220
- show: !!label,
221
- offsetCenter: [0, compactGauge ? "73%" : "78%"],
222
- fontSize: labelFontSize,
223
- color: tokens.colors.text.secondary
224
- },
225
- detail: {
226
- valueAnimation: true,
227
- formatter: (currentValue) => {
228
- const rounded = Math.round(currentValue);
229
- if (!unitSuffix) return `${rounded}`;
230
- if (longUnit) return `${rounded}
231
- {unit|${unitSuffix}}`;
232
- return `${rounded}${unitSuffix}`;
233
- },
234
- rich: {
235
- unit: {
236
- color: tokens.colors.text.secondary,
237
- fontSize: Math.max(10, Math.round(valueFontSize * 0.48)),
238
- fontWeight: 500,
239
- lineHeight: Math.round(valueFontSize * 0.78)
240
- }
241
- },
242
- lineHeight: Math.round(valueFontSize * 1.05),
243
- fontSize: valueFontSize,
244
- fontWeight: 700,
245
- offsetCenter: [0, compactGauge ? "10%" : "14%"],
246
- color: activeColor
247
- },
248
- data: [{ value: clampedValue, name: label }]
249
- }]
250
- },
251
- ...props
252
- }
253
- );
254
- }
255
- ));
256
- const RadarChart = memo(forwardRef(
257
- function RadarChart2({ indicators, areaStyle = true, series = [], ...props }, ref) {
258
- const extractValues = (data) => {
259
- if (!data || data.length === 0) return [];
260
- const first = data[0];
261
- if (typeof first === "number") return data;
262
- if (typeof first === "object" && first !== null && "y" in first) {
263
- return data.map((d) => d.y);
264
- }
265
- return [];
266
- };
267
- return /* @__PURE__ */ jsx(
268
- AstroChart,
269
- {
270
- ref,
271
- type: "radar",
272
- series: [],
273
- tooltip: { trigger: "item" },
274
- echartsOptions: {
275
- radar: {
276
- indicator: indicators,
277
- shape: "polygon"
278
- },
279
- series: series.map((s) => ({
280
- type: "radar",
281
- name: s.name,
282
- data: [{
283
- value: extractValues(s.data),
284
- name: s.name
285
- }],
286
- areaStyle: areaStyle ? { opacity: 0.3 } : void 0
287
- }))
288
- },
289
- ...props
290
- }
291
- );
292
- }
293
- ));
294
- const HeatmapChart = memo(forwardRef(
295
- function HeatmapChart2({
296
- xCategories,
297
- yCategories,
298
- valueRange = [0, 100],
299
- showLabels = true,
300
- series = [],
301
- ...props
302
- }, ref) {
303
- var _a;
304
- const heatmapData = (_a = series[0]) == null ? void 0 : _a.data;
305
- return /* @__PURE__ */ jsx(
306
- AstroChart,
307
- {
308
- ref,
309
- type: "heatmap",
310
- series,
311
- xAxis: { type: "category" },
312
- yAxis: { type: "category" },
313
- tooltip: { trigger: "item" },
314
- echartsOptions: {
315
- xAxis: { data: xCategories },
316
- yAxis: { data: yCategories },
317
- visualMap: {
318
- min: valueRange[0],
319
- max: valueRange[1],
320
- calculable: true,
321
- orient: "horizontal",
322
- left: "center",
323
- bottom: "5%"
324
- },
325
- series: [{
326
- type: "heatmap",
327
- data: heatmapData,
328
- label: {
329
- show: showLabels
330
- },
331
- emphasis: {
332
- itemStyle: {
333
- shadowBlur: 10,
334
- shadowColor: "rgba(0, 0, 0, 0.5)"
335
- }
336
- }
337
- }]
338
- },
339
- ...props
340
- }
341
- );
342
- }
343
- ));
344
- const TimeSeriesChart = memo(forwardRef(
345
- function TimeSeriesChart2({
346
- timeWindow,
347
- maxPoints = 1e3,
348
- autoScroll = true,
349
- showCurrentValues: _showCurrentValues = true,
350
- series = [],
351
- ...props
352
- }, ref) {
353
- const xAxis = {
354
- type: "time",
355
- ...timeWindow ? {
356
- min: "dataMin",
357
- max: "dataMax"
358
- } : {}
359
- };
360
- return /* @__PURE__ */ jsx(
361
- AstroChart,
362
- {
363
- ref,
364
- type: "line",
365
- series: series.map((s) => ({
366
- ...s,
367
- smooth: true,
368
- symbol: { type: "none" }
369
- })),
370
- xAxis,
371
- tooltip: {
372
- trigger: "axis",
373
- crosshair: "x"
374
- },
375
- zoom: autoScroll ? void 0 : {
376
- enabled: true,
377
- type: "both",
378
- axis: "x"
379
- },
380
- realTime: {
381
- enabled: true,
382
- maxPoints,
383
- timeWindow,
384
- shift: autoScroll
385
- },
386
- ...props
387
- }
388
- );
389
- }
390
- ));
391
- const DualAxisChart = memo(forwardRef(
392
- function DualAxisChart2({ leftAxis, rightAxis, series = [], ...props }, ref) {
393
- const transformedSeries = series.map((s, i) => ({
394
- ...s,
395
- yAxisIndex: s.yAxisIndex ?? i % 2
396
- // Alternate by default
397
- }));
398
- return /* @__PURE__ */ jsx(
399
- AstroChart,
400
- {
401
- ref,
402
- type: "line",
403
- series: transformedSeries,
404
- yAxis: [
405
- { position: "left", ...leftAxis },
406
- { position: "right", ...rightAxis }
407
- ],
408
- tooltip: { trigger: "axis", crosshair: "x" },
409
- ...props
410
- }
411
- );
412
- }
413
- ));
414
- const StackedAreaChart = memo(forwardRef(
415
- function StackedAreaChart2(props, ref) {
416
- return /* @__PURE__ */ jsx(AreaChart, { ref, stacked: true, ...props });
417
- }
418
- ));
419
- const StackedBarChart = memo(forwardRef(
420
- function StackedBarChart2(props, ref) {
421
- return /* @__PURE__ */ jsx(BarChart, { ref, stacked: true, ...props });
422
- }
423
- ));
424
- const BubbleChart = memo(forwardRef(
425
- function BubbleChart2({
426
- minSize = 10,
427
- maxSize = 60,
428
- showSizeLegend = true,
429
- series = [],
430
- ...props
431
- }, ref) {
432
- const transformedSeries = series.map((s) => ({
433
- ...s,
434
- type: "scatter"
435
- }));
436
- return /* @__PURE__ */ jsx(
437
- AstroChart,
438
- {
439
- ref,
440
- type: "scatter",
441
- series: transformedSeries,
442
- tooltip: { trigger: "item" },
443
- echartsOptions: {
444
- series: series.map((s, _idx) => {
445
- const data = s.data;
446
- return {
447
- type: "scatter",
448
- name: s.name,
449
- data: data.map((d) => {
450
- if (Array.isArray(d)) return d;
451
- return [d.x, d.y, d.size ?? 10];
452
- }),
453
- symbolSize: (val) => {
454
- const size = val[2] ?? minSize;
455
- return Math.max(minSize, Math.min(maxSize, size));
456
- }
457
- };
458
- }),
459
- visualMap: showSizeLegend ? {
460
- show: true,
461
- dimension: 2,
462
- min: 0,
463
- max: 100,
464
- inRange: { symbolSize: [minSize, maxSize] },
465
- right: 10,
466
- top: "center"
467
- } : void 0
468
- },
469
- ...props
470
- }
471
- );
472
- }
473
- ));
474
- const HistogramChart = memo(forwardRef(
475
- function HistogramChart2({
476
- bins: _bins = 20,
477
- showCurve: _showCurve = false,
478
- series = [],
479
- xAxis,
480
- ...props
481
- }, ref) {
482
- const transformedSeries = series.map((s) => ({
483
- ...s,
484
- type: "bar"
485
- }));
486
- return /* @__PURE__ */ jsx(
487
- AstroChart,
488
- {
489
- ref,
490
- type: "bar",
491
- series: transformedSeries,
492
- xAxis: { type: "category", ...xAxis },
493
- yAxis: { type: "value", name: "Frequency" },
494
- tooltip: { trigger: "axis" },
495
- echartsOptions: {
496
- series: series.map((s) => ({
497
- type: "bar",
498
- name: s.name,
499
- data: s.data,
500
- barWidth: "90%",
501
- itemStyle: { borderRadius: [2, 2, 0, 0] }
502
- }))
503
- },
504
- ...props
505
- }
506
- );
507
- }
508
- ));
509
- const SankeyChart = memo(forwardRef(
510
- function SankeyChart2({
511
- nodes = [],
512
- links = [],
513
- orient = "horizontal",
514
- ...props
515
- }, ref) {
516
- const { tokens } = useTheme();
517
- return /* @__PURE__ */ jsx(
518
- AstroChart,
519
- {
520
- ref,
521
- type: "sankey",
522
- series: [],
523
- echartsOptions: {
524
- tooltip: {
525
- trigger: "item",
526
- triggerOn: "mousemove"
527
- },
528
- series: [{
529
- type: "sankey",
530
- orient,
531
- layoutIterations: 32,
532
- emphasis: { focus: "adjacency" },
533
- nodeAlign: "justify",
534
- lineStyle: { color: "gradient", curveness: 0.5 },
535
- data: nodes,
536
- links,
537
- label: {
538
- color: tokens.colors.text.primary,
539
- fontSize: 12
540
- }
541
- }]
542
- },
543
- ...props
544
- }
545
- );
546
- }
547
- ));
548
- const TreemapChart = memo(forwardRef(
549
- function TreemapChart2({
550
- data = [],
551
- showBreadcrumb = true,
552
- leafDepth = 2,
553
- ...props
554
- }, ref) {
555
- const { tokens } = useTheme();
556
- return /* @__PURE__ */ jsx(
557
- AstroChart,
558
- {
559
- ref,
560
- type: "treemap",
561
- series: [],
562
- echartsOptions: {
563
- tooltip: {
564
- formatter: (info) => {
565
- const value = info.value;
566
- const name = info.name;
567
- return `${name}: ${typeof value === "number" ? value.toLocaleString() : value}`;
568
- }
569
- },
570
- series: [{
571
- type: "treemap",
572
- data,
573
- leafDepth,
574
- roam: false,
575
- // AstroUXDS compliant breadcrumb navigation
576
- breadcrumb: {
577
- show: showBreadcrumb,
578
- bottom: 10,
579
- itemStyle: { color: "rgba(100, 116, 139, 0.6)" }
580
- // Subtle grey
581
- },
582
- label: {
583
- show: true,
584
- formatter: "{b}",
585
- color: tokens.colors.text.primary,
586
- fontSize: 12
587
- },
588
- upperLabel: {
589
- show: true,
590
- height: 30,
591
- color: tokens.colors.text.secondary
592
- },
593
- // AstroUXDS compliant borders - subtle grey
594
- itemStyle: {
595
- borderColor: "rgba(100, 116, 139, 0.2)",
596
- borderWidth: 2,
597
- gapWidth: 2
598
- },
599
- levels: [
600
- {
601
- itemStyle: { borderColor: "rgba(100, 116, 139, 0.3)", borderWidth: 4, gapWidth: 4 },
602
- upperLabel: { show: false }
603
- },
604
- {
605
- itemStyle: { borderColor: "rgba(100, 116, 139, 0.25)", borderWidth: 2, gapWidth: 2 },
606
- emphasis: { itemStyle: { borderColor: ASTRO_DATA_VIZ_COLORS.mixed[0] } }
607
- // Zendir Electric on hover
608
- },
609
- {
610
- colorSaturation: [0.35, 0.5],
611
- itemStyle: { borderColor: "rgba(62, 60, 255, 0.3)", borderWidth: 1 }
612
- // Zendir Electric subtle
613
- }
614
- ]
615
- }]
616
- },
617
- ...props
618
- }
619
- );
620
- }
621
- ));
622
- const SunburstChart = memo(forwardRef(
623
- function SunburstChart2({
624
- data = [],
625
- innerRadius = "15%",
626
- outerRadius = "80%",
627
- ...props
628
- }, ref) {
629
- const { tokens } = useTheme();
630
- return /* @__PURE__ */ jsx(
631
- AstroChart,
632
- {
633
- ref,
634
- type: "sunburst",
635
- series: [],
636
- echartsOptions: {
637
- tooltip: {
638
- trigger: "item"
639
- },
640
- // Zendir-branded sunburst visualization
641
- series: [{
642
- type: "sunburst",
643
- data,
644
- radius: [innerRadius, outerRadius],
645
- emphasis: { focus: "ancestor" },
646
- label: {
647
- rotate: "radial",
648
- color: tokens.colors.text.secondary,
649
- fontSize: 11
650
- },
651
- itemStyle: {
652
- borderRadius: 4,
653
- borderWidth: 2,
654
- borderColor: "rgba(62, 60, 255, 0.25)"
655
- // Zendir Electric subtle border
656
- },
657
- levels: [
658
- {},
659
- { r0: "15%", r: "40%", label: { rotate: "tangential" } },
660
- { r0: "40%", r: "65%" },
661
- { r0: "65%", r: "80%", label: { position: "outside", fontSize: 10 } }
662
- ]
663
- }]
664
- },
665
- ...props
666
- }
667
- );
668
- }
669
- ));
670
- const ParallelChart = memo(forwardRef(
671
- function ParallelChart2({
672
- axes = [],
673
- data = [],
674
- lineStyle = { opacity: 0.5, width: 1.5 },
675
- ...props
676
- }, ref) {
677
- const { tokens } = useTheme();
678
- return /* @__PURE__ */ jsx(
679
- AstroChart,
680
- {
681
- ref,
682
- type: "line",
683
- series: [],
684
- echartsOptions: {
685
- parallelAxis: axes.map((axis) => ({
686
- dim: axis.dim,
687
- name: axis.name,
688
- min: axis.min,
689
- max: axis.max,
690
- type: axis.type || "value",
691
- data: axis.data,
692
- nameTextStyle: { color: tokens.colors.text.secondary },
693
- axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
694
- axisTick: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
695
- axisLabel: { color: tokens.colors.text.tertiary }
696
- })),
697
- parallel: {
698
- left: 60,
699
- right: 60,
700
- bottom: 60,
701
- top: 60,
702
- parallelAxisDefault: {
703
- type: "value",
704
- nameLocation: "end",
705
- nameGap: 20,
706
- axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
707
- axisTick: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
708
- splitLine: { show: false },
709
- axisLabel: { color: tokens.colors.text.tertiary }
710
- }
711
- },
712
- series: [{
713
- type: "parallel",
714
- lineStyle: {
715
- ...lineStyle,
716
- color: ASTRO_DATA_VIZ_COLORS.mixed[0]
717
- // Zendir Electric
718
- },
719
- data: data.map((row) => ({ value: row })),
720
- emphasis: {
721
- lineStyle: { width: 3, opacity: 1 }
722
- }
723
- }]
724
- },
725
- ...props
726
- }
727
- );
728
- }
729
- ));
730
- const CandlestickChart = memo(forwardRef(
731
- function CandlestickChart2({
732
- data = [],
733
- showVolume: _showVolume = false,
734
- ...props
735
- }, ref) {
736
- const { tokens } = useTheme();
737
- const categoryData = data.map((d) => d.time);
738
- const ohlcData = data.map((d) => [d.open, d.close, d.low, d.high]);
739
- return /* @__PURE__ */ jsx(
740
- AstroChart,
741
- {
742
- ref,
743
- type: "candlestick",
744
- series: [],
745
- echartsOptions: {
746
- tooltip: {
747
- trigger: "axis",
748
- axisPointer: { type: "cross" }
749
- },
750
- xAxis: {
751
- type: "category",
752
- data: categoryData,
753
- axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
754
- axisLabel: { color: tokens.colors.text.secondary }
755
- },
756
- yAxis: {
757
- type: "value",
758
- scale: true,
759
- splitLine: { lineStyle: { color: "rgba(100, 116, 139, 0.15)" } },
760
- axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
761
- axisLabel: { color: tokens.colors.text.secondary }
762
- },
763
- series: [{
764
- type: "candlestick",
765
- data: ohlcData,
766
- itemStyle: {
767
- color: SOFT_STATUS_COLORS.normal,
768
- // AstroUXDS green (up/bullish)
769
- color0: SOFT_STATUS_COLORS.critical,
770
- // AstroUXDS red (down/bearish)
771
- borderColor: SOFT_STATUS_COLORS.normal,
772
- borderColor0: SOFT_STATUS_COLORS.critical
773
- }
774
- }],
775
- dataZoom: [
776
- { type: "inside", start: 0, end: 100 },
777
- { show: true, type: "slider", bottom: 10 }
778
- ]
779
- },
780
- ...props
781
- }
782
- );
783
- }
784
- ));
785
- const GraphChart = memo(forwardRef(
786
- function GraphChart2({
787
- nodes = [],
788
- links = [],
789
- categories = [],
790
- layout = "force",
791
- ...props
792
- }, ref) {
793
- const { tokens } = useTheme();
794
- return /* @__PURE__ */ jsx(
795
- AstroChart,
796
- {
797
- ref,
798
- type: "scatter",
799
- series: [],
800
- echartsOptions: {
801
- tooltip: {},
802
- legend: categories.length > 0 ? {
803
- data: categories.map((c) => c.name),
804
- textStyle: { color: tokens.colors.text.primary }
805
- } : void 0,
806
- series: [{
807
- type: "graph",
808
- layout,
809
- data: nodes.map((n) => ({
810
- ...n,
811
- symbolSize: n.symbolSize || 30
812
- })),
813
- links,
814
- categories,
815
- roam: true,
816
- label: {
817
- show: true,
818
- position: "right",
819
- formatter: "{b}",
820
- color: tokens.colors.text.primary,
821
- fontSize: 11
822
- },
823
- lineStyle: {
824
- color: "source",
825
- curveness: 0.3,
826
- opacity: 0.6
827
- },
828
- emphasis: {
829
- focus: "adjacency",
830
- lineStyle: { width: 3 }
831
- },
832
- force: layout === "force" ? {
833
- repulsion: 200,
834
- edgeLength: [50, 150],
835
- gravity: 0.1
836
- } : void 0
837
- }]
838
- },
839
- ...props
840
- }
841
- );
842
- }
843
- ));
21
+ var LineChart = memo(forwardRef(function LineChart({ smooth = true, showPoints = false, showArea = false, series = [], ...props }, ref) {
22
+ const transformedSeries = series.map((s) => ({
23
+ ...s,
24
+ type: showArea ? "area" : "line",
25
+ smooth,
26
+ symbol: showPoints ? {
27
+ type: "circle",
28
+ size: 6
29
+ } : { type: "none" }
30
+ }));
31
+ return /* @__PURE__ */ jsx(AstroChart, {
32
+ ref,
33
+ type: showArea ? "area" : "line",
34
+ series: transformedSeries,
35
+ tooltip: {
36
+ trigger: "axis",
37
+ crosshair: "x"
38
+ },
39
+ ...props
40
+ });
41
+ }));
42
+ var AreaChart = memo(forwardRef(function AreaChart({ stacked = false, smooth = true, series = [], ...props }, ref) {
43
+ return /* @__PURE__ */ jsx(AstroChart, {
44
+ ref,
45
+ type: "area",
46
+ series: series.map((s, _i) => ({
47
+ ...s,
48
+ type: "area",
49
+ smooth,
50
+ stack: stacked ? "total" : void 0,
51
+ areaStyle: { opacity: stacked ? .8 : .3 }
52
+ })),
53
+ tooltip: {
54
+ trigger: "axis",
55
+ crosshair: "x"
56
+ },
57
+ ...props
58
+ });
59
+ }));
60
+ var BarChart = memo(forwardRef(function BarChart({ stacked = false, horizontal = false, series = [], xAxis, yAxis, ...props }, ref) {
61
+ return /* @__PURE__ */ jsx(AstroChart, {
62
+ ref,
63
+ type: "bar",
64
+ series: series.map((s) => ({
65
+ ...s,
66
+ type: "bar",
67
+ stack: stacked ? "total" : void 0
68
+ })),
69
+ xAxis: horizontal ? {
70
+ type: "value",
71
+ ...yAxis
72
+ } : {
73
+ type: "category",
74
+ ...xAxis
75
+ },
76
+ yAxis: horizontal ? {
77
+ type: "category",
78
+ ...xAxis
79
+ } : {
80
+ type: "value",
81
+ ...yAxis
82
+ },
83
+ tooltip: { trigger: "axis" },
84
+ ...props
85
+ });
86
+ }));
87
+ var ScatterChart = memo(forwardRef(function ScatterChart({ symbolSize = 10, series = [], ...props }, ref) {
88
+ return /* @__PURE__ */ jsx(AstroChart, {
89
+ ref,
90
+ type: "scatter",
91
+ series: series.map((s) => ({
92
+ ...s,
93
+ type: "scatter",
94
+ symbol: {
95
+ type: "circle",
96
+ size: typeof symbolSize === "number" ? symbolSize : 10
97
+ }
98
+ })),
99
+ tooltip: { trigger: "item" },
100
+ xAxis: { type: "value" },
101
+ yAxis: { type: "value" },
102
+ ...props
103
+ });
104
+ }));
105
+ var PieChart = memo(forwardRef(function PieChart({ donut = false, innerRadius = "40%", outerRadius = "70%", showLabels = true, series = [], ...props }, ref) {
106
+ const transformedSeries = series.map((s) => ({
107
+ ...s,
108
+ type: donut ? "donut" : "pie"
109
+ }));
110
+ return /* @__PURE__ */ jsx(AstroChart, {
111
+ ref,
112
+ type: donut ? "donut" : "pie",
113
+ series: transformedSeries,
114
+ tooltip: { trigger: "item" },
115
+ echartsOptions: { series: [{
116
+ radius: donut ? [innerRadius, outerRadius] : outerRadius,
117
+ label: {
118
+ show: showLabels,
119
+ formatter: "{b}: {d}%"
120
+ }
121
+ }] },
122
+ ...props
123
+ });
124
+ }));
125
+ var DonutChart = memo(forwardRef(function DonutChart(props, ref) {
126
+ return /* @__PURE__ */ jsx(PieChart, {
127
+ ref,
128
+ donut: true,
129
+ ...props
130
+ });
131
+ }));
132
+ var GaugeChart = memo(forwardRef(function GaugeChart({ value, min = 0, max = 100, unit = "%", label, thresholds, progress = true, showPointer = true, width = 220, height = 220, ...props }, ref) {
133
+ const { tokens } = useTheme();
134
+ const range = max - min;
135
+ const safeRange = range === 0 ? 1 : range;
136
+ const clampedValue = Math.max(min, Math.min(max, value));
137
+ const gaugeSize = Math.max(120, Math.min(typeof width === "number" ? width : typeof height === "number" ? height : 220, typeof height === "number" ? height : 220));
138
+ const compactGauge = gaugeSize < 170;
139
+ const arcWidth = Math.max(8, Math.round(gaugeSize * .07));
140
+ const valueFontSize = Math.max(16, Math.round(gaugeSize * .15));
141
+ const labelFontSize = Math.max(10, Math.round(gaugeSize * .07));
142
+ const unitSuffix = unit?.trim() ?? "";
143
+ const longUnit = unitSuffix.length > 4;
144
+ const series = [{
145
+ id: "gauge",
146
+ name: label || "Value",
147
+ type: "gauge",
148
+ data: [{
149
+ x: 0,
150
+ y: clampedValue
151
+ }]
152
+ }];
153
+ const colorStops = [...thresholds ?? []].filter((t) => Number.isFinite(t.value)).sort((a, b) => a.value - b.value).map((t) => [Math.max(0, Math.min(1, (t.value - min) / safeRange)), t.color]);
154
+ if (colorStops.length === 0) colorStops.push([.3, SOFT_STATUS_COLORS.normal], [.7, SOFT_STATUS_COLORS.caution], [1, SOFT_STATUS_COLORS.critical]);
155
+ else if (colorStops[colorStops.length - 1][0] < 1) colorStops.push([1, colorStops[colorStops.length - 1][1]]);
156
+ const activeColor = [...colorStops].reverse().find(([stop]) => stop <= (clampedValue - min) / safeRange)?.[1] ?? SOFT_STATUS_COLORS.normal;
157
+ return /* @__PURE__ */ jsx(AstroChart, {
158
+ ref,
159
+ type: "gauge",
160
+ series,
161
+ width,
162
+ height,
163
+ echartsOptions: { series: [{
164
+ type: "gauge",
165
+ min,
166
+ max,
167
+ progress: {
168
+ show: progress,
169
+ width: arcWidth,
170
+ roundCap: true
171
+ },
172
+ axisLine: { lineStyle: {
173
+ width: arcWidth,
174
+ color: colorStops
175
+ } },
176
+ axisTick: { show: false },
177
+ splitLine: { show: false },
178
+ axisLabel: { show: false },
179
+ pointer: {
180
+ show: showPointer,
181
+ length: compactGauge ? "56%" : "60%",
182
+ width: Math.max(3, Math.round(arcWidth * .38))
183
+ },
184
+ title: {
185
+ show: !!label,
186
+ offsetCenter: [0, compactGauge ? "73%" : "78%"],
187
+ fontSize: labelFontSize,
188
+ color: tokens.colors.text.secondary
189
+ },
190
+ detail: {
191
+ valueAnimation: true,
192
+ formatter: (currentValue) => {
193
+ const rounded = Math.round(currentValue);
194
+ if (!unitSuffix) return `${rounded}`;
195
+ if (longUnit) return `${rounded}\n{unit|${unitSuffix}}`;
196
+ return `${rounded}${unitSuffix}`;
197
+ },
198
+ rich: { unit: {
199
+ color: tokens.colors.text.secondary,
200
+ fontSize: Math.max(10, Math.round(valueFontSize * .48)),
201
+ fontWeight: 500,
202
+ lineHeight: Math.round(valueFontSize * .78)
203
+ } },
204
+ lineHeight: Math.round(valueFontSize * 1.05),
205
+ fontSize: valueFontSize,
206
+ fontWeight: 700,
207
+ offsetCenter: [0, compactGauge ? "10%" : "14%"],
208
+ color: activeColor
209
+ },
210
+ data: [{
211
+ value: clampedValue,
212
+ name: label
213
+ }]
214
+ }] },
215
+ ...props
216
+ });
217
+ }));
218
+ var RadarChart = memo(forwardRef(function RadarChart({ indicators, areaStyle = true, series = [], ...props }, ref) {
219
+ const extractValues = (data) => {
220
+ if (!data || data.length === 0) return [];
221
+ const first = data[0];
222
+ if (typeof first === "number") return data;
223
+ if (typeof first === "object" && first !== null && "y" in first) return data.map((d) => d.y);
224
+ return [];
225
+ };
226
+ return /* @__PURE__ */ jsx(AstroChart, {
227
+ ref,
228
+ type: "radar",
229
+ series: [],
230
+ tooltip: { trigger: "item" },
231
+ echartsOptions: {
232
+ radar: {
233
+ indicator: indicators,
234
+ shape: "polygon"
235
+ },
236
+ series: series.map((s) => ({
237
+ type: "radar",
238
+ name: s.name,
239
+ data: [{
240
+ value: extractValues(s.data),
241
+ name: s.name
242
+ }],
243
+ areaStyle: areaStyle ? { opacity: .3 } : void 0
244
+ }))
245
+ },
246
+ ...props
247
+ });
248
+ }));
249
+ var HeatmapChart = memo(forwardRef(function HeatmapChart({ xCategories, yCategories, valueRange = [0, 100], showLabels = true, series = [], ...props }, ref) {
250
+ const heatmapData = series[0]?.data;
251
+ return /* @__PURE__ */ jsx(AstroChart, {
252
+ ref,
253
+ type: "heatmap",
254
+ series,
255
+ xAxis: { type: "category" },
256
+ yAxis: { type: "category" },
257
+ tooltip: { trigger: "item" },
258
+ echartsOptions: {
259
+ xAxis: { data: xCategories },
260
+ yAxis: { data: yCategories },
261
+ visualMap: {
262
+ min: valueRange[0],
263
+ max: valueRange[1],
264
+ calculable: true,
265
+ orient: "horizontal",
266
+ left: "center",
267
+ bottom: "5%"
268
+ },
269
+ series: [{
270
+ type: "heatmap",
271
+ data: heatmapData,
272
+ label: { show: showLabels },
273
+ emphasis: { itemStyle: {
274
+ shadowBlur: 10,
275
+ shadowColor: "rgba(0, 0, 0, 0.5)"
276
+ } }
277
+ }]
278
+ },
279
+ ...props
280
+ });
281
+ }));
282
+ var TimeSeriesChart = memo(forwardRef(function TimeSeriesChart({ timeWindow, maxPoints = 1e3, autoScroll = true, showCurrentValues: _showCurrentValues = true, series = [], ...props }, ref) {
283
+ const xAxis = {
284
+ type: "time",
285
+ ...timeWindow ? {
286
+ min: "dataMin",
287
+ max: "dataMax"
288
+ } : {}
289
+ };
290
+ return /* @__PURE__ */ jsx(AstroChart, {
291
+ ref,
292
+ type: "line",
293
+ series: series.map((s) => ({
294
+ ...s,
295
+ smooth: true,
296
+ symbol: { type: "none" }
297
+ })),
298
+ xAxis,
299
+ tooltip: {
300
+ trigger: "axis",
301
+ crosshair: "x"
302
+ },
303
+ zoom: autoScroll ? void 0 : {
304
+ enabled: true,
305
+ type: "both",
306
+ axis: "x"
307
+ },
308
+ realTime: {
309
+ enabled: true,
310
+ maxPoints,
311
+ timeWindow,
312
+ shift: autoScroll
313
+ },
314
+ ...props
315
+ });
316
+ }));
317
+ var DualAxisChart = memo(forwardRef(function DualAxisChart({ leftAxis, rightAxis, series = [], ...props }, ref) {
318
+ return /* @__PURE__ */ jsx(AstroChart, {
319
+ ref,
320
+ type: "line",
321
+ series: series.map((s, i) => ({
322
+ ...s,
323
+ yAxisIndex: s.yAxisIndex ?? i % 2
324
+ })),
325
+ yAxis: [{
326
+ position: "left",
327
+ ...leftAxis
328
+ }, {
329
+ position: "right",
330
+ ...rightAxis
331
+ }],
332
+ tooltip: {
333
+ trigger: "axis",
334
+ crosshair: "x"
335
+ },
336
+ ...props
337
+ });
338
+ }));
339
+ var StackedAreaChart = memo(forwardRef(function StackedAreaChart(props, ref) {
340
+ return /* @__PURE__ */ jsx(AreaChart, {
341
+ ref,
342
+ stacked: true,
343
+ ...props
344
+ });
345
+ }));
346
+ var StackedBarChart = memo(forwardRef(function StackedBarChart(props, ref) {
347
+ return /* @__PURE__ */ jsx(BarChart, {
348
+ ref,
349
+ stacked: true,
350
+ ...props
351
+ });
352
+ }));
353
+ var BubbleChart = memo(forwardRef(function BubbleChart({ minSize = 10, maxSize = 60, showSizeLegend = true, series = [], ...props }, ref) {
354
+ return /* @__PURE__ */ jsx(AstroChart, {
355
+ ref,
356
+ type: "scatter",
357
+ series: series.map((s) => ({
358
+ ...s,
359
+ type: "scatter"
360
+ })),
361
+ tooltip: { trigger: "item" },
362
+ echartsOptions: {
363
+ series: series.map((s, _idx) => {
364
+ const data = s.data;
365
+ return {
366
+ type: "scatter",
367
+ name: s.name,
368
+ data: data.map((d) => {
369
+ if (Array.isArray(d)) return d;
370
+ return [
371
+ d.x,
372
+ d.y,
373
+ d.size ?? 10
374
+ ];
375
+ }),
376
+ symbolSize: (val) => {
377
+ const size = val[2] ?? minSize;
378
+ return Math.max(minSize, Math.min(maxSize, size));
379
+ }
380
+ };
381
+ }),
382
+ visualMap: showSizeLegend ? {
383
+ show: true,
384
+ dimension: 2,
385
+ min: 0,
386
+ max: 100,
387
+ inRange: { symbolSize: [minSize, maxSize] },
388
+ right: 10,
389
+ top: "center"
390
+ } : void 0
391
+ },
392
+ ...props
393
+ });
394
+ }));
395
+ var HistogramChart = memo(forwardRef(function HistogramChart({ bins: _bins = 20, showCurve: _showCurve = false, series = [], xAxis, ...props }, ref) {
396
+ return /* @__PURE__ */ jsx(AstroChart, {
397
+ ref,
398
+ type: "bar",
399
+ series: series.map((s) => ({
400
+ ...s,
401
+ type: "bar"
402
+ })),
403
+ xAxis: {
404
+ type: "category",
405
+ ...xAxis
406
+ },
407
+ yAxis: {
408
+ type: "value",
409
+ name: "Frequency"
410
+ },
411
+ tooltip: { trigger: "axis" },
412
+ echartsOptions: { series: series.map((s) => ({
413
+ type: "bar",
414
+ name: s.name,
415
+ data: s.data,
416
+ barWidth: "90%",
417
+ itemStyle: { borderRadius: [
418
+ 2,
419
+ 2,
420
+ 0,
421
+ 0
422
+ ] }
423
+ })) },
424
+ ...props
425
+ });
426
+ }));
427
+ var SankeyChart = memo(forwardRef(function SankeyChart({ nodes = [], links = [], orient = "horizontal", ...props }, ref) {
428
+ const { tokens } = useTheme();
429
+ return /* @__PURE__ */ jsx(AstroChart, {
430
+ ref,
431
+ type: "sankey",
432
+ series: [],
433
+ echartsOptions: {
434
+ tooltip: {
435
+ trigger: "item",
436
+ triggerOn: "mousemove"
437
+ },
438
+ series: [{
439
+ type: "sankey",
440
+ orient,
441
+ layoutIterations: 32,
442
+ emphasis: { focus: "adjacency" },
443
+ nodeAlign: "justify",
444
+ lineStyle: {
445
+ color: "gradient",
446
+ curveness: .5
447
+ },
448
+ data: nodes,
449
+ links,
450
+ label: {
451
+ color: tokens.colors.text.primary,
452
+ fontSize: 12
453
+ }
454
+ }]
455
+ },
456
+ ...props
457
+ });
458
+ }));
459
+ var TreemapChart = memo(forwardRef(function TreemapChart({ data = [], showBreadcrumb = true, leafDepth = 2, ...props }, ref) {
460
+ const { tokens } = useTheme();
461
+ return /* @__PURE__ */ jsx(AstroChart, {
462
+ ref,
463
+ type: "treemap",
464
+ series: [],
465
+ echartsOptions: {
466
+ tooltip: { formatter: ((info) => {
467
+ const value = info.value;
468
+ return `${info.name}: ${typeof value === "number" ? value.toLocaleString() : value}`;
469
+ }) },
470
+ series: [{
471
+ type: "treemap",
472
+ data,
473
+ leafDepth,
474
+ roam: false,
475
+ breadcrumb: {
476
+ show: showBreadcrumb,
477
+ bottom: 10,
478
+ itemStyle: { color: "rgba(100, 116, 139, 0.6)" }
479
+ },
480
+ label: {
481
+ show: true,
482
+ formatter: "{b}",
483
+ color: tokens.colors.text.primary,
484
+ fontSize: 12
485
+ },
486
+ upperLabel: {
487
+ show: true,
488
+ height: 30,
489
+ color: tokens.colors.text.secondary
490
+ },
491
+ itemStyle: {
492
+ borderColor: "rgba(100, 116, 139, 0.2)",
493
+ borderWidth: 2,
494
+ gapWidth: 2
495
+ },
496
+ levels: [
497
+ {
498
+ itemStyle: {
499
+ borderColor: "rgba(100, 116, 139, 0.3)",
500
+ borderWidth: 4,
501
+ gapWidth: 4
502
+ },
503
+ upperLabel: { show: false }
504
+ },
505
+ {
506
+ itemStyle: {
507
+ borderColor: "rgba(100, 116, 139, 0.25)",
508
+ borderWidth: 2,
509
+ gapWidth: 2
510
+ },
511
+ emphasis: { itemStyle: { borderColor: ASTRO_DATA_VIZ_COLORS.mixed[0] } }
512
+ },
513
+ {
514
+ colorSaturation: [.35, .5],
515
+ itemStyle: {
516
+ borderColor: "rgba(62, 60, 255, 0.3)",
517
+ borderWidth: 1
518
+ }
519
+ }
520
+ ]
521
+ }]
522
+ },
523
+ ...props
524
+ });
525
+ }));
526
+ var SunburstChart = memo(forwardRef(function SunburstChart({ data = [], innerRadius = "15%", outerRadius = "80%", ...props }, ref) {
527
+ const { tokens } = useTheme();
528
+ return /* @__PURE__ */ jsx(AstroChart, {
529
+ ref,
530
+ type: "sunburst",
531
+ series: [],
532
+ echartsOptions: {
533
+ tooltip: { trigger: "item" },
534
+ series: [{
535
+ type: "sunburst",
536
+ data,
537
+ radius: [innerRadius, outerRadius],
538
+ emphasis: { focus: "ancestor" },
539
+ label: {
540
+ rotate: "radial",
541
+ color: tokens.colors.text.secondary,
542
+ fontSize: 11
543
+ },
544
+ itemStyle: {
545
+ borderRadius: 4,
546
+ borderWidth: 2,
547
+ borderColor: "rgba(62, 60, 255, 0.25)"
548
+ },
549
+ levels: [
550
+ {},
551
+ {
552
+ r0: "15%",
553
+ r: "40%",
554
+ label: { rotate: "tangential" }
555
+ },
556
+ {
557
+ r0: "40%",
558
+ r: "65%"
559
+ },
560
+ {
561
+ r0: "65%",
562
+ r: "80%",
563
+ label: {
564
+ position: "outside",
565
+ fontSize: 10
566
+ }
567
+ }
568
+ ]
569
+ }]
570
+ },
571
+ ...props
572
+ });
573
+ }));
574
+ var ParallelChart = memo(forwardRef(function ParallelChart({ axes = [], data = [], lineStyle = {
575
+ opacity: .5,
576
+ width: 1.5
577
+ }, ...props }, ref) {
578
+ const { tokens } = useTheme();
579
+ return /* @__PURE__ */ jsx(AstroChart, {
580
+ ref,
581
+ type: "line",
582
+ series: [],
583
+ echartsOptions: {
584
+ parallelAxis: axes.map((axis) => ({
585
+ dim: axis.dim,
586
+ name: axis.name,
587
+ min: axis.min,
588
+ max: axis.max,
589
+ type: axis.type || "value",
590
+ data: axis.data,
591
+ nameTextStyle: { color: tokens.colors.text.secondary },
592
+ axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
593
+ axisTick: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
594
+ axisLabel: { color: tokens.colors.text.tertiary }
595
+ })),
596
+ parallel: {
597
+ left: 60,
598
+ right: 60,
599
+ bottom: 60,
600
+ top: 60,
601
+ parallelAxisDefault: {
602
+ type: "value",
603
+ nameLocation: "end",
604
+ nameGap: 20,
605
+ axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
606
+ axisTick: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
607
+ splitLine: { show: false },
608
+ axisLabel: { color: tokens.colors.text.tertiary }
609
+ }
610
+ },
611
+ series: [{
612
+ type: "parallel",
613
+ lineStyle: {
614
+ ...lineStyle,
615
+ color: ASTRO_DATA_VIZ_COLORS.mixed[0]
616
+ },
617
+ data: data.map((row) => ({ value: row })),
618
+ emphasis: { lineStyle: {
619
+ width: 3,
620
+ opacity: 1
621
+ } }
622
+ }]
623
+ },
624
+ ...props
625
+ });
626
+ }));
627
+ var CandlestickChart = memo(forwardRef(function CandlestickChart({ data = [], showVolume: _showVolume = false, ...props }, ref) {
628
+ const { tokens } = useTheme();
629
+ const categoryData = data.map((d) => d.time);
630
+ const ohlcData = data.map((d) => [
631
+ d.open,
632
+ d.close,
633
+ d.low,
634
+ d.high
635
+ ]);
636
+ return /* @__PURE__ */ jsx(AstroChart, {
637
+ ref,
638
+ type: "candlestick",
639
+ series: [],
640
+ echartsOptions: {
641
+ tooltip: {
642
+ trigger: "axis",
643
+ axisPointer: { type: "cross" }
644
+ },
645
+ xAxis: {
646
+ type: "category",
647
+ data: categoryData,
648
+ axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
649
+ axisLabel: { color: tokens.colors.text.secondary }
650
+ },
651
+ yAxis: {
652
+ type: "value",
653
+ scale: true,
654
+ splitLine: { lineStyle: { color: "rgba(100, 116, 139, 0.15)" } },
655
+ axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
656
+ axisLabel: { color: tokens.colors.text.secondary }
657
+ },
658
+ series: [{
659
+ type: "candlestick",
660
+ data: ohlcData,
661
+ itemStyle: {
662
+ color: SOFT_STATUS_COLORS.normal,
663
+ color0: SOFT_STATUS_COLORS.critical,
664
+ borderColor: SOFT_STATUS_COLORS.normal,
665
+ borderColor0: SOFT_STATUS_COLORS.critical
666
+ }
667
+ }],
668
+ dataZoom: [{
669
+ type: "inside",
670
+ start: 0,
671
+ end: 100
672
+ }, {
673
+ show: true,
674
+ type: "slider",
675
+ bottom: 10
676
+ }]
677
+ },
678
+ ...props
679
+ });
680
+ }));
681
+ var GraphChart = memo(forwardRef(function GraphChart({ nodes = [], links = [], categories = [], layout = "force", ...props }, ref) {
682
+ const { tokens } = useTheme();
683
+ return /* @__PURE__ */ jsx(AstroChart, {
684
+ ref,
685
+ type: "scatter",
686
+ series: [],
687
+ echartsOptions: {
688
+ tooltip: {},
689
+ legend: categories.length > 0 ? {
690
+ data: categories.map((c) => c.name),
691
+ textStyle: { color: tokens.colors.text.primary }
692
+ } : void 0,
693
+ series: [{
694
+ type: "graph",
695
+ layout,
696
+ data: nodes.map((n) => ({
697
+ ...n,
698
+ symbolSize: n.symbolSize || 30
699
+ })),
700
+ links,
701
+ categories,
702
+ roam: true,
703
+ label: {
704
+ show: true,
705
+ position: "right",
706
+ formatter: "{b}",
707
+ color: tokens.colors.text.primary,
708
+ fontSize: 11
709
+ },
710
+ lineStyle: {
711
+ color: "source",
712
+ curveness: .3,
713
+ opacity: .6
714
+ },
715
+ emphasis: {
716
+ focus: "adjacency",
717
+ lineStyle: { width: 3 }
718
+ },
719
+ force: layout === "force" ? {
720
+ repulsion: 200,
721
+ edgeLength: [50, 150],
722
+ gravity: .1
723
+ } : void 0
724
+ }]
725
+ },
726
+ ...props
727
+ });
728
+ }));
729
+ /**
730
+ * Calculate boxplot statistics from raw values
731
+ */
844
732
  function calculateBoxplotStats(values) {
845
- const sorted = [...values].sort((a, b) => a - b);
846
- const n = sorted.length;
847
- const min = sorted[0];
848
- const max = sorted[n - 1];
849
- const median = n % 2 === 0 ? (sorted[n / 2 - 1] + sorted[n / 2]) / 2 : sorted[Math.floor(n / 2)];
850
- const q1Index = Math.floor(n * 0.25);
851
- const q3Index = Math.floor(n * 0.75);
852
- const q1 = sorted[q1Index];
853
- const q3 = sorted[q3Index];
854
- const iqr = q3 - q1;
855
- const lowerWhisker = Math.max(min, q1 - 1.5 * iqr);
856
- const upperWhisker = Math.min(max, q3 + 1.5 * iqr);
857
- return [lowerWhisker, q1, median, q3, upperWhisker];
733
+ const sorted = [...values].sort((a, b) => a - b);
734
+ const n = sorted.length;
735
+ const min = sorted[0];
736
+ const max = sorted[n - 1];
737
+ const median = n % 2 === 0 ? (sorted[n / 2 - 1] + sorted[n / 2]) / 2 : sorted[Math.floor(n / 2)];
738
+ const q1Index = Math.floor(n * .25);
739
+ const q3Index = Math.floor(n * .75);
740
+ const q1 = sorted[q1Index];
741
+ const q3 = sorted[q3Index];
742
+ const iqr = q3 - q1;
743
+ return [
744
+ Math.max(min, q1 - 1.5 * iqr),
745
+ q1,
746
+ median,
747
+ q3,
748
+ Math.min(max, q3 + 1.5 * iqr)
749
+ ];
858
750
  }
859
- const BoxPlotChart = memo(forwardRef(
860
- function BoxPlotChart2({
861
- data = [],
862
- showOutliers = true,
863
- colors,
864
- horizontal = false,
865
- ...props
866
- }, ref) {
867
- const { tokens } = useTheme();
868
- const categories = data.map((d) => d.name);
869
- const boxplotData = data.map((d, index) => {
870
- const stats = calculateBoxplotStats(d.values);
871
- return {
872
- value: stats,
873
- itemStyle: (colors == null ? void 0 : colors[index]) ? {
874
- color: colors[index],
875
- borderColor: colors[index]
876
- } : void 0
877
- };
878
- });
879
- const outliers = [];
880
- if (showOutliers) {
881
- data.forEach((d, catIndex) => {
882
- const sorted = [...d.values].sort((a, b) => a - b);
883
- const n = sorted.length;
884
- const q1Index = Math.floor(n * 0.25);
885
- const q3Index = Math.floor(n * 0.75);
886
- const q1 = sorted[q1Index];
887
- const q3 = sorted[q3Index];
888
- const iqr = q3 - q1;
889
- const lowerBound = q1 - 1.5 * iqr;
890
- const upperBound = q3 + 1.5 * iqr;
891
- d.values.forEach((v) => {
892
- if (v < lowerBound || v > upperBound) {
893
- outliers.push([catIndex, v]);
894
- }
895
- });
896
- });
897
- }
898
- const categoryAxis = {
899
- type: "category",
900
- data: categories,
901
- boundaryGap: true,
902
- axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
903
- axisLabel: { color: tokens.colors.text.secondary, fontSize: 12 },
904
- splitArea: { show: false }
905
- };
906
- const valueAxis = {
907
- type: "value",
908
- splitLine: { lineStyle: { color: "rgba(100, 116, 139, 0.15)" } },
909
- axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
910
- axisLabel: { color: tokens.colors.text.secondary }
911
- };
912
- return /* @__PURE__ */ jsx(
913
- AstroChart,
914
- {
915
- ref,
916
- type: "boxplot",
917
- series: [],
918
- echartsOptions: {
919
- tooltip: {
920
- trigger: "item",
921
- axisPointer: { type: "shadow" },
922
- formatter: (params) => {
923
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
924
- if (params.seriesType === "boxplot") {
925
- const value = params.value;
926
- return `
751
+ /**
752
+ * BoxPlotChart - Statistical distribution visualization
753
+ *
754
+ * Shows distribution of data through quartiles (box) and whiskers (range).
755
+ * Uses theme-aware colors from the data visualization palette.
756
+ *
757
+ * @example
758
+ * ```tsx
759
+ * <BoxPlotChart
760
+ * title="Score Distribution"
761
+ * data={[
762
+ * { name: 'Team A', values: [65, 72, 84, 91, 55, 88, 76] },
763
+ * { name: 'Team B', values: [78, 82, 95, 88, 70, 92, 85] },
764
+ * ]}
765
+ * />
766
+ * ```
767
+ */
768
+ var BoxPlotChart = memo(forwardRef(function BoxPlotChart({ data = [], showOutliers = true, colors, horizontal = false, ...props }, ref) {
769
+ const { tokens } = useTheme();
770
+ const categories = data.map((d) => d.name);
771
+ const boxplotData = data.map((d, index) => {
772
+ return {
773
+ value: calculateBoxplotStats(d.values),
774
+ itemStyle: colors?.[index] ? {
775
+ color: colors[index],
776
+ borderColor: colors[index]
777
+ } : void 0
778
+ };
779
+ });
780
+ const outliers = [];
781
+ if (showOutliers) data.forEach((d, catIndex) => {
782
+ const sorted = [...d.values].sort((a, b) => a - b);
783
+ const n = sorted.length;
784
+ const q1Index = Math.floor(n * .25);
785
+ const q3Index = Math.floor(n * .75);
786
+ const q1 = sorted[q1Index];
787
+ const q3 = sorted[q3Index];
788
+ const iqr = q3 - q1;
789
+ const lowerBound = q1 - 1.5 * iqr;
790
+ const upperBound = q3 + 1.5 * iqr;
791
+ d.values.forEach((v) => {
792
+ if (v < lowerBound || v > upperBound) outliers.push([catIndex, v]);
793
+ });
794
+ });
795
+ const categoryAxis = {
796
+ type: "category",
797
+ data: categories,
798
+ boundaryGap: true,
799
+ axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
800
+ axisLabel: {
801
+ color: tokens.colors.text.secondary,
802
+ fontSize: 12
803
+ },
804
+ splitArea: { show: false }
805
+ };
806
+ const valueAxis = {
807
+ type: "value",
808
+ splitLine: { lineStyle: { color: "rgba(100, 116, 139, 0.15)" } },
809
+ axisLine: { lineStyle: { color: "rgba(100, 116, 139, 0.3)" } },
810
+ axisLabel: { color: tokens.colors.text.secondary }
811
+ };
812
+ return /* @__PURE__ */ jsx(AstroChart, {
813
+ ref,
814
+ type: "boxplot",
815
+ series: [],
816
+ echartsOptions: {
817
+ tooltip: {
818
+ trigger: "item",
819
+ axisPointer: { type: "shadow" },
820
+ formatter: (params) => {
821
+ if (params.seriesType === "boxplot") {
822
+ const value = params.value;
823
+ return `
927
824
  <div style="font-weight: 600; margin-bottom: 4px;">${params.name}</div>
928
- <div>Upper: ${((_a = value[5]) == null ? void 0 : _a.toFixed(1)) ?? ((_b = value[4]) == null ? void 0 : _b.toFixed(1))}</div>
929
- <div>Q3: ${((_c = value[4]) == null ? void 0 : _c.toFixed(1)) ?? ((_d = value[3]) == null ? void 0 : _d.toFixed(1))}</div>
930
- <div>Median: ${((_e = value[3]) == null ? void 0 : _e.toFixed(1)) ?? ((_f = value[2]) == null ? void 0 : _f.toFixed(1))}</div>
931
- <div>Q1: ${((_g = value[2]) == null ? void 0 : _g.toFixed(1)) ?? ((_h = value[1]) == null ? void 0 : _h.toFixed(1))}</div>
932
- <div>Lower: ${((_i = value[1]) == null ? void 0 : _i.toFixed(1)) ?? ((_j = value[0]) == null ? void 0 : _j.toFixed(1))}</div>
825
+ <div>Upper: ${value[5]?.toFixed(1) ?? value[4]?.toFixed(1)}</div>
826
+ <div>Q3: ${value[4]?.toFixed(1) ?? value[3]?.toFixed(1)}</div>
827
+ <div>Median: ${value[3]?.toFixed(1) ?? value[2]?.toFixed(1)}</div>
828
+ <div>Q1: ${value[2]?.toFixed(1) ?? value[1]?.toFixed(1)}</div>
829
+ <div>Lower: ${value[1]?.toFixed(1) ?? value[0]?.toFixed(1)}</div>
933
830
  `;
934
- }
935
- return `Outlier: ${params.value[1]}`;
936
- }
937
- },
938
- grid: {
939
- left: "10%",
940
- right: "10%",
941
- bottom: "15%",
942
- top: "15%"
943
- },
944
- xAxis: horizontal ? valueAxis : categoryAxis,
945
- yAxis: horizontal ? categoryAxis : valueAxis,
946
- series: [
947
- {
948
- name: "boxplot",
949
- type: "boxplot",
950
- data: boxplotData,
951
- itemStyle: {
952
- borderWidth: 2
953
- },
954
- emphasis: {
955
- itemStyle: {
956
- borderWidth: 3
957
- }
958
- }
959
- },
960
- ...showOutliers && outliers.length > 0 ? [{
961
- name: "outlier",
962
- type: "scatter",
963
- data: outliers,
964
- symbolSize: 8,
965
- itemStyle: {
966
- color: SOFT_STATUS_COLORS.caution
967
- }
968
- }] : []
969
- ]
970
- },
971
- ...props
972
- }
973
- );
974
- }
975
- ));
976
- export {
977
- AreaChart,
978
- BarChart,
979
- BoxPlotChart,
980
- BubbleChart,
981
- CandlestickChart,
982
- DonutChart,
983
- DualAxisChart,
984
- GaugeChart,
985
- GraphChart,
986
- HeatmapChart,
987
- HistogramChart,
988
- LineChart,
989
- ParallelChart,
990
- PieChart,
991
- RadarChart,
992
- SankeyChart,
993
- ScatterChart,
994
- StackedAreaChart,
995
- StackedBarChart,
996
- SunburstChart,
997
- TimeSeriesChart,
998
- TreemapChart
999
- };
1000
- //# sourceMappingURL=presets.js.map
831
+ }
832
+ return `Outlier: ${params.value[1]}`;
833
+ }
834
+ },
835
+ grid: {
836
+ left: "10%",
837
+ right: "10%",
838
+ bottom: "15%",
839
+ top: "15%"
840
+ },
841
+ xAxis: horizontal ? valueAxis : categoryAxis,
842
+ yAxis: horizontal ? categoryAxis : valueAxis,
843
+ series: [{
844
+ name: "boxplot",
845
+ type: "boxplot",
846
+ data: boxplotData,
847
+ itemStyle: { borderWidth: 2 },
848
+ emphasis: { itemStyle: { borderWidth: 3 } }
849
+ }, ...showOutliers && outliers.length > 0 ? [{
850
+ name: "outlier",
851
+ type: "scatter",
852
+ data: outliers,
853
+ symbolSize: 8,
854
+ itemStyle: { color: SOFT_STATUS_COLORS.caution }
855
+ }] : []]
856
+ },
857
+ ...props
858
+ });
859
+ }));
860
+ //#endregion
861
+ export { AreaChart, BarChart, BoxPlotChart, BubbleChart, CandlestickChart, DonutChart, DualAxisChart, GaugeChart, GraphChart, HeatmapChart, HistogramChart, LineChart, ParallelChart, PieChart, RadarChart, SankeyChart, ScatterChart, StackedAreaChart, StackedBarChart, SunburstChart, TimeSeriesChart, TreemapChart };
862
+
863
+ //# sourceMappingURL=presets.js.map