@rfkit/charts 1.3.13 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/README.md +169 -229
  2. package/{lib → charts}/index.d.ts +1 -1
  3. package/components/AxisY/heatmap/index.d.ts +1 -1
  4. package/components/AxisY/heatmap/variants/standard/index.d.ts +6 -0
  5. package/components/AxisY/spectrum/controls/index.d.ts +3 -0
  6. package/components/AxisY/spectrum/index.d.ts +3 -2
  7. package/components/AxisY/spectrum/{components/Ticks → presenters/TicksPanel}/index.d.ts +3 -3
  8. package/components/AxisY/spectrum/presenters/index.d.ts +1 -0
  9. package/components/AxisY/spectrum/useRanging/index.d.ts +4 -1
  10. package/components/AxisY/spectrum/useRanging/ranging.d.ts +3 -1
  11. package/components/Container/runtime.d.ts +10 -0
  12. package/components/Cursor/popover-support.d.ts +8 -0
  13. package/components/Cursor/registry.d.ts +7 -0
  14. package/components/DragSelectBox/index.d.ts +3 -1
  15. package/components/GridLines/OccupancyDashed/index.d.ts +3 -0
  16. package/components/{Dropdown → Overlay/Dropdown}/index.d.ts +10 -2
  17. package/components/{Tooltip → Overlay/Tooltip}/index.d.ts +1 -1
  18. package/components/Overlay/index.d.ts +4 -0
  19. package/components/{ToolsBar → Toolbar/controls}/SeriesControl/index.d.ts +1 -1
  20. package/components/Toolbar/controls/index.d.ts +4 -0
  21. package/components/{ToolsBar → Toolbar/decorations}/GradientRibbon/index.d.ts +1 -1
  22. package/components/Toolbar/decorations/index.d.ts +2 -0
  23. package/components/Toolbar/primitives/IconBox.d.ts +11 -0
  24. package/components/Toolbar/primitives/ToolbarContentBox.d.ts +11 -0
  25. package/components/Toolbar/primitives/ToolbarDropdown.d.ts +16 -0
  26. package/components/Toolbar/primitives/ToolbarGlyph.d.ts +10 -0
  27. package/components/Toolbar/primitives/ToolbarGroup.d.ts +10 -0
  28. package/components/Toolbar/primitives/ToolbarGroupIconBox.d.ts +5 -0
  29. package/components/Toolbar/primitives/ToolbarSurface.d.ts +15 -0
  30. package/components/Toolbar/primitives/index.d.ts +8 -0
  31. package/components/Toolbar/primitives/styles.d.ts +41 -0
  32. package/components/Toolbar/registry.d.ts +12 -0
  33. package/components/Toolbar/toggles/index.d.ts +10 -0
  34. package/components/Zoom/ZoomViewportLayer.d.ts +7 -0
  35. package/components/ui/button.d.ts +16 -0
  36. package/components/ui/checkbox.d.ts +4 -0
  37. package/components/ui/cursor-follow-layer.d.ts +10 -0
  38. package/components/ui/dialog.d.ts +12 -0
  39. package/components/ui/dropdown-menu.d.ts +9 -0
  40. package/components/ui/input.d.ts +1 -0
  41. package/components/ui/number-input.d.ts +10 -0
  42. package/components/ui/panel.d.ts +9 -0
  43. package/components/ui/popover.d.ts +7 -0
  44. package/components/ui/scroll-area.d.ts +5 -0
  45. package/components/ui/select.d.ts +11 -0
  46. package/components/ui/separator.d.ts +4 -0
  47. package/components/ui/slider.d.ts +2 -0
  48. package/components/ui/switch.d.ts +2 -0
  49. package/components/ui/tabs.d.ts +7 -0
  50. package/components/ui/tooltip.d.ts +7 -0
  51. package/components/ui/useChartsPortalContainer.d.ts +1 -0
  52. package/config/constants.d.ts +2 -2
  53. package/config/setting.d.ts +3 -3
  54. package/hooks/index.d.ts +2 -3
  55. package/hooks/module-subscription-core.d.ts +23 -0
  56. package/hooks/publish/enhancedPublish.d.ts +17 -0
  57. package/hooks/publish/index.d.ts +1 -1
  58. package/hooks/publish/publish-event.d.ts +9 -0
  59. package/hooks/publish/useSafePublish.d.ts +2 -8
  60. package/hooks/useChartComponent.d.ts +0 -6
  61. package/hooks/useDragSelect.d.ts +2 -0
  62. package/hooks/useLevelStreamAnalyzer.d.ts +1 -1
  63. package/hooks/useModuleSubscription.d.ts +21 -23
  64. package/index.d.ts +7 -3
  65. package/index.js +23912 -11942
  66. package/modules/Gauge/render.d.ts +0 -2
  67. package/{components/HeatmapCapture → modules/Heatmap/Capture}/tools.d.ts +1 -1
  68. package/modules/Heatmap/CursorPopover.d.ts +6 -0
  69. package/modules/Heatmap/render.d.ts +2 -0
  70. package/modules/Level/CursorPopover.d.ts +6 -0
  71. package/modules/Occupancy/CursorPopover.d.ts +3 -0
  72. package/modules/Occupancy/TotalLine/index.d.ts +1 -1
  73. package/modules/Occupancy/total-line-runtime.d.ts +4 -0
  74. package/modules/Spectrum/AxisYCanvas/index.d.ts +6 -0
  75. package/{components/AxisYByCanvas → modules/Spectrum/AxisYCanvas}/useCanvasAxisY.d.ts +2 -2
  76. package/modules/Spectrum/BandLayer/index.d.ts +5 -0
  77. package/modules/Spectrum/BandLayer/useBandLayerController.d.ts +2 -0
  78. package/{components → modules/Spectrum}/Blaze/tools.d.ts +1 -1
  79. package/modules/Spectrum/CursorPopover.d.ts +6 -0
  80. package/{components → modules/Spectrum}/FrequencyAllocation/color.d.ts +1 -1
  81. package/{components → modules/Spectrum}/FrequencyAllocation/index.d.ts +2 -2
  82. package/modules/Spectrum/FrequencyAllocation/model/index.d.ts +4 -0
  83. package/modules/Spectrum/FrequencyAllocation/model/resolveFrequencyAllocationData.d.ts +2 -0
  84. package/modules/Spectrum/FrequencyAllocation/model/resolver.d.ts +18 -0
  85. package/modules/Spectrum/FrequencyAllocation/model/useAllocationAtCursor.d.ts +6 -0
  86. package/modules/Spectrum/FrequencyAllocation/model/useFrequencyAllocationData.d.ts +1 -0
  87. package/modules/Spectrum/FrequencyAllocation/overlays/Tooltip/index.d.ts +4 -0
  88. package/modules/Spectrum/FrequencyAllocation/overlays/index.d.ts +1 -0
  89. package/{components/FrequencyAllocation → modules/Spectrum/FrequencyAllocation/presenters}/AllocationInfo/index.d.ts +1 -1
  90. package/modules/Spectrum/FrequencyAllocation/presenters/AllocationSegments/index.d.ts +12 -0
  91. package/modules/Spectrum/FrequencyAllocation/presenters/index.d.ts +2 -0
  92. package/{components → modules/Spectrum}/FrequencyAllocation/tools.d.ts +1 -1
  93. package/{components → modules/Spectrum}/FrequencyAllocation/types.d.ts +1 -1
  94. package/modules/Spectrum/FrequencyDataBoard/hooks/index.d.ts +1 -0
  95. package/modules/Spectrum/FrequencyDataBoard/hooks/useStationInfoAtCursor.d.ts +1 -0
  96. package/{components → modules/Spectrum}/FrequencyDataBoard/index.d.ts +1 -0
  97. package/{components/FrequencyDataBoard/StationInfo → modules/Spectrum/FrequencyDataBoard/panels/StationInfoPanel}/index.d.ts +1 -1
  98. package/modules/Spectrum/FrequencyDataBoard/panels/index.d.ts +1 -0
  99. package/{components → modules/Spectrum}/FrequencyTagLine/index.d.ts +2 -2
  100. package/{components → modules/Spectrum}/Markers/MarkerItem/index.d.ts +1 -1
  101. package/{components → modules/Spectrum}/Markers/hooks/useMarkerEvents.d.ts +1 -1
  102. package/{components → modules/Spectrum}/Markers/hooks/useMarkers.d.ts +2 -2
  103. package/{components → modules/Spectrum}/Markers/tools.d.ts +1 -1
  104. package/{components → modules/Spectrum}/Scope/useScope.d.ts +1 -1
  105. package/{components → modules/Spectrum}/Signal/index.d.ts +2 -1
  106. package/modules/Spectrum/Signal/metadata/index.d.ts +1 -0
  107. package/modules/Spectrum/Signal/model/index.d.ts +3 -0
  108. package/modules/Spectrum/Signal/model/resolver.d.ts +40 -0
  109. package/modules/Spectrum/Signal/model/useStationInfoAtCursor.d.ts +7 -0
  110. package/modules/Spectrum/Signal/model/useUnifiedSignals.d.ts +6 -0
  111. package/modules/Spectrum/Signal/presenters/SignalSegments/index.d.ts +10 -0
  112. package/modules/Spectrum/Signal/presenters/index.d.ts +1 -0
  113. package/{components → modules/Spectrum}/Signal/tools.d.ts +1 -1
  114. package/{components → modules/Spectrum}/Signal/useSignalDataManager.d.ts +1 -1
  115. package/modules/Spectrum/Signal/utils.d.ts +27 -0
  116. package/modules/Spectrum/render.d.ts +31 -52
  117. package/{hooks → modules/Spectrum}/useSpectrumAnalyzer/index.d.ts +1 -1
  118. package/modules/base/BaseRenderer.d.ts +63 -0
  119. package/modules/base/CircularRenderer.d.ts +4 -5
  120. package/package.json +28 -4
  121. package/{modules/tools.d.ts → runtime/passThrough.d.ts} +1 -1
  122. package/store/Params.d.ts +2 -1
  123. package/store/chart-store.d.ts +11 -0
  124. package/store/constants.d.ts +2 -3
  125. package/store/context.d.ts +6 -3
  126. package/store/globalState.d.ts +4 -0
  127. package/store/hooks/index.d.ts +1 -0
  128. package/store/hooks/useStore.d.ts +11 -1
  129. package/store/index.d.ts +1 -1
  130. package/store/reducer.d.ts +1 -67
  131. package/store/runtime.d.ts +16 -0
  132. package/tailwind-bridge.css +50 -0
  133. package/theme/init-charts-theme.d.ts +12 -0
  134. package/theme/style-scope.d.ts +20 -0
  135. package/theme/theme-color.d.ts +7 -0
  136. package/theme/theme-contract.d.ts +28 -0
  137. package/theme/theme-runtime.d.ts +14 -0
  138. package/theme/theme-styles.d.ts +10 -0
  139. package/theme/theme-tokens.d.ts +85 -0
  140. package/types/common.d.ts +1 -1
  141. package/types/store/index.d.ts +6 -4
  142. package/types/store/ui.d.ts +19 -5
  143. package/utils/cn.d.ts +2 -0
  144. package/utils/converter.d.ts +1 -1
  145. package/utils/cursor.d.ts +12 -0
  146. package/utils/frequencyCalculation.d.ts +8 -0
  147. package/utils/index.d.ts +1 -1
  148. package/utils/subscription.d.ts +18 -2
  149. package/components/AxisY/heatmap/type/Default/index.d.ts +0 -6
  150. package/components/AxisYByCanvas/index.d.ts +0 -6
  151. package/components/Band/index.d.ts +0 -5
  152. package/components/Band/useBand.d.ts +0 -2
  153. package/components/Cursor/Popover/index.d.ts +0 -10
  154. package/components/FrequencyAllocation/SegmentContainer.d.ts +0 -12
  155. package/components/FrequencyAllocation/Tooltip/index.d.ts +0 -8
  156. package/components/FrequencyAllocation/useAllocationFinder.d.ts +0 -10
  157. package/components/GridLines/Occdahsed/index.d.ts +0 -3
  158. package/components/Signal/SegmentContainer.d.ts +0 -26
  159. package/components/Signal/useStationFinder.d.ts +0 -12
  160. package/components/Signal/utils.d.ts +0 -15
  161. package/components/SignalAnalysis/Switch/index.d.ts +0 -3
  162. package/components/ToolsBar/IconBox.d.ts +0 -12
  163. package/components/Zoom/ZoomOffsetContainer/index.d.ts +0 -7
  164. package/lib/LevelStream/useAxisY.d.ts +0 -1
  165. package/utils/theme.d.ts +0 -18
  166. /package/{lib → charts}/Dial/Chart.d.ts +0 -0
  167. /package/{lib → charts}/Dial/index.d.ts +0 -0
  168. /package/{lib → charts}/Gauge/Chart.d.ts +0 -0
  169. /package/{lib → charts}/Gauge/index.d.ts +0 -0
  170. /package/{lib → charts}/Heatmap/Chart.d.ts +0 -0
  171. /package/{lib → charts}/Heatmap/index.d.ts +0 -0
  172. /package/{lib → charts}/IQ/Chart.d.ts +0 -0
  173. /package/{lib → charts}/IQ/index.d.ts +0 -0
  174. /package/{lib → charts}/LevelStream/Chart.d.ts +0 -0
  175. /package/{lib → charts}/LevelStream/index.d.ts +0 -0
  176. /package/{lib → charts}/Occupancy/Chart.d.ts +0 -0
  177. /package/{lib → charts}/Occupancy/index.d.ts +0 -0
  178. /package/{lib → charts}/SpatialSpectrum/Chart.d.ts +0 -0
  179. /package/{lib → charts}/SpatialSpectrum/index.d.ts +0 -0
  180. /package/{lib → charts}/Spectrum/Chart.d.ts +0 -0
  181. /package/{lib → charts}/Spectrum/index.d.ts +0 -0
  182. /package/components/AxisY/heatmap/{type/Default → variants/standard}/GradientRibbon/index.d.ts +0 -0
  183. /package/components/AxisY/occupancy/{type/Default → variants/standard}/index.d.ts +0 -0
  184. /package/components/AxisY/spectrum/{components/Autoranging/index.d.ts → controls/AutorangingControl.d.ts} +0 -0
  185. /package/components/AxisY/spectrum/{components/Step/index.d.ts → controls/StepControl.d.ts} +0 -0
  186. /package/components/AxisY/spectrum/{components/Unit/index.d.ts → controls/UnitControl.d.ts} +0 -0
  187. /package/components/{Popover → Overlay/Popover}/index.d.ts +0 -0
  188. /package/components/{Portal → Overlay/Portal}/index.d.ts +0 -0
  189. /package/components/{ToolsBar → Toolbar/controls}/Reset.d.ts +0 -0
  190. /package/components/{ToolsBar → Toolbar/controls}/SegmentsDisplayControl/index.d.ts +0 -0
  191. /package/components/{ToolsBar → Toolbar/controls}/SeriesDisplayControl/index.d.ts +0 -0
  192. /package/components/{ToolsBar → Toolbar/decorations}/SpacerLine.d.ts +0 -0
  193. /package/components/{ToolsBar → Toolbar}/index.d.ts +0 -0
  194. /package/{components/GuageBox/index.d.ts → modules/Gauge/InteractionSurface.d.ts} +0 -0
  195. /package/{components/HeatmapCapture → modules/Heatmap/Capture}/Area/index.d.ts +0 -0
  196. /package/{components/HeatmapCapture → modules/Heatmap/Capture}/RowIndex/index.d.ts +0 -0
  197. /package/{components/HeatmapCapture → modules/Heatmap/Capture}/Slider/index.d.ts +0 -0
  198. /package/{components/FrequencyTagLine → modules/Heatmap/Capture}/Switch/index.d.ts +0 -0
  199. /package/{components/HeatmapCapture → modules/Heatmap/Capture}/index.d.ts +0 -0
  200. /package/{components/HeatmapCapture → modules/Heatmap/TimeRange}/Switch/index.d.ts +0 -0
  201. /package/{components → modules/Heatmap}/TimeRange/useTimeRange.d.ts +0 -0
  202. /package/{components → modules/Spectrum}/Blaze/index.d.ts +0 -0
  203. /package/{components → modules/Spectrum}/DeltaMeasurement/Switch.d.ts +0 -0
  204. /package/{components → modules/Spectrum}/DeltaMeasurement/index.d.ts +0 -0
  205. /package/{components → modules/Spectrum}/DragFrame/index.d.ts +0 -0
  206. /package/{components → modules/Spectrum}/FrequencyAllocation/Switch/index.d.ts +0 -0
  207. /package/{components → modules/Spectrum}/FrequencyAllocation/data.d.ts +0 -0
  208. /package/{components → modules/Spectrum}/FrequencyTagLine/Board/index.d.ts +0 -0
  209. /package/{components/Limit → modules/Spectrum/FrequencyTagLine}/Switch/index.d.ts +0 -0
  210. /package/{components → modules/Spectrum}/Legend/index.d.ts +0 -0
  211. /package/{components → modules/Spectrum}/Limit/Item.d.ts +0 -0
  212. /package/{components/TimeRange → modules/Spectrum/Limit}/Switch/index.d.ts +0 -0
  213. /package/{components → modules/Spectrum}/Limit/index.d.ts +0 -0
  214. /package/{components → modules/Spectrum}/Markers/Switch/index.d.ts +0 -0
  215. /package/{components → modules/Spectrum}/Markers/index.d.ts +0 -0
  216. /package/{components → modules/Spectrum}/Scope/index.d.ts +0 -0
  217. /package/{components → modules/Spectrum}/SegmentsZebra/index.d.ts +0 -0
  218. /package/{components → modules/Spectrum}/Signal/Switch/index.d.ts +0 -0
  219. /package/{components/Signal/type.d.ts → modules/Spectrum/Signal/metadata/signalType.d.ts} +0 -0
  220. /package/{components → modules/Spectrum}/Stripe/Switch/index.d.ts +0 -0
  221. /package/{components → modules/Spectrum}/Stripe/index.d.ts +0 -0
  222. /package/{hooks/publish → modules/Spectrum}/useMarkerPublish.d.ts +0 -0
  223. /package/{hooks → modules/Spectrum}/useSpectrumAnalyzer/useTemplateComparison.d.ts +0 -0
@@ -21,11 +21,9 @@ interface GaugeRenderState extends BaseRenderState<Gauge> {
21
21
  * 不完全继承 CircularRenderer,而是直接继承 BaseRenderer
22
22
  */
23
23
  export default class GaugeRender extends BaseRenderer<Gauge, GaugeRenderState, GaugeData> {
24
- private themeUnsubscribe;
25
24
  constructor(props: GaugeRenderProps);
26
25
  protected init(): void;
27
26
  updateProps(p: Record<string, unknown>): void;
28
27
  updateSeries(data: GaugeData): void;
29
- destroy(): void;
30
28
  }
31
29
  export {};
@@ -1,4 +1,4 @@
1
- import type { AxisXProps, HeatmapAreaData, HeatmapCaptureProps } from '../../types';
1
+ import type { AxisXProps, HeatmapAreaData, HeatmapCaptureProps } from '../../../types';
2
2
  interface Coordinates {
3
3
  startLeft: number;
4
4
  endLeft: number;
@@ -0,0 +1,6 @@
1
+ import type React from 'react';
2
+ interface HeatmapCursorPopoverProps {
3
+ id: string;
4
+ }
5
+ declare const HeatmapCursorPopover: React.FC<HeatmapCursorPopoverProps>;
6
+ export default HeatmapCursorPopover;
@@ -14,9 +14,11 @@ interface HeatmapRenderState extends GradientRenderState<IHeatmap> {
14
14
  heatmapDefaultData: number[][];
15
15
  }
16
16
  export default class Heatmap extends GradientRenderer<IHeatmap, HeatmapRenderState, number[][]> {
17
+ private lastSeriesData;
17
18
  constructor(props: HeatmapRenderProps);
18
19
  protected init(): void;
19
20
  updateSeries(data: number[][]): void;
21
+ updateParams(params: Partial<HeatmapRenderState>): void;
20
22
  setRange(realRange?: [number, number]): void;
21
23
  reset(): void;
22
24
  resize(): void;
@@ -0,0 +1,6 @@
1
+ import type React from 'react';
2
+ interface LevelCursorPopoverProps {
3
+ id: string;
4
+ }
5
+ declare const LevelCursorPopover: React.FC<LevelCursorPopoverProps>;
6
+ export default LevelCursorPopover;
@@ -0,0 +1,3 @@
1
+ import type React from 'react';
2
+ declare const OccupancyCursorPopover: React.FC;
3
+ export default OccupancyCursorPopover;
@@ -1,6 +1,6 @@
1
1
  import type React from 'react';
2
2
  interface Props {
3
- value?: number;
3
+ id: string;
4
4
  }
5
5
  declare const TotalLine: React.FC<Props>;
6
6
  export default TotalLine;
@@ -0,0 +1,4 @@
1
+ export declare const TOTAL_LINE_HIDDEN_OFFSET = -200;
2
+ export declare const applyOccupancyTotalLineValue: (lineElement: HTMLDivElement | null, valueElement: HTMLDivElement | null, value?: number) => void;
3
+ export declare const withOccupancyTotalLine: (id: string, name?: string, func?: (value: number) => void) => (...args: any[]) => void;
4
+ export declare const publishOccupancyTotalLine: (id: string, value?: number) => void;
@@ -0,0 +1,6 @@
1
+ import type { RenderChartType } from '../../../types';
2
+ interface AxisYCanvasProps {
3
+ chart: RenderChartType;
4
+ }
5
+ export default function AxisYCanvas(props: AxisYCanvasProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1,6 +1,6 @@
1
- import type Range from '../AxisY/spectrum/useRanging/ranging';
1
+ import type { RangeController } from '../../../components/AxisY/spectrum/useRanging';
2
2
  interface CanvasAxisYOptions {
3
- ranging?: Range;
3
+ ranging?: RangeController;
4
4
  }
5
5
  interface TickData {
6
6
  value: number;
@@ -0,0 +1,5 @@
1
+ import type React from 'react';
2
+ import useBandLayerController from './useBandLayerController';
3
+ export { useBandLayerController };
4
+ declare const BandLayer: React.FC;
5
+ export default BandLayer;
@@ -0,0 +1,2 @@
1
+ import type { BandProps } from '../../../types';
2
+ export default function useBandLayerController(): (e: BandProps) => void;
@@ -1,2 +1,2 @@
1
- import { type CSMCallback } from '../../utils/subscription';
1
+ import { type CSMCallback } from '../../../utils/subscription';
2
2
  export declare const BLAZE_PROGRESS: (globalID: string, func?: CSMCallback) => (...args: any[]) => void;
@@ -0,0 +1,6 @@
1
+ import type React from 'react';
2
+ interface SpectrumCursorPopoverProps {
3
+ id: string;
4
+ }
5
+ declare const SpectrumCursorPopover: React.FC<SpectrumCursorPopoverProps>;
6
+ export default SpectrumCursorPopover;
@@ -1,4 +1,4 @@
1
- import type { FrequencyAllocationItem } from '../../types';
1
+ import type { FrequencyAllocationItem } from '../../../types';
2
2
  export declare const optimizedColors: string[];
3
3
  export declare function hexToHsl(hex: string): {
4
4
  h: number;
@@ -1,6 +1,6 @@
1
1
  import type React from 'react';
2
- import AllocationInfo from './AllocationInfo';
2
+ import { AllocationInfo } from './presenters';
3
+ export { useAllocationFinder } from './model';
3
4
  export { AllocationInfo };
4
- export { useAllocationFinder } from './useAllocationFinder';
5
5
  declare const FrequencyAllocation: React.FC;
6
6
  export default FrequencyAllocation;
@@ -0,0 +1,4 @@
1
+ export { resolveFrequencyAllocationData } from './resolveFrequencyAllocationData';
2
+ export { type FrequencyAllocationSegmentData, findFrequencyAllocationAtCursor, resolveFrequencyAllocationRange, resolveFrequencyAllocationSegments } from './resolver';
3
+ export { useAllocationAtCursor, useAllocationFinder } from './useAllocationAtCursor';
4
+ export { useFrequencyAllocationData } from './useFrequencyAllocationData';
@@ -0,0 +1,2 @@
1
+ import type { FrequencyAllocationItem } from '../../../../types';
2
+ export declare function resolveFrequencyAllocationData(data?: FrequencyAllocationItem[]): FrequencyAllocationItem[];
@@ -0,0 +1,18 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { FrequencyAllocationItem, SegmentType } from '../../../../types';
3
+ import type { BandPosition, FrequencyRange } from '../types';
4
+ export interface FrequencyAllocationSegmentData {
5
+ segment: SegmentType;
6
+ segmentIndex: number;
7
+ bandPositions: BandPosition[];
8
+ style: CSSProperties;
9
+ }
10
+ export declare const resolveFrequencyAllocationRange: (band: FrequencyAllocationItem) => FrequencyRange | null;
11
+ export declare const resolveFrequencyAllocationSegments: ({ segments, allocations }: {
12
+ segments: SegmentType[];
13
+ allocations: FrequencyAllocationItem[];
14
+ }) => FrequencyAllocationSegmentData[];
15
+ export declare const findFrequencyAllocationAtCursor: ({ allocations, frequency }: {
16
+ allocations: FrequencyAllocationItem[];
17
+ frequency: number;
18
+ }) => FrequencyAllocationItem | undefined;
@@ -0,0 +1,6 @@
1
+ interface UseAllocationFinderProps {
2
+ frequency: string;
3
+ }
4
+ export declare function useAllocationAtCursor({ frequency }: UseAllocationFinderProps): import("../../../..").FrequencyAllocationItem;
5
+ export declare const useAllocationFinder: typeof useAllocationAtCursor;
6
+ export {};
@@ -0,0 +1 @@
1
+ export declare function useFrequencyAllocationData(): import("../../../..").FrequencyAllocationItem[];
@@ -0,0 +1,4 @@
1
+ import type React from 'react';
2
+ import type { TooltipState } from '../../types';
3
+ declare const Tooltip: React.FC<TooltipState>;
4
+ export default Tooltip;
@@ -0,0 +1 @@
1
+ export { default as AllocationTooltip } from './Tooltip';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { FrequencyAllocationItem } from '../../../types';
2
+ import type { FrequencyAllocationItem } from '../../../../../types';
3
3
  interface Props {
4
4
  allocationInfo?: FrequencyAllocationItem & {
5
5
  startFrequency?: string | number;
@@ -0,0 +1,12 @@
1
+ import type React from 'react';
2
+ import type { BandPosition, FrequencyRange } from '../../types';
3
+ import type { FrequencyAllocationItem } from '../../../../../types';
4
+ interface AllocationSegmentsProps {
5
+ style: React.CSSProperties;
6
+ bandPositions: BandPosition[];
7
+ onMouseEnter: (band: FrequencyAllocationItem, range: FrequencyRange) => (event: React.MouseEvent) => void;
8
+ onMouseMove: (event: React.MouseEvent) => void;
9
+ onMouseLeave: () => void;
10
+ }
11
+ declare const AllocationSegments: React.FC<AllocationSegmentsProps>;
12
+ export default AllocationSegments;
@@ -0,0 +1,2 @@
1
+ export { default as AllocationInfo } from './AllocationInfo';
2
+ export { default as AllocationSegments } from './AllocationSegments';
@@ -1,4 +1,4 @@
1
- import type { FrequencyAllocationItem } from '../../types';
1
+ import type { FrequencyAllocationItem } from '../../../types';
2
2
  /**
3
3
  * 从本地缓存读取FrequencyAllocation数据
4
4
  * @returns FrequencyAllocationItem数组或null
@@ -1,4 +1,4 @@
1
- import type { FrequencyAllocationItem } from '../../types';
1
+ import type { FrequencyAllocationItem } from '../../../types';
2
2
  export interface TooltipState extends FrequencyAllocationItem {
3
3
  visible: boolean;
4
4
  x: number;
@@ -0,0 +1 @@
1
+ export { useStationFinder, useStationInfoAtCursor } from './useStationInfoAtCursor';
@@ -0,0 +1 @@
1
+ export { useStationFinder, useStationInfoAtCursor } from '../../Signal/model';
@@ -6,6 +6,7 @@ interface Props {
6
6
  frequency: string;
7
7
  }) => void;
8
8
  updateKey?: number;
9
+ showStationInfo?: boolean;
9
10
  }
10
11
  declare const _default: React.NamedExoticComponent<Props>;
11
12
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { StationInfoType } from '../../../types';
2
+ import type { StationInfoType } from '../../../../../types';
3
3
  interface Props {
4
4
  stationInfo?: StationInfoType;
5
5
  }
@@ -0,0 +1 @@
1
+ export { default as StationInfoPanel } from './StationInfoPanel';
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { ToolType } from '../../config';
2
+ import { ToolType } from '../../../config';
3
3
  import FrequencyTagLineBoard from './Board';
4
4
  import FrequencyTagLineSwitch from './Switch';
5
- export { FrequencyTagLineSwitch, FrequencyTagLineBoard };
5
+ export { FrequencyTagLineBoard, FrequencyTagLineSwitch };
6
6
  export declare const COMPONENT_KEY = ToolType.FrequencyTagLine;
7
7
  interface Props {
8
8
  id: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { MarkerType } from '../../../types';
2
+ import type { MarkerType } from '../../../../types';
3
3
  interface Props {
4
4
  marker: MarkerType;
5
5
  }
@@ -1,4 +1,4 @@
1
- import type { MarkerType, TopRightBottomLeft } from '../../../types';
1
+ import type { MarkerType, TopRightBottomLeft } from '../../../../types';
2
2
  interface UseMarkerEventsProps {
3
3
  id: string;
4
4
  markers: MarkerType[];
@@ -15,8 +15,8 @@
15
15
  * - realData.peaks.peaks[1] = 次峰
16
16
  * - realData.peaks.peaks[n] = 第 n+1 峰(可扩展)
17
17
  */
18
- import { MarkerEventType } from '../../../config';
19
- import type { MarkerType, SetMarker } from '../../../types';
18
+ import { MarkerEventType } from '../../../../config';
19
+ import type { MarkerType, SetMarker } from '../../../../types';
20
20
  interface UseMarkersProps {
21
21
  id: string;
22
22
  globalID: string;
@@ -1,4 +1,4 @@
1
- import type { MarkerType, RecursiveFunction, SegmentsType } from '../../types';
1
+ import type { MarkerType, RecursiveFunction, SegmentsType } from '../../../types';
2
2
  /**
3
3
  * Marker 工具函数集合 - 精简版
4
4
  */
@@ -1,2 +1,2 @@
1
- import type { RecursiveObject } from '../../types';
1
+ import type { RecursiveObject } from '../../../types';
2
2
  export default function useScope(): (e: RecursiveObject) => void;
@@ -1,7 +1,8 @@
1
1
  import type React from 'react';
2
2
  import SignalSwitch from './Switch';
3
+ export { useStationFinder } from './model';
4
+ export { useSignalDataManager } from './useSignalDataManager';
3
5
  export { SignalSwitch };
4
- export { useStationFinder } from './useStationFinder';
5
6
  interface Props {
6
7
  left?: number;
7
8
  show?: boolean;
@@ -0,0 +1 @@
1
+ export { SIGNAL_TYPE_MAP, SignalType, signalTypeMap } from './signalType';
@@ -0,0 +1,3 @@
1
+ export { findStationAtCursor, resolveSignalMatchCandidates, resolveSignalPositions, resolveSignalSegments, type SignalPosition, type SignalSegmentData } from './resolver';
2
+ export { useStationFinder, useStationInfoAtCursor } from './useStationInfoAtCursor';
3
+ export { useUnifiedSignals } from './useUnifiedSignals';
@@ -0,0 +1,40 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { SegmentType, StationInfoType } from '../../../../types';
3
+ import { type SignalMatchCandidate, type UnifiedSignalItem } from '../utils';
4
+ export interface SignalPosition extends SignalMatchCandidate {
5
+ key: string;
6
+ position: {
7
+ left: string;
8
+ width: string;
9
+ };
10
+ color: string;
11
+ tooltip?: string;
12
+ }
13
+ export interface SignalSegmentData {
14
+ segment: SegmentType;
15
+ segmentIndex: number;
16
+ signalPositions: SignalPosition[];
17
+ activeSignalKey?: string;
18
+ style: CSSProperties;
19
+ }
20
+ export declare const resolveSignalMatchCandidates: (signalItems: UnifiedSignalItem[], segment: SegmentType) => SignalMatchCandidate[];
21
+ export declare const resolveSignalPositions: (signalItems: UnifiedSignalItem[], segment: SegmentType) => SignalPosition[];
22
+ export declare const resolveSignalSegments: ({ segments, signalItems, isCursorActive, currentFrequency, currentPosition }: {
23
+ segments: SegmentType[];
24
+ signalItems: UnifiedSignalItem[];
25
+ isCursorActive: boolean;
26
+ currentFrequency: number;
27
+ currentPosition: {
28
+ segmentIndex: number;
29
+ pointIndex: number;
30
+ };
31
+ }) => SignalSegmentData[];
32
+ export declare const findStationAtCursor: ({ frequency, signalItems, segments, currentPosition }: {
33
+ frequency: number;
34
+ signalItems: UnifiedSignalItem[];
35
+ segments: SegmentType[];
36
+ currentPosition: {
37
+ segmentIndex: number;
38
+ pointIndex: number;
39
+ };
40
+ }) => StationInfoType | undefined;
@@ -0,0 +1,7 @@
1
+ interface UseStationFinderProps {
2
+ frequency: string;
3
+ enabled?: boolean;
4
+ }
5
+ export declare function useStationInfoAtCursor({ frequency, enabled }: UseStationFinderProps): import("../../../..").StationInfoType;
6
+ export declare const useStationFinder: typeof useStationInfoAtCursor;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { UnifiedSignalItem } from '../utils';
2
+ interface UseUnifiedSignalsOptions {
3
+ respectVisibility?: boolean;
4
+ }
5
+ export declare function useUnifiedSignals({ respectVisibility }?: UseUnifiedSignalsOptions): UnifiedSignalItem[];
6
+ export {};
@@ -0,0 +1,10 @@
1
+ import type React from 'react';
2
+ import type { SignalPosition } from '../../model';
3
+ interface SignalSegmentsProps {
4
+ style: React.CSSProperties;
5
+ signalPositions: SignalPosition[];
6
+ activeSignalKey?: string;
7
+ segmentIndex: number;
8
+ }
9
+ declare const SignalSegments: React.FC<SignalSegmentsProps>;
10
+ export default SignalSegments;
@@ -0,0 +1 @@
1
+ export { default as SignalSegments } from './SignalSegments';
@@ -1,4 +1,4 @@
1
- import type { RecursiveFunction, StationInfoType } from '../../types';
1
+ import type { RecursiveFunction, StationInfoType } from '../../../types';
2
2
  /**
3
3
  * 台站数据更新订阅管理器
4
4
  * 用于通知组件台站数据已更新,触发重新渲染
@@ -1,4 +1,4 @@
1
- import type { SignalData, SignalDataType, StationInfoType } from '../../types';
1
+ import type { SignalData, SignalDataType, StationInfoType } from '../../../types';
2
2
  /**
3
3
  * Signal 数据管理 Hook
4
4
  * - 台站信息 → 全局 openData(通过 STATION_DATA)
@@ -0,0 +1,27 @@
1
+ import type { StationInfoType } from '../../../types';
2
+ import type { SignalData } from '../../../types/store';
3
+ import type { FrequencyRange, FrequencyRangeInput } from '../../../utils';
4
+ /**
5
+ * 统一的信号数据类型(兼容 StationInfo 和 SignalData)
6
+ */
7
+ export type UnifiedSignalItem = StationInfoType | SignalData;
8
+ export interface SignalMatchCandidate {
9
+ item: UnifiedSignalItem;
10
+ range: FrequencyRange;
11
+ startIndex: number;
12
+ stopIndex: number;
13
+ }
14
+ /**
15
+ * 判断是否为完整的台站信息
16
+ */
17
+ export declare function isStationInfo(item: UnifiedSignalItem): item is StationInfoType;
18
+ export declare function getUnifiedSignalKey(item: UnifiedSignalItem): string;
19
+ /**
20
+ * 将统一的信号数据转换为频率范围输入(处理 string | number 类型)
21
+ */
22
+ export declare function toFrequencyRangeInput(item: UnifiedSignalItem): FrequencyRangeInput;
23
+ export declare function resolveBestSignalMatch<T extends SignalMatchCandidate>(candidates: T[], options: {
24
+ currentFrequency: number;
25
+ currentPointIndex: number;
26
+ indexTolerance?: number;
27
+ }): T | undefined;
@@ -1,69 +1,48 @@
1
1
  import { type ISeries } from '@rfkit/renderer';
2
- import type { SeriesConfig } from '../../types';
3
- interface SpectrumState {
4
- chart: ISeries | null;
2
+ import { BaseRenderer, type BaseRenderState } from '../base/BaseRenderer';
3
+ import type { AxisYRange, SeriesConfig, SpectrumExtraData } from '../../types';
4
+ interface SpectrumChart extends ISeries {
5
+ clear(): void;
6
+ dispose(): void;
7
+ draw(): void;
8
+ render(config: {
9
+ data: Float32Array;
10
+ name: string;
11
+ } & Partial<SeriesConfig>): void;
12
+ resize(): void;
13
+ setIntervel(interval: number): void;
14
+ setRange(range: AxisYRange): void;
15
+ setSeries(config: Partial<SeriesConfig> & {
16
+ name: string;
17
+ }): void;
18
+ updateProps(props: Record<string, unknown>): void;
19
+ }
20
+ interface SpectrumState extends BaseRenderState<SpectrumChart> {
5
21
  autoranging: boolean;
6
- prevAutoRangeTime: number;
7
- id: string;
8
- renderRange: [number, number];
22
+ globalID: string;
9
23
  interval: number;
24
+ prevAutoRangeTime: number;
25
+ renderRange: AxisYRange;
10
26
  series: Record<string, SeriesConfig>;
11
- globalID: string;
12
- [key: string]: unknown;
13
27
  }
14
- export default class Spectrum {
15
- state: SpectrumState;
28
+ export interface SpectrumRenderPayload {
29
+ data: Record<string | number, Float32Array>;
30
+ extraData?: SpectrumExtraData;
31
+ }
32
+ export default class Spectrum extends BaseRenderer<SpectrumChart, SpectrumState, SpectrumRenderPayload> {
16
33
  useRangeAutoFocus: () => void;
17
- useRangeSet: () => void;
18
34
  firstRenderAutoFocus: boolean;
19
- seriesUnsubscribe?: () => void;
20
35
  constructor(props: Record<string, unknown>);
21
- /**
22
- * 初始化 series 订阅机制
23
- */
24
- initSeriesSubscription(): void;
25
- init(): void;
36
+ protected init(): void;
26
37
  initSeries(): void;
27
- /**
28
- * 更新数据
29
- * TODO:可以自定义线
30
- */
31
- updateSeries(d: Record<string | number, Float32Array>, extraData?: Map<string, {
32
- outputData: Float32Array;
33
- originalData: Float32Array;
34
- }>): void;
35
- updateMainSeries(data: {
36
- length: number;
37
- at: (arg0: number) => number | undefined;
38
- }): void;
39
- /**
40
- * 更新参数
41
- */
42
- updateParams(params: Record<string, unknown>): void;
43
- /**
44
- * 设置线信息
45
- */
38
+ updateSeries({ data, extraData }: SpectrumRenderPayload): void;
39
+ private updateMainSeries;
46
40
  setSeries(config: SeriesConfig, skipEventEmit?: boolean): void;
47
41
  setDisabledClearRect(disabledClearRect: boolean): void;
48
- setRange(renderRange?: [number, number]): void;
42
+ setRange(renderRange?: AxisYRange): void;
49
43
  zoom(): void;
50
44
  reset(): void;
51
45
  resize(): void;
52
- /**
53
- * 清除图表内容(不取消订阅)
54
- */
55
46
  clearChart(): void;
56
- /**
57
- * 销毁实例(取消订阅)
58
- */
59
- destroy(): void;
60
- /**
61
- * 组件卸载时的清理(useChart 会调用此方法)
62
- */
63
- dispose(): () => void;
64
- /**
65
- * @deprecated 使用 clearChart() 或 destroy()
66
- */
67
- clear(): void;
68
47
  }
69
48
  export {};
@@ -1,3 +1,3 @@
1
1
  import { type SpectrumConfig } from '@rfkit/spectrum-analyzer';
2
- import type { PublishData } from '../../types';
2
+ import type { PublishData } from '../../../types';
3
3
  export default function useSpectrumAnalyzer(props?: SpectrumConfig): (e: PublishData) => Promise<void>;
@@ -30,7 +30,9 @@ interface ChartLike {
30
30
  clear?: () => void;
31
31
  draw?: () => void;
32
32
  updateProps?: (props: Record<string, unknown>) => void;
33
+ dispose?: () => void;
33
34
  }
35
+ type RendererCleanup = () => void;
34
36
  /**
35
37
  * 渲染器抽象基类
36
38
  *
@@ -42,6 +44,9 @@ export declare abstract class BaseRenderer<TChart extends ChartLike, TState exte
42
44
  /** 公开 state 以兼容 RenderChartType 接口 */
43
45
  state: TState;
44
46
  protected resizeTimer: ReturnType<typeof setTimeout> | null;
47
+ protected resizeObserver: ResizeObserver | null;
48
+ private destroyed;
49
+ private cleanupTasks;
45
50
  constructor(initialState: TState);
46
51
  /**
47
52
  * 初始化图表引擎(子类必须实现)
@@ -51,6 +56,14 @@ export declare abstract class BaseRenderer<TChart extends ChartLike, TState exte
51
56
  * 更新数据(子类必须实现)
52
57
  */
53
58
  abstract updateSeries(data: TData): void;
59
+ /**
60
+ * 更新运行时参数
61
+ */
62
+ updateParams(params: Partial<TState>): void;
63
+ /**
64
+ * 参数更新后的钩子,为子类提供 hook
65
+ */
66
+ protected onParamsUpdated(_params: Partial<TState>): void;
54
67
  /**
55
68
  * 重置(清空 + 调整大小)
56
69
  */
@@ -79,5 +92,55 @@ export declare abstract class BaseRenderer<TChart extends ChartLike, TState exte
79
92
  * 清理 resize 定时器
80
93
  */
81
94
  protected clearResizeTimer(): void;
95
+ /**
96
+ * 注册统一 cleanup,由基类在 destroy 时回收
97
+ */
98
+ protected trackCleanup(cleanup?: RendererCleanup | null): () => void;
99
+ /**
100
+ * 获取图表容器元素
101
+ */
102
+ protected getContainerElement(): HTMLElement | null;
103
+ /**
104
+ * 获取图表容器当前尺寸
105
+ */
106
+ protected getContainerSize(): {
107
+ width: number;
108
+ height: number;
109
+ };
110
+ /**
111
+ * 子类可覆盖最小可绘制尺寸
112
+ */
113
+ protected getMinimumContainerSize(): {
114
+ width: number;
115
+ height: number;
116
+ };
117
+ /**
118
+ * 当前容器尺寸是否足以安全触发 renderer 绘制
119
+ */
120
+ protected hasRenderableContainerSize(): boolean;
121
+ /**
122
+ * 监听图表容器尺寸,避免只靠初始化阶段的一次性 resize
123
+ */
124
+ protected observeContainerResize(): void;
125
+ /**
126
+ * 清理容器尺寸监听
127
+ */
128
+ protected clearResizeObserver(): void;
129
+ /**
130
+ * 清理统一注册的 cleanup 任务
131
+ */
132
+ protected runCleanupTasks(): void;
133
+ /**
134
+ * 销毁前钩子,子类可覆盖
135
+ */
136
+ protected beforeDestroy(): void;
137
+ /**
138
+ * 释放底层 chart 实例,避免 renderer 引擎残留监听和 canvas/WebGL 资源
139
+ */
140
+ protected disposeChartInstance(): void;
141
+ /**
142
+ * 在容器尺寸满足条件后再初始化 chart,避免 renderer 在错误尺寸下提前绘制
143
+ */
144
+ protected initializeChartWhenReady(): void;
82
145
  }
83
146
  export {};