Skip to main content

Function: sceneToSVG()

sceneToSVG(scene, options?): string

Defined in: src/export/SvgExporter.ts:280

Convert a scene to a complete, standalone SVG string.

Each top-level mobject becomes a <g> group holding the <path> elements of its VMobject family, in draw order. World coordinates map to the pixel viewBox through the camera frame, matching the raster exporters' aspect. An empty scene yields a valid, empty <svg>.

Parameters​

scene​

SvgExportableScene

The scene to export

options?​

SvgExportOptions

Export options

Returns​

string

The SVG markup