Creates an instance of SvgBuilder.
add a transformation to the current transformation
add a class
class name to add
Adds an SVG clip path definition to the builder.
The x-coordinate of the top-left corner of the clipping rectangle.
The y-coordinate of the top-left corner of the clipping rectangle.
The width of the clipping rectangle.
The height of the clipping rectangle.
An object containing the generated id for the clip path and the SvgGroup instance representing the clip path.
Adds an SVG clip path definition to the builder.
handle SVG DOM event
Adds an SVG pattern definition to the builder.
The x-coordinate of the pattern tile's top-left corner.
The y-coordinate of the pattern tile's top-left corner.
The width of the pattern tile.
The height of the pattern tile.
An object containing the generated id for the pattern and the SvgGroup instance representing the pattern.
Adds an SVG pattern definition to the builder.
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).
Creates and appends an SVG circle element to this group. (Internally uses an ellipse with equal x and y radii).
The x-coordinate of the center of the circle.
The y-coordinate of the center of the circle.
The radius of the circle.
The newly created SvgShape instance representing the circle.
Clears all child elements from this SVG group.
void
remove all transformations
Creates and appends an SVG ellipse element to this group.
The x-coordinate of the center of the ellipse.
The y-coordinate of the center of the ellipse.
The x-radius of the ellipse.
Optionalr2: number
The y-radius of the ellipse.
The newly created SvgShape instance representing the ellipse.
change the fill color
return the given attribute if any
the svh element dom
return the attribute as number
Creates and appends an SVG group element (<g>) to this group.
Optionalid: string
Optional. An ID for the new group.
The newly created SvgGroup instance.
Creates and appends an SvgIcon element to this group.
The SVG string content for the icon.
The x-coordinate for the icon's position.
The y-coordinate for the icon's position.
The width of the icon.
The height of the icon.
The newly created SvgIcon instance.
Creates and appends an SVG linear gradient definition to this group.
The x-coordinate of the starting point of the gradient vector.
The y-coordinate of the starting point of the gradient vector.
The x-coordinate of the ending point of the gradient vector.
The y-coordinate of the ending point of the gradient vector.
The newly created SvgGradient instance.
the element is not filled
Creates and appends an SvgPath element to this group.
The newly created SvgPath instance.
Creates and appends an SVG rectangle element to this group.
Handles negative height by adjusting y and h accordingly.
The x-coordinate of the top-left corner of the rectangle.
The y-coordinate of the top-left corner of the rectangle.
The width of the rectangle.
The height of the rectangle.
The newly created SvgShape instance representing the rectangle.
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
Creates and appends an SvgText element to this group.
The x-coordinate for the text.
The y-coordinate for the text.
The text content.
The newly created SvgText instance.
define the whole transformation
translation
A specialized
SvgGroupthat provides methods for adding SVG definitions like clip paths and patterns. It extendsSvgGroupto inherit common SVG element functionalities and acts as a container for definitions.