waveform-analysis 0.1.35 → 0.1.37
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 +9 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +909 -816
- package/dist/style.css +1 -1
- package/dist/types/components/annotation/WaveformAnnotationEditor.vue.d.ts +4 -0
- package/dist/types/components/annotation/useWaveformChartAnnotations.d.ts +3 -1
- package/dist/types/components/core/constants.d.ts +3 -1
- package/dist/types/components/core/types.d.ts +2 -0
- package/dist/types/components/core/useWaveformChartController.d.ts +2 -0
- package/dist/types/components/interaction/WaveformTooltip.vue.d.ts +1 -0
- package/dist/types/types/data.d.ts +3 -0
- package/package.json +1 -1
- package/src/App.test.ts +3 -2
- package/src/App.vue +1 -1
- package/src/components/WaveformChartView.vue +10 -1
- package/src/components/annotation/WaveformAnnotationEditor.css +35 -104
- package/src/components/annotation/WaveformAnnotationEditor.vue +87 -37
- package/src/components/annotation/components.test.ts +134 -20
- package/src/components/annotation/markup.test.ts +18 -2
- package/src/components/annotation/markup.ts +33 -0
- package/src/components/annotation/useWaveformChartAnnotations.ts +53 -12
- package/src/components/core/constants.test.ts +29 -0
- package/src/components/core/constants.ts +31 -9
- package/src/components/core/types.ts +2 -0
- package/src/components/interaction/WaveformTooltip.test.ts +17 -9
- package/src/components/interaction/WaveformTooltip.vue +41 -45
- package/src/components/interaction/useWaveformHover.ts +1 -0
- package/src/components/waveformChartCases/annotationEditingAndReprojection.test.ts +13 -3
- package/src/components/waveformChartCases/compactAndSharedHover.test.ts +4 -4
- package/src/components/waveformChartCases/dataAndHoverPerformance.test.ts +42 -2
- package/src/components/waveformChartCases/interactionAndAnnotationCreation.test.ts +24 -14
- package/src/components/waveformChartCases/legendVisibility.test.ts +10 -2
- package/src/components/waveformChartCases/multiAxisAndPagination.test.ts +1 -1
- package/src/components/waveformChartCases/presentationMode.test.ts +10 -2
- package/src/components/waveformChartCases/renderingStyles.test.ts +1 -1
- package/src/components/waveformChartCases/xDomainStrategy.test.ts +60 -0
- package/src/core/data.test.ts +22 -0
- package/src/core/data.ts +1 -0
- package/src/data/simulatedWaveforms.test.ts +1 -0
- package/src/data/simulatedWaveforms.ts +7 -1
- package/src/types/data.ts +3 -0
- package/src/views/FixedYDomainDemo.vue +2 -0
package/README.md
CHANGED
|
@@ -109,8 +109,8 @@ const data = ref<WaveformData>({
|
|
|
109
109
|
| `pannable` | `boolean` | `false` | 空格拖拽平移开关 |
|
|
110
110
|
| `minZoomSpan` | `number` | 未设置 | 最小缩放跨度,使用原始 X 数据单位 |
|
|
111
111
|
| `minVisiblePoints` | `number` | `0` | 缩放后至少保留的不同 X 坐标数 |
|
|
112
|
-
| `initialXDomain` | `[number, number]` | 未设置 | 所有图框的初始 X
|
|
113
|
-
| `initialXDomains` | `Record<string, [number, number]>` | 未设置 | 按 track/series ID
|
|
112
|
+
| `initialXDomain` | `[number, number]` | 未设置 | 所有图框的初始 X 范围(可超出数据,空白显示) |
|
|
113
|
+
| `initialXDomains` | `Record<string, [number, number]>` | 未设置 | 按 track/series ID 配置初始范围(可超出数据) |
|
|
114
114
|
| `xDomainStrategy` | `WaveformXDomainStrategy` | `{ type: 'data' }` | 自动 X 轴视口范围策略 |
|
|
115
115
|
| `yDomain` | `[number, number]` | 未设置 | 所有波形的固定 Y 轴范围 |
|
|
116
116
|
| `yDomains` | `Record<string, [number, number]>` | 未设置 | 按 track/series ID 配置固定范围 |
|
|
@@ -163,8 +163,8 @@ const points: WaveformData = {
|
|
|
163
163
|
const chartData: WaveformData = {
|
|
164
164
|
kind: 'series',
|
|
165
165
|
series: [
|
|
166
|
-
{ id: 'ch-a', name: '通道 A', trackId: 'group-1', data: samples },
|
|
167
|
-
{ id: 'ch-b', name: '通道 B', trackId: 'group-1', data: points },
|
|
166
|
+
{ id: 'ch-a', shotNo: '13300', name: '通道 A', trackId: 'group-1', data: samples },
|
|
167
|
+
{ id: 'ch-b', shotNo: '13300', name: '通道 B', trackId: 'group-1', data: points },
|
|
168
168
|
],
|
|
169
169
|
}
|
|
170
170
|
```
|
|
@@ -247,7 +247,7 @@ X 轴且包含多个轨道时使用按稳定 track ID 索引的 `yRanges`。平
|
|
|
247
247
|
调用方应处理加载失败的情况(网络错误、超时等),并保持旧数据或显示加载状态。生产环境建议使用
|
|
248
248
|
`AbortController` 取消过时的请求。
|
|
249
249
|
|
|
250
|
-
`initialXDomain`
|
|
250
|
+
`initialXDomain` 固定首次及重置时的 X 轴视口范围,不要将它改成后端返回的当前窗口;范围可以超出数据的实际时间,超出部分保留空白。独立图框有不同时间范围时,可通过
|
|
251
251
|
`initialXDomains` 按 track ID 或 series ID 分别配置。`minZoomSpan` 使用原始 X 数据单位,
|
|
252
252
|
可防止每次区间数据回填后重新累计放大。双击图框会
|
|
253
253
|
重置组件内部缩放并触发 `zoom-reset`;调用方应在事件中取消区间请求并恢复首次完整数据。
|
|
@@ -281,6 +281,9 @@ X 轴且包含多个轨道时使用按稳定 track ID 索引的 `yRanges`。平
|
|
|
281
281
|
多通道数据应为每个 `WaveformSeries` 提供稳定的 `id`。内部时间坐标始终使用秒,
|
|
282
282
|
`timeUnit` 只控制坐标轴和 tooltip 的显示单位。
|
|
283
283
|
|
|
284
|
+
Tooltip 每个系列按 `炮号:通道 (x:值 y:值)` 格式显示。`WaveformSeries.shotNo` 为空或未提供时,
|
|
285
|
+
炮号显示为“未配置炮号”;Tooltip 不显示单位和误差附加文本。
|
|
286
|
+
|
|
284
287
|
### 线型、点型与误差棒
|
|
285
288
|
|
|
286
289
|
每条序列可以独立设置连线方式、数据点符号和误差棒:
|
|
@@ -288,6 +291,7 @@ X 轴且包含多个轨道时使用按稳定 track ID 索引的 `yRanges`。平
|
|
|
288
291
|
```ts
|
|
289
292
|
const series = {
|
|
290
293
|
id: 'temperature',
|
|
294
|
+
shotNo: '13300',
|
|
291
295
|
name: '温度',
|
|
292
296
|
lineType: 'step-end',
|
|
293
297
|
lineStyle: 'dashed',
|