analyseSVGStructure

external fun analyseSVGStructure(svg: SVG, options: AnalyseSVGStructureOptions? = definedExternally): AnalyseSVGStructureResult

Find IDs, links and palette usage in an SVG.

Run cleanup functions first so inline styles are converted to attributes. The result contains maps of elements and IDs, a list of links from elements to IDs, and a tree describing which elements are rendered as paint or as masks/clip paths.

Duplicate IDs, definitions without an ID and missing links throw an error. With AnalyseSVGStructureOptions.fixErrors they are removed or repaired with a warning instead.