@rfkit/charts 1.10.12 → 1.11.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 +7 -30
- package/charts/Spectrum/Chart.d.ts +1 -0
- package/components/AxisY/spectrum/tools.d.ts +0 -6
- package/components/AxisY/spectrum/useRanging/index.d.ts +2 -2
- package/components/AxisY/spectrum/useRanging/ranging.d.ts +2 -30
- package/components/AxisY/spectrum/useRanging/tools.d.ts +0 -15
- package/components/Cursor/tools.d.ts +0 -6
- package/components/DragSelectBox/index.d.ts +0 -4
- package/components/EventBus/tools.d.ts +0 -29
- package/components/Toolbar/primitives/styles.d.ts +10 -10
- package/components/Zoom/tools.d.ts +5 -0
- package/components/ui/button.d.ts +4 -4
- package/components/ui/panel.d.ts +2 -2
- package/config/constants.d.ts +0 -2
- package/config/setting.d.ts +1 -27
- package/hooks/data/index.d.ts +0 -3
- package/hooks/index.d.ts +0 -3
- package/hooks/publish/index.d.ts +0 -3
- package/hooks/spectrum/index.d.ts +1 -3
- package/hooks/spectrum/useTouchMode.d.ts +1 -0
- package/hooks/useChart/index.d.ts +0 -4
- package/hooks/useChartComponent.d.ts +0 -6
- package/hooks/useDragSelect.d.ts +0 -7
- package/hooks/useModuleSubscription.d.ts +0 -50
- package/hooks/useSeriesManager/index.d.ts +0 -4
- package/hooks/useSeriesManager/useFilteredSeries.d.ts +1 -9
- package/hooks/useSeriesManager/useSeriesManager.d.ts +0 -18
- package/index.d.ts +1 -3
- package/index.js +62 -31109
- package/index.js.LICENSE.txt +1 -1
- package/modules/Dial/render.d.ts +0 -3
- package/modules/Fluorescence/render.d.ts +0 -3
- package/modules/Gauge/render.d.ts +0 -9
- package/modules/Heatmap/Capture/sliderInfo.d.ts +3 -6
- package/modules/Heatmap/render.d.ts +0 -3
- package/modules/SpatialSpectrum/render.d.ts +0 -3
- package/modules/Spectrum/AxisYCanvas/layout.d.ts +2 -2
- package/modules/Spectrum/FrequencyAllocation/tools.d.ts +0 -23
- package/modules/Spectrum/Markers/hooks/useMarkers.d.ts +2 -19
- package/modules/Spectrum/Markers/tools.d.ts +0 -3
- package/modules/Spectrum/Signal/Switch/index.d.ts +0 -5
- package/modules/Spectrum/Signal/metadata/level.d.ts +1 -9
- package/modules/Spectrum/Signal/metadata/signalType.d.ts +5 -8
- package/modules/Spectrum/Signal/model/match.d.ts +0 -1
- package/modules/Spectrum/Signal/model/resolver.d.ts +1 -1
- package/modules/Spectrum/Signal/model/tree.d.ts +0 -30
- package/modules/Spectrum/Signal/tools.d.ts +0 -8
- package/modules/Spectrum/Signal/useSignalDataManager.d.ts +0 -5
- package/modules/Spectrum/TouchBus/index.d.ts +6 -0
- package/modules/Spectrum/index.d.ts +1 -0
- package/modules/Spectrum/useSpectrumAnalyzer/useTemplateComparison.d.ts +1 -5
- package/modules/base/BaseRenderer.d.ts +0 -89
- package/modules/base/CircularRenderer.d.ts +1 -29
- package/modules/base/GradientRenderer.d.ts +0 -25
- package/modules/base/IQRenderer.d.ts +0 -21
- package/modules/base/index.d.ts +0 -3
- package/package.json +1 -1
- package/runtime/interaction/index.d.ts +4 -2
- package/runtime/passThrough.d.ts +1 -1
- package/store/Params.d.ts +0 -7
- package/store/bandState.d.ts +0 -4
- package/store/defaultState.d.ts +0 -4
- package/store/globalState.d.ts +0 -9
- package/store/hooks/useStore.d.ts +0 -9
- package/theme/style-scope.d.ts +11 -11
- package/theme/theme-color.d.ts +0 -1
- package/theme/theme-contract.d.ts +4 -4
- package/theme/theme-tokens.d.ts +36 -36
- package/types/publish.d.ts +1 -3
- package/types/store/index.d.ts +0 -12
- package/types/store/marker.d.ts +5 -5
- package/types/store/signal.d.ts +1 -2
- package/types/store/ui.d.ts +3 -8
- package/types/store.d.ts +0 -12
- package/utils/array.d.ts +0 -18
- package/utils/cursor.d.ts +1 -1
- package/utils/frequency.d.ts +0 -48
- package/utils/frequencyCalculation.d.ts +0 -139
- package/utils/index.d.ts +0 -9
- package/utils/object.d.ts +0 -9
- package/utils/series/events.d.ts +7 -29
- package/utils/series/index.d.ts +0 -53
- package/utils/series/modes.d.ts +0 -25
- package/utils/series/subscription.d.ts +0 -30
- package/utils/subscription.d.ts +0 -5
- package/utils/throttle.d.ts +0 -26
- package/utils/time.d.ts +0 -20
package/modules/base/index.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 渲染器基类导出
|
|
3
|
-
*/
|
|
4
1
|
export { BaseRenderer, type BaseRenderState, type IRenderer } from './BaseRenderer';
|
|
5
2
|
export { type CircularData, CircularRenderer, type CircularRenderState, type CircularSeriesItem } from './CircularRenderer';
|
|
6
3
|
export { GradientRenderer, type GradientRenderState } from './GradientRenderer';
|
package/package.json
CHANGED
|
@@ -38,6 +38,8 @@ export interface InteractionRuntimeOptions {
|
|
|
38
38
|
}
|
|
39
39
|
type PointerListener = (snapshot: PointerSnapshot | null) => void;
|
|
40
40
|
type SampleListener = (snapshot: CursorSampleSnapshot | null) => void;
|
|
41
|
+
declare const createBounds: (left: number, top: number, right: number, bottom: number) => InteractionBounds;
|
|
42
|
+
declare const toCursorEventSnapshot: (snapshot: PointerSnapshot | CursorSampleSnapshot) => CursorEventSnapshot;
|
|
41
43
|
export declare class InteractionRuntime {
|
|
42
44
|
private readonly entries;
|
|
43
45
|
private readonly sampleIntervalMs;
|
|
@@ -66,6 +68,6 @@ export declare class InteractionRuntime {
|
|
|
66
68
|
private cleanupEntryIfEmpty;
|
|
67
69
|
}
|
|
68
70
|
export declare const interactionRuntime: InteractionRuntime;
|
|
69
|
-
export declare const createInteractionBounds:
|
|
70
|
-
export declare const toCursorSnapshotEvent:
|
|
71
|
+
export declare const createInteractionBounds: typeof createBounds;
|
|
72
|
+
export declare const toCursorSnapshotEvent: typeof toCursorEventSnapshot;
|
|
71
73
|
export {};
|
package/runtime/passThrough.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type CSMCallback } from '../utils/subscription';
|
|
2
|
-
declare const _default: (globalID: string, name: string, func?: CSMCallback, subscriptionName?: string) => (...args: any[]) => void;
|
|
3
2
|
export default _default;
|
|
3
|
+
declare function _default(globalID: string, name: string, func?: CSMCallback, subscriptionName?: string): (...args: any[]) => void;
|
package/store/Params.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { AxisYProps, ParamsProps, StoreState } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* 混合参数
|
|
5
|
-
* @param key 参数键名
|
|
6
|
-
* @param params 要混合的参数
|
|
7
|
-
* @param state 当前状态
|
|
8
|
-
* @returns 混合后的参数
|
|
9
|
-
*/
|
|
10
3
|
export declare function mergeParameter<K extends keyof StoreState>(key: K, params: StoreState[K] | Partial<StoreState[K]> | null | undefined, state?: StoreState): StoreState[K];
|
|
11
4
|
export declare function normalizeAxisYProps(axisY?: Partial<AxisYProps>): Partial<AxisYProps> | undefined;
|
|
12
5
|
declare const Params: React.FC<ParamsProps>;
|
package/store/bandState.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import { type BandState } from '../types/store/ui.ts';
|
|
2
2
|
export type BandUpdateStrategy = 'merge' | 'replace';
|
|
3
|
-
/**
|
|
4
|
-
* 将 prop / publish 的 Band 输入归一化为唯一内部状态。
|
|
5
|
-
* 无效输入返回当前状态引用,避免破坏已生效的 Band。
|
|
6
|
-
*/
|
|
7
3
|
export declare function resolveBandState(input: Record<string, unknown>, current?: BandState, strategy?: BandUpdateStrategy): BandState;
|
package/store/defaultState.d.ts
CHANGED
package/store/globalState.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import type { RecursiveObject } from '../types';
|
|
2
2
|
import type { StoreState } from '../types/store';
|
|
3
|
-
/**
|
|
4
|
-
* 设置全局store状态
|
|
5
|
-
*/
|
|
6
3
|
export declare const setGlobalStoreState: (globalID: string, state: RecursiveObject) => void;
|
|
7
|
-
/**
|
|
8
|
-
* 获取全局store状态
|
|
9
|
-
*/
|
|
10
4
|
export declare const getGlobalStoreState: (globalID: string) => StoreState | null;
|
|
11
|
-
/**
|
|
12
|
-
* 清理指定图表实例的全局store状态
|
|
13
|
-
*/
|
|
14
5
|
export declare const clearGlobalStoreState: (globalID: string) => void;
|
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
import type { DispatchAction, StoreState } from '../../types/store';
|
|
2
2
|
import type { ChartStore } from '../chart-store';
|
|
3
3
|
import type { ChartRuntime } from '../runtime';
|
|
4
|
-
/**
|
|
5
|
-
* 使用全局状态的 hook
|
|
6
|
-
* @returns 状态和 dispatch 函数
|
|
7
|
-
*/
|
|
8
4
|
export declare function useStore(): {
|
|
9
5
|
dispatch: (action: DispatchAction) => void;
|
|
10
6
|
runtime: ChartRuntime;
|
|
11
7
|
state: StoreState;
|
|
12
8
|
store: ChartStore;
|
|
13
9
|
};
|
|
14
|
-
/**
|
|
15
|
-
* 获取特定状态的 hook
|
|
16
|
-
* @param selector 选择器函数
|
|
17
|
-
* @returns 选择的状态
|
|
18
|
-
*/
|
|
19
10
|
export declare function useSelector<T>(selector: (state: StoreState) => T): T;
|
|
20
11
|
export declare function useStoreApi(): {
|
|
21
12
|
dispatch: (action: DispatchAction) => void;
|
package/theme/style-scope.d.ts
CHANGED
|
@@ -4,17 +4,17 @@ export declare const CHARTS_STYLE_SCOPE_VALUE = "true";
|
|
|
4
4
|
export declare const CHARTS_PORTAL_SLOT_ATTRIBUTE = "data-rfkit-charts-portal";
|
|
5
5
|
export declare const CHARTS_PORTAL_Z_INDEX: Record<string, number>;
|
|
6
6
|
export declare const CHARTS_SCOPE_STYLE_VARS: {
|
|
7
|
-
readonly '--radius':
|
|
8
|
-
readonly '--radius-sm':
|
|
9
|
-
readonly '--radius-md':
|
|
10
|
-
readonly '--radius-lg':
|
|
11
|
-
readonly '--radius-xl':
|
|
12
|
-
readonly '--radius-micro':
|
|
13
|
-
readonly '--radius-control':
|
|
14
|
-
readonly '--radius-group':
|
|
15
|
-
readonly '--radius-surface':
|
|
16
|
-
readonly '--radius-pill':
|
|
17
|
-
readonly '--size-border-radius-second':
|
|
7
|
+
readonly '--radius': '0px';
|
|
8
|
+
readonly '--radius-sm': '0px';
|
|
9
|
+
readonly '--radius-md': '0px';
|
|
10
|
+
readonly '--radius-lg': '0px';
|
|
11
|
+
readonly '--radius-xl': '0px';
|
|
12
|
+
readonly '--radius-micro': '0px';
|
|
13
|
+
readonly '--radius-control': '0px';
|
|
14
|
+
readonly '--radius-group': '0px';
|
|
15
|
+
readonly '--radius-surface': '0px';
|
|
16
|
+
readonly '--radius-pill': '9999px';
|
|
17
|
+
readonly '--size-border-radius-second': 'var(--radius-control)';
|
|
18
18
|
};
|
|
19
19
|
export declare const applyChartsScopeRoot: (element: HTMLElement) => void;
|
|
20
20
|
export declare const ensureChartsPortalRoot: (slot: string) => HTMLDivElement | null;
|
package/theme/theme-color.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export interface ThemeFillStyle {
|
|
|
3
3
|
fillStylePrimary: string;
|
|
4
4
|
fillStyleTransparentBase: string;
|
|
5
5
|
}
|
|
6
|
-
/** 文本图例沿用颜色色相,但去除业务填充色的透明度以保证可读性。 */
|
|
7
6
|
export declare const toOpaqueCssColor: (value: string) => string;
|
|
8
7
|
export declare function getThemeFillStyle(scopeTarget?: Element | null): ThemeFillStyle;
|
|
9
8
|
export declare const getThemeColor: (property: string, opacity?: number, scopeTarget?: Element | null) => string;
|
|
@@ -2,13 +2,13 @@ export declare const THEME_KEY = "theme";
|
|
|
2
2
|
export declare const THEME_FOLLOW_OS_KEY = "theme-follow-OS";
|
|
3
3
|
export declare const SIZE_KEY = "size";
|
|
4
4
|
export declare const ThemeType: {
|
|
5
|
-
readonly Dark:
|
|
6
|
-
readonly Light:
|
|
5
|
+
readonly Dark: 'dark';
|
|
6
|
+
readonly Light: 'light';
|
|
7
7
|
};
|
|
8
8
|
export type ThemeType = (typeof ThemeType)[keyof typeof ThemeType];
|
|
9
9
|
export declare const SizeType: {
|
|
10
|
-
readonly Middle:
|
|
11
|
-
readonly Small:
|
|
10
|
+
readonly Middle: 'middle';
|
|
11
|
+
readonly Small: 'small';
|
|
12
12
|
};
|
|
13
13
|
export type SizeType = (typeof SizeType)[keyof typeof SizeType];
|
|
14
14
|
export interface ChartsThemeContract {
|
package/theme/theme-tokens.d.ts
CHANGED
|
@@ -13,51 +13,51 @@ export interface SizeVariableDefinition extends SizeScaleValues {
|
|
|
13
13
|
name: string;
|
|
14
14
|
}
|
|
15
15
|
export declare const SEMANTIC_TOKEN_VARIABLES: {
|
|
16
|
-
readonly accent:
|
|
17
|
-
readonly accentForeground:
|
|
18
|
-
readonly background:
|
|
19
|
-
readonly border:
|
|
20
|
-
readonly card:
|
|
21
|
-
readonly cardForeground:
|
|
22
|
-
readonly destructive:
|
|
23
|
-
readonly destructiveForeground:
|
|
24
|
-
readonly foreground:
|
|
25
|
-
readonly input:
|
|
26
|
-
readonly muted:
|
|
27
|
-
readonly mutedForeground:
|
|
28
|
-
readonly popover:
|
|
29
|
-
readonly popoverForeground:
|
|
30
|
-
readonly primary:
|
|
31
|
-
readonly primaryForeground:
|
|
32
|
-
readonly radius:
|
|
33
|
-
readonly ring:
|
|
34
|
-
readonly secondary:
|
|
35
|
-
readonly secondaryForeground:
|
|
36
|
-
readonly success:
|
|
37
|
-
readonly successForeground:
|
|
38
|
-
readonly warning:
|
|
39
|
-
readonly warningForeground:
|
|
16
|
+
readonly accent: '--accent';
|
|
17
|
+
readonly accentForeground: '--accent-foreground';
|
|
18
|
+
readonly background: '--background';
|
|
19
|
+
readonly border: '--border';
|
|
20
|
+
readonly card: '--card';
|
|
21
|
+
readonly cardForeground: '--card-foreground';
|
|
22
|
+
readonly destructive: '--destructive';
|
|
23
|
+
readonly destructiveForeground: '--destructive-foreground';
|
|
24
|
+
readonly foreground: '--foreground';
|
|
25
|
+
readonly input: '--input';
|
|
26
|
+
readonly muted: '--muted';
|
|
27
|
+
readonly mutedForeground: '--muted-foreground';
|
|
28
|
+
readonly popover: '--popover';
|
|
29
|
+
readonly popoverForeground: '--popover-foreground';
|
|
30
|
+
readonly primary: '--primary';
|
|
31
|
+
readonly primaryForeground: '--primary-foreground';
|
|
32
|
+
readonly radius: '--radius';
|
|
33
|
+
readonly ring: '--ring';
|
|
34
|
+
readonly secondary: '--secondary';
|
|
35
|
+
readonly secondaryForeground: '--secondary-foreground';
|
|
36
|
+
readonly success: '--success';
|
|
37
|
+
readonly successForeground: '--success-foreground';
|
|
38
|
+
readonly warning: '--warning';
|
|
39
|
+
readonly warningForeground: '--warning-foreground';
|
|
40
40
|
};
|
|
41
41
|
export declare const CHART_TOKEN_VARIABLES: {
|
|
42
|
-
readonly grid:
|
|
43
|
-
readonly gridStrong:
|
|
44
|
-
readonly highlight:
|
|
45
|
-
readonly panel:
|
|
46
|
-
readonly panelForeground:
|
|
47
|
-
readonly surface:
|
|
42
|
+
readonly grid: '--chart-grid';
|
|
43
|
+
readonly gridStrong: '--chart-grid-strong';
|
|
44
|
+
readonly highlight: '--chart-highlight';
|
|
45
|
+
readonly panel: '--chart-panel';
|
|
46
|
+
readonly panelForeground: '--chart-panel-foreground';
|
|
47
|
+
readonly surface: '--chart-surface';
|
|
48
48
|
};
|
|
49
49
|
export declare const SIZE_TOKEN_VARIABLES: {
|
|
50
50
|
readonly font: {
|
|
51
|
-
readonly base:
|
|
52
|
-
readonly max:
|
|
53
|
-
readonly second:
|
|
51
|
+
readonly base: '--size-font-base';
|
|
52
|
+
readonly max: '--size-font-max';
|
|
53
|
+
readonly second: '--size-font-second';
|
|
54
54
|
};
|
|
55
55
|
readonly radius: {
|
|
56
|
-
readonly base:
|
|
57
|
-
readonly second:
|
|
56
|
+
readonly base: '--size-border-radius-base';
|
|
57
|
+
readonly second: '--size-border-radius-second';
|
|
58
58
|
};
|
|
59
59
|
readonly spacing: {
|
|
60
|
-
readonly base:
|
|
60
|
+
readonly base: '--size-gap-base';
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
export type SemanticTokenName = keyof typeof SEMANTIC_TOKEN_VARIABLES;
|
package/types/publish.d.ts
CHANGED
|
@@ -91,10 +91,9 @@ export interface PublishIQ {
|
|
|
91
91
|
QData: number[];
|
|
92
92
|
}
|
|
93
93
|
export interface DialPolygon {
|
|
94
|
-
/** 各方向归一化值(0-1),长度即方向数,按 0..360 度均匀分布;值决定该方向半径,1 贴最外网格 */
|
|
95
94
|
values: number[];
|
|
96
|
-
/** 多边形颜色;缺省走主题主色 fillStylePrimary,边框与半透明填充均由此色派生 */
|
|
97
95
|
color?: string;
|
|
96
|
+
showDots?: boolean;
|
|
98
97
|
}
|
|
99
98
|
export interface PublishDial {
|
|
100
99
|
pstype?: PSType.Dial;
|
|
@@ -144,7 +143,6 @@ export interface Render {
|
|
|
144
143
|
export type PublishData = SetOption | SetSeries | SetSpectrumBandwidth | SetSegments | SetChannels | SetMarker | SetAntennaFactor | SetSignal | PublishSpectrum | PublishHeatmap | PublishFluorescence | PublishOccupancy | PublishLevelStream | PublishIQ | PublishDial | PublishGauge | AutorangingEvent | PointsEvent | BandEvent | ScopeEvent | Reset | Clear | Resize | Render;
|
|
145
144
|
export type Publish = ((p: PublishData) => void) & {
|
|
146
145
|
getSourceData: () => rawData;
|
|
147
|
-
/** 将支持视口的图表恢复为完整数据范围;不支持时为空操作。 */
|
|
148
146
|
resetViewport?: () => void;
|
|
149
147
|
};
|
|
150
148
|
export {};
|
package/types/store/index.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Store 类型定义
|
|
3
|
-
*
|
|
4
|
-
* 按功能模块拆分:
|
|
5
|
-
* - axis: 坐标轴配置
|
|
6
|
-
* - marker: 标记配置
|
|
7
|
-
* - signal: 信号配置
|
|
8
|
-
* - heatmap: 热力图配置
|
|
9
|
-
* - series: 系列数据配置
|
|
10
|
-
* - frequency: 频率分配配置
|
|
11
|
-
* - ui: UI 组件配置
|
|
12
|
-
*/
|
|
13
1
|
export * from './axis';
|
|
14
2
|
export * from './frequency';
|
|
15
3
|
export * from './heatmap';
|
package/types/store/marker.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ export declare enum MarkerMode {
|
|
|
4
4
|
DDC = "ddc"
|
|
5
5
|
}
|
|
6
6
|
export declare enum MarkerAction {
|
|
7
|
-
Add = "add"
|
|
8
|
-
Move = "move"
|
|
9
|
-
Update = "update"
|
|
10
|
-
Delete = "delete"
|
|
11
|
-
Clear = "clear"
|
|
7
|
+
Add = "add",
|
|
8
|
+
Move = "move",
|
|
9
|
+
Update = "update",
|
|
10
|
+
Delete = "delete",
|
|
11
|
+
Clear = "clear",
|
|
12
12
|
Select = "select"
|
|
13
13
|
}
|
|
14
14
|
export interface MarkerChangeEvent {
|
package/types/store/signal.d.ts
CHANGED
package/types/store/ui.d.ts
CHANGED
|
@@ -45,14 +45,11 @@ export interface CursorProps {
|
|
|
45
45
|
mode?: ModuleType;
|
|
46
46
|
}
|
|
47
47
|
export interface ZoomOverviewProps {
|
|
48
|
-
/** 是否在独立瀑布图缩放后显示全景导航。仅在 zoom.xy=true 时生效。 */
|
|
49
48
|
show?: boolean;
|
|
50
49
|
}
|
|
51
50
|
export interface ZoomProps {
|
|
52
51
|
show: boolean;
|
|
53
|
-
/** 独立瀑布图是否启用 X/Y 同步缩放。 */
|
|
54
52
|
xy?: boolean;
|
|
55
|
-
/** 独立瀑布图的可选全景导航。 */
|
|
56
53
|
overview?: ZoomOverviewProps;
|
|
57
54
|
select: boolean;
|
|
58
55
|
interval: AxisXRange;
|
|
@@ -89,15 +86,13 @@ type BandFrequencyRangeProps = {
|
|
|
89
86
|
frequency?: never;
|
|
90
87
|
bandwidth?: never;
|
|
91
88
|
};
|
|
92
|
-
/** Band 对外配置:百分比、中心频率带宽、起止频率三种定位方式互斥。 */
|
|
93
89
|
export type BandProps = BandSharedProps & (BandPositionProps | BandCenterBandwidthProps | BandFrequencyRangeProps);
|
|
94
90
|
export declare const BandKind: {
|
|
95
|
-
readonly Position:
|
|
96
|
-
readonly CenterBandwidth:
|
|
97
|
-
readonly FrequencyRange:
|
|
91
|
+
readonly Position: 'position';
|
|
92
|
+
readonly CenterBandwidth: 'centerBandwidth';
|
|
93
|
+
readonly FrequencyRange: 'frequencyRange';
|
|
98
94
|
};
|
|
99
95
|
export type BandKind = (typeof BandKind)[keyof typeof BandKind];
|
|
100
|
-
/** Band 内部归一化状态。 */
|
|
101
96
|
export type BandState = {
|
|
102
97
|
kind: typeof BandKind.Position;
|
|
103
98
|
show: boolean;
|
package/types/store.d.ts
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Store 类型定义
|
|
3
|
-
*
|
|
4
|
-
* 类型已按功能模块拆分到 store/ 目录:
|
|
5
|
-
* - store/axis.ts: 坐标轴配置 (AxisXProps, AxisYProps)
|
|
6
|
-
* - store/marker.ts: 标记配置 (MarkerProps, MarkerType, MarkerMode, MarkerAction)
|
|
7
|
-
* - store/signal.ts: 信号配置 (SignalProps, SignalData, SignalDataType)
|
|
8
|
-
* - store/heatmap.ts: 热力图配置 (HeatmapCaptureProps, HeatmapCaptureType)
|
|
9
|
-
* - store/series.ts: 系列数据配置 (SeriesProps, LevelStreamProps)
|
|
10
|
-
* - store/frequency.ts: 频率分配配置 (FrequencyAllocationProps, FrequencyAllocationItem)
|
|
11
|
-
* - store/ui.ts: UI 组件配置 (CursorProps, ZoomProps, LimitProps, etc.)
|
|
12
|
-
*/
|
|
13
1
|
export * from './store/index';
|
package/utils/array.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 数组操作工具函数
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* 查找数组最大值及索引
|
|
6
|
-
*/
|
|
7
1
|
export declare function arrayFindMax(arr: Array<number>): {
|
|
8
2
|
max?: undefined;
|
|
9
3
|
maxIndex?: undefined;
|
|
@@ -15,17 +9,8 @@ interface MinResult {
|
|
|
15
9
|
min: number;
|
|
16
10
|
minIndex: number;
|
|
17
11
|
}
|
|
18
|
-
/**
|
|
19
|
-
* 查找数组最小值及索引
|
|
20
|
-
*/
|
|
21
12
|
export declare function arrayFindMin(arr: Array<number>): MinResult | 0;
|
|
22
|
-
/**
|
|
23
|
-
* 是否为有效数字
|
|
24
|
-
*/
|
|
25
13
|
export declare const isNumberAlias: (n: unknown) => boolean;
|
|
26
|
-
/**
|
|
27
|
-
* 获取平均值、最大值、最小值
|
|
28
|
-
*/
|
|
29
14
|
export declare function getDimInfo(d: Array<number>): {
|
|
30
15
|
min?: number;
|
|
31
16
|
minIndex?: number;
|
|
@@ -33,8 +18,5 @@ export declare function getDimInfo(d: Array<number>): {
|
|
|
33
18
|
maxIndex?: number;
|
|
34
19
|
avg?: number;
|
|
35
20
|
};
|
|
36
|
-
/**
|
|
37
|
-
* 获取中间索引
|
|
38
|
-
*/
|
|
39
21
|
export declare function getMidIndex(indexStart: number, indexEnd: number): number;
|
|
40
22
|
export {};
|
package/utils/cursor.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ interface CursorStateLike {
|
|
|
8
8
|
} | null;
|
|
9
9
|
}
|
|
10
10
|
export declare const hasActiveSpectrumCursor: (cursor: CursorStateLike) => boolean;
|
|
11
|
-
export declare const resolveCursorVisibleBounds: (target: HTMLElement) => CursorEventSnapshot[
|
|
11
|
+
export declare const resolveCursorVisibleBounds: (target: HTMLElement) => CursorEventSnapshot['bounds'];
|
|
12
12
|
export {};
|
package/utils/frequency.d.ts
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 频率计算工具函数
|
|
3
|
-
*/
|
|
4
1
|
import { FrequencyUnit } from '../config/constants';
|
|
5
2
|
import type { RecursiveObject, SegmentsOriginal, SegmentsType } from '../types';
|
|
6
|
-
/**
|
|
7
|
-
* 格式化频率为固定小数位字符串
|
|
8
|
-
*/
|
|
9
3
|
export declare const getFrequencyToFixed: (frequency: number, fixedNum?: number) => string;
|
|
10
|
-
/**
|
|
11
|
-
* 是否是 dBm 单位
|
|
12
|
-
*/
|
|
13
4
|
export declare function isdBm(unit: string): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* 通过 left segments 格式化 frequency 频谱信息
|
|
16
|
-
*/
|
|
17
5
|
export declare const leftSegments2frequency: (segments: SegmentsType) => (left: number) => string;
|
|
18
|
-
/**
|
|
19
|
-
* 点信息转换成频率
|
|
20
|
-
*/
|
|
21
6
|
export declare const leftToIndex: (left: number, length: number) => number;
|
|
22
7
|
export declare function leftPoints2frequency<T>(points: Array<T>): (left: number) => T | undefined;
|
|
23
8
|
interface ScopeInfo {
|
|
@@ -25,49 +10,16 @@ interface ScopeInfo {
|
|
|
25
10
|
startLeft: number;
|
|
26
11
|
endLeft: number;
|
|
27
12
|
}
|
|
28
|
-
/**
|
|
29
|
-
* 通过范围框中信息的 left segments 转换成 bandwidth
|
|
30
|
-
*/
|
|
31
13
|
export declare const scopeLeftSegments2bandwidth: (e: ScopeInfo | null | undefined) => number;
|
|
32
|
-
/**
|
|
33
|
-
* 生成频率段
|
|
34
|
-
*/
|
|
35
14
|
export declare const generateFrequencySegments: (e: RecursiveObject) => SegmentsType;
|
|
36
|
-
/**
|
|
37
|
-
* 为无频率规则的模式生成默认 segments(如 LiteNormalized)
|
|
38
|
-
*/
|
|
39
15
|
export declare const generateNormalizedSegments: (totalPoints: number) => SegmentsType;
|
|
40
|
-
/**
|
|
41
|
-
* 生成大段频率数据
|
|
42
|
-
*/
|
|
43
16
|
export declare const generateGreatSegments: (prevSegments: SegmentsOriginal[]) => SegmentsType;
|
|
44
|
-
/**
|
|
45
|
-
* 频率单位自适应结果
|
|
46
|
-
*/
|
|
47
17
|
export interface FrequencyUnitResult {
|
|
48
18
|
value: number;
|
|
49
19
|
unit: FrequencyUnit;
|
|
50
20
|
formatted: string;
|
|
51
21
|
}
|
|
52
|
-
/**
|
|
53
|
-
* 频率单位自适应转换(基于 kHz)
|
|
54
|
-
* @param frequencyKHz 频率(单位:kHz)
|
|
55
|
-
* @param precision 小数位数,默认 2
|
|
56
|
-
* @returns 转换后的频率值、单位和格式化字符串
|
|
57
|
-
*/
|
|
58
22
|
export declare const formatFrequencyUnit: (frequencyKHz: number, precision?: number) => FrequencyUnitResult;
|
|
59
|
-
/**
|
|
60
|
-
* 频率单位自适应转换(基于 MHz)
|
|
61
|
-
* @param frequencyMHz 频率(单位:MHz)
|
|
62
|
-
* @param precision 小数位数,默认 2
|
|
63
|
-
* @returns 转换后的频率值、单位和格式化字符串
|
|
64
|
-
*/
|
|
65
23
|
export declare const formatFrequencyUnitFromMHz: (frequencyMHz: number, precision?: number) => FrequencyUnitResult;
|
|
66
|
-
/**
|
|
67
|
-
* 频率单位自适应转换(基于 Hz)
|
|
68
|
-
* @param frequencyHz 频率(单位:Hz)
|
|
69
|
-
* @param precision 小数位数,默认 2
|
|
70
|
-
* @returns 转换后的频率值、单位和格式化字符串
|
|
71
|
-
*/
|
|
72
24
|
export declare const formatFrequencyUnitFromHz: (frequencyHz: number, precision?: number) => FrequencyUnitResult;
|
|
73
25
|
export {};
|