waveform-analysis 0.1.57 → 0.1.59
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 +12 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +752 -680
- package/dist/types/components/WaveformChart.vue.d.ts +2 -0
- package/dist/types/components/core/grid.d.ts +3 -0
- package/dist/types/components/core/trackPagination.d.ts +4 -0
- package/dist/types/components/core/useWaveformChartController.d.ts +3 -1
- package/dist/types/components/core/useWaveformChartLifecycle.d.ts +1 -2
- package/dist/types/components/core/useWaveformLayout.d.ts +2 -1
- package/dist/types/components/core/waveformChartTypes.d.ts +4 -1
- 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/WaveformChartView.vue +3 -3
- package/src/components/core/grid.test.ts +3 -0
- package/src/components/core/grid.ts +4 -0
- package/src/components/core/trackPagination.ts +40 -0
- package/src/components/core/useWaveformChartController.ts +6 -1
- package/src/components/core/useWaveformChartLifecycle.ts +15 -9
- package/src/components/core/useWaveformLayout.ts +12 -9
- package/src/components/core/waveformChartTypes.ts +4 -0
- 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/waveformChartCases/trackOrder.test.ts +62 -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
|
@@ -120,6 +120,7 @@ const data = ref<WaveformData>({
|
|
|
120
120
|
| `rendering` | `WaveformRenderingOptions` | `{}` | 降采样与点/误差棒间距 |
|
|
121
121
|
| `title` / `legend` / `frameStyle` | 对应公开类型 | 未设置 | 标题、图例和图框样式 |
|
|
122
122
|
| `frameNumber` | `string \| number` | 未设置 | 图框水印内容 |
|
|
123
|
+
| `frameNumbers` | `Record<string, string \| number>` | 未设置 | 按 `trackId` 覆盖图框水印内容 |
|
|
123
124
|
| `zeroLine` | `WaveformZeroLineOptions` | `{ visible: false }` | 零值参考线显隐与样式 |
|
|
124
125
|
| `cleanView` | `boolean` | `false` | 保留波形、图框和刻度的净图模式 |
|
|
125
126
|
| `presentationMode` | `boolean` | `false` | 禁用绘图区交互的展示模式 |
|
|
@@ -197,7 +198,8 @@ const chartData: WaveformData = {
|
|
|
197
198
|
```
|
|
198
199
|
|
|
199
200
|
需要让图框在合并或暂时没有数据时仍保持位置和分页,可传入 `grid.trackOrder`。列表中的
|
|
200
|
-
`trackId`
|
|
201
|
+
`trackId` 会按给定顺序占用图框;没有对应系列的项显示为空图框,数据中未列出的轨道会追加在末尾。传入
|
|
202
|
+
`hideEmptyTracks: true` 可省略空图框,同时按稳定 `trackId` 保留图例、交互和水印映射:
|
|
201
203
|
|
|
202
204
|
```vue
|
|
203
205
|
<WaveformChart :data="chartData" :grid="{ rowCount: 2, trackOrder: ['ch-a', 'ch-b', 'ch-c'] }" />
|
|
@@ -273,8 +275,9 @@ Y 轴会独立计算:
|
|
|
273
275
|
组件支持 Plotly 风格的矩形框选缩放:在 zoom 模式下按住鼠标左键拖拽,松开后同时缩放
|
|
274
276
|
X/Y 轴;设置 `pannable` 后,指针位于图表内时按住空格键拖拽可平移当前视口。
|
|
275
277
|
鼠标滚轮可放大和缩小,双击恢复完整视口。
|
|
276
|
-
|
|
277
|
-
`
|
|
278
|
+
组件会在真实滚轮或框选确定目标范围时同步触发 `zoom-intent`,可立即取消过时请求并启动
|
|
279
|
+
新请求;缩放结束后仍会触发 `zoom-end`。独立分图模式还会包含 `trackIndex` 和稳定的
|
|
280
|
+
`seriesIds`。
|
|
278
281
|
|
|
279
282
|
```vue
|
|
280
283
|
<WaveformChart
|
|
@@ -283,14 +286,15 @@ X/Y 轴;设置 `pannable` 后,指针位于图表内时按住空格键拖拽
|
|
|
283
286
|
:initial-x-domain="initialDomain"
|
|
284
287
|
:min-zoom-span="initialDomainSpan / 40"
|
|
285
288
|
pannable
|
|
286
|
-
@zoom-
|
|
289
|
+
@zoom-intent="loadVisibleData"
|
|
287
290
|
@zoom-reset="restoreInitialData"
|
|
288
291
|
/>
|
|
289
292
|
```
|
|
290
293
|
|
|
291
|
-
`zoom-change`
|
|
292
|
-
`zoom-
|
|
293
|
-
|
|
294
|
+
`zoom-change` 会在滚轮、框选和平移过程中触发,适合更新外部状态。后端按视口回填数据时,
|
|
295
|
+
应使用 `zoom-intent` 使每次用户意图立即使旧请求失效;`zoom-end` 适合只在手势完成后执行
|
|
296
|
+
的工作。标注数据应由父组件独立持有,替换波形数据时不要清空标注,组件会根据当前数据域
|
|
297
|
+
自动隐藏或恢复对应标注。
|
|
294
298
|
|
|
295
299
|
`zoom-end.gesture` 用于区分 `wheel` 和 `box`。单轨道 payload 使用 `yStart/yEnd`;共享
|
|
296
300
|
X 轴且包含多个轨道时使用按稳定 track ID 索引的 `yRanges`。平移不会触发 `zoom-end`,
|
|
@@ -819,6 +823,7 @@ X 轴刻度和左右端点先按 `timeUnit` 转换为秒或毫秒,再显示为
|
|
|
819
823
|
| 事件 | 说明 |
|
|
820
824
|
| --------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
821
825
|
| `point-hover` | 当前最近点变化时触发,离开图表时传入 `null` |
|
|
826
|
+
| `zoom-intent` | 真实滚轮或框选确定目标范围时同步触发,参数含端点和 `gesture` |
|
|
822
827
|
| `zoom-change` | 缩放过程中触发,参数为 `[start, end]` |
|
|
823
828
|
| `zoom-end` | 滚轮或框选结束后触发;`gesture` 区分二者,独立模式附带轨道信息 |
|
|
824
829
|
| `zoom-reset` | 双击重置视口时触发;独立模式 payload 标识目标图框 |
|