X-band generator: a shaded region between two domain x values, with an optional label (spec/04 §13, D-27).
The edge accessors yield domain values that scale/2 maps; without a scale they are
pixels. Each datum is one annotation; by default a {start, stop} tuple.
Examples
band =
Visualize.Shape.XBand.new()
|> Visualize.Shape.XBand.scale(x_scale)
|> Visualize.Shape.XBand.y1(height)
|> Visualize.Shape.XBand.label("incident")
[group] = Visualize.Shape.XBand.generate(band, [{t0, t1}])
Summary
Types
An accessor whose value is text or a fill: a 1-arity function, an atom field, or a string.
Functions
Sets the fill accessor: function, atom field, or string constant
Returns one :group element per datum: the rectangle, then the label when there is one.
Sets the label accessor: function, atom field, or string constant; nil clears it
Creates an x-band generator reading tuple elements 0 and 1 as its edges
Sets the x scale the edges map through; nil means the values are pixels
Sets the first-edge domain-value accessor
Sets the second-edge domain-value accessor
Sets the first vertical-extent accessor, in pixels
Sets the second vertical-extent accessor, in pixels
Types
@type t() :: %Visualize.Shape.XBand{ fill: (any() -> String.t() | nil) | nil, label: (any() -> String.t() | nil) | nil, scale: struct() | nil, x0: Visualize.Shape.Line.accessor() | nil, x1: Visualize.Shape.Line.accessor() | nil, y0: Visualize.Shape.Line.accessor(), y1: Visualize.Shape.Line.accessor() }
An accessor whose value is text or a fill: a 1-arity function, an atom field, or a string.
Functions
@spec fill(t(), text_accessor() | nil) :: t()
Sets the fill accessor: function, atom field, or string constant
@spec generate(t(), Visualize.Data.Table.source()) :: [Visualize.IR.Element.t()]
Returns one :group element per datum: the rectangle, then the label when there is one.
@spec label(t(), text_accessor() | nil) :: t()
Sets the label accessor: function, atom field, or string constant; nil clears it
@spec new() :: t()
Creates an x-band generator reading tuple elements 0 and 1 as its edges
Sets the x scale the edges map through; nil means the values are pixels
@spec x0(t(), Visualize.Shape.Line.accessor()) :: t()
Sets the first-edge domain-value accessor
@spec x1(t(), Visualize.Shape.Line.accessor()) :: t()
Sets the second-edge domain-value accessor
@spec y0(t(), Visualize.Shape.Line.accessor()) :: t()
Sets the first vertical-extent accessor, in pixels
@spec y1(t(), Visualize.Shape.Line.accessor()) :: t()
Sets the second vertical-extent accessor, in pixels