Home
API: forms

Function: toSvgDocument()

lifecycle-kit

lifecycle-kit


lifecycle-kit / forms / toSvgDocument

Function: toSvgDocument()

toSvgDocument(path, viewBox): string

Defined in: forms/render/svg.ts:103

A complete standalone SVG document.

The viewBox is derived from the path's own bounds by the caller rather than assumed here, because a form's extent is a property of the form. Callers that want a fixture usually want a fixed box so that a geometry change shows up as a path diff rather than as a viewBox diff.

Parameters

path

Path

viewBox

height

number

minX

number

minY

number

width

number

Returns

string