@rfkit/charts 1.17.0 → 1.17.2
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 -1
- package/charts/Dial/Chart.d.ts +2 -0
- package/charts/Dial/index.d.ts +4 -1
- package/index.d.ts +1 -0
- package/index.js +16 -16
- package/modules/Dial/index.d.ts +5 -1
- package/modules/Dial/render.d.ts +6 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -133,8 +133,10 @@ export function AudioWaveformDemo() {
|
|
|
133
133
|
|
|
134
134
|
`PublishDial` 支持推送 `series`、`range`、`yawAngle`、`isNorthFacing`,以及可选 `polygon: DialPolygon[]` 绘制雷达多边形:每个多边形提供 `values`(各方向归一化值 0-1,长度即方向数,按 0..360 度均匀分布)、可选 `color`(缺省走主题主色)与可选 `showDots`(是否绘制顶点小圆点,缺省 true)。各方向值决定半径,连成闭合多边形,径向渐变填充 + 细描边 + 顶点圆点;`series` 已改为可选,纯雷达数据可以只传 `polygon`。
|
|
135
135
|
|
|
136
|
+
`Dial` 的低频属性 `directionLabelMode` 使用公开枚举 `DialDirectionLabelMode`(组件属性类型 `DialProps`),默认是 `DialDirectionLabelMode.Cardinal`,在 0° / 180° 显示“北 / 南”。设置 `DialDirectionLabelMode.Degrees` 显示“0 / 180”,保留原有红 / 蓝颜色以及偏航、朝向语义;属性可运行时切换,不需要重新推送数据。
|
|
137
|
+
|
|
136
138
|
```tsx
|
|
137
|
-
import { Dial, PSType, type Publish } from '@rfkit/charts';
|
|
139
|
+
import { Dial, DialDirectionLabelMode, PSType, type Publish } from '@rfkit/charts';
|
|
138
140
|
|
|
139
141
|
const dialRef = useRef<Publish>(null);
|
|
140
142
|
|
|
@@ -142,10 +144,14 @@ dialRef.current?.({
|
|
|
142
144
|
pstype: PSType.Dial,
|
|
143
145
|
polygon: [{ values: [0.9, 0.6, 0.8, 0.45, 0.75, 0.5, 0.85, 0.7] }]
|
|
144
146
|
});
|
|
147
|
+
|
|
148
|
+
<Dial ref={dialRef} directionLabelMode={DialDirectionLabelMode.Degrees} />;
|
|
145
149
|
```
|
|
146
150
|
|
|
147
151
|
`PublishSpectrum` 支持推送内置频谱数据线,包括 `data`、`maxData`、`minData`、`avgData`、`thresholdData`、`templateData`、`backgroundNoiseData` 和 `extraData`。`thresholdData` 不传 `segmentOffset` / `offset` 时按整条门限替换;传入 `segmentOffset` 或 `offset` 时按局部门限写入。
|
|
148
152
|
|
|
153
|
+
频率规划数据 `FrequencyAllocationItem` 的 `startFrequency`、`stopFrequency`、`centerFrequency` 单位为 MHz,`stepFrequency` 和 `bandwidth` 单位为 kHz。`bandwidth` 表示信道带宽,不是整个频段跨度;例如 400~470 MHz 频段的 `bandwidth: 25` 在悬停详情中显示为 `25 kHz`,频段绘制与游标匹配仍使用完整起止频率范围。
|
|
154
|
+
|
|
149
155
|
`extraData` 默认保持完整数组设置语义;设置 `segmentedExtraData: true` 后,同一次推送中的每条额外频谱线会独立使用 `segmentOffset + offset` 拼接,并随主实时值同步缩放。
|
|
150
156
|
|
|
151
157
|
## 信号标注接入
|
package/charts/Dial/Chart.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { DialDirectionLabelMode } from '@rfkit/renderer';
|
|
1
2
|
import type React from 'react';
|
|
2
3
|
import type { ParamsProps } from '../../types/index.js';
|
|
3
4
|
export interface Props extends ParamsProps {
|
|
5
|
+
directionLabelMode?: DialDirectionLabelMode;
|
|
4
6
|
}
|
|
5
7
|
declare const Chart: React.FC<Props>;
|
|
6
8
|
export default Chart;
|
package/charts/Dial/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import type { Publish } from '../../types/index.js';
|
|
2
3
|
import type { Props } from './Chart.js';
|
|
3
|
-
|
|
4
|
+
export { DialDirectionLabelMode } from '@rfkit/renderer';
|
|
5
|
+
export type { Props as DialProps } from './Chart.js';
|
|
6
|
+
declare const Dial: React.ForwardRefExoticComponent<Omit<Props, 'publish'> & Pick<Props, 'directionLabelMode'> & React.RefAttributes<Publish>>;
|
|
4
7
|
export default Dial;
|
package/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import './theme/library.css';
|
|
|
2
2
|
export type { TemplateDetectionRegion, TemplateDetectionSnapshot } from '@rfkit/spectrum-analyzer';
|
|
3
3
|
export { AudioWaveform, Dial, Gauge, Heatmap, IQ, LevelStream, Occupancy, Spectrum } from './charts/index.js';
|
|
4
4
|
export type { AudioWaveformPalette, AudioWaveformProps } from './charts/AudioWaveform/index.js';
|
|
5
|
+
export { DialDirectionLabelMode, type DialProps } from './charts/Dial/index.js';
|
|
5
6
|
export { AxisPlacement, ChartType, FrequencyUnit, MarkerEventType, ModuleType, OptionKey, PSType, SegmentsEvent, SeriesType, ToolbarItemType, ToolType } from './config/index.js';
|
|
6
7
|
export { type EnhancedPublish, useSafePublish, withChartPublisher } from './hooks/index.js';
|
|
7
8
|
export { setFrequencyAllocationChannelsToCache, setFrequencyAllocationToCache } from './modules/Spectrum/FrequencyAllocation/tools.js';
|