Index

Svg

MMO.svg · 1 symbol · generated 30 Sep 2026

class

Svg

Svg.js:5
class MMO.svg.Svg
Namespace
MMO.svg

Index

From(svg) static── SVG helpers
constructor(svg)
createElement(tag, attrs, children)Build an element in the svg namespace.
select(node)Mark one node as selected, carrying the selected class over to it.
allowSelection(cssSelector)Declare which nodes a double click can select, replacing any previous rule.
zoomBy(x, y, factor)Zoom around a point of the svg's own coordinate system.
focus(node, zoom)Bring a node into view, centring the viewbox on it.
updateViewbox(box)Animate the viewbox towards a new one, rather than jumping to it.

Methods8

From(svg)

staticSvg.js:8

── SVG helpers

static From(svg)
svg

createElement(tag, attrs, children)

Svg.js:96

Build an element in the svg namespace.

createElement(tag, attrs = null, ...children)
tagstring
attrs = null?(Object | Function | Array)
...children...*
returnsElement

select(node)

Svg.js:105

Mark one node as selected, carrying the selected class over to it.

select(node)
node?Elementnull clears the selection
returnsthis

allowSelection(cssSelector)

Svg.js:119

Declare which nodes a double click can select, replacing any previous rule.

allowSelection(cssSelector)
cssSelector?stringnull disables selection entirely
returnsthis

zoomBy(x, y, factor)

Svg.js:134

Zoom around a point of the svg's own coordinate system.

zoomBy(x, y, factor)
xnumberthe focal point's abscissa
ynumberthe focal point's ordinate
factornumberabove 1 zooms in, below 1 zooms out
returnsthis

focus(node, zoom)

Svg.js:154

Bring a node into view, centring the viewbox on it.

focus(node, zoom = false)
nodeElement | stringan element, or the id of one
zoom = falsebooleanalso scale the viewbox down to the node's own box
returnsthis

updateViewbox(box)

Svg.js:185

Animate the viewbox towards a new one, rather than jumping to it.

updateViewbox(box)
box