Skip to content

@graphty/graphty-element / index / AnimationOptions

Interface: AnimationOptions ​

Defined in: graphty-element/src/video/VideoCapture.ts:24

Options for capturing animation/video from the graph.

Video capture uses the browser's MediaRecorder API for hardware-accelerated real-time capture. This provides excellent performance but operates in real-time, meaning the video is captured as the animation plays. Frame timing depends on system performance; on slower systems, some frames may be dropped.

For guaranteed frame-perfect capture (e.g., for production video rendering), consider using external screen recording software or frame-by-frame export with a third-party video encoding library like ffmpeg.

See ​

  • design/screen-capture-design-review.md for technical details on capture modes
  • src/screenshot/constants.ts for default values (VIDEO_CONSTANTS)

Properties ​

camera? ​

optional camera?: CameraState | { preset: string; }

Defined in: graphty-element/src/video/VideoCapture.ts:49

Camera position/state or preset name for stationary mode


cameraMode ​

cameraMode: "stationary" | "animated"

Defined in: graphty-element/src/video/VideoCapture.ts:47

Camera behavior during capture: 'stationary' or 'animated'


cameraPath? ​

optional cameraPath?: CameraWaypoint[]

Defined in: graphty-element/src/video/VideoCapture.ts:51

Waypoints for camera animation path (animated mode)


download? ​

optional download?: boolean

Defined in: graphty-element/src/video/VideoCapture.ts:55

Whether to automatically download the video after capture


downloadFilename? ​

optional downloadFilename?: string

Defined in: graphty-element/src/video/VideoCapture.ts:57

Filename for downloaded video (default: 'graphty-animation.{format}')


duration ​

duration: number

Defined in: graphty-element/src/video/VideoCapture.ts:26

Total duration of the video capture in milliseconds


easing? ​

optional easing?: "linear" | "easeIn" | "easeOut" | "easeInOut"

Defined in: graphty-element/src/video/VideoCapture.ts:53

Easing function for camera animations (default: 'easeInOut')


format? ​

optional format?: "auto" | "webm" | "mp4"

Defined in: graphty-element/src/video/VideoCapture.ts:33

Video format: 'webm', 'mp4', or 'auto' to detect best format for browser


fps? ​

optional fps?: number

Defined in: graphty-element/src/video/VideoCapture.ts:31

Target frames per second.

Default ​

ts
30 (VIDEO_CONSTANTS.DEFAULT_FPS)

height? ​

optional height?: number

Defined in: graphty-element/src/video/VideoCapture.ts:43

Output height in pixels (default: canvas height)


transparentBackground? ​

optional transparentBackground?: boolean

Defined in: graphty-element/src/video/VideoCapture.ts:45

Whether to capture with transparent background


videoBitrate? ​

optional videoBitrate?: number

Defined in: graphty-element/src/video/VideoCapture.ts:39

Video bitrate in bits per second. Higher values = better quality but larger file size.

Default ​

ts
5000000 (VIDEO_CONSTANTS.DEFAULT_VIDEO_BITRATE - 5 Mbps)

width? ​

optional width?: number

Defined in: graphty-element/src/video/VideoCapture.ts:41

Output width in pixels (default: canvas width)