@rfkit/charts 1.4.2 → 1.5.0
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 +2 -0
- package/components/AxisY/heatmap/index.d.ts +1 -1
- package/components/AxisY/spectrum/index.d.ts +1 -1
- package/components/AxisY/spectrum/presenters/TicksPanel/index.d.ts +1 -1
- package/components/AxisY/spectrum/tools.d.ts +1 -1
- package/components/AxisY/spectrum/useRanging/index.d.ts +1 -1
- package/components/AxisY/spectrum/useRanging/ranging.d.ts +3 -3
- package/components/Cursor/tools.d.ts +3 -1
- package/components/EventBus/useKeyEvent.d.ts +1 -1
- package/components/ui/button.d.ts +8 -8
- package/components/ui/dialog.d.ts +1 -1
- package/components/ui/dropdown-menu.d.ts +1 -1
- package/components/ui/panel.d.ts +4 -4
- package/components/ui/tooltip.d.ts +1 -1
- package/components/ui/useChartsPortalContainer.d.ts +1 -1
- package/hooks/publish/usePublish.d.ts +1 -1
- package/hooks/spectrum/useSpectrumRule.d.ts +1 -1
- package/hooks/useChart/index.d.ts +1 -1
- package/hooks/useDragSelect.d.ts +1 -1
- package/hooks/useLevelStreamAnalyzer.d.ts +1 -1
- package/index.js +326 -219
- package/modules/Spectrum/AxisYCanvas/index.d.ts +2 -2
- package/modules/Spectrum/AxisYCanvas/useCanvasAxisY.d.ts +4 -4
- package/modules/Spectrum/FrequencyAllocation/model/useAllocationAtCursor.d.ts +1 -1
- package/modules/Spectrum/Markers/hooks/useMarkerEvents.d.ts +2 -2
- package/modules/Spectrum/Markers/hooks/useMarkers.d.ts +2 -2
- package/modules/Spectrum/Markers/tools.d.ts +3 -3
- package/modules/Spectrum/Signal/model/useStationInfoAtCursor.d.ts +1 -1
- package/modules/base/BaseRenderer.d.ts +2 -2
- package/modules/base/GradientRenderer.d.ts +4 -4
- package/package.json +1 -1
- package/store/Params.d.ts +1 -1
- package/store/context.d.ts +1 -1
- package/store/globalState.d.ts +2 -1
- package/theme/style-scope.d.ts +1 -1
- package/theme/theme-contract.d.ts +1 -1
- package/types/publish.d.ts +1 -0
- package/utils/converter.d.ts +1 -1
- package/utils/series/events.d.ts +4 -4
- package/utils/series/subscription.d.ts +1 -1
- package/utils/subscription.d.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RenderChartType } from '../../../types';
|
|
2
2
|
interface AxisYCanvasProps {
|
|
3
|
-
chart: RenderChartType;
|
|
3
|
+
chart: RenderChartType | null;
|
|
4
4
|
}
|
|
5
|
-
export default function AxisYCanvas(props: AxisYCanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default function AxisYCanvas(props: AxisYCanvasProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
6
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RangeController } from '../../../components/AxisY/spectrum/useRanging';
|
|
2
2
|
interface CanvasAxisYOptions {
|
|
3
|
-
ranging
|
|
3
|
+
ranging: RangeController;
|
|
4
4
|
}
|
|
5
5
|
interface TickData {
|
|
6
6
|
value: number;
|
|
@@ -9,9 +9,9 @@ interface TickData {
|
|
|
9
9
|
label: string;
|
|
10
10
|
isAdjusted?: boolean;
|
|
11
11
|
}
|
|
12
|
-
export declare function useCanvasAxisY(options
|
|
13
|
-
canvasRef: import("react").RefObject<HTMLCanvasElement>;
|
|
14
|
-
containerRef: import("react").RefObject<HTMLDivElement>;
|
|
12
|
+
export declare function useCanvasAxisY(options: CanvasAxisYOptions): {
|
|
13
|
+
canvasRef: import("react").RefObject<HTMLCanvasElement | null>;
|
|
14
|
+
containerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
15
15
|
isDragging: boolean;
|
|
16
16
|
range: {
|
|
17
17
|
min: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
interface UseAllocationFinderProps {
|
|
2
2
|
frequency: string;
|
|
3
3
|
}
|
|
4
|
-
export declare function useAllocationAtCursor({ frequency }: UseAllocationFinderProps): import("../../../..").FrequencyAllocationItem;
|
|
4
|
+
export declare function useAllocationAtCursor({ frequency }: UseAllocationFinderProps): import("../../../..").FrequencyAllocationItem | undefined;
|
|
5
5
|
export declare const useAllocationFinder: typeof useAllocationAtCursor;
|
|
6
6
|
export {};
|
|
@@ -41,9 +41,9 @@ interface MarkerState {
|
|
|
41
41
|
}
|
|
42
42
|
export declare const useMarkers: (props: UseMarkersProps) => {
|
|
43
43
|
markers: MarkerType[];
|
|
44
|
-
isDown: MarkerType & {
|
|
44
|
+
isDown: (MarkerType & {
|
|
45
45
|
index?: number;
|
|
46
|
-
};
|
|
46
|
+
}) | null;
|
|
47
47
|
isHover: string | (MarkerType & {
|
|
48
48
|
index?: number;
|
|
49
49
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { MarkerType, RecursiveFunction, SegmentsType } from '../../../types';
|
|
1
|
+
import type { MarkerType, RecursiveFunction, SegmentsType, SetMarker } from '../../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Marker 工具函数集合 - 精简版
|
|
4
4
|
*/
|
|
5
|
-
export declare const MARKER_UPDATE_ATTRIBUTE: (id: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
5
|
+
export declare const MARKER_UPDATE_ATTRIBUTE: (id: string, func?: RecursiveFunction<[SetMarker]>) => (...args: any[]) => void;
|
|
6
6
|
export declare const MARKER_UPDATE_RESET: (id: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
7
7
|
export declare const MARKER_COUNT_CHANGE: (id: string, func?: RecursiveFunction<[{
|
|
8
8
|
count: number;
|
|
@@ -33,7 +33,7 @@ export type MarkerCommand = {
|
|
|
33
33
|
} | {
|
|
34
34
|
type: 'clear-all';
|
|
35
35
|
};
|
|
36
|
-
export declare const MARKER_COMMAND: (id: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
36
|
+
export declare const MARKER_COMMAND: (id: string, func?: RecursiveFunction<[MarkerCommand]>) => (...args: any[]) => void;
|
|
37
37
|
export declare const leftDataSelectMax: (left: number, data: Float32Array) => number;
|
|
38
38
|
export declare function fixLocation(location: number, len: number): number;
|
|
39
39
|
interface ZoomLeftParams {
|
|
@@ -2,6 +2,6 @@ interface UseStationFinderProps {
|
|
|
2
2
|
frequency: string;
|
|
3
3
|
enabled?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare function useStationInfoAtCursor({ frequency, enabled }: UseStationFinderProps): import("../../../..").StationInfoType;
|
|
5
|
+
export declare function useStationInfoAtCursor({ frequency, enabled }: UseStationFinderProps): import("../../../..").StationInfoType | undefined;
|
|
6
6
|
export declare const useStationFinder: typeof useStationInfoAtCursor;
|
|
7
7
|
export {};
|
|
@@ -95,7 +95,7 @@ export declare abstract class BaseRenderer<TChart extends ChartLike, TState exte
|
|
|
95
95
|
/**
|
|
96
96
|
* 注册统一 cleanup,由基类在 destroy 时回收
|
|
97
97
|
*/
|
|
98
|
-
protected trackCleanup(cleanup?: RendererCleanup | null): () => void;
|
|
98
|
+
protected trackCleanup(cleanup?: RendererCleanup | null): (() => void) | null;
|
|
99
99
|
/**
|
|
100
100
|
* 获取图表容器元素
|
|
101
101
|
*/
|
|
@@ -106,7 +106,7 @@ export declare abstract class BaseRenderer<TChart extends ChartLike, TState exte
|
|
|
106
106
|
protected getContainerSize(): {
|
|
107
107
|
width: number;
|
|
108
108
|
height: number;
|
|
109
|
-
};
|
|
109
|
+
} | null;
|
|
110
110
|
/**
|
|
111
111
|
* 子类可覆盖最小可绘制尺寸
|
|
112
112
|
*/
|
|
@@ -9,10 +9,10 @@ import { BaseRenderer, type BaseRenderState } from './BaseRenderer';
|
|
|
9
9
|
* 具有 updateProps/render 方法的梯度图表接口
|
|
10
10
|
*/
|
|
11
11
|
interface GradientChartLike {
|
|
12
|
-
resize
|
|
13
|
-
clear
|
|
14
|
-
updateProps
|
|
15
|
-
render
|
|
12
|
+
resize?(): void;
|
|
13
|
+
clear?(): void;
|
|
14
|
+
updateProps?(props: Record<string, unknown>): void;
|
|
15
|
+
render?(data: unknown): void;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* 梯度渲染状态
|
package/package.json
CHANGED
package/store/Params.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { AxisYProps, ParamsProps, StoreState } from '../types';
|
|
|
7
7
|
* @param state 当前状态
|
|
8
8
|
* @returns 混合后的参数
|
|
9
9
|
*/
|
|
10
|
-
export declare function mergeParameter<K extends keyof StoreState>(key: K, params: Partial<StoreState[K]
|
|
10
|
+
export declare function mergeParameter<K extends keyof StoreState>(key: K, params: StoreState[K] | Partial<StoreState[K]> | null | undefined, state?: StoreState): StoreState[K];
|
|
11
11
|
export declare function normalizeAxisYProps(axisY?: Partial<AxisYProps>): Partial<AxisYProps> | undefined;
|
|
12
12
|
declare const Params: React.FC<ParamsProps>;
|
|
13
13
|
export default Params;
|
package/store/context.d.ts
CHANGED
package/store/globalState.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RecursiveObject } from '../types';
|
|
2
|
+
import type { StoreState } from '../types/store';
|
|
2
3
|
/**
|
|
3
4
|
* 设置全局store状态
|
|
4
5
|
*/
|
|
@@ -6,7 +7,7 @@ export declare const setGlobalStoreState: (globalID: string, state: RecursiveObj
|
|
|
6
7
|
/**
|
|
7
8
|
* 获取全局store状态
|
|
8
9
|
*/
|
|
9
|
-
export declare const getGlobalStoreState: (globalID: string) =>
|
|
10
|
+
export declare const getGlobalStoreState: (globalID: string) => StoreState | null;
|
|
10
11
|
/**
|
|
11
12
|
* 清理指定图表实例的全局store状态
|
|
12
13
|
*/
|
package/theme/style-scope.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export declare const CHARTS_SCOPE_STYLE_VARS: {
|
|
|
17
17
|
readonly '--size-border-radius-second': "var(--radius-control)";
|
|
18
18
|
};
|
|
19
19
|
export declare const applyChartsScopeRoot: (element: HTMLElement) => void;
|
|
20
|
-
export declare const ensureChartsPortalRoot: (slot: string) => HTMLDivElement;
|
|
20
|
+
export declare const ensureChartsPortalRoot: (slot: string) => HTMLDivElement | null;
|
|
@@ -19,7 +19,7 @@ export declare const DEFAULT_THEME: ThemeType;
|
|
|
19
19
|
export declare const DEFAULT_FOLLOW_OS = true;
|
|
20
20
|
export declare const DEFAULT_SIZE: SizeType;
|
|
21
21
|
export declare const canUseDOM: () => boolean;
|
|
22
|
-
export declare const getThemeMedia: () => MediaQueryList;
|
|
22
|
+
export declare const getThemeMedia: () => MediaQueryList | undefined;
|
|
23
23
|
export declare const isThemeType: (value: string | null) => value is ThemeType;
|
|
24
24
|
export declare const getSystemTheme: () => ThemeType;
|
|
25
25
|
export declare const readThemeContract: () => ChartsThemeContract;
|
package/types/publish.d.ts
CHANGED
package/utils/converter.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ declare const V2mW: (input: number) => number;
|
|
|
11
11
|
declare const mW2dBm: (input: number) => number;
|
|
12
12
|
declare const mW2dBuV: (input: number) => number;
|
|
13
13
|
declare const mW2V: (input: number) => number;
|
|
14
|
-
declare const spectrum2dBm: (inputs: Array<number>) => number[];
|
|
14
|
+
declare const spectrum2dBm: (inputs: Array<number>) => (number | undefined)[];
|
|
15
15
|
export { dBm2dBuV, dBm2mW, dBm2V, dBuV2dBm, dBuV2mW, dBuV2uV, dBuV2V, mW2dBm, mW2dBuV, mW2V, spectrum2dBm, V2dBm, V2dBuV, V2mW };
|
package/utils/series/events.d.ts
CHANGED
|
@@ -59,19 +59,19 @@ export declare const seriesEvents: {
|
|
|
59
59
|
/**
|
|
60
60
|
* 订阅事件
|
|
61
61
|
*/
|
|
62
|
-
on:
|
|
62
|
+
on: <K extends keyof SeriesEvents>(event: K, listener: EventListener<SeriesEvents[K]>) => () => void;
|
|
63
63
|
/**
|
|
64
64
|
* 发布事件
|
|
65
65
|
*/
|
|
66
|
-
emit:
|
|
66
|
+
emit: <K extends keyof SeriesEvents>(event: K, data: SeriesEvents[K]) => void;
|
|
67
67
|
/**
|
|
68
68
|
* 移除监听器
|
|
69
69
|
*/
|
|
70
|
-
removeAllListeners:
|
|
70
|
+
removeAllListeners: (event?: keyof SeriesEvents) => void;
|
|
71
71
|
/**
|
|
72
72
|
* 获取监听器数量
|
|
73
73
|
*/
|
|
74
|
-
getListenerCount:
|
|
74
|
+
getListenerCount: (event: keyof SeriesEvents) => number;
|
|
75
75
|
};
|
|
76
76
|
export declare function subscribeToSeries<K extends keyof SeriesEvents>(globalID: string, event: K, listener: EventListener<SeriesEvents[K]>): () => void;
|
|
77
77
|
export declare function emitSeriesEvent<K extends keyof SeriesEvents>(event: K, data: SeriesEvents[K]): void;
|
package/utils/subscription.d.ts
CHANGED
|
@@ -45,6 +45,6 @@ export interface rawData {
|
|
|
45
45
|
export declare const getDefaultData: () => rawData;
|
|
46
46
|
export default function withDatabase(globalID: string, data?: rawData): rawData;
|
|
47
47
|
export declare const withUpdateData: (id?: string, name?: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
48
|
-
export declare const setScanDF360Prob: (id?: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
48
|
+
export declare const setScanDF360Prob: (id?: string, func?: RecursiveFunction<[boolean]>) => (...args: any[]) => void;
|
|
49
49
|
export declare function withSpectrumAnalyzerSYNC(globalID: string, analyzer?: SpectrumAnalyzer): SpectrumAnalyzer;
|
|
50
50
|
export {};
|