const class dom::Svg

sys::Obj
  dom::Svg

@Js

Source

SVG (Scalar Vector Graphics) utilities

def

static Str def(Elem svgElem, Elem defElem)

Source

Auto-generate an id for the def element and mount it into the svg document's defs section. This method will automatically generate a <defs> child in the svg document as needed. If defs already has an id or is already mounted, then no action is taken.

defUrl

static Str defUrl(Elem svgElem, Elem defElem)

Source

Mount a definition element using def and return a CSS URL to the fragment identifier such as "url(#def-d)". This is used to reference gradient and clip definitions.

elem

static Elem elem(Str tagName)

Source

Create element with proper namespace

image

static Elem image(Uri href, Float x, Float y, Float w, Float h)

Source

Convenience to create a image element

line

static Elem line(Num x1, Num y1, Num x2, Num y2)

Source

Convenience to create line element

ns

const static Uri ns := `http://www.w3.org/2000/svg`

Source

SVG XML namesapce

const static Uri nsXLink := `http://www.w3.org/1999/xlink`

Source

XLink XML namespace

rect

static Elem rect(Num x, Num y, Num w, Num h)

Source

Convenience to create rect element

text

static Elem text(Str text, Num x, Num y)

Source

Convenience to create text element