waveform-analysis 0.1.58 → 0.1.60
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 -6
- package/dist/index.cjs +1 -1
- package/dist/index.js +894 -817
- package/dist/types/components/WaveformChart.vue.d.ts +2 -0
- package/dist/types/components/core/layout.d.ts +9 -2
- package/dist/types/components/core/useWaveformChartLifecycle.d.ts +1 -2
- package/dist/types/components/core/waveformChartTypes.d.ts +2 -1
- package/dist/types/components/core/yAxisLayoutMetrics.d.ts +10 -0
- package/dist/types/components/data/types.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/interaction/useWaveformZoom.d.ts +2 -1
- package/dist/types/components/interaction/zoomEventPayload.d.ts +7 -0
- package/dist/types/core/rendering.d.ts +1 -1
- package/dist/types/core/renderingOptions.d.ts +1 -1
- package/dist/types/core/wasmSampling.d.ts +1 -1
- package/dist/types/core/workerSampling/multiresolution.d.ts +1 -1
- package/dist/types/core/workerSampling/protocol.d.ts +1 -1
- package/dist/types/core/workerSampling/repositoryDataset.d.ts +1 -1
- package/dist/types/core/workerSampling/repositorySupport.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/chart.d.ts +8 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/geometry.d.ts +1 -1
- package/dist/types/wasm/waveform_sampling_wasm.d.ts +74 -0
- package/dist/types/wasm/waveform_sampling_wasm_bg.wasm.d.ts +19 -0
- package/package.json +5 -4
- package/src/components/core/layout.test.ts +24 -0
- package/src/components/core/layout.ts +75 -13
- package/src/components/core/trackLayoutBuilder.ts +7 -13
- package/src/components/core/useWaveformChartController.ts +6 -1
- package/src/components/core/useWaveformChartLifecycle.ts +15 -9
- package/src/components/core/useWaveformLayout.ts +30 -58
- package/src/components/core/waveformChartTypes.ts +2 -0
- package/src/components/core/yAxisLayoutMetrics.ts +75 -0
- package/src/components/core/yAxisSlotLayout.test.ts +37 -1
- package/src/components/data/types.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/components/interaction/useWaveformViewport.ts +2 -0
- package/src/components/interaction/useWaveformZoom.ts +58 -61
- package/src/components/interaction/zoomEventPayload.ts +88 -0
- package/src/components/rendering/WaveformTrackAxes.vue +8 -4
- package/src/components/waveformChartCases/layoutAndDomains.test.ts +23 -24
- package/src/components/waveformChartCases/yAxisLayout.test.ts +103 -0
- package/src/components/waveformChartCases/zoomIntentAndDataRebind.test.ts +213 -0
- package/src/core/rendering.ts +1 -1
- package/src/core/renderingOptions.ts +1 -1
- package/src/core/workerSampling/multiresolution.ts +1 -1
- package/src/core/workerSampling/protocol.ts +1 -1
- package/src/core/workerSampling/repository.ts +1 -1
- package/src/core/workerSampling/repositoryDataset.ts +1 -1
- package/src/core/workerSampling/repositorySupport.ts +1 -1
- package/src/index.ts +1 -0
- package/src/types/chart.ts +9 -0
- package/src/types/index.ts +1 -0
- package/src/utils/geometry.ts +1 -1
package/README.md
CHANGED
|
@@ -275,8 +275,9 @@ Y 轴会独立计算:
|
|
|
275
275
|
组件支持 Plotly 风格的矩形框选缩放:在 zoom 模式下按住鼠标左键拖拽,松开后同时缩放
|
|
276
276
|
X/Y 轴;设置 `pannable` 后,指针位于图表内时按住空格键拖拽可平移当前视口。
|
|
277
277
|
鼠标滚轮可放大和缩小,双击恢复完整视口。
|
|
278
|
-
|
|
279
|
-
`
|
|
278
|
+
组件会在真实滚轮或框选确定目标范围时同步触发 `zoom-intent`,可立即取消过时请求并启动
|
|
279
|
+
新请求;缩放结束后仍会触发 `zoom-end`。独立分图模式还会包含 `trackIndex` 和稳定的
|
|
280
|
+
`seriesIds`。
|
|
280
281
|
|
|
281
282
|
```vue
|
|
282
283
|
<WaveformChart
|
|
@@ -285,14 +286,15 @@ X/Y 轴;设置 `pannable` 后,指针位于图表内时按住空格键拖拽
|
|
|
285
286
|
:initial-x-domain="initialDomain"
|
|
286
287
|
:min-zoom-span="initialDomainSpan / 40"
|
|
287
288
|
pannable
|
|
288
|
-
@zoom-
|
|
289
|
+
@zoom-intent="loadVisibleData"
|
|
289
290
|
@zoom-reset="restoreInitialData"
|
|
290
291
|
/>
|
|
291
292
|
```
|
|
292
293
|
|
|
293
|
-
`zoom-change`
|
|
294
|
-
`zoom-
|
|
295
|
-
|
|
294
|
+
`zoom-change` 会在滚轮、框选和平移过程中触发,适合更新外部状态。后端按视口回填数据时,
|
|
295
|
+
应使用 `zoom-intent` 使每次用户意图立即使旧请求失效;`zoom-end` 适合只在手势完成后执行
|
|
296
|
+
的工作。标注数据应由父组件独立持有,替换波形数据时不要清空标注,组件会根据当前数据域
|
|
297
|
+
自动隐藏或恢复对应标注。
|
|
296
298
|
|
|
297
299
|
`zoom-end.gesture` 用于区分 `wheel` 和 `box`。单轨道 payload 使用 `yStart/yEnd`;共享
|
|
298
300
|
X 轴且包含多个轨道时使用按稳定 track ID 索引的 `yRanges`。平移不会触发 `zoom-end`,
|
|
@@ -821,6 +823,7 @@ X 轴刻度和左右端点先按 `timeUnit` 转换为秒或毫秒,再显示为
|
|
|
821
823
|
| 事件 | 说明 |
|
|
822
824
|
| --------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
823
825
|
| `point-hover` | 当前最近点变化时触发,离开图表时传入 `null` |
|
|
826
|
+
| `zoom-intent` | 真实滚轮或框选确定目标范围时同步触发,参数含端点和 `gesture` |
|
|
824
827
|
| `zoom-change` | 缩放过程中触发,参数为 `[start, end]` |
|
|
825
828
|
| `zoom-end` | 滚轮或框选结束后触发;`gesture` 区分二者,独立模式附带轨道信息 |
|
|
826
829
|
| `zoom-reset` | 双击重置视口时触发;独立模式 payload 标识目标图框 |
|