d2animate

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: MPL-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(rootDiagram *d2target.Diagram, svgs [][]byte, renderOpts d2svg.RenderOpts, intervalMS int) ([]byte, error)

func WrapTimed added in v0.10.0

func WrapTimed(rootDiagram *d2target.Diagram, svgs [][]byte, renderOpts d2svg.RenderOpts, durationsMS []int) ([]byte, error)

WrapTimed composes independently rendered SVG frames on a shared playback clock.

Types

type Frame added in v0.10.0

type Frame struct {
	Diagram    *d2target.Diagram
	DurationMS int
	// TweenSample distinguishes an already sampled transition from a board
	// whose independent shape and connection animations still need sampling.
	TweenSample bool
	// ElapsedMS is the local time of a sampled frame within its step.
	ElapsedMS int
}

Frame is a diagram held for a duration on the playback timeline.

func AppendBoardFrames added in v0.10.0

func AppendBoardFrames(frames []Frame, board *d2target.Diagram, intervalMS int) []Frame

AppendBoardFrames expands one validated, drawable board. Raster exporters impose their own traversal limits before expanding its samples.

func Timeline added in v0.10.0

func Timeline(root *d2target.Diagram, intervalMS int) ([]Frame, error)

Timeline returns the same root, layer, scenario and step order as a normal multiboard export, inserting each step's samples immediately before it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL