@rfkit/charts 1.1.16 → 1.1.19

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.
Files changed (37) hide show
  1. package/README.md +3 -2
  2. package/components/EventBus/tools.d.ts +2 -2
  3. package/components/FrequencyTagLine/index.d.ts +11 -0
  4. package/components/Markers/{Dot → MarkerItem}/index.d.ts +1 -2
  5. package/components/Markers/hooks/useMarkerEvents.d.ts +21 -0
  6. package/components/Markers/hooks/useMarkers.d.ts +45 -0
  7. package/components/Markers/index.d.ts +2 -7
  8. package/components/Markers/tools.d.ts +41 -0
  9. package/components/ToolsBar/IconBox.d.ts +2 -2
  10. package/config/constants.d.ts +3 -12
  11. package/hooks/useChannel.d.ts +1 -11
  12. package/hooks/useMarkerPublish.d.ts +8 -0
  13. package/hooks/useSpectrumRule.d.ts +1 -4
  14. package/index.d.ts +1 -1
  15. package/index.js +3845 -4534
  16. package/lib/Spectrum/Chart.d.ts +2 -4
  17. package/modules/Heatmap/index.d.ts +0 -2
  18. package/modules/HeatmapPortal/index.d.ts +0 -2
  19. package/modules/Spectrum/index.d.ts +0 -1
  20. package/package.json +1 -1
  21. package/store/globalState.d.ts +9 -0
  22. package/store/reducer.d.ts +2 -2
  23. package/types/common.d.ts +0 -20
  24. package/types/publish.d.ts +4 -4
  25. package/types/store.d.ts +37 -25
  26. package/components/FrequencyMarkerLine/index.d.ts +0 -11
  27. package/components/Markers/Board/index.d.ts +0 -14
  28. package/components/Markers/lib/Counter.d.ts +0 -38
  29. package/components/Markers/lib/FreeMarkers.d.ts +0 -34
  30. package/components/Markers/lib/LineMarkers.d.ts +0 -55
  31. package/components/Markers/lib/Markers.d.ts +0 -55
  32. package/components/Markers/lib/Selecter.d.ts +0 -35
  33. package/components/Markers/lib/tools.d.ts +0 -72
  34. package/hooks/use10DataRate.d.ts +0 -1
  35. package/hooks/useMarkerLinkageZoom.d.ts +0 -1
  36. /package/components/{FrequencyMarkerLine → FrequencyTagLine}/Board/index.d.ts +0 -0
  37. /package/components/{FrequencyMarkerLine → FrequencyTagLine}/Switch/index.d.ts +0 -0
@@ -1,8 +1,6 @@
1
1
  import { type Props as SpectrumChartTypeProps } from '../../hooks/useSpectrumChartType';
2
- import { type Props as SpectrumRuleProps } from '../../hooks/useSpectrumRule';
3
- import type { ParamsProps, RecursiveObject } from '../../types';
4
- export interface Props extends SpectrumChartTypeProps, SpectrumRuleProps, ParamsProps {
5
- selecter?: RecursiveObject;
2
+ import type { ParamsProps } from '../../types';
3
+ export interface Props extends SpectrumChartTypeProps, ParamsProps {
6
4
  occupancyElementID?: string;
7
5
  }
8
6
  declare const Chart: React.FC<Props>;
@@ -1,6 +1,4 @@
1
- import type { RecursiveObject } from '../../types';
2
1
  interface Props {
3
- selecter?: RecursiveObject;
4
2
  heatmapDefaultData?: Array<Array<number>>;
5
3
  }
6
4
  declare const Heatmap: React.FC<Props>;
@@ -1,9 +1,7 @@
1
1
  import type React from 'react';
2
2
  import { ChartType } from '../../config';
3
- import type { RecursiveObject } from '../../types';
4
3
  interface Props {
5
4
  type: ChartType;
6
- selecter?: RecursiveObject;
7
5
  heatmapElementID?: string;
8
6
  }
9
7
  declare const Chart: React.FC<Props>;
@@ -1,7 +1,6 @@
1
1
  import type React from 'react';
2
2
  import { type ReactNode } from 'react';
3
3
  interface Props {
4
- selecter?: object;
5
4
  children?: ReactNode;
6
5
  }
7
6
  declare const Spectrum: React.FC<Props>;
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.1.16",
8
+ "version": "1.1.19",
9
9
  "private": false
10
10
  }
@@ -0,0 +1,9 @@
1
+ import type { RecursiveObject } from '../types';
2
+ /**
3
+ * 设置全局store状态
4
+ */
5
+ export declare const setGlobalStoreState: (globalID: string, state: RecursiveObject) => void;
6
+ /**
7
+ * 获取全局store状态
8
+ */
9
+ export declare const getGlobalStoreState: (globalID: string) => RecursiveObject | null;
@@ -23,7 +23,7 @@ export declare const defaultState: () => {
23
23
  scope: import("../types").ScopeProps;
24
24
  gridLines: boolean;
25
25
  legend: import("../types").LegendProps;
26
- frequencyMarkerLine: import("../types").FrequencyMarkerLineProps;
26
+ frequencyTagLine: import("../types").FrequencyTagLineBoardProps;
27
27
  stripe: import("../types").StripeProps;
28
28
  blaze: import("../types").BlazeProps;
29
29
  frequencyAllocation: import("../types").FrequencyAllocationProps;
@@ -55,7 +55,7 @@ export declare const reducer: (state: StoreState, action: DispatchAction) => {
55
55
  scope: import("../types").ScopeProps;
56
56
  gridLines: boolean;
57
57
  legend: import("../types").LegendProps;
58
- frequencyMarkerLine: import("../types").FrequencyMarkerLineProps;
58
+ frequencyTagLine: import("../types").FrequencyTagLineBoardProps;
59
59
  stripe: import("../types").StripeProps;
60
60
  blaze: import("../types").BlazeProps;
61
61
  frequencyAllocation: import("../types").FrequencyAllocationProps;
package/types/common.d.ts CHANGED
@@ -63,26 +63,6 @@ export type SegmentType = Partial<SpectrumBandwidth> & {
63
63
  export type SegmentsType = SegmentType[] & {
64
64
  totalPoints?: number;
65
65
  };
66
- export interface MarkerType {
67
- timestamp: number;
68
- id: string;
69
- label: string;
70
- name: string;
71
- color: string;
72
- select: boolean;
73
- peak: boolean;
74
- heatmapMode: boolean;
75
- flow: {
76
- name: string;
77
- color: string;
78
- };
79
- left: number;
80
- top: number;
81
- frequency: number;
82
- level: number;
83
- levelFormatted: string;
84
- hover: boolean;
85
- }
86
66
  export interface StationInfoType {
87
67
  signalName: string;
88
68
  orgName: string;
@@ -1,7 +1,7 @@
1
1
  import type { MarkerEventType, OptionKey, PSType, SegmentsEvent } from '../config';
2
2
  import type { rawData } from '../utils/subscription';
3
3
  import type { SegmentsOriginal, SeriesConfig, SpectrumBandwidth, StationInfoType } from './common';
4
- import type { ParamsProps } from './store';
4
+ import type { MarkerType, ParamsProps } from './store';
5
5
  export interface SetOption {
6
6
  pstype: PSType.Option;
7
7
  key: OptionKey;
@@ -38,9 +38,9 @@ export interface SetChannels {
38
38
  export interface SetMarker {
39
39
  pstype: PSType.Marker;
40
40
  event: MarkerEventType;
41
- data: number[];
42
- heatmapMode?: boolean;
43
- clear?: boolean;
41
+ marker?: Partial<MarkerType>;
42
+ frequencies?: number[];
43
+ silent?: boolean;
44
44
  }
45
45
  export interface SpectrumExtraData {
46
46
  [key: string]: Float32Array;
package/types/store.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TimestampedFloat32Array } from '@rfkit/spectrum-analyzer';
2
- import type { SeriesType } from '../config';
2
+ import type { MarkerEventType, SeriesType } from '../config';
3
3
  import type { AxisXRange, AxisYRange, Publish, RecursiveObject, SegmentsType, SeriesConfig, StationInfoType, TopRightBottomLeft } from './';
4
4
  export interface SystemConfig {
5
5
  width: number;
@@ -49,28 +49,40 @@ export interface SeriesProps {
49
49
  enableMetrics?: boolean;
50
50
  enableWaterfall?: boolean;
51
51
  }
52
+ export declare enum MarkerMode {
53
+ Normal = "normal",
54
+ DDC = "ddc"
55
+ }
56
+ export declare enum MarkerAction {
57
+ Add = "add",// 添加markers
58
+ Move = "move",// 移动marker
59
+ Update = "update",// 更新marker
60
+ Delete = "delete",// 删除markers
61
+ Clear = "clear",// 清空所有
62
+ Select = "select"
63
+ }
64
+ export interface MarkerChangeEvent {
65
+ type: MarkerAction;
66
+ spectrumMarkers: MarkerType[];
67
+ waterfallMarkers?: MarkerType[];
68
+ }
69
+ export interface MarkerType {
70
+ id: string;
71
+ color: string;
72
+ left: number;
73
+ top: number;
74
+ hover: boolean;
75
+ peak: boolean;
76
+ select: boolean;
77
+ frequency: number;
78
+ level: number;
79
+ }
52
80
  export interface MarkerProps {
53
- show: boolean;
54
- display: boolean;
55
- selectMax: boolean;
56
- count: number;
57
- dot: {
58
- format?: (e: RecursiveObject) => string;
59
- pop?: boolean;
60
- fixed?: boolean;
61
- };
62
- board: {
63
- show?: boolean;
64
- total?: number;
65
- format?: null | ((value: unknown) => string);
66
- };
67
- flow: boolean;
68
- linkageZoom: boolean;
69
- selected: {
70
- left?: number;
71
- [x: string]: unknown;
72
- };
73
- onChange: (m: RecursiveObject) => void;
81
+ enabled: boolean;
82
+ visible: boolean;
83
+ mode: MarkerMode;
84
+ maxCount: number;
85
+ onChange: (event: MarkerEventType, markers?: MarkerType[]) => void;
74
86
  }
75
87
  export interface LimitProps {
76
88
  show: boolean;
@@ -178,7 +190,7 @@ export interface ScopeProps {
178
190
  export interface LegendProps {
179
191
  children: React.ReactNode | null;
180
192
  }
181
- export interface FrequencyMarkerLineProps {
193
+ export interface FrequencyTagLineBoardProps {
182
194
  show: boolean;
183
195
  display: boolean;
184
196
  left: number;
@@ -252,7 +264,7 @@ export interface StoreState {
252
264
  scope: ScopeProps;
253
265
  gridLines: boolean;
254
266
  legend: LegendProps;
255
- frequencyMarkerLine: FrequencyMarkerLineProps;
267
+ frequencyTagLine: FrequencyTagLineBoardProps;
256
268
  stripe: StripeProps;
257
269
  blaze: BlazeProps;
258
270
  frequencyAllocation: FrequencyAllocationProps;
@@ -287,7 +299,7 @@ export interface ParamsProps {
287
299
  stripe?: Partial<StripeProps>;
288
300
  signalAnalysis?: Partial<SignalAnalysisProps>;
289
301
  series?: Partial<SeriesProps>;
290
- frequencyMarkerLine?: Partial<FrequencyMarkerLineProps>;
302
+ frequencyTagLine?: Partial<FrequencyTagLineBoardProps>;
291
303
  frequencyAllocation?: Partial<FrequencyAllocationProps>;
292
304
  toolsBar?: Partial<ToolsBarProps>;
293
305
  band?: Partial<BandProps>;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { ToolType } from '../../config';
3
- import FrequencyMarkerLineBoard from './Board';
4
- import FrequencyMarkerSwitch from './Switch';
5
- export { FrequencyMarkerSwitch, FrequencyMarkerLineBoard };
6
- export declare const COMPONENT_KEY = ToolType.FrequencyMarkerLine;
7
- interface Props {
8
- id: string;
9
- }
10
- declare const _default: React.NamedExoticComponent<Props>;
11
- export default _default;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { MarkerType } from '../../../types';
3
- interface Props {
4
- heatmapMode: boolean;
5
- markers: Array<MarkerType>;
6
- onChange: (e: {
7
- id: string;
8
- peak?: boolean;
9
- event?: string;
10
- select?: boolean;
11
- }) => void;
12
- }
13
- declare const _default: React.NamedExoticComponent<Props>;
14
- export default _default;
@@ -1,38 +0,0 @@
1
- interface CounterState {
2
- id: string;
3
- count: number;
4
- all: string[];
5
- include: string[];
6
- markers: Record<string | number, unknown[]>;
7
- }
8
- interface CounterProps {
9
- id?: string;
10
- count?: number;
11
- all?: string[];
12
- include?: string[];
13
- markers?: Record<string | number, unknown[]>;
14
- }
15
- export default class Counter {
16
- private state;
17
- constructor(props?: CounterProps);
18
- add(): string | false;
19
- remove(no: string): boolean;
20
- clear(): void;
21
- destroy(cache: string[]): void;
22
- /**
23
- * 混合onChange,可能包含多个markers实例公用counter
24
- *
25
- * @param id 实例ID
26
- * @param markers 标记数组
27
- * @param onChange 变更回调函数
28
- * @param operationType 操作类型
29
- */
30
- /**
31
- * 更新状态
32
- *
33
- * @param p 状态更新参数
34
- */
35
- setState(p: Partial<CounterState>): void;
36
- onMixChange(id: string | number, markers: unknown[], onChange: (markers: unknown[], mix: unknown[], operationType?: string) => void, operationType?: string): void;
37
- }
38
- export {};
@@ -1,34 +0,0 @@
1
- import type { MarkerType } from '../../../types';
2
- import Markers from './Markers';
3
- export default class FreeMarkers extends Markers {
4
- /**
5
- * 格式化marker
6
- */
7
- formatMarker(e: MarkerType): {
8
- left: number;
9
- top: number;
10
- frequency: any;
11
- level: any;
12
- levelFormatted: any;
13
- timestamp: any;
14
- id: string;
15
- label: string;
16
- name: string;
17
- color: string;
18
- select: boolean;
19
- peak: boolean;
20
- heatmapMode: boolean;
21
- flow: {
22
- name: string;
23
- color: string;
24
- };
25
- hover: boolean;
26
- };
27
- /**
28
- * 拖动方案
29
- */
30
- hover(e: {
31
- left: number;
32
- top: number;
33
- }): string;
34
- }
@@ -1,55 +0,0 @@
1
- import type { AxisYProps, MarkerType } from '../../../types';
2
- import Markers from './Markers';
3
- export default class LineMarkers extends Markers {
4
- /**
5
- * 格式化marker
6
- */
7
- formatMarker(e: MarkerType, update?: string): {
8
- left: number;
9
- top: number;
10
- frequency: any;
11
- level: any;
12
- levelFormatted: any;
13
- timestamp: number;
14
- id: string;
15
- label: string;
16
- name: string;
17
- color: string;
18
- select: boolean;
19
- peak: boolean;
20
- heatmapMode: boolean;
21
- flow: {
22
- name: string;
23
- color: string;
24
- };
25
- hover: boolean;
26
- };
27
- /**
28
- * 更新依赖参数额外行为
29
- *
30
- * @param {*} e
31
- * @memberof Drag
32
- */
33
- updateParamsNext(e: {
34
- axisY: AxisYProps;
35
- }): void;
36
- /**
37
- * 选中临近最大值
38
- */
39
- leftDataSelectMax(e: number): number;
40
- /**
41
- * 拖动方案
42
- */
43
- hover(e: {
44
- left: number;
45
- }): string;
46
- /**
47
- * 根据数据算出主次峰值的值
48
- */
49
- formatPeaks(): void;
50
- /**
51
- * marker.id存入主次峰值
52
- */
53
- getPeaks(id: string, xIndex: number): any;
54
- updateAttributeEventMore(attr: any): void;
55
- }
@@ -1,55 +0,0 @@
1
- export default class Markers {
2
- [x: string]: any;
3
- constructor(props: any);
4
- /**
5
- * 获取参考系位置
6
- *
7
- * @memberof Markers
8
- */
9
- /**
10
- * 注册面板事件
11
- *
12
- * @memberof Drag
13
- */
14
- init(): void;
15
- /**
16
- * 生成marker
17
- *
18
- * @param {*} postion
19
- * @param {*} proto
20
- * @memberof Markers
21
- */
22
- create(e: {
23
- left: any;
24
- }, isBatchAdd?: boolean): void;
25
- /**
26
- * 更新marker属性 有问题
27
- */
28
- updateAttribute(attr: any): void;
29
- /**
30
- * 更新数据
31
- */
32
- updateByData(data?: any): void;
33
- /**
34
- * 更新依赖参数
35
- */
36
- updateParams(e: any): void;
37
- /**
38
- * 向外通知
39
- *
40
- * @memberof Markers
41
- */
42
- onChange(isDel?: boolean, operationType?: string): void;
43
- /**
44
- * 卸载计数器
45
- */
46
- destroyCounter(): void;
47
- /**
48
- * 重置hover状态
49
- */
50
- resetHover(): void;
51
- /**
52
- * 重置marker
53
- */
54
- reset(): void;
55
- }
@@ -1,35 +0,0 @@
1
- /**
2
- * 处理唯一选中
3
- */
4
- type SelecterCallback = (event: {
5
- select: boolean;
6
- parentID: string;
7
- attribute: Record<string, unknown>;
8
- }) => void;
9
- interface MarkerAttribute {
10
- select: boolean;
11
- [key: string]: unknown;
12
- }
13
- export default class Selecter {
14
- private state;
15
- constructor();
16
- /**
17
- * 设置当前选中
18
- *
19
- * @param parentID 实例的id
20
- * @param id 被选中的marker的id
21
- * @param attribute 标记属性
22
- */
23
- set(parentID: string, id: string, attribute: MarkerAttribute): void;
24
- /**
25
- * 取消选中
26
- * @param parentID 实例的id
27
- */
28
- cancel(parentID: string): void;
29
- /**
30
- * 订阅变更
31
- * @param func 回调函数
32
- */
33
- subscription(func: SelecterCallback): void;
34
- }
35
- export {};
@@ -1,72 +0,0 @@
1
- import type { MarkerType, RecursiveFunction, SegmentsType } from '../../../types';
2
- export declare const MARKER_UPDATE_PARAMS: (id: string, func?: RecursiveFunction) => (...args: any[]) => void;
3
- export declare const MARKER_UPDATE_ATTRIBUTE: (id: string, func?: RecursiveFunction) => (...args: any[]) => void;
4
- export declare const MARKER_UPDATE_RESET: (id: string, func?: RecursiveFunction) => (...args: any[]) => void;
5
- export declare function startstop2frequency({ start, stop }: {
6
- start: number;
7
- stop: number;
8
- }): (x: number, len: number) => number;
9
- export declare function bandwidthfrequency2frequency({ frequency, bandwidth }: {
10
- frequency: number;
11
- bandwidth: number;
12
- }): (x: number, len: number) => number;
13
- /**
14
- * 通过leftdata找最大值
15
- */
16
- export declare const leftDataSelectMax: (left: number, data: number[]) => number;
17
- /**
18
- * 按照栅格格式化位置信息
19
- * marker的位置需要在单个数据位置的中间,所以要修正left
20
- */
21
- export declare function fixLocation(location: number, len: number): number;
22
- interface ZoomLeftParams {
23
- left: number;
24
- zoom: {
25
- interval: {
26
- start: number;
27
- end: number;
28
- };
29
- };
30
- segments: {
31
- totalPoints: number;
32
- };
33
- }
34
- interface ZoomLeftResult {
35
- insideLeft: number;
36
- outsideLeft: number;
37
- multiple: number;
38
- }
39
- /**
40
- * 分拆缩放后的left关系
41
- * @param left - 相对位置百分比 (0-100)
42
- * @param zoom - 缩放区间信息
43
- * @param segments - 数据段信息
44
- * @returns 返回缩放后的位置信息
45
- */
46
- export declare function splitZoomLeft({ left, zoom, segments }: ZoomLeftParams): ZoomLeftResult;
47
- /**
48
- * 移动marker
49
- */
50
- export declare const setMarkerMove: (e: MarkerType, segments: SegmentsType, func: RecursiveFunction) => void;
51
- /**
52
- * 批量新增
53
- */
54
- export declare const setMarkerBatchAdd: (e: {
55
- data: any;
56
- clear?: boolean;
57
- [key: string]: any;
58
- }, segments: SegmentsType, func: (arg0: {
59
- pstype: string;
60
- event: string;
61
- data: number[];
62
- clear?: boolean;
63
- [key: string]: any;
64
- }) => void) => void;
65
- /**
66
- * 峰值算法
67
- */
68
- export declare function findPeaks(data: number[], count: number | undefined): {
69
- value: number;
70
- index: number;
71
- }[];
72
- export {};
@@ -1 +0,0 @@
1
- export default function use10DataRate(manager?: any): void;
@@ -1 +0,0 @@
1
- export default function useMarkerLinkageZoom(): void;