Vectored.Elements.Desc (Vectored v0.4.0)

Copy Markdown View Source

The <desc> element provides a detailed text description of an element.

Why use Desc?

While <title> is for short names, <desc> is for complex descriptions.

  • Accessibility: It provides a way to explain complex graphics (like charts or diagrams) to screen reader users.
  • Documentation: It helps keep your SVG source code self-documenting.

The with_description/2 function available on every element module (e.g. Vectored.Elements.Group.with_description/2) is the recommended way to add a description to any shape.

Examples

Vectored.Elements.Group.new([chart_bars])
|> Vectored.Elements.Group.with_description("A bar chart showing quarterly revenue growth.")

Summary

Types

t()

@type t() :: %Vectored.Elements.Desc{content: String.t() | nil}

Functions

new(content)

@spec new(String.t()) :: t()