@rfkit/charts 1.0.93 → 1.0.95

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 CHANGED
@@ -179,6 +179,7 @@ export interface PublishSpectrum {
179
179
  pstype: PSType.Spectrum;
180
180
  data: Float32Array;
181
181
  extraData?: SpectrumExtraData;
182
+ template?: Float32Array;
182
183
  // 瀑布图可选参数
183
184
  timestamp?: number;
184
185
  // 扫描可选参数
@@ -4,6 +4,7 @@ export declare const SERIES: {
4
4
  maxData: import("./setting").LineConfig;
5
5
  avgData: import("./setting").LineConfig;
6
6
  threshold: import("./setting").LineConfig;
7
+ template: import("./setting").LineConfig;
7
8
  };
8
9
  export declare const SERIES_NAMES: string[];
9
10
  export declare const REAL_DATA_NAME: string;
@@ -105,5 +106,6 @@ export declare enum SeriesType {
105
106
  MaxData = "maxData",
106
107
  MinData = "minData",
107
108
  AvgData = "avgData",
108
- ThresholdData = "threshold"
109
+ ThresholdData = "threshold",
110
+ TemplateData = "templateData"
109
111
  }
@@ -24,6 +24,7 @@ interface Config {
24
24
  maxData: LineConfig;
25
25
  avgData: LineConfig;
26
26
  threshold: LineConfig;
27
+ template: LineConfig;
27
28
  };
28
29
  gradient: GradientConfig;
29
30
  levelStream: LevelStreamConfig;
package/engine/type.d.ts CHANGED
@@ -7,7 +7,8 @@ export declare enum GraphicType {
7
7
  Rect = "rect",
8
8
  Line = "line",
9
9
  Stepline = "stepline",
10
- Bar = "bar"
10
+ Bar = "bar",
11
+ Area = "area"
11
12
  }
12
13
  export interface StateProps {
13
14
  id: string;
@@ -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>;
@@ -0,0 +1,22 @@
1
+ import { type RefObject } from 'react';
2
+ import type { SelectedSignal } from '../../types';
3
+ interface UseTemplateComparisonProps {
4
+ frequencyFormat: RefObject<(x: number) => string>;
5
+ onChange: RefObject<(e: SelectedSignal) => void>;
6
+ }
7
+ interface ExceedingSegment {
8
+ startFrequency: number;
9
+ stopFrequency: number;
10
+ centerFrequency: number;
11
+ bandwidth: number;
12
+ timestamp: number;
13
+ }
14
+ /**
15
+ * 模板数据比较 Hook
16
+ * 用于检测数据是否超出模板阈值,并输出相关信息
17
+ */
18
+ export default function useTemplateComparison({ frequencyFormat, onChange, }: UseTemplateComparisonProps): {
19
+ findExceedingSegments: (dataArray: Float32Array, templateArray: Float32Array, timestamp: number) => ExceedingSegment[];
20
+ processExceedingData: (data: Float32Array, templateData: Float32Array, timestamp: number) => void;
21
+ };
22
+ export {};