svg
SVG utilities (DOM via `dom` + path string fragments).
Load with: use svg
Quick example
use svg
result = svgsl("value")
prn(result)
Functions
Internal: create a lowercase SVG tag (host creates in document; SVG namespace when supported).
svgsl(t)
Performs the operation. Takes t.
Create SVG element
svgne(w, h)
Creates a new instance. Takes w, h.
Shape helpers
svgci(cx, cy, r, fill)
Performs the operation. Takes cx, cy, r, fill.
svgre(x, y, w, h, fill)
Performs the operation. Takes x, y, w, h, fill.
svgli(x1, y1, x2, y2, stroke, wid)
Performs the operation. Takes x1, y1, x2, y2, stroke, wid.
svgtx(x, y, s, sz, fill)
Performs the operation. Takes x, y, s, sz, fill.
svgpo(pts, fill, stroke)
Performs the operation. Takes pts, fill, stroke.
svgpa(d, fill, stroke)
Parses. Takes d, fill, stroke.
Group
svgg()
Performs the operation.
svgap(g, ch)
Performs the operation. Takes g, ch.
Transform
svgtr(el, x, y)
Performs the operation. Takes el, x, y.
svgsc(el, s)
Performs the operation. Takes el, s.
svgro(el, deg, cx, cy)
Performs the operation. Takes el, deg, cx, cy.
Path d-string fragments
svgmo(x, y)
Performs the operation. Takes x, y.
svglt(x, y)
Performs the operation. Takes x, y.
svgcr(x1, y1, x2, y2, x, y)
Creates a new instance. Takes x1, y1, x2, y2, x, y.
svgcl()
Closes or clears.
Chart helpers (append into parent SVG root)
svgba(svg, x, y, w, h, col)
Performs the operation. Takes svg, x, y, w, h, col.
svglc(svg, data, col, wid)
Performs the operation. Takes svg, data, col, wid.
Notes
- SVG generation - shapes, paths, text, transforms.