@rfkit/charts 1.16.0 → 1.17.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 CHANGED
@@ -170,6 +170,30 @@ publish({ pstype: PSType.Signal, type: SignalDataType.Simple, data: simpleData }
170
170
 
171
171
  台站数据需要提供 `startFrequency` / `stopFrequency`(也可以由 MHz 中心频率和 kHz 带宽在业务侧计算)。
172
172
 
173
+ ## Band 悬停详情
174
+
175
+ 频谱游标命中 Band 时,会在同一游标信息面板内统一展示起始频率、结束频率(MHz)和带宽(kHz),不展示百分比。频率最多保留 6 位小数、带宽最多保留 3 位小数,均去除末尾多余的零。业务端可通过 prop 或 `'band'` publish 传入 `details`;可选字段缺失时不显示,不传详情仍可查看基础信息。
176
+
177
+ ```tsx
178
+ <Spectrum
179
+ band={{
180
+ show: true,
181
+ frequency: 107.8,
182
+ bandwidth: 1800,
183
+ details: {
184
+ name: '广播接收频段',
185
+ organization: '监测站',
186
+ modulation: 'FM',
187
+ remark: '业务侧详情'
188
+ }
189
+ }}
190
+ />
191
+ ```
192
+
193
+ Band 支持 `left + width`(%)、`frequency`(MHz)+ `bandwidth`(kHz)、`startFrequency + stopFrequency`(MHz)三种互斥定位方式。离开 Band 后其详情自动隐藏,Band 原有遮罩样式保持不变。
194
+
195
+ ## 独立瀑布图缩放
196
+
173
197
  独立 `Heatmap` 可以显式开启 X/Y 同步缩放:
174
198
 
175
199
  ```tsx
@@ -1,9 +1,10 @@
1
- export declare const TOOLBAR_SHELL_CLASS_NAME = "relative flex h-10 w-full items-center justify-between pl-[var(--size-gap-base)] text-xs text-foreground";
1
+ export declare const TOOLBAR_SHELL_CLASS_NAME = "relative flex h-10 min-w-0 w-full items-center justify-between pl-[var(--size-gap-base)] text-xs text-foreground";
2
2
  export declare const TOOLBAR_SHELL_STYLE: {
3
3
  readonly background: 'linear-gradient(to bottom, var(--background), var(--mix-background-86))';
4
4
  readonly boxShadow: '0 1px 4px var(--mix-border-72)';
5
5
  };
6
- export declare const TOOLBAR_ITEMS_CLASS_NAME = "flex h-full items-center gap-[var(--size-gap-base)]";
6
+ export declare const TOOLBAR_ITEMS_CLASS_NAME = "flex h-full w-max min-w-full items-center gap-[var(--size-gap-base)]";
7
+ export declare const TOOLBAR_VIEWPORT_CLASS_NAME = "min-w-0 flex-1 overflow-x-auto overflow-y-hidden";
7
8
  export declare const TOOLBAR_SEPARATOR_BASE_CLASS_NAME = "self-center";
8
9
  export declare const TOOLBAR_SEPARATOR_CLASS_NAME = "self-center h-[18px]";
9
10
  export declare const TOOLBAR_GROUP_SEPARATOR_CLASS_NAME = "self-center h-3.5";
@@ -11,6 +11,7 @@ export interface RectBounds {
11
11
  right: number;
12
12
  top: number;
13
13
  }
14
+ export declare const intersectsViewport: (rect: RectPosition) => boolean;
14
15
  export interface UseDragSelectConfig {
15
16
  enabled?: boolean;
16
17
  defaultRect?: Partial<RectPosition>;
@@ -24,6 +25,7 @@ export interface UseDragSelectConfig {
24
25
  preserveDefaultRect?: boolean;
25
26
  bounds?: RectBounds;
26
27
  }
28
+ export declare const constrainDragPosition: (position: number, size: number, min: number, max: number, snapThreshold: number) => number;
27
29
  export declare const useDragSelect: (config?: UseDragSelectConfig) => {
28
30
  rect: RectPosition;
29
31
  isDragging: boolean;