waveform-analysis 0.1.74 → 0.1.75

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.
Files changed (97) hide show
  1. package/README.md +246 -39
  2. package/dist/assets/workerRuntime-BJiRmIZD.js +2446 -0
  3. package/dist/index.cjs +1 -2
  4. package/dist/index.js +1 -7119
  5. package/dist/style.css +1 -1
  6. package/dist/types/animation/WaveformAnimationController.d.ts +30 -0
  7. package/dist/types/animation/core/Animation.d.ts +13 -0
  8. package/dist/types/animation/core/Animator.d.ts +23 -0
  9. package/dist/types/animation/core/easing.d.ts +3 -0
  10. package/dist/types/animation/core/errors.d.ts +4 -0
  11. package/dist/types/animation/core/handle.d.ts +7 -0
  12. package/dist/types/animation/core/owner.d.ts +3 -0
  13. package/dist/types/animation/core/propertyGroups.d.ts +17 -0
  14. package/dist/types/animation/core/task.d.ts +29 -0
  15. package/dist/types/animation/core/types.d.ts +74 -0
  16. package/dist/types/animation/core/validation.d.ts +30 -0
  17. package/dist/types/animation/core/values.d.ts +8 -0
  18. package/dist/types/animation/presets/annotation.d.ts +4 -0
  19. package/dist/types/animation/presets/lineDrawing.d.ts +7 -0
  20. package/dist/types/animation/presets/shared.d.ts +14 -0
  21. package/dist/types/animation/presets/transitions.d.ts +4 -0
  22. package/dist/types/animation/types.d.ts +84 -0
  23. package/dist/types/components/WaveformChart.vue.d.ts +3 -2
  24. package/dist/types/components/animation/annotationPresentation.d.ts +17 -0
  25. package/dist/types/components/animation/chartExportVersion.d.ts +2 -0
  26. package/dist/types/components/animation/config.d.ts +31 -0
  27. package/dist/types/components/animation/context.d.ts +20 -0
  28. package/dist/types/components/animation/geometry.d.ts +10 -0
  29. package/dist/types/components/animation/paginationPresentation.d.ts +13 -0
  30. package/dist/types/components/animation/pathBuffer.d.ts +4 -0
  31. package/dist/types/components/animation/trackPresentation.d.ts +35 -0
  32. package/dist/types/components/animation/useWaveformAnimations.d.ts +27 -0
  33. package/dist/types/components/annotation/WaveformAnnotationContextMenu.vue.d.ts +2 -2
  34. package/dist/types/components/annotation/types.d.ts +7 -0
  35. package/dist/types/components/controls/useChartImageExport.d.ts +2 -0
  36. package/dist/types/components/core/types.d.ts +8 -0
  37. package/dist/types/components/core/useWaveformChartController.d.ts +25 -0
  38. package/dist/types/components/core/useWaveformRenderSampling.d.ts +2 -0
  39. package/dist/types/components/core/waveformChartTypes.d.ts +2 -1
  40. package/dist/types/components/rendering/WaveformSeriesLayer.vue.d.ts +1 -0
  41. package/dist/types/components/rendering/WaveformTrack.vue.d.ts +4 -3
  42. package/dist/types/components/rendering/updateAxis.d.ts +5 -0
  43. package/dist/types/components/rendering/updateGrid.d.ts +3 -0
  44. package/dist/types/components/rendering/yAxisTickVisibility.d.ts +2 -0
  45. package/dist/types/components/utils/assignElement.d.ts +2 -0
  46. package/dist/types/index.d.ts +9 -0
  47. package/dist/types/views/AnimationDemo.vue.d.ts +3 -0
  48. package/package.json +5 -2
  49. package/src/DemoRouterApp.vue +1 -0
  50. package/src/animation/WaveformAnimationController.ts +328 -0
  51. package/src/animation/core/Animation.ts +37 -0
  52. package/src/animation/core/Animator.ts +200 -0
  53. package/src/animation/core/easing.ts +74 -0
  54. package/src/animation/core/errors.ts +24 -0
  55. package/src/animation/core/handle.ts +34 -0
  56. package/src/animation/core/owner.ts +9 -0
  57. package/src/animation/core/propertyGroups.ts +143 -0
  58. package/src/animation/core/task.ts +153 -0
  59. package/src/animation/core/types.ts +81 -0
  60. package/src/animation/core/validation.ts +173 -0
  61. package/src/animation/core/values.ts +38 -0
  62. package/src/animation/presets/annotation.ts +66 -0
  63. package/src/animation/presets/lineDrawing.ts +51 -0
  64. package/src/animation/presets/shared.ts +58 -0
  65. package/src/animation/presets/transitions.ts +77 -0
  66. package/src/animation/types.ts +81 -0
  67. package/src/components/WaveformChart.vue +1 -0
  68. package/src/components/WaveformChartView.vue +13 -4
  69. package/src/components/animation/annotationPresentation.ts +145 -0
  70. package/src/components/animation/chartExportVersion.ts +5 -0
  71. package/src/components/animation/config.ts +87 -0
  72. package/src/components/animation/context.ts +56 -0
  73. package/src/components/animation/geometry.ts +148 -0
  74. package/src/components/animation/paginationPresentation.ts +114 -0
  75. package/src/components/animation/pathBuffer.ts +61 -0
  76. package/src/components/animation/trackPresentation.ts +172 -0
  77. package/src/components/animation/useWaveformAnimations.ts +420 -0
  78. package/src/components/annotation/WaveformAnnotationLayer.vue +43 -30
  79. package/src/components/annotation/types.ts +3 -0
  80. package/src/components/controls/useChartImageExport.ts +4 -0
  81. package/src/components/core/trackLayoutBuilder.ts +9 -18
  82. package/src/components/core/types.ts +4 -0
  83. package/src/components/core/useWaveformChartController.ts +24 -20
  84. package/src/components/core/useWaveformRenderSampling.ts +23 -1
  85. package/src/components/core/waveformChartTypes.ts +2 -1
  86. package/src/components/rendering/WaveformSeriesLayer.vue +13 -1
  87. package/src/components/rendering/WaveformTrack.vue +6 -1
  88. package/src/components/rendering/WaveformTrackAxes.vue +64 -51
  89. package/src/components/rendering/WaveformTrackBackdrop.vue +35 -49
  90. package/src/components/rendering/updateAxis.ts +57 -0
  91. package/src/components/rendering/updateGrid.ts +42 -0
  92. package/src/components/rendering/yAxisTickVisibility.ts +45 -18
  93. package/src/components/utils/assignElement.ts +7 -0
  94. package/src/index.ts +52 -0
  95. package/src/router.ts +1 -0
  96. package/src/views/AnimationDemo.vue +129 -0
  97. package/dist/assets/workerRuntime-5p-EI-GL.js +0 -1
@@ -84,8 +84,10 @@ declare const __VLS_export: import("vue").DefineComponent<WaveformChartProps, {
84
84
  minVisiblePoints: number;
85
85
  xDomainStrategy: import("..").WaveformXDomainStrategy;
86
86
  timeUnit: "s" | "ms";
87
+ frameNumber: string | number;
87
88
  annotations: import("..").WaveformAnnotation[];
88
89
  annotationsVisible: boolean;
90
+ interactionMode: import("..").WaveformInteractionMode;
89
91
  grid: import("..").WaveformGridOptions;
90
92
  rendering: import("..").WaveformRenderingOptions;
91
93
  plotMargin: import("..").WaveformPlotMargin;
@@ -94,8 +96,7 @@ declare const __VLS_export: import("vue").DefineComponent<WaveformChartProps, {
94
96
  cleanView: boolean;
95
97
  presentationMode: boolean;
96
98
  zeroLine: import("..").WaveformZeroLineOptions;
97
- frameNumber: string | number;
98
- interactionMode: import("..").WaveformInteractionMode;
99
+ animationEnabled: boolean;
99
100
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
100
101
  declare const _default: typeof __VLS_export;
101
102
  export default _default;
@@ -0,0 +1,17 @@
1
+ import type { RenderedAnnotation } from '../annotation/types';
2
+ import type { ResolvedAnimationProps } from './config';
3
+ import type { WaveformAnnotation } from '@/types';
4
+ import type { AnnotationAnimationState } from '@/animation/types';
5
+ import { WaveformAnimationController } from '@/animation/WaveformAnimationController';
6
+ export interface PresentedAnnotation extends RenderedAnnotation {
7
+ animationStyle?: AnnotationAnimationState;
8
+ leaving?: boolean;
9
+ seriesOpacity?: number;
10
+ }
11
+ export declare function createAnnotationPresentation(controller: WaveformAnimationController, invalidate: () => void): {
12
+ reconcile(rendered: RenderedAnnotation[], controlled: WaveformAnnotation[], config: ResolvedAnimationProps["animationAnnotation"], enabled: boolean, waitingSeries: Set<string>): void;
13
+ release(seriesId?: string): void;
14
+ finish(rendered: RenderedAnnotation[]): void;
15
+ project(rendered: RenderedAnnotation[], seriesOpacity: Map<string, number>): PresentedAnnotation[];
16
+ clear(): void;
17
+ };
@@ -0,0 +1,2 @@
1
+ import type { ResolvedWaveformChartProps } from '../core/waveformChartTypes';
2
+ export declare function chartExportVersion(props: ResolvedWaveformChartProps, state: object): unknown[];
@@ -0,0 +1,31 @@
1
+ import type { WaveformAnimationProps, AnnotationAnimationType, LineDrawingDirection } from '@/animation/types';
2
+ export declare function resolveAnimationProps(props: WaveformAnimationProps, warn?: (message: string) => void): {
3
+ animationEnabled: boolean;
4
+ animationThreshold: number;
5
+ animation: {
6
+ delay: number;
7
+ staggerDelay: number;
8
+ direction: LineDrawingDirection;
9
+ enabled: boolean;
10
+ duration: number;
11
+ easing: NonNullable<import("../..").EasingType | import("../..").EasingFunction | undefined>;
12
+ onComplete: (() => void) | undefined;
13
+ onAbort: (() => void) | undefined;
14
+ };
15
+ animationUpdate: {
16
+ enabled: boolean;
17
+ duration: number;
18
+ easing: NonNullable<import("../..").EasingType | import("../..").EasingFunction | undefined>;
19
+ onComplete: (() => void) | undefined;
20
+ onAbort: (() => void) | undefined;
21
+ };
22
+ animationAnnotation: {
23
+ type: AnnotationAnimationType;
24
+ enabled: boolean;
25
+ duration: number;
26
+ easing: NonNullable<import("../..").EasingType | import("../..").EasingFunction | undefined>;
27
+ onComplete: (() => void) | undefined;
28
+ onAbort: (() => void) | undefined;
29
+ };
30
+ };
31
+ export type ResolvedAnimationProps = ReturnType<typeof resolveAnimationProps>;
@@ -0,0 +1,20 @@
1
+ import type { ComputedRef, Ref, ShallowRef } from 'vue';
2
+ import type { TrackLayout } from '../core/types';
3
+ import type { PreparedWaveformSeries } from '../core/useWaveformData';
4
+ import type { ResolvedWaveformChartProps } from '../core/waveformChartTypes';
5
+ export interface AnimationContext {
6
+ props: ResolvedWaveformChartProps;
7
+ tracks: ComputedRef<TrackLayout[]>;
8
+ currentPage: Ref<number>;
9
+ containerSize: ComputedRef<number[]>;
10
+ preparedSeries: ShallowRef<PreparedWaveformSeries[]>;
11
+ layoutReady: ComputedRef<boolean>;
12
+ innerWidth: ComputedRef<number>;
13
+ innerHeight: ComputedRef<number>;
14
+ sampling: {
15
+ state: ComputedRef<'pending' | 'success' | 'fallback' | 'error'>;
16
+ requestSignature: ComputedRef<string>;
17
+ };
18
+ }
19
+ export declare function animationLayoutSignature(context: AnimationContext): string;
20
+ export declare function wrapAnimationCommands<T extends object>(commands: T, stabilize: () => void): T;
@@ -0,0 +1,10 @@
1
+ import type { ScaleLinear } from 'd3';
2
+ import type { WaveformPoint, WaveformLineType } from '@/types';
3
+ import type { TrackSeriesPath } from '../core/types';
4
+ import type { NumericGeometry } from '@/animation/types';
5
+ /** Private presentation buffer; the source/target snapshots and business points stay immutable. */
6
+ export declare function interpolateGeometry(from: NumericGeometry, to: NumericGeometry, p: number): NumericGeometry;
7
+ export declare function generateWaveformPath(points: WaveformPoint[], type: WaveformLineType, x: ScaleLinear<number, number>, y: ScaleLinear<number, number>): string | null;
8
+ export declare function captureGeometry(path: TrackSeriesPath, x: ScaleLinear<number, number>): NumericGeometry;
9
+ export declare function projectGeometry(path: TrackSeriesPath, geometry: NumericGeometry, x: ScaleLinear<number, number>, y: ScaleLinear<number, number>): TrackSeriesPath;
10
+ export declare function compatibleGeometry(a: TrackSeriesPath, b: TrackSeriesPath, from: NumericGeometry, to: NumericGeometry): boolean;
@@ -0,0 +1,13 @@
1
+ import { type ComputedRef } from 'vue';
2
+ import type { AnimationContext } from './context';
3
+ import type { ResolvedAnimationProps } from './config';
4
+ import type { WaveformAnimationController } from '@/animation/WaveformAnimationController';
5
+ /** A single owner-scoped fade; it holds no old page geometry. */
6
+ export declare function createPaginationPresentation(context: AnimationContext, controller: WaveformAnimationController, config: ComputedRef<ResolvedAnimationProps>, effective: ComputedRef<boolean>, commit: () => void): {
7
+ opacity: import("vue").ShallowRef<number, number>;
8
+ reset: () => void;
9
+ cancel: () => void;
10
+ reconcile: (dataChanged: boolean) => boolean;
11
+ wrapPagination: (goToPage: (page: number) => void, count: ComputedRef<number>) => (page: number) => void;
12
+ active: () => boolean;
13
+ };
@@ -0,0 +1,4 @@
1
+ import type { ScaleLinear } from 'd3';
2
+ import type { WaveformPoint, WaveformLineType } from '@/types';
3
+ /** Stable D3 accessors/context keep their feedback across frames; storage is private to points. */
4
+ export declare function createPathBuffer(x: ScaleLinear<number, number>, y: ScaleLinear<number, number>): (points: WaveformPoint[], nextType: WaveformLineType, x: ScaleLinear<number, number>, y: ScaleLinear<number, number>) => string;
@@ -0,0 +1,35 @@
1
+ import type { TrackLayout, TrackSeriesPath } from '../core/types';
2
+ import type { WaveformAnnotation } from '@/types';
3
+ import type { NumericGeometry } from '@/animation/types';
4
+ interface AnchorValue {
5
+ seriesId: string;
6
+ annotationY: number;
7
+ x: number;
8
+ y: number;
9
+ }
10
+ interface SeriesGeometry {
11
+ path: TrackSeriesPath;
12
+ values: NumericGeometry;
13
+ old?: {
14
+ path: TrackSeriesPath;
15
+ values: NumericGeometry;
16
+ };
17
+ opacity: number;
18
+ }
19
+ export interface TrackPresentation {
20
+ target: TrackLayout;
21
+ series: Map<string, SeriesGeometry>;
22
+ xDomain: [number, number];
23
+ yDomains: [number, number][];
24
+ anchors: Map<string, AnchorValue>;
25
+ clips: Map<string, {
26
+ id: string;
27
+ x: number;
28
+ width: number;
29
+ }>;
30
+ }
31
+ export declare function staticTrack(track: TrackLayout, annotations: WaveformAnnotation[], previous?: TrackPresentation, refreshAnchors?: boolean): TrackPresentation;
32
+ export declare function hasThirdGeometry(from: TrackPresentation): boolean;
33
+ export declare function transitionTrack(from: TrackPresentation, to: TrackPresentation, p: number, terminal: boolean): TrackPresentation;
34
+ export declare function projectTrack(state: TrackPresentation): TrackLayout;
35
+ export {};
@@ -0,0 +1,27 @@
1
+ import { type AnimationContext } from './context';
2
+ export declare function useWaveformAnimations(context: AnimationContext): {
3
+ presentationTracks: import("vue").ComputedRef<import("../core").TrackLayout[]>;
4
+ presentationAnnotations: import("vue").ComputedRef<{
5
+ seriesOpacity: number;
6
+ animationStyle?: import("../..").AnnotationAnimationState;
7
+ leaving?: boolean;
8
+ annotation: import("..").WaveformAnnotation;
9
+ trackIndex: number;
10
+ anchorX: number;
11
+ anchorY: number;
12
+ placement: import("../annotation").AnnotationPlacement;
13
+ lines: string[];
14
+ box: import("../annotation").AnnotationBoxLayout;
15
+ style: {
16
+ borderColor: string;
17
+ textColor: string;
18
+ backgroundColor: string;
19
+ };
20
+ }[]>;
21
+ paginationOpacity: import("vue").ShallowRef<number, number>;
22
+ stabilizeAnimations: (event?: Event) => void;
23
+ wrap: <T extends object>(commands: T) => T;
24
+ wrapPagination: (goToPage: (page: number) => void, count: import("vue").ComputedRef<number>) => (page: number) => void;
25
+ prepareExport: () => void;
26
+ releaseExport: () => void;
27
+ };
@@ -6,12 +6,12 @@ interface Props {
6
6
  }
7
7
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
8
  edit: () => any;
9
- delete: () => any;
10
9
  close: () => any;
10
+ delete: () => any;
11
11
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
12
12
  onEdit?: (() => any) | undefined;
13
- onDelete?: (() => any) | undefined;
14
13
  onClose?: (() => any) | undefined;
14
+ onDelete?: (() => any) | undefined;
15
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const _default: typeof __VLS_export;
17
17
  export default _default;
@@ -48,6 +48,13 @@ export interface AnnotationBoxLayout {
48
48
  }
49
49
  export type AnnotationPlacement = 'top' | 'bottom' | 'right' | 'left' | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
50
50
  export interface RenderedAnnotation {
51
+ animationStyle?: {
52
+ opacity: number;
53
+ scale: number;
54
+ offsetY: number;
55
+ };
56
+ leaving?: boolean;
57
+ seriesOpacity?: number;
51
58
  annotation: WaveformAnnotation;
52
59
  trackIndex: number;
53
60
  anchorX: number;
@@ -10,6 +10,8 @@ interface Context {
10
10
  };
11
11
  version: () => unknown;
12
12
  ready: () => boolean;
13
+ prepare?: () => void;
14
+ release?: () => void;
13
15
  }
14
16
  export declare function useChartImageExport(c: Context): {
15
17
  exportImage: (options?: WaveformImageExportOptions) => Promise<Blob>;
@@ -37,6 +37,14 @@ export interface DisplayTrack {
37
37
  export interface TrackSeriesPath {
38
38
  series: DisplaySeries;
39
39
  path: string | null;
40
+ lineRenderPoints?: WaveformPoint[];
41
+ presentationKey?: string;
42
+ opacity?: number;
43
+ animationClip?: {
44
+ id: string;
45
+ x: number;
46
+ width: number;
47
+ };
40
48
  pointRenderPoints: WaveformPoint[];
41
49
  errorBarRenderPoints: WaveformPoint[];
42
50
  yScale: ScaleLinear<number, number>;
@@ -210,6 +210,26 @@ export declare function useWaveformChartController(inputProps: ResolvedWaveformC
210
210
  setTitleMeasureElement: (element: Element | ComponentPublicInstance | null) => void;
211
211
  setSharedOverlayElement: (element: Element | ComponentPublicInstance | null) => void;
212
212
  exportImage: (options?: import("../..").WaveformImageExportOptions) => Promise<Blob>;
213
+ presentationTracks: import("./types").TrackLayout[];
214
+ presentationAnnotations: {
215
+ seriesOpacity: number;
216
+ animationStyle?: import("../..").AnnotationAnimationState;
217
+ leaving?: boolean;
218
+ annotation: import("..").WaveformAnnotation;
219
+ trackIndex: number;
220
+ anchorX: number;
221
+ anchorY: number;
222
+ placement: import("../annotation").AnnotationPlacement;
223
+ lines: string[];
224
+ box: import("../annotation").AnnotationBoxLayout;
225
+ style: {
226
+ borderColor: string;
227
+ textColor: string;
228
+ backgroundColor: string;
229
+ };
230
+ }[];
231
+ paginationOpacity: number;
232
+ stabilizeAnimations: (event?: Event) => void;
213
233
  controlState: import("../..").WaveformControlState;
214
234
  getControlState: () => import("../..").WaveformControlState;
215
235
  execute: (action: import("../..").WaveformControlAction, target?: import("../..").WaveformControlTarget, domain?: [number, number], source?: "toolbar" | "api") => import("../..").WaveformControlResult;
@@ -387,5 +407,10 @@ export declare function useWaveformChartController(inputProps: ResolvedWaveformC
387
407
  cleanView: boolean;
388
408
  presentationMode: boolean;
389
409
  zeroLine: import("..").WaveformZeroLineOptions;
410
+ animationEnabled?: boolean | undefined;
411
+ animation?: import("../..").WaveformEnterAnimationOptions | undefined;
412
+ animationUpdate?: import("../..").WaveformUpdateAnimationOptions | undefined;
413
+ animationAnnotation?: import("../..").WaveformAnnotationAnimationOptions | undefined;
414
+ animationThreshold?: number | undefined;
390
415
  };
391
416
  export type WaveformChartController = ReturnType<typeof useWaveformChartController>;
@@ -14,6 +14,8 @@ interface SamplingContext {
14
14
  linePointOverrides: ShallowRef<Record<string, WaveformPoint[]>>;
15
15
  }
16
16
  export declare function useWaveformRenderSampling(context: SamplingContext): {
17
+ requestSignature: ComputedRef<string>;
18
+ state: ComputedRef<"error" | "pending" | "success" | "fallback">;
17
19
  linePointOverrides: ShallowRef<Record<string, WaveformPoint[]>>;
18
20
  ready: () => boolean;
19
21
  };
@@ -1,7 +1,8 @@
1
+ import type { WaveformAnimationProps } from '../../animation/types';
1
2
  import type { WaveformToolbarOptions, WaveformControlState } from '../../types/controls';
2
3
  import type { WaveformAnnotation, WaveformAxesOptions, WaveformData, WaveformDisplayMode, WaveformUnitDisplayMode, WaveformLayoutPreset, WaveformFrameStyle, WaveformInteractionMode, WaveformLegendOptions, WaveformOverlayMode, WaveformPlotMargin, WaveformPoint, WaveformRenderingOptions, WaveformSamplingBackend, WaveformSamplingDiagnostics, WaveformSamplingError, WaveformTitleOptions, WaveformXDomainStrategy, WaveformZeroLineOptions, WaveformZoomIntentPayload, WaveformZoomEndPayload, WaveformPanEndPayload, WaveformZoomResetPayload } from '../data/types';
3
4
  import type { WaveformGridOptions } from './grid';
4
- export interface WaveformChartProps {
5
+ export interface WaveformChartProps extends WaveformAnimationProps {
5
6
  toolbar?: boolean | WaveformToolbarOptions;
6
7
  data: WaveformData;
7
8
  displayMode?: WaveformDisplayMode;
@@ -1,6 +1,7 @@
1
1
  import type { TrackLayout } from '../core/types';
2
2
  type __VLS_Props = {
3
3
  track: TrackLayout;
4
+ paginationOpacity?: number;
4
5
  clipPathId: string;
5
6
  };
6
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -3,6 +3,7 @@ import type { TrackLayout } from '../core/types';
3
3
  import type { WaveformDisplayMode, WaveformInteractionMode } from '../data/types';
4
4
  interface Props {
5
5
  track: TrackLayout;
6
+ paginationOpacity?: number;
6
7
  clipPathId: string;
7
8
  innerWidth: number;
8
9
  zoomable: boolean;
@@ -23,25 +24,25 @@ interface Props {
23
24
  zeroLine?: Required<WaveformZeroLineOptions>;
24
25
  }
25
26
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
26
- contextmenu: (mouseEvent: MouseEvent) => any;
27
27
  click: (mouseEvent: MouseEvent) => any;
28
+ contextmenu: (mouseEvent: MouseEvent) => any;
28
29
  "pointer-move": (pointerEvent: PointerEvent) => any;
29
30
  "pointer-down": (pointerEvent: PointerEvent) => any;
30
31
  "pointer-up": (pointerEvent: PointerEvent) => any;
31
32
  "pointer-cancel": (pointerEvent: PointerEvent) => any;
32
33
  "pointer-leave": () => any;
33
34
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
34
- onContextmenu?: ((mouseEvent: MouseEvent) => any) | undefined;
35
35
  onClick?: ((mouseEvent: MouseEvent) => any) | undefined;
36
+ onContextmenu?: ((mouseEvent: MouseEvent) => any) | undefined;
36
37
  "onPointer-move"?: ((pointerEvent: PointerEvent) => any) | undefined;
37
38
  "onPointer-down"?: ((pointerEvent: PointerEvent) => any) | undefined;
38
39
  "onPointer-up"?: ((pointerEvent: PointerEvent) => any) | undefined;
39
40
  "onPointer-cancel"?: ((pointerEvent: PointerEvent) => any) | undefined;
40
41
  "onPointer-leave"?: (() => any) | undefined;
41
42
  }>, {
43
+ interactionMode: WaveformInteractionMode;
42
44
  cleanView: boolean;
43
45
  zeroLine: Required<WaveformZeroLineOptions>;
44
- interactionMode: WaveformInteractionMode;
45
46
  interactive: boolean;
46
47
  showAxisUnits: boolean;
47
48
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,5 @@
1
+ import type { Axis, NumberValue, ScaleLinear } from 'd3';
2
+ /** Avoid invalidating native SVG layout when an attribute already has the required value. */
3
+ export declare function updateSvgAttribute(element: Element, name: string, value: string | number | null): void;
4
+ /** Domain animation moves existing ticks; unchanged labels keep their native text nodes. */
5
+ export declare function updateAxis(element: SVGGElement, axis: Axis<NumberValue>, scale: ScaleLinear<number, number>, ticks: number[], orientation: 'bottom' | 'left' | 'right', format: (value: number) => string): void;
@@ -0,0 +1,3 @@
1
+ import type { ScaleLinear } from 'd3';
2
+ /** Keep each grid line independently discoverable by the axis collision pass. */
3
+ export declare function updateGrid(group: SVGGElement, ticks: readonly number[], scale: ScaleLinear<number, number>, direction: 'vertical' | 'horizontal', extent: number, color: string | undefined): void;
@@ -6,6 +6,8 @@ interface Box {
6
6
  }
7
7
  export declare function labelsOverlap(a: Box, b: Box): boolean;
8
8
  export declare function linesOverlap(a: number, b: number, widthA?: number, widthB?: number): boolean;
9
+ /** Coalesce sibling axes after Vue's current DOM patch, without adding a late animation frame. */
10
+ export declare function scheduleMaximumTickVisibility(svg: SVGSVGElement): void;
9
11
  /** Apply after axes and grid are in the DOM; never feed the filtered set back into layout. */
10
12
  export declare function updateMaximumTickVisibility(svg: SVGSVGElement): void;
11
13
  export {};
@@ -0,0 +1,2 @@
1
+ import type { ComponentPublicInstance, Ref } from 'vue';
2
+ export declare function assignElement<T extends Element>(target: Ref<T | undefined>, element: Element | ComponentPublicInstance | null): void;
@@ -4,6 +4,15 @@
4
4
  */
5
5
  export { default as WaveformChart } from './components/WaveformChart.vue';
6
6
  export type { WaveformChartProps } from './components/core/waveformChartTypes';
7
+ export { getEasingFunction } from './animation/core/easing';
8
+ export { WaveformAnimationController } from './animation/WaveformAnimationController';
9
+ export { createLineDrawingAnimation, createStaggeredLineDrawingAnimations, } from './animation/presets/lineDrawing';
10
+ export { createPathTransitionAnimation, createYAxisScaleAnimation, } from './animation/presets/transitions';
11
+ export { createAnnotationAppearAnimation, createAnnotationDisappearAnimation, } from './animation/presets/annotation';
12
+ export { Animation } from './animation/core/Animation';
13
+ export { Animator, globalAnimator } from './animation/core/Animator';
14
+ export type { AnimationValue, AnimationDirection, AnimationState, AnimationFrame, AnimationTrack, AnimationConfig, AnimationHandle, AnimationScheduler, EasingFunction, EasingFamily, EasingType, } from './animation/core/types';
15
+ export type { LineDrawingDirection, AnnotationAnimationType, LineDrawingOptions, StaggeredLineDrawingOptions, DataUpdateOptions, AnnotationAnimationOptions, WaveformEnterAnimationOptions, WaveformUpdateAnimationOptions, WaveformAnnotationAnimationOptions, WaveformAnimationProps, ClipAnimationState, AnimationBinding, NumericGeometry, GeometryTransitionInput, GeometryTransitionFrame, AnnotationAnimationState, AnimationScope, AnimationObjectKey, WaveformAnimationControllerOptions, } from './animation/types';
7
16
  export type { WaveformPoint, WaveformDisplayMode, WaveformUnitDisplayMode, WaveformLayoutPreset, WaveformOverlayMode, WaveformInteractionMode, WaveformXDomainStrategy, WaveformZoomIntentPayload, WaveformZoomEndPayload, WaveformPanEndPayload, WaveformZoomResetPayload, WaveformAnnotationStyle, WaveformAnnotation, WaveformSamplingMode, WaveformSamplingStrategy, WaveformSamplingOptions, WaveformSamplingBackend, WaveformSamplingDiagnostics, WaveformSamplingError, WaveformRenderingOptions, WaveformPlotMargin, WaveformTitleTextStyle, WaveformTitleOptions, WaveformLegendPosition, WaveformLegendOrientation, WaveformLegendOptions, WaveformFrameStyle, WaveformXAxisLabelKind, WaveformXAxisLabelFormatterContext, WaveformXAxisLabelFormatter, WaveformAxesOptions, WaveformYAxisLabelTextStyle, WaveformZeroLineOptions, SingleWaveformData, WaveformLineType, WaveformLineStyle, WaveformPointType, WaveformErrorBarOptions, ResolvedWaveformErrorBarOptions, WaveformTypedValues, TypedSampleData, TypedPointData, WaveformSeries, WaveformData, NormalizedWaveformSeries, } from './types';
8
17
  export type { WaveformGridOptions, WaveformGridLineOptions, WaveformGridTrackLines, } from './components/core/grid';
9
18
  export { normalizeWaveformData, normalizeWaveformSeries } from './core';
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waveform-analysis",
3
- "version": "0.1.74",
3
+ "version": "0.1.75",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -44,7 +44,9 @@
44
44
  "globals": "17.7.0",
45
45
  "jsdom": "29.1.1",
46
46
  "oxlint": "1.77.0",
47
+ "playwright": "1.56.1",
47
48
  "prettier": "3.9.5",
49
+ "terser": "5.51.2",
48
50
  "typescript": "~6.0.0",
49
51
  "typescript-eslint": "8.64.0",
50
52
  "vite": "8.1.5",
@@ -70,6 +72,7 @@
70
72
  "test": "pnpm prepare:wasm && vitest run",
71
73
  "test:coverage": "pnpm prepare:wasm && vitest run --coverage",
72
74
  "test:package": "node scripts/test-package.mjs",
73
- "prepare:wasm": "node scripts/prepare-wasm.mjs"
75
+ "prepare:wasm": "node scripts/prepare-wasm.mjs",
76
+ "test:animation:browser": "node scripts/test-animation-browser.mjs"
74
77
  }
75
78
  }
@@ -5,6 +5,7 @@
5
5
  <nav class="demo-shell__nav" aria-label="示例导航">
6
6
  <RouterLink to="/">综合示例</RouterLink>
7
7
  <RouterLink to="/fixed-y-domain">固定振幅范围</RouterLink>
8
+ <RouterLink to="/animation">动画</RouterLink>
8
9
  <RouterLink to="/wasm-sampling">WASM 采样</RouterLink>
9
10
  </nav>
10
11
  </header>