add a transformation to the current transformation
add a class
class name to add
handle SVG DOM event
Set the shape rendering attribute to control anti-aliasing for shapes.
When enabled, the attribute is set to "auto" to allow smoothing/anti-aliasing. When disabled, the attribute is set to "crispEdges" to favor pixel-aligned, non-anti-aliased rendering.
True to enable anti-aliasing ("auto"), false to disable ("crispEdges").
the current instance to allow chaining).
remove all transformations
change the fill color
return the given attribute if any
the svh element dom
return the attribute as number
the element is not filled
remove a class
class name to remove
Remove all attributes from the underlying DOM element.
The current instance (this) to allow method chaining.
rotation
scaling
define a new attribute
attibute name
attribute value
this
change one style value
change the stroke color
Optionalwidth: numberchange the stroke opacity attribute on the element.
Opacity value where 0 is fully transparent and 1 is fully opaque.
The current instance to allow method chaining.
change the stroke width
define the whole transformation
translation
Represents a lightweight wrapper around an SVG DOM element that provides convenient, chainable helpers for common SVG manipulations (attributes, styles, transforms, classes and events).
The class encapsulates an underlying SVGElement and exposes methods that operate directly on that element while allowing fluent chaining.
Key behaviors:
getAttr,getNumAttr, andsetAttrlet you read and write attributes. PassingnullorundefinedtosetAttrremoves the attribute.setStyleassigns CSS properties on the element. When a numeric value is provided, a "px" unit is appended unless the property is known to be unitless (the implementation relies on a small helper to detect unitless properties).transform,add_transformation,clear_transform), and higher-level helpers for rotate, translate and scale (both replace and append forms).stroke,strokeWidth,strokeCap,strokeOpacity,fill, andno_fillprovide convenient setters for common paint properties. These methods returnthisso they can be chained.addClass/removeClassmanipulate the element's class list (supporting space-separated lists) andclipsets a clip-path reference using an id.resetremoves all attributes from the element (but does not remove the element itself).addDOMEventattaches DOM events to the underlying element.Notes and caveats: