Reference Docs

SVG Library

Elements

SVG()
line(x1, y1, x2, y2)
circle(x, y, radius)
ellipse(x, y, rx, ry)
rect(x, y, width, height)
polygon(pointsArray)
polyline(pointsArray)
path()
text(textString, x, y)

Layers and Masks

g()
clipPath()
mask()

Outside the Specification

regularPolygon(sides, cX, cY, radius)
parabola(x, y, width, height)
curve(x1, y1, x2, y2)
arc(x, y, radius, angleA, angleB)
wedge(x, y, radius, angleA, angleB)
arrow(x1, y1, x2, y2)

Events

onMove, onPress, onRelease
animate

Methods

removeChildren()
appendTo(...)
setAttributes(...)

translate(...)
rotate(...)
scale(...)
matrix(...)
clearTransform()

marker(...)
symbol(...)
clipPath(...)
mask(...)

addClass(...)
removeClass(...)
setClass(...)
setID(...)

svg

clear()
size(x, y, w, h)
size(w, h)
setViewBox(x, y, w, h)
background(color)
getWidth()
getHeight()
stylesheet(css)
load(file)
save()

path

clear()
command(command, ...args)
get()
set(...)
add(string)

move()
line()
vertical()
horizontal()
ellipse()
curve()
smoothCurve()
quadCurve()
smoothQuadCurve()

Move()
Line()
Vertical()
Horizontal()
Ellipse()
Curve()
SmoothCurve()
QuadCurve()
SmoothQuadCurve()

close()

polygon, polyline

setPoints(...)
addPoint(...)

marker, symbol, clipPath, mask

size(...)
setViewBox(...)

line

setPoints(...)

circle, ellipse

radius(...)
setRadius(...)
center(...)
setCenter(...)
position(...)
setPosition(...)

Supported Nodes

svg, defs, desc, filter, metadata, style, script, title, view, cdata, g, circle, ellipse, line, path, polygon, polyline, rect, text, marker, symbol, clipPath, mask, linearGradient, radialGradient, pattern, textPath, tspan, stop, feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feDiffuseLighting, feDisplacementMap, feDistantLight, feDropShadow, feFlood, feFuncA, feFuncB, feFuncG, feFuncR, feGaussianBlur, feImage, feMerge, feMergeNode, feMorphology, feOffset, fePointLight, feSpecularLighting, feSpotLight, feTile, feTurbulence

Supported Attributes

accumulate, additive, alignment-baseline, attributeName, azimuth, baseFrequency, baseline-shift, begin, bias, by, calcMode, color, color-interpolation, color-interpolation-filters, cursor, diffuseConstant, direction, display, divisor, dominant-baseline, dur, dx, dy, edgeMode, elevation, end, exponent, fill, fill-opacity, fill-rule, filter, filterRes, filterUnits, flood-color, flood-opacity, font-family, font-size, font-size-adjust, font-stretch, font-style, font-variant, font-weight, from, gradientTransform, gradientUnits, image-rendering, in, in2, intercept, k1, k2, k3, k4, kernelMatrix, keyPoints, keySplines, keyTimes, lengthAdjust, letter-spacing, lighting-color, limitingConeAngle, max, method, min, mode, numOctaves, opacity, operator, order, overflow, overline-position, overline-thickness, paint-order, pointer-events, pointsAtX, pointsAtY, pointsAtZ, preserveAlpha, preserveAspectRatio, primitiveUnits, radius, repeatCount, repeatDur, restart, result, rotate, seed, shape-rendering, spacing, specularConstant, specularExponent, spreadMethod, startOffset, stdDeviation, stitchTiles, strikethrough-position, strikethrough-thickness, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, surfaceScale, tabindex, targetX, targetY, text-anchor, text-decoration, text-rendering, textLength, to, transform-origin, type, underline-position, underline-thickness, user-select, values, vector-effect, visibility, word-spacing, writing-mode, xChannelSelector, yChannelSelector