@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.
@@ -1,7 +1,6 @@
1
1
  import type React from 'react';
2
- import type { ParamsProps, RecursiveFunction } from '../../types';
2
+ import type { ParamsProps } from '../../types';
3
3
  export interface Props extends ParamsProps {
4
- publish?: RecursiveFunction;
5
4
  }
6
5
  declare const Chart: React.FC<Props>;
7
6
  export default Chart;
@@ -1,3 +1,4 @@
1
+ import type React from 'react';
1
2
  import type { Props } from './Chart';
2
- declare const Dial: React.FC<Props>;
3
+ declare const Dial: React.ForwardRefExoticComponent<Omit<Omit<Props, "publish">, "ref"> & React.RefAttributes<import("../..").Publish>>;
3
4
  export default Dial;
@@ -1,10 +1,9 @@
1
1
  import type React from 'react';
2
- import type { ParamsProps, RecursiveFunction } from '../../types';
2
+ import type { ParamsProps } from '../../types';
3
3
  export interface Props extends ParamsProps {
4
4
  axisY?: {
5
5
  range?: [number, number];
6
6
  };
7
- publish?: RecursiveFunction;
8
7
  onChange?: (limit: number) => void;
9
8
  }
10
9
  declare const Chart: React.FC<Props>;
@@ -1,3 +1,4 @@
1
+ import type React from 'react';
1
2
  import type { Props } from './Chart';
2
- declare const Gauge: React.FC<Props>;
3
+ declare const Gauge: React.ForwardRefExoticComponent<Omit<Omit<Props, "publish">, "ref"> & React.RefAttributes<import("../..").Publish>>;
3
4
  export default Gauge;
@@ -1,8 +1,7 @@
1
1
  import type React from 'react';
2
- import type { ParamsProps, RecursiveFunction } from '../../types';
2
+ import type { ParamsProps } from '../../types';
3
3
  export interface Props extends ParamsProps {
4
4
  heatmapDefaultData?: Array<Array<number>>;
5
- publish?: RecursiveFunction;
6
5
  }
7
6
  declare const Chart: React.FC<Props>;
8
7
  export default Chart;
@@ -1,3 +1,4 @@
1
+ import type React from 'react';
1
2
  import type { Props } from './Chart';
2
- declare const Heatmap: React.FC<Props>;
3
+ declare const Heatmap: React.ForwardRefExoticComponent<Omit<Omit<Props, "publish">, "ref"> & React.RefAttributes<import("../..").Publish>>;
3
4
  export default Heatmap;
package/lib/IQ/Chart.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import type React from 'react';
2
2
  import { ChartType } from '../../config';
3
- import type { ParamsProps, RecursiveFunction } from '../../types';
3
+ import type { ParamsProps } from '../../types';
4
4
  export interface Props extends ParamsProps {
5
5
  type: ChartType;
6
- publish?: RecursiveFunction;
7
6
  }
8
7
  declare const Chart: React.FC<Props>;
9
8
  export default Chart;
package/lib/IQ/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type React from 'react';
1
2
  import type { Props } from './Chart';
2
- declare const IQ: React.FC<Props>;
3
+ declare const IQ: React.ForwardRefExoticComponent<Omit<Omit<Props, "publish">, "ref"> & React.RefAttributes<import("../..").Publish>>;
3
4
  export default IQ;
@@ -1,7 +1,6 @@
1
1
  import type React from 'react';
2
- import type { ParamsProps, RecursiveFunction } from '../../types';
2
+ import type { ParamsProps } from '../../types';
3
3
  export interface Props extends ParamsProps {
4
- publish?: RecursiveFunction;
5
4
  statisticsTime?: number;
6
5
  }
7
6
  declare const Chart: React.FC<Props>;
@@ -1,4 +1,4 @@
1
1
  import type React from 'react';
2
2
  import type { Props } from './Chart';
3
- declare const LevelStream: React.FC<Props>;
3
+ declare const LevelStream: React.ForwardRefExoticComponent<Omit<Omit<Props, "publish">, "ref"> & React.RefAttributes<import("../..").Publish>>;
4
4
  export default LevelStream;
@@ -1,7 +1,6 @@
1
1
  import type React from 'react';
2
- import type { ParamsProps, RecursiveFunction } from '../../types';
2
+ import type { ParamsProps } from '../../types';
3
3
  export interface Props extends ParamsProps {
4
- publish?: RecursiveFunction;
5
4
  }
6
5
  declare const Chart: React.FC<Props>;
7
6
  export default Chart;
@@ -1,4 +1,4 @@
1
1
  import type React from 'react';
2
2
  import type { Props } from './Chart';
3
- declare const Occupancy: React.FC<Props>;
3
+ declare const Occupancy: React.ForwardRefExoticComponent<Omit<Omit<Props, "publish">, "ref"> & React.RefAttributes<import("../..").Publish>>;
4
4
  export default Occupancy;
@@ -1,7 +1,6 @@
1
1
  import type React from 'react';
2
- import type { ParamsProps, RecursiveFunction } from '../../types';
2
+ import type { ParamsProps } from '../../types';
3
3
  interface Props extends ParamsProps {
4
- publish?: RecursiveFunction;
5
4
  }
6
5
  declare const Chart: React.FC<Props>;
7
6
  export default Chart;
@@ -1,3 +1,3 @@
1
1
  import type { ParamsProps } from '../../types';
2
- declare const Dial: React.FC<ParamsProps>;
3
- export default Dial;
2
+ declare const SpatialSpectrum: import("react").ForwardRefExoticComponent<Omit<Omit<ParamsProps, "publish">, "ref"> & import("react").RefAttributes<import("../../types").Publish>>;
3
+ export default SpatialSpectrum;
@@ -1,9 +1,8 @@
1
1
  import { type Props as SpectrumChartTypeProps } from '../../hooks/useSpectrumChartType';
2
2
  import { type Props as SpectrumRuleProps } from '../../hooks/useSpectrumRule';
3
- import type { ParamsProps, RecursiveFunction, RecursiveObject } from '../../types';
3
+ import type { ParamsProps, RecursiveObject } from '../../types';
4
4
  export interface Props extends SpectrumChartTypeProps, SpectrumRuleProps, ParamsProps {
5
5
  selecter?: RecursiveObject;
6
- publish?: RecursiveFunction;
7
6
  occupancyElementID?: string;
8
7
  }
9
8
  declare const Chart: React.FC<Props>;
@@ -1,4 +1,4 @@
1
1
  import type React from 'react';
2
2
  import type { Props } from './Chart';
3
- declare const Spectrum: React.FC<Props>;
3
+ declare const Spectrum: React.ForwardRefExoticComponent<Omit<Omit<Props, "publish">, "ref"> & React.RefAttributes<import("../..").Publish>>;
4
4
  export default Spectrum;
package/package.json CHANGED
@@ -5,6 +5,6 @@
5
5
  "types": "index.d.ts",
6
6
  "author": "Hxgh",
7
7
  "license": "MIT",
8
- "version": "1.0.105",
8
+ "version": "1.1.1",
9
9
  "private": false
10
10
  }
@@ -30,7 +30,7 @@ export declare const defaultState: () => {
30
30
  levelStream?: import("../types").LevelStreamProps;
31
31
  timeRange?: number;
32
32
  stationInfo: import("../types").StationInfoProps;
33
- publish?: import("..").RecursiveFunction;
33
+ publish?: import("..").Publish;
34
34
  };
35
35
  export declare const reducer: (state: StoreState, action: DispatchAction) => {
36
36
  [x: string]: unknown;
@@ -62,5 +62,5 @@ export declare const reducer: (state: StoreState, action: DispatchAction) => {
62
62
  levelStream?: import("../types").LevelStreamProps;
63
63
  timeRange?: number;
64
64
  stationInfo: import("../types").StationInfoProps;
65
- publish?: import("..").RecursiveFunction;
65
+ publish?: import("..").Publish;
66
66
  };
package/types/common.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { GraphicType } from '../engine';
2
- import type { RecursiveObject, SetSeries } from './';
2
+ import type { Publish, RecursiveObject, SetSeries } from './';
3
3
  export type AxisYRange = [number, number];
4
4
  export interface AxisXRange {
5
5
  start: number;
@@ -93,3 +93,6 @@ export interface StationInfoType {
93
93
  startFrequency: number;
94
94
  stopFrequency: number;
95
95
  }
96
+ export interface ChartRef {
97
+ publish: Publish;
98
+ }
@@ -1,4 +1,5 @@
1
1
  import type { MarkerEventType, OptionKey, PSType, SegmentsEvent } from '../config';
2
+ import type { rawData } from '../utils/subscription';
2
3
  import type { SegmentsOriginal, SeriesConfig, SpectrumBandwidth, StationInfoType } from './common';
3
4
  import type { ParamsProps } from './store';
4
5
  export interface SetOption {
@@ -37,7 +38,7 @@ export interface SetChannels {
37
38
  export interface SetMarker {
38
39
  pstype: PSType.Marker;
39
40
  event: MarkerEventType;
40
- data: number;
41
+ data: number[];
41
42
  heatmapMode?: boolean;
42
43
  }
43
44
  export interface SpectrumExtraData {
@@ -49,7 +50,8 @@ export interface PublishSpectrum {
49
50
  maxData?: Float32Array;
50
51
  minData?: Float32Array;
51
52
  avgData?: Float32Array;
52
- template?: Float32Array;
53
+ backgroundNoiseData?: Float32Array;
54
+ templateData?: Float32Array;
53
55
  extraData?: SpectrumExtraData;
54
56
  timestamp?: number;
55
57
  offset?: number;
@@ -72,7 +74,7 @@ export interface PublishLevelStream {
72
74
  export interface PublishIQ {
73
75
  pstype: PSType.IQ;
74
76
  IData: number[];
75
- Qdata: number[];
77
+ QData: number[];
76
78
  }
77
79
  export interface PublishDial {
78
80
  pstype?: PSType.Dial;
@@ -97,5 +99,7 @@ export interface Render {
97
99
  [key: string]: unknown;
98
100
  }
99
101
  export type PublishData = SetOption | SetSeries | SetSpectrumBandwidth | SetSegments | SetChannels | SetMarker | SetAntennaFactor | SetStationInfo | PublishSpectrum | PublishHeatmap | PublishOccupancy | PublishLevelStream | PublishIQ | PublishDial | PublishGauge | Reset | Render;
100
- export type Publish = (p: PublishData) => void;
102
+ export type Publish = ((p: PublishData) => void) & {
103
+ getSourceData: () => rawData;
104
+ };
101
105
  export {};
package/types/store.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { TimestampedFloat32Array } from '@rfkit/spectrum-analyzer';
2
2
  import type { SeriesType } from '../config';
3
- import type { AxisXRange, AxisYRange, RecursiveFunction, RecursiveObject, SegmentsType, SeriesConfig, StationInfoType, TopRightBottomLeft } from './';
3
+ import type { AxisXRange, AxisYRange, Publish, RecursiveObject, SegmentsType, SeriesConfig, StationInfoType, TopRightBottomLeft } from './';
4
4
  export interface SystemConfig {
5
5
  width: number;
6
6
  height: number;
@@ -43,6 +43,7 @@ export interface SeriesProps {
43
43
  weaken: boolean | number;
44
44
  zoomMinSimulateWave: boolean;
45
45
  dataRate: number;
46
+ forceDisplay: boolean;
46
47
  data: Map<string, SeriesConfig>;
47
48
  legendExternal: SeriesType[];
48
49
  enableMetrics?: boolean;
@@ -256,7 +257,7 @@ export interface StoreState {
256
257
  timeRange?: number;
257
258
  stationInfo: StationInfoProps;
258
259
  [key: string]: unknown;
259
- publish?: RecursiveFunction;
260
+ publish?: Publish;
260
261
  }
261
262
  export interface DispatchAction {
262
263
  type?: string;
@@ -288,6 +289,6 @@ export interface ParamsProps {
288
289
  toolsBar?: Partial<ToolsBarProps>;
289
290
  band?: Partial<BandProps>;
290
291
  levelStream?: Partial<LevelStreamProps>;
291
- publish?: (p: RecursiveFunction) => void;
292
+ publish?: Publish;
292
293
  [key: string]: unknown;
293
294
  }