View Source GGity.Element.Text (GGity v0.5.0)

Defines the data and functions used to style non-geom text elements.

CSS presentation attributes:

  • :family - string: sets value of CSS font-family

  • :face - string or integer: sets value of CSS font-weight

    Valid values:

    • "normal"
    • "bold"
    • "bolder"
    • "lighter"
    • "initial"
    • "inherit"
    • A multiple of 100 between 100 and 900
  • :color - string: sets value of CSS fill

    Values must be valid CSS color names or hex values.

  • :size - number: sets value of CSS font-size in pixels

Other attributes:

  • :angle - number (between 0 and 90): sets the value passed to transform: rotate() for the purpose of rotating x axis tick labels (has no effect when set for other theme elements)

Link to this section Summary

Functions

Constructor for a Text element.

Link to this section Types

@type t() :: %GGity.Element.Text{
  angle: term(),
  color: term(),
  face: term(),
  family: term(),
  size: term()
}

Link to this section Functions

Link to this function

element_text(attributes)

View Source
@spec element_text(keyword()) :: t()

Constructor for a Text element.

Setting the value of an attributed to nil will remove that property from the generated stylesheet altogether.

Calling element_text(attributes) is equivalent to struct(GGity.Element.Text, attributes).