waveform-analysis 0.1.52 → 0.1.53
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 +8 -5
- package/dist/assets/{workerRuntime-Dt94jbqq.js → workerRuntime-BcYng9TR.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +553 -545
- package/dist/types/core/renderingOptions.d.ts +1 -0
- package/dist/types/core/workerSampling/protocol.d.ts +1 -0
- package/dist/types/types/chart.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/core/useWaveformRenderSampling.ts +8 -7
- package/src/core/rendering.test.ts +3 -0
- package/src/core/rendering.ts +3 -1
- package/src/core/renderingOptions.ts +9 -0
- package/src/core/renderingStrategies.ts +6 -2
- package/src/core/workerSampling/protocol.ts +1 -0
- package/src/core/workerSampling/repositorySampling.test.ts +52 -0
- package/src/core/workerSampling/repositorySupport.ts +4 -0
- package/src/types/chart.ts +2 -0
- package/src/views/WasmSamplingDemo.vue +10 -7
package/README.md
CHANGED
|
@@ -684,8 +684,9 @@ Demo 左侧“网格与轴线”支持直接切换数值或固定时间格式。
|
|
|
684
684
|
|
|
685
685
|
默认 `auto` 模式按每条系列的当前可见点数决定渲染路径:不超过 1,000 个点直接使用原始
|
|
686
686
|
可视点;超过 1,000 个点时,组件将当前页面的可见系列合并为一次 Web Worker 请求,并在
|
|
687
|
-
Worker 内通过 WASM
|
|
688
|
-
最多渲染 4
|
|
687
|
+
Worker 内通过 WASM 执行保峰采样。默认采样数量由图框宽度和每像素最大点数控制,默认每个像素
|
|
688
|
+
最多渲染 4 个保峰点。多通道场景可通过 `sampling.maxPointCount` 设定每条曲线的固定目标数量;
|
|
689
|
+
设置后会优先于像素密度。可按业务调整:
|
|
689
690
|
|
|
690
691
|
```vue
|
|
691
692
|
<WaveformChart
|
|
@@ -708,8 +709,9 @@ Worker 内通过 WASM 执行保峰采样。采样数量仍由图框宽度和每
|
|
|
708
709
|
|
|
709
710
|
`rendering.sampling` 控制 Worker/WASM 渲染路径。默认模式为 `auto`,其单系列可见点阈值为
|
|
710
711
|
`1_000`,默认策略为 `peak`。`wasm` 强制发起 Worker+WASM 请求,不受阈值影响;`raw` 完全绕过
|
|
711
|
-
Worker
|
|
712
|
-
`
|
|
712
|
+
Worker 和采样,直接渲染当前可见原始点。`sampling.maxPointCount` 用于每条线的固定采样数量,
|
|
713
|
+
`sampling.maxPointsPerPixel` 用于按宽度自适应;两者同时存在时固定数量优先。嵌套的
|
|
714
|
+
`sampling.maxPointsPerPixel` 优先于旧的 `rendering.maxPointsPerPixel`。未指定 `sampling.mode` 时,旧的 `downsample: false` 映射为
|
|
713
715
|
`raw`,`downsample: true` 映射为 `auto`。
|
|
714
716
|
|
|
715
717
|
```ts
|
|
@@ -719,6 +721,7 @@ rendering: {
|
|
|
719
721
|
autoThreshold: 1_000,
|
|
720
722
|
autoHysteresis: 0,
|
|
721
723
|
strategy: 'peak',
|
|
724
|
+
maxPointCount: 1_000,
|
|
722
725
|
maxPointsPerPixel: 4,
|
|
723
726
|
rawPointLimit: 100_000,
|
|
724
727
|
wasmFailureFallback: 'error',
|
|
@@ -852,7 +855,7 @@ Worker 的 JavaScript 回退后端和 Rust/WASM 后端都按需建立多分辨
|
|
|
852
855
|
同步释放其索引与缓存项。`sampling-complete.cacheHit` 只在 Worker 实际返回该缓存项时为 `true`。
|
|
853
856
|
|
|
854
857
|
演示可在 `#/wasm-sampling` 打开。该路由生成 10 条各 100,000 点的 `Float32Array` 通道,可切换
|
|
855
|
-
`auto` / `wasm` / `raw
|
|
858
|
+
`auto` / `wasm` / `raw`,所有采样策略、自动阈值和每条线最大渲染点数;右侧表格显示每个系列的真实后端、
|
|
856
859
|
源点/可见点/渲染点、耗时和缓存命中状态。
|
|
857
860
|
|
|
858
861
|
库产物会把 WASM 数据内联到 Worker 运行时,消费者无需额外复制 `.wasm` 文件。严格 CSP 部署
|