feat: 优化波形渲染性能与交互
All checks were successful
Package component / package (push) Successful in 5m56s

This commit is contained in:
李启源
2026-07-22 16:36:48 +08:00
parent 356f55c9fd
commit 5b0ba7413e
35 changed files with 8208 additions and 246 deletions

View File

@@ -7,7 +7,7 @@ import {
type SymbolType,
} from 'd3'
import type { WaveformLineType, WaveformPointType } from '../../types'
import type { WaveformLineStyle, WaveformLineType, WaveformPointType } from '../../types'
const LEGEND_SWATCH_CENTER_X = 13
const LEGEND_ERROR_BAR_TOP = 2
@@ -82,6 +82,12 @@ export function waveformLegendLinePath(lineType: WaveformLineType): string | nul
return 'M1 8H25'
}
export function waveformLineDasharray(lineStyle: WaveformLineStyle): string | undefined {
if (lineStyle === 'dashed') return '8 5'
if (lineStyle === 'dash-dot') return '8 5 1.5 5'
return undefined
}
export function waveformLegendErrorBarPath(capWidth: number): string {
const resolvedCapWidth =
Number.isFinite(capWidth) && capWidth > 0