@rfkit/charts 1.2.28 → 1.3.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.
- package/components/AxisY/occupancy/index.d.ts +1 -0
- package/components/AxisY/occupancy/type/Default/index.d.ts +4 -1
- package/components/AxisY/spectrum/useRanging/tools.d.ts +27 -11
- package/components/AxisY/tools.d.ts +2 -0
- package/components/Blaze/tools.d.ts +2 -1
- package/components/Cursor/tools.d.ts +1 -1
- package/components/Dashed/index.d.ts +1 -0
- package/components/DeltaMeasurement/Switch.d.ts +3 -0
- package/components/DeltaMeasurement/index.d.ts +3 -0
- package/components/DragSelectBox/index.d.ts +28 -0
- package/components/Dropdown/index.d.ts +1 -0
- package/components/EventBus/tools.d.ts +2 -2
- package/components/Markers/hooks/useMarkerEvents.d.ts +1 -0
- package/components/Markers/hooks/useMarkers.d.ts +2 -0
- package/components/Markers/tools.d.ts +15 -0
- package/components/Zoom/ZoomOffsetContainer/index.d.ts +1 -0
- package/config/constants.d.ts +12 -4
- package/config/setting.d.ts +9 -0
- package/hooks/data/index.d.ts +6 -0
- package/hooks/{useSegments.d.ts → data/useSegments.d.ts} +1 -1
- package/hooks/index.d.ts +12 -0
- package/hooks/publish/index.d.ts +6 -0
- package/hooks/{useMarkerPublish.d.ts → publish/useMarkerPublish.d.ts} +1 -1
- package/hooks/{usePublish.d.ts → publish/usePublish.d.ts} +2 -2
- package/hooks/{useSafePublish.d.ts → publish/useSafePublish.d.ts} +3 -3
- package/hooks/spectrum/index.d.ts +6 -0
- package/hooks/{useSpectrumChartType.d.ts → spectrum/useSpectrumChartType.d.ts} +1 -1
- package/hooks/{useSpectrumRule.d.ts → spectrum/useSpectrumRule.d.ts} +2 -2
- package/hooks/useChart/index.d.ts +14 -5
- package/hooks/useDragSelect.d.ts +32 -0
- package/hooks/useModuleSubscription.d.ts +66 -0
- package/hooks/useSeriesManager/index.d.ts +1 -1
- package/hooks/useSeriesManager/useFilteredSeries.d.ts +1 -1
- package/hooks/useSeriesManager/useSeriesManager.d.ts +0 -8
- package/index.d.ts +4 -2
- package/index.js +10953 -11488
- package/lib/Spectrum/Chart.d.ts +4 -3
- package/modules/Dial/render.d.ts +13 -8
- package/modules/Fluorescence/render.d.ts +13 -33
- package/modules/Gauge/render.d.ts +30 -9
- package/modules/Heatmap/render.d.ts +21 -21
- package/modules/IQEye/index.d.ts +6 -1
- package/modules/IQPlanisphere/index.d.ts +6 -1
- package/modules/IQStream/index.d.ts +5 -1
- package/modules/Occupancy/render.d.ts +14 -8
- package/modules/OccupancyPortal/index.d.ts +5 -2
- package/modules/SpatialSpectrum/render.d.ts +13 -8
- package/modules/Spectrum/render.d.ts +3 -2
- package/modules/base/BaseRenderer.d.ts +83 -0
- package/modules/base/CircularRenderer.d.ts +59 -0
- package/modules/base/GradientRenderer.d.ts +42 -0
- package/modules/base/IQRenderer.d.ts +41 -0
- package/modules/base/index.d.ts +7 -0
- package/modules/tools.d.ts +2 -1
- package/package.json +1 -1
- package/store/reducer.d.ts +2 -0
- package/types/common.d.ts +14 -12
- package/types/publish.d.ts +4 -1
- package/types/store/axis.d.ts +29 -0
- package/types/store/frequency.d.ts +19 -0
- package/types/store/heatmap.d.ts +53 -0
- package/types/store/index.d.ts +95 -0
- package/types/store/marker.d.ts +39 -0
- package/types/store/series.d.ts +16 -0
- package/types/store/signal.d.ts +27 -0
- package/types/store/ui.d.ts +98 -0
- package/types/store.d.ts +13 -328
- package/utils/array.d.ts +40 -0
- package/utils/frequency.d.ts +72 -0
- package/utils/index.d.ts +12 -114
- package/utils/object.d.ts +11 -0
- package/utils/series/events.d.ts +1 -1
- package/utils/series/index.d.ts +1 -1
- package/utils/series/modes.d.ts +1 -1
- package/utils/subscription.d.ts +20 -2
- package/utils/theme.d.ts +18 -0
- package/utils/throttle.d.ts +52 -0
- package/utils/time.d.ts +27 -0
- package/engine/ColorInterpolator.d.ts +0 -49
- package/engine/dial.d.ts +0 -13
- package/engine/engine.d.ts +0 -10
- package/engine/fillImageData.d.ts +0 -34
- package/engine/fluorescence.d.ts +0 -37
- package/engine/gauge.d.ts +0 -16
- package/engine/heatmap.d.ts +0 -13
- package/engine/index.d.ts +0 -11
- package/engine/iq.d.ts +0 -12
- package/engine/iqEye.d.ts +0 -17
- package/engine/radar.d.ts +0 -11
- package/engine/series.d.ts +0 -12
- package/engine/tools.d.ts +0 -30
- package/engine/type.d.ts +0 -32
- package/engine/utils.d.ts +0 -2
- package/engine/webglEngine.d.ts +0 -23
- package/engine/webglExample.d.ts +0 -21
- package/engine/webglSeries.d.ts +0 -21
- package/hooks/useHeatmapHeight.d.ts +0 -7
- package/hooks/useRuleUpdate.d.ts +0 -4
- package/hooks/useZoomMinSimulateWave.d.ts +0 -7
- package/modules/IQEye/render.d.ts +0 -12
- package/modules/IQPlanisphere/render.d.ts +0 -12
- package/modules/IQStream/render.d.ts +0 -12
- /package/hooks/{useChannel.d.ts → data/useChannel.d.ts} +0 -0
- /package/hooks/{usePoints.d.ts → data/usePoints.d.ts} +0 -0
- /package/hooks/{uselevelStreamAnalyzer.d.ts → useLevelStreamAnalyzer.d.ts} +0 -0
|
@@ -1,24 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 虚拟范围数据结构
|
|
3
|
+
*/
|
|
4
|
+
interface VirtualRangeData {
|
|
5
|
+
flaw: number;
|
|
6
|
+
offset: number;
|
|
7
|
+
range: [number, number];
|
|
8
|
+
renderRange: [number, number];
|
|
9
|
+
}
|
|
1
10
|
/**
|
|
2
11
|
* 全局共享的虚拟范围值
|
|
3
12
|
*/
|
|
4
|
-
export declare const VIRTUAL_RANGE: (globalID: string, virtual?:
|
|
13
|
+
export declare const VIRTUAL_RANGE: (globalID: string, virtual?: VirtualRangeData) => VirtualRangeData;
|
|
14
|
+
interface VirtualRangeParams {
|
|
15
|
+
unit?: string;
|
|
16
|
+
realRange?: number[];
|
|
17
|
+
step?: number;
|
|
18
|
+
globalID: string;
|
|
19
|
+
}
|
|
5
20
|
/**
|
|
6
21
|
* 虚拟范围管理器
|
|
7
22
|
*/
|
|
8
|
-
export declare function useVirtualRange({ unit, realRange, step, globalID }:
|
|
9
|
-
|
|
10
|
-
range:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
23
|
+
export declare function useVirtualRange({ unit, realRange, step, globalID }: VirtualRangeParams): VirtualRangeData;
|
|
24
|
+
interface Range2RealRangeParams {
|
|
25
|
+
range: [number, number];
|
|
26
|
+
unit?: string;
|
|
27
|
+
globalID: string;
|
|
28
|
+
}
|
|
14
29
|
/**
|
|
15
30
|
* 虚拟范围转真实范围
|
|
16
31
|
*/
|
|
17
|
-
export declare function range2realRange({ range, unit, globalID }:
|
|
18
|
-
realRange:
|
|
19
|
-
renderRange:
|
|
32
|
+
export declare function range2realRange({ range, unit, globalID }: Range2RealRangeParams): {
|
|
33
|
+
realRange: [number, number];
|
|
34
|
+
renderRange: [number, number];
|
|
20
35
|
};
|
|
21
36
|
/**
|
|
22
37
|
* 获取虚拟电频值
|
|
23
38
|
*/
|
|
24
|
-
export declare function getVirtualLevel(unit: string, v: number
|
|
39
|
+
export declare function getVirtualLevel(unit: string, v: number): number;
|
|
40
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { type CSMCallback } from '../../utils/subscription';
|
|
2
|
+
export declare const BLAZE_PROGRESS: (globalID: string, func?: CSMCallback) => (...args: any[]) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RecursiveFunction } from '../../types';
|
|
2
|
-
export declare const CURSOR_TIMEOUT: (globalID: string, timer?: number | NodeJS.Timeout) =>
|
|
2
|
+
export declare const CURSOR_TIMEOUT: (globalID: string, timer?: number | NodeJS.Timeout) => number | NodeJS.Timeout;
|
|
3
3
|
export declare const CURSOR_SETACTIVE: (globalID: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
4
4
|
/**
|
|
5
5
|
* 将位置信息转换为视觉left
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 通用拖拽框选组件
|
|
3
|
+
* 用于创建可拖拽、可调整大小的矩形框
|
|
4
|
+
*/
|
|
5
|
+
import type React from 'react';
|
|
6
|
+
import type { ReactNode } from 'react';
|
|
7
|
+
import { type RectPosition } from '../../hooks/useDragSelect';
|
|
8
|
+
export interface DragSelectBoxProps {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
defaultRect?: Partial<RectPosition>;
|
|
11
|
+
minSize?: number;
|
|
12
|
+
maxSize?: number;
|
|
13
|
+
snapThreshold?: number;
|
|
14
|
+
onChange?: (rect: RectPosition) => void;
|
|
15
|
+
onDragEnd?: (rect: RectPosition) => void;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
labels?: {
|
|
18
|
+
top?: ReactNode;
|
|
19
|
+
bottom?: ReactNode;
|
|
20
|
+
left?: ReactNode;
|
|
21
|
+
right?: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
className?: string;
|
|
24
|
+
zIndex?: number;
|
|
25
|
+
showBoundaryLines?: boolean;
|
|
26
|
+
}
|
|
27
|
+
declare const DragSelectBox: React.FC<DragSelectBoxProps>;
|
|
28
|
+
export default DragSelectBox;
|
|
@@ -45,8 +45,8 @@ export declare const CURSOR_STYLE_MAP: {
|
|
|
45
45
|
zoom: string;
|
|
46
46
|
area: string;
|
|
47
47
|
};
|
|
48
|
-
export declare const getEventLevel: (id: string, level?: string) =>
|
|
49
|
-
export declare const getEventType: (id: string, type?: string) =>
|
|
48
|
+
export declare const getEventLevel: (id: string, level?: string) => string;
|
|
49
|
+
export declare const getEventType: (id: string, type?: string) => string;
|
|
50
50
|
/**
|
|
51
51
|
* 比较事件优先级
|
|
52
52
|
* @param id 事件ID
|
|
@@ -40,6 +40,8 @@ export declare const useMarkers: (props: UseMarkersProps) => {
|
|
|
40
40
|
left: number;
|
|
41
41
|
}) => string;
|
|
42
42
|
resetHover: () => void;
|
|
43
|
+
toggleMainSecondaryPeaks: () => void;
|
|
44
|
+
moveToAdjacentPeak: (direction: "left" | "right", markerId: string) => void;
|
|
43
45
|
setState: import("react").Dispatch<import("react").SetStateAction<MarkerState>>;
|
|
44
46
|
};
|
|
45
47
|
export {};
|
|
@@ -7,6 +7,19 @@ export declare const MARKER_UPDATE_RESET: (id: string, func?: RecursiveFunction)
|
|
|
7
7
|
export declare const MARKER_COUNT_CHANGE: (id: string, func?: RecursiveFunction<[{
|
|
8
8
|
count: number;
|
|
9
9
|
}]>) => (...args: any[]) => void;
|
|
10
|
+
export declare const MARKER_SELECTION_CHANGE: (id: string, func?: RecursiveFunction<[{
|
|
11
|
+
selectedId: string | null;
|
|
12
|
+
}]>) => (...args: any[]) => void;
|
|
13
|
+
export type MarkerCommand = {
|
|
14
|
+
type: 'main-secondary-peaks';
|
|
15
|
+
} | {
|
|
16
|
+
type: 'left-peak';
|
|
17
|
+
selectedId: string;
|
|
18
|
+
} | {
|
|
19
|
+
type: 'right-peak';
|
|
20
|
+
selectedId: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const MARKER_COMMAND: (id: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
10
23
|
export declare const leftDataSelectMax: (left: number, data: Float32Array) => number;
|
|
11
24
|
export declare function fixLocation(location: number, len: number): number;
|
|
12
25
|
interface ZoomLeftParams {
|
|
@@ -23,7 +36,9 @@ export interface PeakPoint {
|
|
|
23
36
|
value: number;
|
|
24
37
|
index: number;
|
|
25
38
|
}
|
|
39
|
+
export declare function findMaxPeak(data: Float32Array): PeakPoint | null;
|
|
26
40
|
export declare function findPeaks(data: Float32Array): PeakPoint[] | null;
|
|
41
|
+
export declare function findTopPeaks(data: Float32Array, count?: number, threshold?: number, minDistance?: number): PeakPoint[];
|
|
27
42
|
export declare function findMultiplePeaks(data: Float32Array, threshold?: number, minDistance?: number): PeakPoint[];
|
|
28
43
|
export declare function findNearbyPeak(data: Float32Array, targetIndex: number, searchRadius?: number): PeakPoint | null;
|
|
29
44
|
export declare const setMarkerMove: (marker: MarkerType, segments: SegmentsType, callback: RecursiveFunction) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
children: React.ReactNode;
|
|
3
3
|
className?: string;
|
|
4
|
+
style?: React.CSSProperties;
|
|
4
5
|
}
|
|
5
6
|
declare const ZoomOffsetContainer: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
7
|
export default ZoomOffsetContainer;
|
package/config/constants.d.ts
CHANGED
|
@@ -9,8 +9,16 @@ export declare const SERIES: {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const SERIES_NAMES: string[];
|
|
11
11
|
export declare const REAL_DATA_NAME: string;
|
|
12
|
-
|
|
13
|
-
export declare const
|
|
12
|
+
/** @deprecated 使用 UI_CONFIG.ZOOM_MIN_RANGE */
|
|
13
|
+
export declare const ZOOM_MIN_RANGE: 10;
|
|
14
|
+
/** @deprecated 使用 UI_CONFIG.POPOVER_MARGIN */
|
|
15
|
+
export declare const POPOVER_MARGIN: 16;
|
|
16
|
+
export declare enum FrequencyUnit {
|
|
17
|
+
Hz = "Hz",
|
|
18
|
+
kHz = "kHz",
|
|
19
|
+
MHz = "MHz",
|
|
20
|
+
GHz = "GHz"
|
|
21
|
+
}
|
|
14
22
|
export declare enum ChartType {
|
|
15
23
|
SingleFrequency = "singleFrequency",
|
|
16
24
|
Scan = "scan",
|
|
@@ -39,7 +47,6 @@ export declare enum ModuleType {
|
|
|
39
47
|
IQPlanisphere = "iqPlanisphere",
|
|
40
48
|
IQEye = "iqEye",
|
|
41
49
|
IQLine = "iqLine",
|
|
42
|
-
Factor = "factor",
|
|
43
50
|
SpatialSpectrum = "spatialSpectrum"
|
|
44
51
|
}
|
|
45
52
|
export declare enum PSType {
|
|
@@ -128,7 +135,8 @@ export declare enum ToolsBarItemType {
|
|
|
128
135
|
SignalSwitch = "SignalSwitch",
|
|
129
136
|
SegmentsDisplayControl = "SegmentsDisplayControl",
|
|
130
137
|
SeriesDisplayControl = "SeriesDisplayControl",
|
|
131
|
-
FluorescenceSwitch = "FluorescenceSwitch"
|
|
138
|
+
FluorescenceSwitch = "FluorescenceSwitch",
|
|
139
|
+
DeltaMeasurementSwitch = "DeltaMeasurementSwitch"
|
|
132
140
|
}
|
|
133
141
|
export declare enum SeriesType {
|
|
134
142
|
RealData = "realData",
|
package/config/setting.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { SegmentsType } from '
|
|
1
|
+
import type { SegmentsType } from '../../types';
|
|
2
2
|
export default function useSegments(): [SegmentsType, (s: SegmentsType) => void];
|
package/hooks/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks 统一导出
|
|
3
|
+
*/
|
|
4
|
+
export { useChannel, usePoints, useSegments } from './data';
|
|
5
|
+
export { PUB_SUB, useMarkerPublish, usePublish, useSafePublish } from './publish';
|
|
6
|
+
export { SET_SEGMENTS_DISPLAY, type UseSpectrumChartTypeProps, useSpectrumChartType, useSpectrumRule } from './spectrum';
|
|
7
|
+
export { default as useChart } from './useChart';
|
|
8
|
+
export { type EnhancedPublish, withChartPublisher } from './useChartComponent';
|
|
9
|
+
export { default as useLevelStreamAnalyzer } from './useLevelStreamAnalyzer';
|
|
10
|
+
export { useModuleSubscription } from './useModuleSubscription';
|
|
11
|
+
export { useFilteredSeries, useSeriesForComponent, useSeriesManager } from './useSeriesManager';
|
|
12
|
+
export { default as useSpectrumAnalyzer } from './useSpectrumAnalyzer';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Publish } from '
|
|
2
|
-
import { type CSMCallback } from '
|
|
1
|
+
import type { Publish } from '../../types';
|
|
2
|
+
import { type CSMCallback } from '../../utils/subscription';
|
|
3
3
|
export declare const PUB_SUB: (globalID: string, func?: CSMCallback) => (...args: any[]) => void;
|
|
4
4
|
interface Props {
|
|
5
5
|
subscribe?: CSMCallback;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Publish, PublishData } from '
|
|
2
|
-
import type { rawData } from '
|
|
1
|
+
import type { Publish, PublishData } from '../../index';
|
|
2
|
+
import type { rawData } from '../../utils/subscription';
|
|
3
3
|
interface EnhancedPublish extends Publish {
|
|
4
4
|
isReady: () => boolean;
|
|
5
|
-
onReady: (callback: () =>
|
|
5
|
+
onReady: (callback: () => undefined | (() => void)) => undefined | (() => void);
|
|
6
6
|
getSourceData: () => rawData;
|
|
7
7
|
}
|
|
8
8
|
export interface UseSafePublishReturn {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 频谱相关 hooks
|
|
3
|
+
*/
|
|
4
|
+
export type { Props as UseSpectrumChartTypeProps } from './useSpectrumChartType';
|
|
5
|
+
export { default as useSpectrumChartType } from './useSpectrumChartType';
|
|
6
|
+
export { default as useSpectrumRule, SET_SEGMENTS_DISPLAY } from './useSpectrumRule';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartType } from '
|
|
2
|
-
import type { PublishData, RecursiveFunction } from '
|
|
1
|
+
import { ChartType } from '../../config';
|
|
2
|
+
import type { PublishData, RecursiveFunction } from '../../types';
|
|
3
3
|
export declare const SET_SEGMENTS_DISPLAY: (globalID: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
4
4
|
export default function useSpectrumRule(type: ChartType): (e: PublishData) => void;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import type { RecursiveObject, RenderChartType } from '../../types';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Render 类构造函数类型
|
|
5
|
+
* 所有 render 类必须接受 id 和 globalID 参数,并实现 RenderChartType 接口
|
|
6
|
+
*/
|
|
7
|
+
type RenderConstructor<T extends RenderChartType = RenderChartType> = new (props: {
|
|
8
|
+
id: string;
|
|
9
|
+
globalID: string;
|
|
10
|
+
} & RecursiveObject) => T;
|
|
11
|
+
interface Props<T extends RenderChartType = RenderChartType> {
|
|
12
|
+
Render: RenderConstructor<T>;
|
|
4
13
|
params?: RecursiveObject;
|
|
5
14
|
onIDChange?: (id: string) => void;
|
|
6
15
|
}
|
|
7
|
-
declare const useChart: (props: Props) => {
|
|
16
|
+
declare const useChart: <T extends RenderChartType = RenderChartType>(props: Props<T>) => {
|
|
8
17
|
id: string;
|
|
9
|
-
chart:
|
|
10
|
-
Chart: (e:
|
|
18
|
+
chart: T;
|
|
19
|
+
Chart: (e: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
11
20
|
};
|
|
12
21
|
export default useChart;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 通用拖拽框选 Hook
|
|
3
|
+
* 提炼自 HeatmapCapture/Slider 的框选能力
|
|
4
|
+
*/
|
|
5
|
+
export type DragType = 'top' | 'bottom' | 'left' | 'right' | 'middle' | null;
|
|
6
|
+
export interface RectPosition {
|
|
7
|
+
position: number;
|
|
8
|
+
height: number;
|
|
9
|
+
leftPosition: number;
|
|
10
|
+
width: number;
|
|
11
|
+
}
|
|
12
|
+
export interface UseDragSelectConfig {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
defaultRect?: Partial<RectPosition>;
|
|
15
|
+
minSize?: number;
|
|
16
|
+
maxSize?: number;
|
|
17
|
+
snapThreshold?: number;
|
|
18
|
+
onChange?: (rect: RectPosition) => void;
|
|
19
|
+
onDragEnd?: (rect: RectPosition) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 通用拖拽框选 Hook
|
|
23
|
+
*/
|
|
24
|
+
export declare const useDragSelect: (config?: UseDragSelectConfig) => {
|
|
25
|
+
rect: RectPosition;
|
|
26
|
+
isDragging: boolean;
|
|
27
|
+
dragType: DragType;
|
|
28
|
+
containerRef: import("react").RefObject<HTMLDivElement>;
|
|
29
|
+
handleMouseDown: (e: React.MouseEvent<HTMLDivElement>, type: DragType) => void;
|
|
30
|
+
resetRect: (newRect: Partial<RectPosition>) => void;
|
|
31
|
+
setRect: (newRect: RectPosition) => void;
|
|
32
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ModuleType } from '../config';
|
|
2
|
+
import type { PublishData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 模块订阅所需的图表接口(最小化)
|
|
5
|
+
*/
|
|
6
|
+
interface ChartSubscriptionInterface<TData = unknown> {
|
|
7
|
+
updateSeries?(data: TData): void;
|
|
8
|
+
reset(): void;
|
|
9
|
+
resize(): void;
|
|
10
|
+
}
|
|
11
|
+
type DataExtractor<TData> = (d: PublishData) => TData;
|
|
12
|
+
type CustomHandler = (d: PublishData) => boolean | undefined;
|
|
13
|
+
interface UseModuleSubscriptionOptions<TData = unknown> {
|
|
14
|
+
/**
|
|
15
|
+
* 模块类型
|
|
16
|
+
*/
|
|
17
|
+
moduleType: ModuleType;
|
|
18
|
+
/**
|
|
19
|
+
* 图表实例
|
|
20
|
+
*/
|
|
21
|
+
chart: ChartSubscriptionInterface<TData> | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* 从 PublishData 中提取数据(默认直接传递整个 d)
|
|
24
|
+
*/
|
|
25
|
+
extractData?: DataExtractor<TData>;
|
|
26
|
+
/**
|
|
27
|
+
* 自定义处理器(返回 true 表示已处理,跳过默认逻辑)
|
|
28
|
+
*/
|
|
29
|
+
customHandler?: CustomHandler;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 模块订阅 Hook
|
|
33
|
+
*
|
|
34
|
+
* 提供统一的数据订阅模式,处理 Render/Reset/Resize 事件
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // 基础用法
|
|
38
|
+
* useModuleSubscription({
|
|
39
|
+
* moduleType: ModuleType.Dial,
|
|
40
|
+
* chart
|
|
41
|
+
* });
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* // 提取特定数据字段
|
|
45
|
+
* useModuleSubscription({
|
|
46
|
+
* moduleType: ModuleType.Occupancy,
|
|
47
|
+
* chart,
|
|
48
|
+
* extractData: (d) => d.data
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* // 自定义处理
|
|
53
|
+
* useModuleSubscription({
|
|
54
|
+
* moduleType: ModuleType.Heatmap,
|
|
55
|
+
* chart,
|
|
56
|
+
* customHandler: (d) => {
|
|
57
|
+
* if (d.pstype === PSType.Option) {
|
|
58
|
+
* // 自定义处理
|
|
59
|
+
* return true; // 已处理
|
|
60
|
+
* }
|
|
61
|
+
* return false; // 继续默认处理
|
|
62
|
+
* }
|
|
63
|
+
* });
|
|
64
|
+
*/
|
|
65
|
+
export declare function useModuleSubscription<TData = unknown>({ moduleType, chart, extractData, customHandler }: UseModuleSubscriptionOptions<TData>): void;
|
|
66
|
+
export default useModuleSubscription;
|
|
@@ -14,6 +14,6 @@ export declare function useFilteredSeries(globalID: string | undefined, filter?:
|
|
|
14
14
|
color: string;
|
|
15
15
|
thickness: number;
|
|
16
16
|
display: boolean;
|
|
17
|
-
type: import("
|
|
17
|
+
type: import("@rfkit/renderer").GraphicType;
|
|
18
18
|
}[];
|
|
19
19
|
export default useFilteredSeries;
|
|
@@ -28,14 +28,6 @@ export interface UseSeriesManagerResult {
|
|
|
28
28
|
* 统一的 Series 管理 Hook
|
|
29
29
|
*/
|
|
30
30
|
export declare function useSeriesManager(globalID: string | undefined, options?: UseSeriesManagerOptions): UseSeriesManagerResult;
|
|
31
|
-
/**
|
|
32
|
-
* 轻量级版本 - 只获取数据,不订阅变化
|
|
33
|
-
*/
|
|
34
|
-
export declare function useSeriesData(globalID: string | undefined): {
|
|
35
|
-
series: Map<string, SeriesConfig>;
|
|
36
|
-
mode: SeriesMode;
|
|
37
|
-
getSeries: (name: string) => SeriesConfig | undefined;
|
|
38
|
-
};
|
|
39
31
|
/**
|
|
40
32
|
* 专门用于组件的版本 - 自动订阅所有变化
|
|
41
33
|
*/
|
package/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export { setFrequencyAllocationToCache } from './components/FrequencyAllocation/tools';
|
|
2
|
-
export { ChartType, MarkerEventType, OptionKey, PSType, SegmentsEvent, SeriesType, ToolsBarItemType } from './config';
|
|
3
|
-
export {
|
|
2
|
+
export { ChartType, FrequencyUnit, MarkerEventType, ModuleType, OptionKey, PSType, SegmentsEvent, SeriesType, ToolsBarItemType, ToolType } from './config';
|
|
3
|
+
export { type EnhancedPublish, useSafePublish, withChartPublisher } from './hooks';
|
|
4
4
|
export { Dial, Gauge, Heatmap, IQ, LevelStream, Occupancy, Spectrum } from './lib';
|
|
5
5
|
export type { AxisXProps, AxisYRange, ChartRef, FrequencyAllocationItem, MarkerProps, MarkerType, Publish, PublishData, PublishDial, PublishGauge, PublishHeatmap, PublishIQ, PublishLevelStream, PublishOccupancy, PublishSpectrum, RecursiveFunction, // 递归方法 后期会删除
|
|
6
6
|
RecursiveObject, // 递归对象 后期会删除
|
|
7
7
|
Render, Reset, SegmentsOriginal, SeriesConfig, SetAntennaFactor, SetChannels, SetMarker, SetSegments, SetSeries, SetSpectrumBandwidth, SpectrumBandwidth, SpectrumExtraData, StationInfoType } from './types';
|
|
8
8
|
export { HeatmapCaptureType, MarkerMode } from './types';
|
|
9
9
|
export { SignalDataType } from './types/store';
|
|
10
|
+
export { formatFrequencyUnit, formatFrequencyUnitFromHz, formatFrequencyUnitFromMHz } from './utils';
|
|
11
|
+
export type { FrequencyUnitResult } from './utils';
|