@rfkit/charts 1.0.105 → 1.1.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/README.md +7 -2
- package/components/Band/index.d.ts +1 -1
- package/components/Markers/index.d.ts +2 -2
- package/config/constants.d.ts +6 -4
- package/config/setting.d.ts +3 -2
- package/hooks/useChartComponent.d.ts +17 -0
- package/hooks/usePublish.d.ts +2 -1
- package/hooks/useSafePublish.d.ts +13 -0
- package/hooks/useSpectrumAnalyzer/useTemplateComparison.d.ts +1 -1
- package/index.d.ts +3 -2
- package/index.js +309 -146
- package/lib/Dial/Chart.d.ts +1 -2
- package/lib/Dial/index.d.ts +2 -1
- package/lib/Gauge/Chart.d.ts +1 -2
- package/lib/Gauge/index.d.ts +2 -1
- package/lib/Heatmap/Chart.d.ts +1 -2
- package/lib/Heatmap/index.d.ts +2 -1
- package/lib/IQ/Chart.d.ts +1 -2
- package/lib/IQ/index.d.ts +2 -1
- package/lib/LevelStream/Chart.d.ts +1 -2
- package/lib/LevelStream/index.d.ts +1 -1
- package/lib/Occupancy/Chart.d.ts +1 -2
- package/lib/Occupancy/index.d.ts +1 -1
- package/lib/SpatialSpectrum/Chart.d.ts +1 -2
- package/lib/SpatialSpectrum/index.d.ts +2 -2
- package/lib/Spectrum/Chart.d.ts +1 -2
- package/lib/Spectrum/index.d.ts +1 -1
- package/package.json +1 -1
- package/store/reducer.d.ts +2 -2
- package/types/common.d.ts +4 -1
- package/types/publish.d.ts +8 -4
- package/types/store.d.ts +4 -3
package/README.md
CHANGED
|
@@ -175,9 +175,14 @@ export interface SpectrumExtraData {
|
|
|
175
175
|
// 推送频谱数据
|
|
176
176
|
export interface PublishSpectrum {
|
|
177
177
|
pstype: PSType.Spectrum;
|
|
178
|
-
data
|
|
178
|
+
data?: Float32Array;
|
|
179
|
+
// 一般仅在静态绘制
|
|
180
|
+
maxData?: Float32Array;
|
|
181
|
+
minData?: Float32Array;
|
|
182
|
+
avgData?: Float32Array;
|
|
183
|
+
backgroundNoiseData?: Float32Array;
|
|
184
|
+
templateData?: Float32Array;
|
|
179
185
|
extraData?: SpectrumExtraData;
|
|
180
|
-
template?: Float32Array;
|
|
181
186
|
// 瀑布图可选参数
|
|
182
187
|
timestamp?: number;
|
|
183
188
|
// 扫描可选参数
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import Counter from './lib/Counter
|
|
3
|
-
import Selecter from './lib/Selecter
|
|
2
|
+
import Counter from './lib/Counter';
|
|
3
|
+
import Selecter from './lib/Selecter';
|
|
4
4
|
import { bandwidthfrequency2frequency, MARKER_UPDATE_ATTRIBUTE, MARKER_UPDATE_PARAMS, MARKER_UPDATE_RESET, startstop2frequency } from './lib/tools';
|
|
5
5
|
export { Counter, Selecter, startstop2frequency, bandwidthfrequency2frequency, MARKER_UPDATE_PARAMS, MARKER_UPDATE_ATTRIBUTE, MARKER_UPDATE_RESET };
|
|
6
6
|
interface Props {
|
package/config/constants.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ export declare const SERIES: {
|
|
|
3
3
|
minData: import("./setting").LineConfig;
|
|
4
4
|
maxData: import("./setting").LineConfig;
|
|
5
5
|
avgData: import("./setting").LineConfig;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
thresholdData: import("./setting").LineConfig;
|
|
7
|
+
templateData: import("./setting").LineConfig;
|
|
8
|
+
backgroundNoiseData: import("./setting").LineConfig;
|
|
8
9
|
};
|
|
9
10
|
export declare const SERIES_NAMES: string[];
|
|
10
11
|
export declare const REAL_DATA_NAME: string;
|
|
@@ -106,6 +107,7 @@ export declare enum SeriesType {
|
|
|
106
107
|
MaxData = "maxData",
|
|
107
108
|
MinData = "minData",
|
|
108
109
|
AvgData = "avgData",
|
|
109
|
-
ThresholdData = "
|
|
110
|
-
TemplateData = "
|
|
110
|
+
ThresholdData = "thresholdData",
|
|
111
|
+
TemplateData = "templateData",
|
|
112
|
+
BackgroundNoiseData = "backgroundNoiseData"
|
|
111
113
|
}
|
package/config/setting.d.ts
CHANGED
|
@@ -23,8 +23,9 @@ interface Config {
|
|
|
23
23
|
minData: LineConfig;
|
|
24
24
|
maxData: LineConfig;
|
|
25
25
|
avgData: LineConfig;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
thresholdData: LineConfig;
|
|
27
|
+
templateData: LineConfig;
|
|
28
|
+
backgroundNoiseData: LineConfig;
|
|
28
29
|
};
|
|
29
30
|
gradient: GradientConfig;
|
|
30
31
|
levelStream: LevelStreamConfig;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { type ComponentType } from 'react';
|
|
2
|
+
import type { Publish } from '../types';
|
|
3
|
+
import type { rawData } from '../utils/subscription';
|
|
4
|
+
export interface EnhancedPublish extends Publish {
|
|
5
|
+
isReady: () => boolean;
|
|
6
|
+
onReady: (callback: () => (() => void) | undefined) => (() => void) | undefined;
|
|
7
|
+
getSourceData: () => rawData;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 创建图表组件的高阶函数,提供安全的publish功能
|
|
11
|
+
* @param ChartComponent 要包装的图表组件
|
|
12
|
+
* @param componentName 组件名称,用于调试
|
|
13
|
+
* @returns 包装后的forwardRef组件
|
|
14
|
+
*/
|
|
15
|
+
export declare function withChartPublisher<TProps extends {
|
|
16
|
+
publish?: Publish;
|
|
17
|
+
}>(ChartComponent: ComponentType<TProps>, componentName: string): React.ForwardRefExoticComponent<React.PropsWithoutRef<Omit<TProps, "publish">> & React.RefAttributes<Publish>>;
|
package/hooks/usePublish.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { Publish } from '../types';
|
|
1
2
|
import { type CSMCallback } from '../utils/subscription';
|
|
2
3
|
export declare const PUB_SUB: (globalID: string, func?: CSMCallback) => (...args: any[]) => void;
|
|
3
4
|
interface Props {
|
|
4
5
|
subscribe?: CSMCallback;
|
|
5
|
-
publish
|
|
6
|
+
publish: Publish;
|
|
6
7
|
}
|
|
7
8
|
declare const usePublish: ({ publish, subscribe }: Props) => void;
|
|
8
9
|
export default usePublish;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Publish, PublishData } from '../index';
|
|
2
|
+
import type { rawData } from '../utils/subscription';
|
|
3
|
+
interface EnhancedPublish extends Publish {
|
|
4
|
+
isReady: () => boolean;
|
|
5
|
+
onReady: (callback: () => void | (() => void)) => void | (() => void);
|
|
6
|
+
getSourceData: () => rawData;
|
|
7
|
+
}
|
|
8
|
+
export interface UseSafePublishReturn {
|
|
9
|
+
publish: (data: PublishData) => void;
|
|
10
|
+
chartRef: React.RefObject<EnhancedPublish>;
|
|
11
|
+
}
|
|
12
|
+
export default function useSafePublish(): UseSafePublishReturn;
|
|
13
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ChartType, MarkerEventType, OptionKey, PSType, SegmentsEvent, SeriesType } from './config';
|
|
2
|
+
export { default as useSafePublish } from './hooks/useSafePublish';
|
|
2
3
|
export { Dial, Gauge, Heatmap, IQ, LevelStream, Occupancy, Spectrum } from './lib';
|
|
3
|
-
export type { AxisXProps, AxisYRange, MarkerType, Publish, PublishData, PublishDial, PublishGauge, PublishHeatmap, PublishIQ, PublishLevelStream, PublishOccupancy, PublishSpectrum, RecursiveFunction, // 递归方法 后期会删除
|
|
4
|
+
export type { AxisXProps, AxisYRange, ChartRef, MarkerType, Publish, PublishData, PublishDial, PublishGauge, PublishHeatmap, PublishIQ, PublishLevelStream, PublishOccupancy, PublishSpectrum, RecursiveFunction, // 递归方法 后期会删除
|
|
4
5
|
RecursiveObject, // 递归对象 后期会删除
|
|
5
|
-
Render, Reset, SegmentsOriginal, SeriesConfig, SetAntennaFactor, SetChannels, SetMarker, SetSegments, SetSeries, SetSpectrumBandwidth, SpectrumBandwidth, SpectrumExtraData } from './types';
|
|
6
|
+
Render, Reset, SegmentsOriginal, SeriesConfig, SetAntennaFactor, SetChannels, SetMarker, SetSegments, SetSeries, SetSpectrumBandwidth, SpectrumBandwidth, SpectrumExtraData, StationInfoType } from './types';
|
|
6
7
|
export { HeatmapCaptureType } from './types';
|