Capítulo 264 de 411

Chapter 264: MorphSVGPlugin.convertToPath()

Core Idea

Converts basic SVG shapes (circle, rect, ellipse, line) into <path> elements, since only paths (and polyline/polygon) can actually be morphed.

Reference Tables

ParameterTypeDescription
shapeElement | Stringelement or selector to convert
swapBooleandefault true: replaces the shape in the DOM with the new path; false leaves the original in place

Returns: Array of the created <path> elements.

Code Examples

MorphSVGPlugin.convertToPath("circle, rect");

Connects To

  • MorphSVGPlugin (morphSVG tween): the actual animation, run on the resulting paths.