Skip to content

Wiggle API / loadSVG

Function: loadSVG() ​

loadSVG(path, opts?): SVGGroup

Load an SVG file as a group of vector shapes, parsed once. The returned group serves both roles: add it to draw the file (comp.add(loadSVG("logo.svg"))), or pass it as a morph target (shape.morphTo(loadSVG("logo.svg"))). comp.svg(path) is the create-and-add shorthand for placing one. The path is resolved relative to the composition script. By default the group keeps its own size from the file; size fits it into that size (a single number, or [width, height]), preserving aspect ratio. x/y place it; otherwise it centers when added.

Parameters ​

path ​

string

opts? ​

size? ​

number | [number, number]

x? ​

number

y? ​

number

Returns ​

SVGGroup