@rfkit/charts 1.1.16 → 1.1.20
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/README.md +3 -2
- package/components/EventBus/tools.d.ts +2 -2
- package/components/FrequencyTagLine/index.d.ts +11 -0
- package/components/Markers/{Dot → MarkerItem}/index.d.ts +1 -2
- package/components/Markers/hooks/useMarkerEvents.d.ts +21 -0
- package/components/Markers/hooks/useMarkers.d.ts +45 -0
- package/components/Markers/index.d.ts +2 -7
- package/components/Markers/tools.d.ts +41 -0
- package/components/ToolsBar/IconBox.d.ts +2 -2
- package/config/constants.d.ts +3 -12
- package/hooks/useChannel.d.ts +1 -11
- package/hooks/useMarkerPublish.d.ts +8 -0
- package/hooks/useSpectrumRule.d.ts +1 -4
- package/index.d.ts +1 -1
- package/index.js +3862 -4533
- package/lib/Spectrum/Chart.d.ts +2 -4
- package/modules/Heatmap/index.d.ts +0 -2
- package/modules/HeatmapPortal/index.d.ts +0 -2
- package/modules/Spectrum/index.d.ts +0 -1
- package/package.json +1 -1
- package/store/globalState.d.ts +9 -0
- package/store/reducer.d.ts +2 -2
- package/types/common.d.ts +1 -20
- package/types/publish.d.ts +8 -5
- package/types/store.d.ts +37 -25
- package/components/FrequencyMarkerLine/index.d.ts +0 -11
- package/components/Markers/Board/index.d.ts +0 -14
- package/components/Markers/lib/Counter.d.ts +0 -38
- package/components/Markers/lib/FreeMarkers.d.ts +0 -34
- package/components/Markers/lib/LineMarkers.d.ts +0 -55
- package/components/Markers/lib/Markers.d.ts +0 -55
- package/components/Markers/lib/Selecter.d.ts +0 -35
- package/components/Markers/lib/tools.d.ts +0 -72
- package/hooks/use10DataRate.d.ts +0 -1
- package/hooks/useMarkerLinkageZoom.d.ts +0 -1
- /package/components/{FrequencyMarkerLine → FrequencyTagLine}/Board/index.d.ts +0 -0
- /package/components/{FrequencyMarkerLine → FrequencyTagLine}/Switch/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -164,8 +164,9 @@ export interface SetChannels {
|
|
|
164
164
|
export interface SetMarker {
|
|
165
165
|
pstype: PSType.Marker;
|
|
166
166
|
event: MarkerEventType;
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
marker?: Partial<MarkerType>;
|
|
168
|
+
frequencies?: number[]; // 设计规定:frequencies必须是频率数据
|
|
169
|
+
silent?: boolean; // 是否通知外部onChange回调
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
// 额外的频谱数据
|
|
@@ -30,7 +30,7 @@ export declare const EVENT_PRIORITY_LEVELS: {
|
|
|
30
30
|
markers: number;
|
|
31
31
|
limit: number;
|
|
32
32
|
stripe: number;
|
|
33
|
-
|
|
33
|
+
frequencyTagLine: number;
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
36
|
* 事件样式映射
|
|
@@ -38,7 +38,7 @@ export declare const EVENT_PRIORITY_LEVELS: {
|
|
|
38
38
|
export declare const CURSOR_STYLE_MAP: {
|
|
39
39
|
markers: string;
|
|
40
40
|
stripe: string;
|
|
41
|
-
|
|
41
|
+
frequencyTagLine: string;
|
|
42
42
|
limit: string;
|
|
43
43
|
frame: string;
|
|
44
44
|
zoom: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ToolType } from '../../config';
|
|
3
|
+
import FrequencyTagLineBoard from './Board';
|
|
4
|
+
import FrequencyTagLineSwitch from './Switch';
|
|
5
|
+
export { FrequencyTagLineSwitch, FrequencyTagLineBoard };
|
|
6
|
+
export declare const COMPONENT_KEY = ToolType.FrequencyTagLine;
|
|
7
|
+
interface Props {
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: React.NamedExoticComponent<Props>;
|
|
11
|
+
export default _default;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MarkerType } from '../../../types';
|
|
3
3
|
interface Props {
|
|
4
|
-
|
|
5
|
-
heatmapMode: boolean;
|
|
4
|
+
marker: MarkerType;
|
|
6
5
|
}
|
|
7
6
|
declare const _default: React.NamedExoticComponent<Props>;
|
|
8
7
|
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MarkerType, TopRightBottomLeft } from '../../../types';
|
|
2
|
+
interface UseMarkerEventsProps {
|
|
3
|
+
id: string;
|
|
4
|
+
markers: MarkerType[];
|
|
5
|
+
display: boolean;
|
|
6
|
+
onCreateMarker: (e: {
|
|
7
|
+
left: number;
|
|
8
|
+
}) => void;
|
|
9
|
+
onDeleteMarker: (id: string) => void;
|
|
10
|
+
onUpdateMarker: (id: string, position: TopRightBottomLeft) => void;
|
|
11
|
+
onHover: (e: {
|
|
12
|
+
left: number;
|
|
13
|
+
}) => void;
|
|
14
|
+
onResetHover: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const useMarkerEvents: (props: UseMarkerEventsProps) => {
|
|
17
|
+
isDown: MarkerType & {
|
|
18
|
+
index?: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { MarkerEventType } from '../../../config';
|
|
2
|
+
import type { MarkerType, SetMarker } from '../../../types';
|
|
3
|
+
interface UseMarkersProps {
|
|
4
|
+
id: string;
|
|
5
|
+
globalID: string;
|
|
6
|
+
display?: boolean;
|
|
7
|
+
onChange?: (operationType: MarkerEventType, markers: MarkerType[]) => void;
|
|
8
|
+
}
|
|
9
|
+
interface MarkerState {
|
|
10
|
+
markers: MarkerType[];
|
|
11
|
+
colorIndex: number;
|
|
12
|
+
isDown: (MarkerType & {
|
|
13
|
+
index?: number;
|
|
14
|
+
}) | null;
|
|
15
|
+
isHover: (MarkerType & {
|
|
16
|
+
index?: number;
|
|
17
|
+
}) | string;
|
|
18
|
+
peak: {
|
|
19
|
+
value: number;
|
|
20
|
+
index: number;
|
|
21
|
+
id?: string;
|
|
22
|
+
} | null;
|
|
23
|
+
hasPeak: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const useMarkers: (props: UseMarkersProps) => {
|
|
26
|
+
markers: MarkerType[];
|
|
27
|
+
isDown: MarkerType & {
|
|
28
|
+
index?: number;
|
|
29
|
+
};
|
|
30
|
+
isHover: string | (MarkerType & {
|
|
31
|
+
index?: number;
|
|
32
|
+
});
|
|
33
|
+
createMarker: (e: {
|
|
34
|
+
left: number;
|
|
35
|
+
}, isBatchAdd?: boolean) => void;
|
|
36
|
+
updateMarkerAttribute: ({ event, marker, frequencies, silent }: Partial<SetMarker>) => void;
|
|
37
|
+
resetMarkers: () => void;
|
|
38
|
+
updateByData: (data?: Float32Array) => void;
|
|
39
|
+
handleHover: (e: {
|
|
40
|
+
left: number;
|
|
41
|
+
}) => string;
|
|
42
|
+
resetHover: () => void;
|
|
43
|
+
setState: import("react").Dispatch<import("react").SetStateAction<MarkerState>>;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { bandwidthfrequency2frequency, MARKER_UPDATE_ATTRIBUTE, MARKER_UPDATE_PARAMS, MARKER_UPDATE_RESET, startstop2frequency } from './lib/tools';
|
|
5
|
-
export { Counter, Selecter, startstop2frequency, bandwidthfrequency2frequency, MARKER_UPDATE_PARAMS, MARKER_UPDATE_ATTRIBUTE, MARKER_UPDATE_RESET };
|
|
2
|
+
import { MARKER_UPDATE_ATTRIBUTE, MARKER_UPDATE_RESET } from './tools';
|
|
3
|
+
export { MARKER_UPDATE_ATTRIBUTE, MARKER_UPDATE_RESET };
|
|
6
4
|
interface Props {
|
|
7
5
|
id: string;
|
|
8
|
-
counter?: any;
|
|
9
|
-
selecter?: any;
|
|
10
|
-
heatmapMode?: boolean;
|
|
11
6
|
}
|
|
12
7
|
declare const Markers: React.FC<Props>;
|
|
13
8
|
export default Markers;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { MarkerType, RecursiveFunction, SegmentsType } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Marker 工具函数集合 - 精简版
|
|
4
|
+
*/
|
|
5
|
+
export declare const MARKER_UPDATE_ATTRIBUTE: (id: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
6
|
+
export declare const MARKER_UPDATE_RESET: (id: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
7
|
+
export declare const MARKER_COUNT_CHANGE: (id: string, func?: RecursiveFunction<[{
|
|
8
|
+
count: number;
|
|
9
|
+
}]>) => (...args: any[]) => void;
|
|
10
|
+
export declare const leftDataSelectMax: (left: number, data: Float32Array) => number;
|
|
11
|
+
export declare function fixLocation(location: number, len: number): number;
|
|
12
|
+
interface ZoomLeftParams {
|
|
13
|
+
left: number;
|
|
14
|
+
globalID: string;
|
|
15
|
+
}
|
|
16
|
+
interface ZoomLeftResult {
|
|
17
|
+
insideLeft: number;
|
|
18
|
+
outsideLeft: number;
|
|
19
|
+
multiple: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function splitZoomLeft({ left, globalID }: ZoomLeftParams): ZoomLeftResult;
|
|
22
|
+
export interface PeakPoint {
|
|
23
|
+
value: number;
|
|
24
|
+
index: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function findPeaks(data: Float32Array): PeakPoint[] | null;
|
|
27
|
+
export declare function findMultiplePeaks(data: Float32Array, threshold?: number, minDistance?: number): PeakPoint[];
|
|
28
|
+
export declare function findNearbyPeak(data: Float32Array, targetIndex: number, searchRadius?: number): PeakPoint | null;
|
|
29
|
+
export declare const setMarkerMove: (marker: MarkerType, segments: SegmentsType, callback: RecursiveFunction) => void;
|
|
30
|
+
export declare const setMarkerBatchAdd: (params: {
|
|
31
|
+
data: number[];
|
|
32
|
+
clear?: boolean;
|
|
33
|
+
}, segments: SegmentsType, callback: (arg: {
|
|
34
|
+
pstype: string;
|
|
35
|
+
event: string;
|
|
36
|
+
data: number[];
|
|
37
|
+
clear?: boolean;
|
|
38
|
+
}) => void) => void;
|
|
39
|
+
export declare const validateMarkerPosition: (left: number, segments: SegmentsType) => boolean;
|
|
40
|
+
export declare const calculateMarkerFrequency: (left: number, segments: SegmentsType) => number | null;
|
|
41
|
+
export {};
|
|
@@ -5,8 +5,8 @@ interface Props {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
title?: string;
|
|
7
7
|
children: ReactNode;
|
|
8
|
-
onClick?: (e:
|
|
9
|
-
onDoubleClick?: (e:
|
|
8
|
+
onClick?: (e: unknown) => void;
|
|
9
|
+
onDoubleClick?: (e: unknown) => void;
|
|
10
10
|
}
|
|
11
11
|
declare const IconBox: React.FC<Props>;
|
|
12
12
|
export default IconBox;
|
package/config/constants.d.ts
CHANGED
|
@@ -71,16 +71,8 @@ export declare enum SegmentsEvent {
|
|
|
71
71
|
export declare enum MarkerEventType {
|
|
72
72
|
Add = "add",
|
|
73
73
|
Del = "del",
|
|
74
|
-
Reset = "reset",
|
|
75
|
-
Move = "move",
|
|
76
74
|
Clear = "clear",
|
|
77
|
-
|
|
78
|
-
Update = "update",
|
|
79
|
-
Format = "format",
|
|
80
|
-
Dashed = "dashed",
|
|
81
|
-
Center = "center",
|
|
82
|
-
Ref = "ref",
|
|
83
|
-
Flow = "flow"
|
|
75
|
+
Update = "update"
|
|
84
76
|
}
|
|
85
77
|
export declare enum ToolType {
|
|
86
78
|
AxisX = "axisX",
|
|
@@ -93,7 +85,7 @@ export declare enum ToolType {
|
|
|
93
85
|
EventBus = "eventBus",
|
|
94
86
|
FrequencyAllocation = "frequencyAllocation",
|
|
95
87
|
FrequencyDataBoard = "frequencyDataBoard",
|
|
96
|
-
|
|
88
|
+
FrequencyTagLine = "frequencyTagLine",
|
|
97
89
|
GridLines = "gridLines",
|
|
98
90
|
GuageBox = "guageBox",
|
|
99
91
|
HeatmapCapture = "heatmapCapture",
|
|
@@ -108,8 +100,7 @@ export declare enum ToolType {
|
|
|
108
100
|
Stripe = "stripe",
|
|
109
101
|
Zoom = "zoom",
|
|
110
102
|
Frame = "frame",
|
|
111
|
-
Area = "area"
|
|
112
|
-
MarkerFree = "markerFree"
|
|
103
|
+
Area = "area"
|
|
113
104
|
}
|
|
114
105
|
export declare enum SeriesType {
|
|
115
106
|
RealData = "realData",
|
package/hooks/useChannel.d.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { SetChannels } from '../types';
|
|
3
|
-
export interface Props {
|
|
4
|
-
channel?: number;
|
|
5
|
-
onChannelChange?: (c: {
|
|
6
|
-
frequency: number;
|
|
7
|
-
type: MarkerEventType;
|
|
8
|
-
list: number[];
|
|
9
|
-
}) => void;
|
|
10
|
-
}
|
|
11
|
-
export default function useChannel({ channel, onChannelChange }: Props): ({ event, frequency }: SetChannels) => void;
|
|
1
|
+
export default function useChannel(): () => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PublishData } from '../types';
|
|
2
|
+
interface UseMarkerPublishProps {
|
|
3
|
+
globalID: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const useMarkerPublish: ({ globalID }: UseMarkerPublishProps) => {
|
|
6
|
+
handleMarkerPublish: (e: PublishData) => void;
|
|
7
|
+
};
|
|
8
|
+
export default useMarkerPublish;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { type Props as ChannelProps } from './useChannel';
|
|
2
1
|
import type { PublishData, RecursiveFunction } from '../types';
|
|
3
2
|
export declare const SET_SEGMENTS_DISPLAY: (globalID: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
4
|
-
export
|
|
5
|
-
}
|
|
6
|
-
export default function useSpectrumRule({ channel, onChannelChange }: Props): (e: PublishData) => void;
|
|
3
|
+
export default function useSpectrumRule(): (e: PublishData) => void;
|
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { setFrequencyAllocationToCache } from './components/FrequencyAllocation/
|
|
|
2
2
|
export { ChartType, MarkerEventType, OptionKey, PSType, SegmentsEvent, SeriesType } from './config';
|
|
3
3
|
export { default as useSafePublish } from './hooks/useSafePublish';
|
|
4
4
|
export { Dial, Gauge, Heatmap, IQ, LevelStream, Occupancy, Spectrum } from './lib';
|
|
5
|
-
export type { AxisXProps, AxisYRange, ChartRef, MarkerType, Publish, PublishData, PublishDial, PublishGauge, PublishHeatmap, PublishIQ, PublishLevelStream, PublishOccupancy, PublishSpectrum, RecursiveFunction, // 递归方法 后期会删除
|
|
5
|
+
export type { AxisXProps, AxisYRange, ChartRef, MarkerMode, 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 } from './types';
|