@rfkit/charts 1.8.2 → 1.9.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 +13 -0
- package/components/DragSelectBox/index.d.ts +5 -1
- package/hooks/publish/enhancedPublish.d.ts +1 -0
- package/hooks/publish/usePublish.d.ts +2 -1
- package/hooks/useDragSelect.d.ts +9 -1
- package/index.js +3055 -976
- package/index.js.LICENSE.txt +6 -0
- package/modules/Heatmap/Capture/sliderInfo.d.ts +18 -0
- package/modules/Heatmap/Capture/tools.d.ts +4 -0
- package/modules/Heatmap/Overview.d.ts +10 -0
- package/modules/Heatmap/cursorValue.d.ts +17 -6
- package/modules/Heatmap/index.d.ts +4 -0
- package/modules/Heatmap/snapshot.d.ts +3 -0
- package/modules/Heatmap/useWaterfallZoomEvent.d.ts +1 -0
- package/modules/Heatmap/viewport.d.ts +98 -0
- package/package.json +1 -1
- package/types/publish.d.ts +2 -0
- package/types/store/heatmap.d.ts +10 -0
- package/types/store/index.d.ts +2 -1
- package/types/store/ui.d.ts +8 -0
- package/utils/subscription.d.ts +3 -1
package/README.md
CHANGED
|
@@ -96,6 +96,19 @@ export function GaugeDemo() {
|
|
|
96
96
|
|
|
97
97
|
`PublishSpectrum` 支持推送内置频谱数据线,包括 `data`、`maxData`、`minData`、`avgData`、`thresholdData`、`templateData`、`backgroundNoiseData` 和 `extraData`。`thresholdData` 不传 `segmentOffset` / `offset` 时按整条门限替换;传入 `segmentOffset` 或 `offset` 时按局部门限写入。
|
|
98
98
|
|
|
99
|
+
独立 `Heatmap` 可以显式开启 X/Y 同步缩放:
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
<Heatmap
|
|
103
|
+
ref={heatmapRef}
|
|
104
|
+
zoom={{ xy: true, overview: { show: true } }}
|
|
105
|
+
/>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
开启后,滚轮会围绕指针位置同步缩放频率列和时间行,左键拖拽会同时平移两个方向。`overview.show` 会在发生缩放后于右上角以小尺寸半透明悬浮显示全量瀑布缩略图,恢复全景后自动隐藏且不改变主图布局;点击空白区域居中、拖动视口框平移,双击主图或 Overview 恢复全景。框选边界越出视口时可通过主图边缘代理手柄继续调整;完全离开视口时可点击 Overview 中的虚线框定位,二者均不会自动改变框选或缩放倍率。外部也可以调用 `heatmapRef.current?.resetViewport?.()` 恢复完整 XY 范围。
|
|
109
|
+
|
|
110
|
+
这些开关默认关闭,只作用于独立 `Heatmap`;`Spectrum` 组合使用的 `HeatmapPortal` 仍由频谱图统一控制,不显示 Overview,也不注册单独的缩放操作。
|
|
111
|
+
|
|
99
112
|
工具栏相关命名统一使用:
|
|
100
113
|
|
|
101
114
|
- 工具栏枚举使用 `ToolbarItemType`
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type React from 'react';
|
|
6
6
|
import { type ReactNode } from 'react';
|
|
7
|
-
import { type RectPosition } from '../../hooks/useDragSelect';
|
|
7
|
+
import { type RectBounds, type RectPosition } from '../../hooks/useDragSelect';
|
|
8
|
+
type DragSelectBoxVariant = 'contained' | 'projected';
|
|
8
9
|
export interface DragSelectBoxProps {
|
|
9
10
|
enabled: boolean;
|
|
10
11
|
defaultRect?: Partial<RectPosition>;
|
|
@@ -14,6 +15,7 @@ export interface DragSelectBoxProps {
|
|
|
14
15
|
maxSize?: number;
|
|
15
16
|
snapThreshold?: number;
|
|
16
17
|
onChange?: (rect: RectPosition) => void;
|
|
18
|
+
onDragStart?: () => boolean | undefined;
|
|
17
19
|
onDragEnd?: (rect: RectPosition) => void;
|
|
18
20
|
children?: ReactNode;
|
|
19
21
|
labels?: {
|
|
@@ -25,6 +27,8 @@ export interface DragSelectBoxProps {
|
|
|
25
27
|
className?: string;
|
|
26
28
|
zIndex?: number;
|
|
27
29
|
showBoundaryLines?: boolean;
|
|
30
|
+
variant?: DragSelectBoxVariant;
|
|
31
|
+
interactionBounds?: RectBounds;
|
|
28
32
|
}
|
|
29
33
|
declare const DragSelectBox: React.FC<DragSelectBoxProps>;
|
|
30
34
|
export default DragSelectBox;
|
|
@@ -6,6 +6,7 @@ export interface EnhancedPublish extends Publish {
|
|
|
6
6
|
isReady: () => boolean;
|
|
7
7
|
onReady: (callback: ReadyCallback) => ReadyCleanup | undefined;
|
|
8
8
|
getSourceData: () => rawData;
|
|
9
|
+
resetViewport: () => void;
|
|
9
10
|
}
|
|
10
11
|
export interface EnhancedPublishController {
|
|
11
12
|
attachPublish: (publish: Publish) => void;
|
|
@@ -4,6 +4,7 @@ export declare const PUB_SUB: (globalID: string, func?: CSMCallback) => (...args
|
|
|
4
4
|
interface Props {
|
|
5
5
|
subscribe?: CSMCallback;
|
|
6
6
|
publish?: Publish;
|
|
7
|
+
resetViewport?: () => void;
|
|
7
8
|
}
|
|
8
|
-
declare const usePublish: ({ publish, subscribe }: Props) => void;
|
|
9
|
+
declare const usePublish: ({ publish, resetViewport, subscribe }: Props) => void;
|
|
9
10
|
export default usePublish;
|
package/hooks/useDragSelect.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ export interface RectPosition {
|
|
|
9
9
|
leftPosition: number;
|
|
10
10
|
width: number;
|
|
11
11
|
}
|
|
12
|
+
export interface RectBounds {
|
|
13
|
+
bottom: number;
|
|
14
|
+
left: number;
|
|
15
|
+
right: number;
|
|
16
|
+
top: number;
|
|
17
|
+
}
|
|
12
18
|
export interface UseDragSelectConfig {
|
|
13
19
|
enabled?: boolean;
|
|
14
20
|
defaultRect?: Partial<RectPosition>;
|
|
@@ -19,6 +25,8 @@ export interface UseDragSelectConfig {
|
|
|
19
25
|
snapThreshold?: number;
|
|
20
26
|
onChange?: (rect: RectPosition) => void;
|
|
21
27
|
onDragEnd?: (rect: RectPosition) => void;
|
|
28
|
+
preserveDefaultRect?: boolean;
|
|
29
|
+
bounds?: RectBounds;
|
|
22
30
|
}
|
|
23
31
|
/**
|
|
24
32
|
* 通用拖拽框选 Hook
|
|
@@ -28,7 +36,7 @@ export declare const useDragSelect: (config?: UseDragSelectConfig) => {
|
|
|
28
36
|
isDragging: boolean;
|
|
29
37
|
dragType: DragType;
|
|
30
38
|
containerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
31
|
-
handleMouseDown: (e: React.MouseEvent<
|
|
39
|
+
handleMouseDown: (e: React.MouseEvent<HTMLElement>, type: DragType, startRect?: RectPosition) => void;
|
|
32
40
|
resetRect: (newRect: Partial<RectPosition>) => void;
|
|
33
41
|
setRect: (newRect: RectPosition) => void;
|
|
34
42
|
};
|