Skip to main content

SVG

Creates a SVG object.

constructor(svg: string)

// If no width/height/fit is used, then dimensions from the svg element is used.
new SVG('<svg width="300" height="200" viewBox="0 0 300 200">...</svg>').end;

fit(fit: [number, number]): Img

Fits the image inside a container, you can see it as a witdh and height in the same place.

new SVG('...').fit([100, 100]).end;

Types

ISVG

Svg properties (extends from IStyleDefinition).

  • readonly svg: string;
  • readonly fit?: [number, number];