waveform-analysis 0.1.40 → 0.1.41
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 +13 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +454 -458
- package/dist/types/components/core/layout.d.ts +4 -3
- package/dist/types/components/core/trackLayoutBuilder.d.ts +1 -0
- package/dist/types/types/chart.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/core/fixedYDomainLayout.test.ts +75 -5
- package/src/components/core/layout.test.ts +10 -2
- package/src/components/core/layout.ts +21 -8
- package/src/components/core/trackLayoutBuilder.ts +13 -8
- package/src/components/core/useWaveformLayout.ts +9 -2
- package/src/components/waveformChartCases/compactAndSharedHover.test.ts +2 -2
- package/src/components/waveformChartCases/dataLifecycle.test.ts +2 -2
- package/src/components/waveformChartCases/layoutAndDomains.test.ts +23 -3
- package/src/types/chart.ts +2 -0
package/README.md
CHANGED
|
@@ -115,7 +115,7 @@ const data = ref<WaveformData>({
|
|
|
115
115
|
| `yDomain` | `[number, number]` | 未设置 | 所有波形的固定 Y 轴范围 |
|
|
116
116
|
| `yDomains` | `Record<string, [number, number]>` | 未设置 | 按 track/series ID 配置固定范围 |
|
|
117
117
|
| `grid` | `WaveformGridOptions` | `{ rowCount: 2, columnCount: 1, showPagination: true }` | 网格和分页 |
|
|
118
|
-
| `axes` | `WaveformAxesOptions` | 轴线均显示 | X/Y
|
|
118
|
+
| `axes` | `WaveformAxesOptions` | 轴线均显示 | X/Y 轴基线、Y 轴分割数与 X 轴 label 格式化 |
|
|
119
119
|
| `rendering` | `WaveformRenderingOptions` | `{}` | 降采样与点/误差棒间距 |
|
|
120
120
|
| `title` / `legend` / `frameStyle` | 对应公开类型 | 未设置 | 标题、图例和图框样式 |
|
|
121
121
|
| `frameNumber` | `string \| number` | 未设置 | 图框水印内容 |
|
|
@@ -208,7 +208,8 @@ import 'waveform-analysis/style.css'
|
|
|
208
208
|
|
|
209
209
|
范围优先级为 `trackId` 配置、`seriesId` 配置、全局 `yDomain`、数据自动范围。上下限必须
|
|
210
210
|
是两个有限且不相等的数字;倒序范围会自动调整为升序,无效配置会回退到下一优先级。
|
|
211
|
-
|
|
211
|
+
固定范围作为 Y 轴刻度算法的初始范围;轴会按漂亮步长经过 D3 的 `nice()` 扩展,确保主刻度
|
|
212
|
+
等间距。原始数据和传入的范围值不会被修改。
|
|
212
213
|
|
|
213
214
|
单值轴叠加模式会合并同一根轴上所有可见系列的有效范围;多值轴模式按系列分别使用配置,
|
|
214
215
|
超过四根轴后复用第 4 根轴的系列会取范围并集。隐藏系列不参与公共范围合并。
|
|
@@ -216,6 +217,16 @@ import 'waveform-analysis/style.css'
|
|
|
216
217
|
固定范围存在时,对应图框的 Y 轴不会被平移或视口重置覆盖;X 轴缩放、平移和重置保持原有
|
|
217
218
|
行为。运行时更新或移除 `yDomain` / `yDomains` 会立即重新布局,移除后恢复自动范围。
|
|
218
219
|
|
|
220
|
+
### Y 轴自动等分
|
|
221
|
+
|
|
222
|
+
Y 轴默认显示 5 个主刻度(包含上下端点),并使用类似 ECharts 的 `1 / 2 / 5 × 10ⁿ` 漂亮
|
|
223
|
+
步长,保证主刻度之间数值等间距。可以通过 `axes.y.splitNumber` 指定主刻度总数;每条
|
|
224
|
+
Y 轴会独立计算:
|
|
225
|
+
|
|
226
|
+
```vue
|
|
227
|
+
<WaveformChart :data="chartData" :axes="{ y: { splitNumber: 5 } }" />
|
|
228
|
+
```
|
|
229
|
+
|
|
219
230
|
### 缩放后按可视区间加载数据
|
|
220
231
|
|
|
221
232
|
组件支持 Plotly 风格的矩形框选缩放:在 zoom 模式下按住鼠标左键拖拽,松开后同时缩放
|