@rfkit/charts 1.5.1 → 1.7.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 (53) hide show
  1. package/charts/Spectrum/heatmapCaptureDefaults.d.ts +2 -0
  2. package/components/Cursor/useCursorSample.d.ts +2 -0
  3. package/components/EventBus/position.d.ts +8 -0
  4. package/components/EventBus/tools.d.ts +2 -1
  5. package/components/Overlay/Popover/index.d.ts +1 -0
  6. package/components/Toolbar/icons/DeltaMeasurementIcon.d.ts +3 -0
  7. package/components/Toolbar/icons/index.d.ts +1 -0
  8. package/components/ui/cursor-follow-layer.d.ts +1 -2
  9. package/components/ui/dialog.d.ts +5 -5
  10. package/components/ui/dropdown-menu.d.ts +3 -3
  11. package/components/ui/popover.d.ts +3 -3
  12. package/components/ui/select.d.ts +3 -3
  13. package/components/ui/separator.d.ts +1 -1
  14. package/components/ui/tabs.d.ts +1 -1
  15. package/components/ui/tooltip.d.ts +4 -4
  16. package/hooks/spectrum/index.d.ts +1 -0
  17. package/hooks/spectrum/waterfall.d.ts +5 -0
  18. package/hooks/useChart/index.d.ts +1 -1
  19. package/index.d.ts +2 -2
  20. package/index.js +1785 -736
  21. package/modules/Dial/index.d.ts +1 -1
  22. package/modules/Heatmap/cursorValue.d.ts +38 -0
  23. package/modules/IQEye/index.d.ts +1 -1
  24. package/modules/IQPlanisphere/index.d.ts +1 -1
  25. package/modules/Occupancy/CursorPopover.d.ts +4 -1
  26. package/modules/Spectrum/AxisYCanvas/index.d.ts +1 -1
  27. package/modules/Spectrum/BandLayer/bandState.d.ts +9 -0
  28. package/modules/Spectrum/FrequencyAllocation/model/channelModel.d.ts +16 -0
  29. package/modules/Spectrum/FrequencyAllocation/model/density.d.ts +13 -0
  30. package/modules/Spectrum/FrequencyAllocation/model/index.d.ts +4 -3
  31. package/modules/Spectrum/FrequencyAllocation/model/resolveFrequencyAllocationData.d.ts +7 -1
  32. package/modules/Spectrum/FrequencyAllocation/model/resolver.d.ts +26 -1
  33. package/modules/Spectrum/FrequencyAllocation/model/useAllocationAtCursor.d.ts +3 -1
  34. package/modules/Spectrum/FrequencyAllocation/model/useFrequencyAllocationData.d.ts +1 -0
  35. package/modules/Spectrum/FrequencyAllocation/overlays/Tooltip/index.d.ts +8 -1
  36. package/modules/Spectrum/FrequencyAllocation/presenters/AllocationInfo/index.d.ts +1 -0
  37. package/modules/Spectrum/FrequencyAllocation/presenters/AllocationSegments/index.d.ts +3 -3
  38. package/modules/Spectrum/FrequencyAllocation/tools.d.ts +11 -1
  39. package/modules/Spectrum/FrequencyAllocation/types.d.ts +3 -0
  40. package/modules/Spectrum/FrequencyDataBoard/index.d.ts +2 -0
  41. package/modules/Spectrum/Signal/index.d.ts +1 -0
  42. package/modules/Spectrum/Signal/model/index.d.ts +1 -1
  43. package/modules/Spectrum/Signal/model/resolver.d.ts +25 -0
  44. package/modules/Spectrum/Signal/model/useStationInfoAtCursor.d.ts +3 -1
  45. package/package.json +1 -1
  46. package/runtime/interaction/index.d.ts +71 -0
  47. package/store/bandState.d.ts +7 -0
  48. package/types/publish.d.ts +2 -2
  49. package/types/store/frequency.d.ts +8 -0
  50. package/types/store/heatmap.d.ts +2 -0
  51. package/types/store/index.d.ts +3 -3
  52. package/types/store/ui.d.ts +53 -2
  53. package/utils/object.d.ts +1 -1
@@ -1,2 +1,2 @@
1
- declare const Dial: () => import("react/jsx-runtime").JSX.Element;
1
+ declare const Dial: () => import("react").JSX.Element;
2
2
  export default Dial;
@@ -0,0 +1,38 @@
1
+ import type { TimestampedFloat32Array } from '@rfkit/spectrum-analyzer';
2
+ export interface HeatmapGridInfo {
3
+ columnCount: number;
4
+ rowCount: number;
5
+ }
6
+ export interface HeatmapRowRange {
7
+ endIndex: number;
8
+ startIndex: number;
9
+ }
10
+ export interface HeatmapColumnRange {
11
+ endCol: number;
12
+ startCol: number;
13
+ }
14
+ export interface HeatmapGridRange extends HeatmapRowRange, HeatmapColumnRange {
15
+ }
16
+ export interface HeatmapCursorValue {
17
+ columnIndex: number;
18
+ rowIndex: number;
19
+ timestamp: string;
20
+ value: number | null;
21
+ }
22
+ export declare const resolveHeatmapColumnCount: (waterfallData: TimestampedFloat32Array[]) => number;
23
+ export declare const resolveHeatmapGridInfo: (waterfallData: TimestampedFloat32Array[]) => HeatmapGridInfo;
24
+ export declare const resolveHeatmapRowIndex: (top: number, rowCount: number) => number;
25
+ export declare const resolveHeatmapColumnIndex: (left: number, columnCount: number) => number;
26
+ export declare const resolveHeatmapRowRange: (topA: number, topB: number, rowCount: number) => HeatmapRowRange | null;
27
+ export declare const resolveHeatmapColumnRange: (leftA: number, leftB: number, columnCount: number) => HeatmapColumnRange | null;
28
+ export declare const resolveHeatmapGridRange: (waterfallData: TimestampedFloat32Array[], bounds: {
29
+ endLeft: number;
30
+ endTop: number;
31
+ startLeft: number;
32
+ startTop: number;
33
+ }) => HeatmapGridRange | null;
34
+ export declare const resolveHeatmapRangeData: (waterfallData: TimestampedFloat32Array[], range: HeatmapGridRange) => number[][];
35
+ export declare const resolveHeatmapCursorValue: (waterfallData: TimestampedFloat32Array[], coord: {
36
+ left: number;
37
+ top: number;
38
+ }) => HeatmapCursorValue | null;
@@ -2,5 +2,5 @@ import { type IQChartType } from '../base';
2
2
  interface IQEyeProps {
3
3
  type?: IQChartType;
4
4
  }
5
- export default function IQEye({ type }: IQEyeProps): import("react/jsx-runtime").JSX.Element;
5
+ export default function IQEye({ type }: IQEyeProps): import("react").JSX.Element;
6
6
  export {};
@@ -2,5 +2,5 @@ import { type IQChartType } from '../base';
2
2
  interface IQPlanisphereProps {
3
3
  type?: IQChartType;
4
4
  }
5
- export default function IQPlanisphere({ type }: IQPlanisphereProps): import("react/jsx-runtime").JSX.Element;
5
+ export default function IQPlanisphere({ type }: IQPlanisphereProps): import("react").JSX.Element;
6
6
  export {};
@@ -1,3 +1,6 @@
1
1
  import type React from 'react';
2
- declare const OccupancyCursorPopover: React.FC;
2
+ interface OccupancyCursorPopoverProps {
3
+ id: string;
4
+ }
5
+ declare const OccupancyCursorPopover: React.FC<OccupancyCursorPopoverProps>;
3
6
  export default OccupancyCursorPopover;
@@ -2,5 +2,5 @@ import type { RenderChartType } from '../../../types';
2
2
  interface AxisYCanvasProps {
3
3
  chart: RenderChartType | null;
4
4
  }
5
- export default function AxisYCanvas(props: AxisYCanvasProps): import("react/jsx-runtime").JSX.Element | null;
5
+ export default function AxisYCanvas(props: AxisYCanvasProps): import("react").JSX.Element | null;
6
6
  export {};
@@ -0,0 +1,9 @@
1
+ import type { SegmentType } from '../../../types/common.ts';
2
+ import { type BandState } from '../../../types/store/ui.ts';
3
+ export { resolveBandState } from '../../../store/bandState.ts';
4
+ export interface BandPosition {
5
+ key: string;
6
+ left: number;
7
+ width: number;
8
+ }
9
+ export declare function resolveBandPositions(band: BandState, segments: SegmentType[]): BandPosition[];
@@ -0,0 +1,16 @@
1
+ import type { FrequencyAllocationChannel, FrequencyAllocationItem } from '../../../../types';
2
+ export declare const DEFAULT_FREQUENCY_ALLOCATION_CHANNEL_ID = "default";
3
+ export interface ResolvedFrequencyAllocationChannel {
4
+ id: string;
5
+ title?: string;
6
+ data: FrequencyAllocationItem[];
7
+ }
8
+ export interface ResolveFrequencyAllocationChannelsOptions {
9
+ data?: FrequencyAllocationItem[];
10
+ channels?: FrequencyAllocationChannel[];
11
+ cachedData?: FrequencyAllocationItem[] | null;
12
+ cachedChannels?: FrequencyAllocationChannel[] | null;
13
+ presetData: FrequencyAllocationItem[];
14
+ normalizeData: (data: FrequencyAllocationItem[]) => FrequencyAllocationItem[];
15
+ }
16
+ export declare function resolveFrequencyAllocationChannelModel({ data, channels, cachedData, cachedChannels, presetData, normalizeData }: ResolveFrequencyAllocationChannelsOptions): ResolvedFrequencyAllocationChannel[];
@@ -0,0 +1,13 @@
1
+ import type { FrequencyAllocationDensity } from '../../../../types';
2
+ export declare const FREQUENCY_ALLOCATION_LANE_HEIGHT = 14;
3
+ export declare const FREQUENCY_ALLOCATION_COMPACT_LANE_HEIGHT = 5;
4
+ export declare const FREQUENCY_ALLOCATION_COMPACT_THRESHOLD = 4;
5
+ export interface FrequencyAllocationDensityModel {
6
+ compact: boolean;
7
+ laneHeight: number;
8
+ showLabels: boolean;
9
+ }
10
+ export declare const resolveFrequencyAllocationDensity: ({ density, channelCount }: {
11
+ density?: FrequencyAllocationDensity;
12
+ channelCount: number;
13
+ }) => FrequencyAllocationDensityModel;
@@ -1,4 +1,5 @@
1
- export { resolveFrequencyAllocationData } from './resolveFrequencyAllocationData';
2
- export { type FrequencyAllocationSegmentData, findFrequencyAllocationAtCursor, resolveFrequencyAllocationRange, resolveFrequencyAllocationSegments } from './resolver';
1
+ export { FREQUENCY_ALLOCATION_COMPACT_LANE_HEIGHT, FREQUENCY_ALLOCATION_COMPACT_THRESHOLD, FREQUENCY_ALLOCATION_LANE_HEIGHT, type FrequencyAllocationDensityModel, resolveFrequencyAllocationDensity } from './density';
2
+ export { type ResolvedFrequencyAllocationChannel, resolveFrequencyAllocationChannels, resolveFrequencyAllocationData } from './resolveFrequencyAllocationData';
3
+ export { createFrequencyAllocationRangeIndex, type FrequencyAllocationLaneData, type FrequencyAllocationRangeCandidate, type FrequencyAllocationSegmentData, findFrequencyAllocationAtCursor, findFrequencyAllocationInRangeIndex, resolveFrequencyAllocationLanes, resolveFrequencyAllocationRange, resolveFrequencyAllocationSegments } from './resolver';
3
4
  export { useAllocationAtCursor, useAllocationFinder } from './useAllocationAtCursor';
4
- export { useFrequencyAllocationData } from './useFrequencyAllocationData';
5
+ export { useFrequencyAllocationChannels, useFrequencyAllocationData } from './useFrequencyAllocationData';
@@ -1,2 +1,8 @@
1
- import type { FrequencyAllocationItem } from '../../../../types';
1
+ import type { FrequencyAllocationChannel, FrequencyAllocationItem } from '../../../../types';
2
+ import { type ResolvedFrequencyAllocationChannel } from './channelModel';
3
+ export type { ResolvedFrequencyAllocationChannel };
4
+ export declare function resolveFrequencyAllocationChannels({ data, channels }: {
5
+ data?: FrequencyAllocationItem[];
6
+ channels?: FrequencyAllocationChannel[];
7
+ }): ResolvedFrequencyAllocationChannel[];
2
8
  export declare function resolveFrequencyAllocationData(data?: FrequencyAllocationItem[]): FrequencyAllocationItem[];
@@ -1,17 +1,42 @@
1
1
  import type { CSSProperties } from 'react';
2
2
  import type { FrequencyAllocationItem, SegmentType } from '../../../../types';
3
+ import { type FrequencyRange as CalculatedFrequencyRange } from '../../../../utils';
3
4
  import type { BandPosition, FrequencyRange } from '../types';
5
+ import type { ResolvedFrequencyAllocationChannel } from './resolveFrequencyAllocationData';
4
6
  export interface FrequencyAllocationSegmentData {
5
7
  segment: SegmentType;
6
8
  segmentIndex: number;
7
9
  bandPositions: BandPosition[];
8
10
  style: CSSProperties;
9
11
  }
12
+ export interface FrequencyAllocationLaneData {
13
+ channel: ResolvedFrequencyAllocationChannel;
14
+ channelIndex: number;
15
+ segmentData: FrequencyAllocationSegmentData[];
16
+ }
17
+ export interface FrequencyAllocationRangeCandidate {
18
+ item: FrequencyAllocationItem;
19
+ range: CalculatedFrequencyRange;
20
+ width: number;
21
+ center: number;
22
+ title: string;
23
+ }
10
24
  export declare const resolveFrequencyAllocationRange: (band: FrequencyAllocationItem) => FrequencyRange | null;
11
- export declare const resolveFrequencyAllocationSegments: ({ segments, allocations }: {
25
+ export declare const resolveFrequencyAllocationSegments: ({ segments, allocations, channelIndex, channelTitle }: {
12
26
  segments: SegmentType[];
13
27
  allocations: FrequencyAllocationItem[];
28
+ channelIndex?: number;
29
+ channelTitle?: string;
14
30
  }) => FrequencyAllocationSegmentData[];
31
+ export declare const resolveFrequencyAllocationLanes: ({ segments, channels }: {
32
+ segments: SegmentType[];
33
+ channels: ResolvedFrequencyAllocationChannel[];
34
+ }) => FrequencyAllocationLaneData[];
35
+ export declare const createFrequencyAllocationRangeIndex: (allocations: FrequencyAllocationItem[]) => FrequencyAllocationRangeCandidate[];
36
+ export declare const findFrequencyAllocationInRangeIndex: ({ rangeIndex, frequency }: {
37
+ rangeIndex: FrequencyAllocationRangeCandidate[];
38
+ frequency: number;
39
+ }) => FrequencyAllocationItem | undefined;
15
40
  export declare const findFrequencyAllocationAtCursor: ({ allocations, frequency }: {
16
41
  allocations: FrequencyAllocationItem[];
17
42
  frequency: number;
@@ -1,6 +1,8 @@
1
+ import type { CursorSampleSnapshot } from '../../../../runtime/interaction';
1
2
  interface UseAllocationFinderProps {
2
3
  frequency: string;
4
+ cursorSample?: CursorSampleSnapshot | null;
3
5
  }
4
- export declare function useAllocationAtCursor({ frequency }: UseAllocationFinderProps): import("../../../..").FrequencyAllocationItem | undefined;
6
+ export declare function useAllocationAtCursor({ frequency, cursorSample }: UseAllocationFinderProps): import("../../../..").FrequencyAllocationItem | undefined;
5
7
  export declare const useAllocationFinder: typeof useAllocationAtCursor;
6
8
  export {};
@@ -1 +1,2 @@
1
1
  export declare function useFrequencyAllocationData(): import("../../../..").FrequencyAllocationItem[];
2
+ export declare function useFrequencyAllocationChannels(): import("./channelModel").ResolvedFrequencyAllocationChannel[];
@@ -1,4 +1,11 @@
1
1
  import type React from 'react';
2
2
  import type { TooltipState } from '../../types';
3
- declare const Tooltip: React.FC<TooltipState>;
3
+ interface TooltipProps extends TooltipState {
4
+ positionRef: React.RefObject<{
5
+ x: number;
6
+ y: number;
7
+ }>;
8
+ scheduleRef: React.RefObject<(() => void) | null>;
9
+ }
10
+ declare const Tooltip: React.FC<TooltipProps>;
4
11
  export default Tooltip;
@@ -5,6 +5,7 @@ interface Props {
5
5
  startFrequency?: string | number;
6
6
  stopFrequency?: string | number;
7
7
  centerFrequency?: string | number;
8
+ channelTitle?: string;
8
9
  };
9
10
  variant?: 'default' | 'board';
10
11
  }
@@ -1,10 +1,10 @@
1
1
  import type React from 'react';
2
- import type { BandPosition, FrequencyRange } from '../../types';
3
- import type { FrequencyAllocationItem } from '../../../../../types';
2
+ import type { BandPosition } from '../../types';
4
3
  interface AllocationSegmentsProps {
5
4
  style: React.CSSProperties;
6
5
  bandPositions: BandPosition[];
7
- onMouseEnter: (band: FrequencyAllocationItem, range: FrequencyRange) => (event: React.MouseEvent) => void;
6
+ showLabels: boolean;
7
+ onMouseEnter: (position: BandPosition) => (event: React.MouseEvent) => void;
8
8
  onMouseMove: (event: React.MouseEvent) => void;
9
9
  onMouseLeave: () => void;
10
10
  }
@@ -1,14 +1,24 @@
1
- import type { FrequencyAllocationItem } from '../../../types';
1
+ import type { FrequencyAllocationChannel, FrequencyAllocationItem } from '../../../types';
2
2
  /**
3
3
  * 从本地缓存读取FrequencyAllocation数据
4
4
  * @returns FrequencyAllocationItem数组或null
5
5
  */
6
6
  export declare const getFrequencyAllocationFromCache: () => FrequencyAllocationItem[] | null;
7
+ /**
8
+ * 从本地缓存读取多通道FrequencyAllocation数据
9
+ * @returns FrequencyAllocationChannel数组或null
10
+ */
11
+ export declare const getFrequencyAllocationChannelsFromCache: () => FrequencyAllocationChannel[] | null;
7
12
  /**
8
13
  * 将FrequencyAllocation数据保存到本地缓存
9
14
  * @param data FrequencyAllocationItem数组
10
15
  */
11
16
  export declare const setFrequencyAllocationToCache: (data: FrequencyAllocationItem[]) => void;
17
+ /**
18
+ * 将多通道FrequencyAllocation数据保存到本地缓存
19
+ * @param channels FrequencyAllocationChannel数组
20
+ */
21
+ export declare const setFrequencyAllocationChannelsToCache: (channels: FrequencyAllocationChannel[]) => void;
12
22
  /**
13
23
  * 清除本地缓存的FrequencyAllocation数据
14
24
  */
@@ -3,6 +3,7 @@ export interface TooltipState extends FrequencyAllocationItem {
3
3
  visible: boolean;
4
4
  x: number;
5
5
  y: number;
6
+ channelTitle?: string;
6
7
  }
7
8
  export interface FrequencyRange {
8
9
  start: number;
@@ -14,6 +15,8 @@ export interface FrequencyRange {
14
15
  export interface BandPosition {
15
16
  band: FrequencyAllocationItem;
16
17
  range: FrequencyRange;
18
+ channelIndex: number;
19
+ channelTitle?: string;
17
20
  position: {
18
21
  left: string;
19
22
  width: string;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { CursorSampleSnapshot } from '../../../runtime/interaction';
2
3
  interface Props {
3
4
  left: number;
4
5
  onChange?: (e: {
@@ -7,6 +8,7 @@ interface Props {
7
8
  }) => void;
8
9
  updateKey?: number;
9
10
  showStationInfo?: boolean;
11
+ cursorSample?: CursorSampleSnapshot | null;
10
12
  }
11
13
  declare const _default: React.NamedExoticComponent<Props>;
12
14
  export default _default;
@@ -4,6 +4,7 @@ export { useStationFinder } from './model';
4
4
  export { useSignalDataManager } from './useSignalDataManager';
5
5
  export { SignalSwitch };
6
6
  interface Props {
7
+ id: string;
7
8
  left?: number;
8
9
  show?: boolean;
9
10
  display?: boolean;
@@ -1,3 +1,3 @@
1
- export { findStationAtCursor, resolveSignalMatchCandidates, resolveSignalPositions, resolveSignalSegments, type SignalPosition, type SignalSegmentData } from './resolver';
1
+ export { createStationRangeIndex, findStationAtCursor, findStationInRangeIndex, resolveActiveSignalKey, resolveSignalMatchCandidates, resolveSignalPositions, resolveSignalSegments, resolveStaticSignalSegments, type SignalPosition, type SignalSegmentData } from './resolver';
2
2
  export { useStationFinder, useStationInfoAtCursor } from './useStationInfoAtCursor';
3
3
  export { useUnifiedSignals } from './useUnifiedSignals';
@@ -29,6 +29,19 @@ export declare const resolveSignalSegments: ({ segments, signalItems, isCursorAc
29
29
  pointIndex: number;
30
30
  };
31
31
  }) => SignalSegmentData[];
32
+ export declare const resolveStaticSignalSegments: ({ segments, signalItems }: {
33
+ segments: SegmentType[];
34
+ signalItems: UnifiedSignalItem[];
35
+ }) => SignalSegmentData[];
36
+ export declare const resolveActiveSignalKey: ({ segmentData, isCursorActive, currentFrequency, currentPosition }: {
37
+ segmentData: SignalSegmentData[];
38
+ isCursorActive: boolean;
39
+ currentFrequency: number;
40
+ currentPosition: {
41
+ segmentIndex: number;
42
+ pointIndex: number;
43
+ };
44
+ }) => string | undefined;
32
45
  export declare const findStationAtCursor: ({ frequency, signalItems, segments, currentPosition }: {
33
46
  frequency: number;
34
47
  signalItems: UnifiedSignalItem[];
@@ -38,3 +51,15 @@ export declare const findStationAtCursor: ({ frequency, signalItems, segments, c
38
51
  pointIndex: number;
39
52
  };
40
53
  }) => StationInfoType | undefined;
54
+ export declare const createStationRangeIndex: ({ signalItems, segments }: {
55
+ signalItems: UnifiedSignalItem[];
56
+ segments: SegmentType[];
57
+ }) => SignalMatchCandidate[][];
58
+ export declare const findStationInRangeIndex: ({ frequency, stationRangeIndex, currentPosition }: {
59
+ frequency: number;
60
+ stationRangeIndex: SignalMatchCandidate[][];
61
+ currentPosition: {
62
+ segmentIndex: number;
63
+ pointIndex: number;
64
+ };
65
+ }) => StationInfoType | undefined;
@@ -1,7 +1,9 @@
1
+ import type { CursorSampleSnapshot } from '../../../../runtime/interaction';
1
2
  interface UseStationFinderProps {
2
3
  frequency: string;
3
4
  enabled?: boolean;
5
+ cursorSample?: CursorSampleSnapshot | null;
4
6
  }
5
- export declare function useStationInfoAtCursor({ frequency, enabled }: UseStationFinderProps): import("../../../..").StationInfoType | undefined;
7
+ export declare function useStationInfoAtCursor({ frequency, enabled, cursorSample }: UseStationFinderProps): import("../../../..").StationInfoType | undefined;
6
8
  export declare const useStationFinder: typeof useStationInfoAtCursor;
7
9
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rfkit/charts",
3
- "version": "1.5.1",
3
+ "version": "1.7.0",
4
4
  "type": "module",
5
5
  "description": "Chart components for wireless monitoring web applications",
6
6
  "exports": {
@@ -0,0 +1,71 @@
1
+ import type { ModuleType } from '../../config';
2
+ import type { CursorEventSnapshot } from '../../types/store';
3
+ export interface InteractionBounds {
4
+ left: number;
5
+ top: number;
6
+ right: number;
7
+ bottom: number;
8
+ width: number;
9
+ height: number;
10
+ }
11
+ export interface PointerSnapshot {
12
+ sourceId: string;
13
+ sourceType: ModuleType;
14
+ clientX: number;
15
+ clientY: number;
16
+ coord: {
17
+ left: number;
18
+ top: number;
19
+ };
20
+ bounds: InteractionBounds;
21
+ version: number;
22
+ timestamp: number;
23
+ }
24
+ export interface CursorSampleSnapshot extends PointerSnapshot {
25
+ sampledIndex?: number;
26
+ globalIndex?: number;
27
+ rowIndex?: number;
28
+ }
29
+ export type InteractionClearReason = 'leave' | 'bounds' | 'blur' | 'visibility' | 'mouseout' | 'dispose' | 'manual';
30
+ export interface InteractionRuntimeOptions {
31
+ sampleIntervalMs?: number;
32
+ sampleIdleDelayMs?: number;
33
+ now?: () => number;
34
+ requestFrame?: (callback: () => void) => number;
35
+ cancelFrame?: (id: number) => void;
36
+ setTimer?: (callback: () => void, delay: number) => number | ReturnType<typeof setTimeout>;
37
+ clearTimer?: (id: number | ReturnType<typeof setTimeout>) => void;
38
+ }
39
+ type PointerListener = (snapshot: PointerSnapshot | null) => void;
40
+ type SampleListener = (snapshot: CursorSampleSnapshot | null) => void;
41
+ export declare class InteractionRuntime {
42
+ private readonly entries;
43
+ private readonly sampleIntervalMs;
44
+ private readonly sampleIdleDelayMs;
45
+ private readonly now;
46
+ private readonly requestFrame;
47
+ private readonly cancelFrame;
48
+ private readonly setTimer;
49
+ private readonly clearTimer;
50
+ constructor(options?: InteractionRuntimeOptions);
51
+ updatePointer(id: string, snapshot: Omit<PointerSnapshot, 'version' | 'timestamp'>): void;
52
+ refreshBounds(id: string, bounds: InteractionBounds): void;
53
+ clearPointer(id: string, _reason?: InteractionClearReason): void;
54
+ subscribePointer(id: string, listener: PointerListener): () => void;
55
+ subscribeSample(id: string, listener: SampleListener): () => void;
56
+ getPointer(id: string): PointerSnapshot | null;
57
+ getSample(id: string): CursorSampleSnapshot | null;
58
+ dispose(id?: string): void;
59
+ private ensureEntry;
60
+ private schedulePointerFrame;
61
+ private scheduleSample;
62
+ private flushSample;
63
+ private notifyPointer;
64
+ private notifySample;
65
+ private clearEntryTimers;
66
+ private cleanupEntryIfEmpty;
67
+ }
68
+ export declare const interactionRuntime: InteractionRuntime;
69
+ export declare const createInteractionBounds: (left: number, top: number, right: number, bottom: number) => InteractionBounds;
70
+ export declare const toCursorSnapshotEvent: (snapshot: PointerSnapshot | CursorSampleSnapshot) => CursorEventSnapshot;
71
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type BandState } from '../types/store/ui.ts';
2
+ export type BandUpdateStrategy = 'merge' | 'replace';
3
+ /**
4
+ * 将 prop / publish 的 Band 输入归一化为唯一内部状态。
5
+ * 无效输入返回当前状态引用,避免破坏已生效的 Band。
6
+ */
7
+ export declare function resolveBandState(input: Record<string, unknown>, current?: BandState, strategy?: BandUpdateStrategy): BandState;
@@ -111,9 +111,9 @@ export interface PointsEvent {
111
111
  pstype: 'points';
112
112
  data: number[];
113
113
  }
114
- export interface BandEvent extends BandProps {
114
+ export type BandEvent = BandProps & {
115
115
  pstype: 'band';
116
- }
116
+ };
117
117
  export interface ScopeEvent extends RecursiveObject {
118
118
  pstype: 'scope';
119
119
  frequency: number;
@@ -12,8 +12,16 @@ export interface FrequencyAllocationItem {
12
12
  color?: string;
13
13
  gradientColors?: [string, string];
14
14
  }
15
+ export interface FrequencyAllocationChannel {
16
+ id?: string;
17
+ title?: string;
18
+ data: FrequencyAllocationItem[];
19
+ }
20
+ export type FrequencyAllocationDensity = 'auto' | 'normal' | 'compact';
15
21
  export interface FrequencyAllocationProps {
16
22
  show: boolean;
17
23
  display: boolean;
18
24
  data: FrequencyAllocationItem[];
25
+ channels?: FrequencyAllocationChannel[];
26
+ density?: FrequencyAllocationDensity;
19
27
  }
@@ -4,6 +4,7 @@ export declare enum HeatmapCaptureType {
4
4
  Slider = "slider",
5
5
  RowIndex = "rowIndex"
6
6
  }
7
+ export type HeatmapCaptureToolbarVariant = 'default' | 'deltaMeasurement';
7
8
  export interface HeatmapSliderData {
8
9
  startIndex: number;
9
10
  endIndex: number;
@@ -41,6 +42,7 @@ export interface HeatmapCaptureProps {
41
42
  type: HeatmapCaptureType;
42
43
  show: boolean;
43
44
  display: boolean;
45
+ toolbarVariant?: HeatmapCaptureToolbarVariant;
44
46
  sync: boolean;
45
47
  interval: {
46
48
  startIndex: number;
@@ -24,7 +24,7 @@ import type { HeatmapCaptureProps } from './heatmap';
24
24
  import type { MarkerProps } from './marker';
25
25
  import type { LevelStreamProps, SeriesProps } from './series';
26
26
  import type { SignalAnalysisProps, SignalProps } from './signal';
27
- import type { BandProps, BlazeProps, CursorProps, DeltaMeasurementProps, EventBusProps, FluorescenceProps, FrequencyTagLineBoardProps, LegendProps, LimitProps, ScopeProps, StripeProps, SystemConfig, ToolbarProps, ZoomProps } from './ui';
27
+ import type { BandProps, BandState, BlazeProps, CursorProps, DeltaMeasurementProps, EventBusProps, FluorescenceProps, FrequencyTagLineBoardProps, LegendProps, LimitProps, ScopeProps, StripeProps, SystemConfig, ToolbarProps, ZoomProps } from './ui';
28
28
  export interface StoreState {
29
29
  globalID: string;
30
30
  config: unknown;
@@ -43,7 +43,7 @@ export interface StoreState {
43
43
  zoom: ZoomProps;
44
44
  signal: SignalProps;
45
45
  signalAnalysis: SignalAnalysisProps;
46
- band: BandProps;
46
+ band: BandState;
47
47
  scope: ScopeProps;
48
48
  gridLines: boolean;
49
49
  legend: LegendProps;
@@ -89,7 +89,7 @@ export interface ParamsProps {
89
89
  frequencyTagLine?: Partial<FrequencyTagLineBoardProps>;
90
90
  frequencyAllocation?: Partial<FrequencyAllocationProps>;
91
91
  toolbar?: Partial<ToolbarProps>;
92
- band?: Partial<BandProps>;
92
+ band?: BandProps;
93
93
  levelStream?: Partial<LevelStreamProps>;
94
94
  deltaMeasurement?: Partial<DeltaMeasurementProps>;
95
95
  publish?: Publish;
@@ -53,12 +53,62 @@ export interface ZoomProps {
53
53
  onChange: (se: [string, string], interval: AxisXRange) => void;
54
54
  autoCloseTimeout: number;
55
55
  }
56
- export interface BandProps {
56
+ type BandSharedProps = {
57
+ show?: boolean;
58
+ color?: string;
59
+ };
60
+ type BandPositionProps = {
61
+ left?: number;
62
+ width?: number;
63
+ frequency?: never;
64
+ bandwidth?: never;
65
+ startFrequency?: never;
66
+ stopFrequency?: never;
67
+ };
68
+ type BandCenterBandwidthProps = {
69
+ frequency: number;
70
+ bandwidth: number;
71
+ left?: never;
72
+ width?: never;
73
+ startFrequency?: never;
74
+ stopFrequency?: never;
75
+ };
76
+ type BandFrequencyRangeProps = {
77
+ startFrequency: number;
78
+ stopFrequency: number;
79
+ left?: never;
80
+ width?: never;
81
+ frequency?: never;
82
+ bandwidth?: never;
83
+ };
84
+ /** Band 对外配置:百分比、中心频率带宽、起止频率三种定位方式互斥。 */
85
+ export type BandProps = BandSharedProps & (BandPositionProps | BandCenterBandwidthProps | BandFrequencyRangeProps);
86
+ export declare const BandKind: {
87
+ readonly Position: "position";
88
+ readonly CenterBandwidth: "centerBandwidth";
89
+ readonly FrequencyRange: "frequencyRange";
90
+ };
91
+ export type BandKind = (typeof BandKind)[keyof typeof BandKind];
92
+ /** Band 内部归一化状态。 */
93
+ export type BandState = {
94
+ kind: typeof BandKind.Position;
57
95
  show: boolean;
96
+ color?: string;
58
97
  left?: number;
59
98
  width: number;
99
+ } | {
100
+ kind: typeof BandKind.CenterBandwidth;
101
+ show: boolean;
60
102
  color?: string;
61
- }
103
+ frequency: number;
104
+ bandwidth: number;
105
+ } | {
106
+ kind: typeof BandKind.FrequencyRange;
107
+ show: boolean;
108
+ color?: string;
109
+ startFrequency: number;
110
+ stopFrequency: number;
111
+ };
62
112
  export interface ScopeProps {
63
113
  show: boolean;
64
114
  left: number;
@@ -112,3 +162,4 @@ export interface EventBusProps {
112
162
  onDoubleClick: (frequency: string, e: RecursiveObject) => void;
113
163
  [key: string]: unknown;
114
164
  }
165
+ export {};
package/utils/object.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import type { RecursiveObject } from '../types';
5
5
  /**
6
- * 混合对象 - 将参数对象合并到源对象中
6
+ * 混合对象 - 将参数对象合并到源对象副本中
7
7
  * @param source 源对象
8
8
  * @param params 要混合的参数
9
9
  * @returns 混合后的对象