Svg
MMO.svg · 1 symbol · generated 30 Sep 2026
class MMO.svg.Svg- Namespace
MMO.svg
Methods8
── SVG helpers
static From(svg)constructor(svg)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)