SvgBuilder

Builder for SVG root element. This class provides methods to define attributes and child elements for the root <svg> element in an SVG document.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun attr(name: String, value: Number)

Sets an attribute on the SVG element with a numeric value.

fun attr(name: String, value: String)

Sets an attribute on the SVG element with a string value.

Link copied to clipboard
fun circle(block: CircleBuilder.() -> Unit)

Adds a <circle> child element to the SVG element.

Link copied to clipboard
fun className(value: String)

Sets the class attribute of the SVG element.

Link copied to clipboard
fun clipPath(value: String)

Sets the clip-path attribute of the SVG element.

Link copied to clipboard
fun defs(block: DefsBuilder.() -> Unit)

Adds a <defs> child element to the SVG element.

Link copied to clipboard
fun ellipse(block: EllipseBuilder.() -> Unit)

Adds an <ellipse> child element to the SVG element.

Link copied to clipboard
fun fill(color: Color)

Sets the fill attribute of the SVG element with a Color object.

fun fill(color: String)

Sets the fill attribute of the SVG element with a color string.

Link copied to clipboard
fun fillOpacity(value: Number)

Sets the fill-opacity attribute of the SVG element.

Link copied to clipboard
fun fillRule(value: String)

Sets the fill-rule attribute of the SVG element.

Link copied to clipboard
fun filter(value: String)

Sets the filter attribute of the SVG element.

Link copied to clipboard
fun g(block: GBuilder.() -> Unit)

Adds a <g> (group) child element to the SVG element.

Link copied to clipboard
fun height(value: Number)

Sets the height attribute of the SVG element.

Link copied to clipboard
fun id(value: String)

Sets the id attribute of the SVG element.

Link copied to clipboard
fun line(block: LineBuilder.() -> Unit)

Adds a <line> child element to the SVG element.

Link copied to clipboard
fun mask(value: String)

Sets the mask attribute of the SVG element.

Link copied to clipboard
fun opacity(value: Number)

Sets the opacity attribute of the SVG element.

Link copied to clipboard
fun path(block: PathBuilder.() -> Unit)

Adds a <path> child element to the SVG element.

Link copied to clipboard
fun polygon(block: PolygonBuilder.() -> Unit)

Adds a <polygon> child element to the SVG element.

Link copied to clipboard
fun polyline(block: PolylineBuilder.() -> Unit)

Adds a <polyline> child element to the SVG element.

Link copied to clipboard

Sets the preserveAspectRatio attribute of the SVG element.

Link copied to clipboard
fun rect(block: RectBuilder.() -> Unit)

Adds a <rect> child element to the SVG element.

Link copied to clipboard
fun stroke(color: Color)

Sets the stroke attribute of the SVG element with a Color object.

fun stroke(color: String)

Sets the stroke attribute of the SVG element with a color string.

Link copied to clipboard

Sets the stroke-dasharray attribute of the SVG element.

Link copied to clipboard

Sets the stroke-dashoffset attribute of the SVG element.

Link copied to clipboard
fun strokeLinecap(value: String)

Sets the stroke-linecap attribute of the SVG element.

Link copied to clipboard

Sets the stroke-linejoin attribute of the SVG element.

Link copied to clipboard
fun strokeOpacity(value: Number)

Sets the stroke-opacity attribute of the SVG element.

Link copied to clipboard
fun strokeWidth(value: Number)

Sets the stroke-width attribute of the SVG element.

Link copied to clipboard
fun style(value: String)

Sets the style attribute of the SVG element.

Link copied to clipboard
fun symbol(block: SymbolBuilder.() -> Unit)

Adds a <symbol> child element to the SVG element.

Link copied to clipboard
fun text(block: TextBuilder.() -> Unit)

Adds a <text> child element to the SVG element.

Link copied to clipboard
fun transform(value: String)

Sets the transform attribute of the SVG element.

Link copied to clipboard
fun use(block: UseBuilder.() -> Unit)

Adds a <use> child element to the SVG element.

Link copied to clipboard
fun viewBox(minX: Number, minY: Number, width: Number, height: Number)

Sets the viewBox attribute of the SVG element.

Link copied to clipboard
fun width(value: Number)

Sets the width attribute of the SVG element.

Link copied to clipboard
fun xmlns(value: String = "http://www.w3.org/2000/svg")

Sets the xmlns attribute of the SVG element.