Svg
MMO.svg · 1 symbol · generated 5 Oct 2026
class MMO.svg.Svg- Namespace
MMO.svg
Index
| From(svg, options) static | The helper of an svg element, created the first time. |
| constructor(svg, options) | |
| 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
The helper of an svg element, created the first time.
static From(svg, options = {})constructor(svg, options = {})Build an element in the svg namespace.
createElement(tag, attrs = null, ...children)| tag | string | |
| attrs = null | ?(Object | Function | Array) | |
| ...children | ...* | |
| returns | Element | |
Mark one node as selected, carrying the selected class over to it.
select(node)| node | ?Element | null clears the selection |
| returns | this | |
Declare which nodes a double click can select, replacing any previous rule.
allowSelection(cssSelector)| cssSelector | ?string | null disables selection entirely |
| returns | this | |
Zoom around a point of the svg's own coordinate system.
zoomBy(x, y, factor)| x | number | the focal point's abscissa |
| y | number | the focal point's ordinate |
| factor | number | above 1 zooms in, below 1 zooms out |
| returns | this | |
Bring a node into view, centring the viewbox on it.
focus(node, zoom = false)| node | Element | string | an element, or the id of one |
| zoom = false | boolean | also scale the viewbox down to the node's own box |
| returns | this | |
Animate the viewbox towards a new one, rather than jumping to it.
updateViewbox(box)