The shape facade (spec/07 §2), copied from visualize's Visualize.Shape: constructors
for every generator, and setters dispatched on the generator's struct.
iex> alias Macaw.Draw.Shape
iex> Shape.line() |> Shape.y(7) |> Shape.generate([{0, 1}, {10, 2}])
"M0,7L10,7"A setter given a generator that lacks the setting answers
{:error, [{[], {:type, expected}}]}, expected the list of generators that have it,
never a clause error (spec/06 §1.2). A refusable setter (a curve type, a symbol type, a
needle cap) answers through the facade as it does on its module, {:ok, generator} or
{:error, faults}.
Stacking is no shape of Draw's (§8, dco-tek/macaw/macaw#478): it is Macaw.Data.Stack's,
a reshape of data, and what stacks calls it and hands Draw the stacked series, plain
values, so Draw depends on no data package.
Summary
Functions
Sets angle on a rose, a needle.
An arc generator, Macaw.Draw.Shape.Arc.new/0.
An area generator, Macaw.Draw.Shape.Area.new/0.
A band (state timeline) generator, Macaw.Draw.Shape.Band.new/0.
Sets corner_radius on a arc.
curve(shape, type, []).
Sets the curve of a line, an area or a percentile band: {:ok, shape} or {:error, faults} (§5.1).
Sets defined on a line, a area, a percentile_band.
Sets end_angle on a arc, a pie.
Sets fill on a band, a x_band.
generate(shape, nil): meaningful for a symbol.
The generator's output (§2): path data for a line, an area, an arc and a symbol; arc data for a pie; elements for a band, a rule and an x-band; a path map for a percentile band; and path data lists for a rose and a needle.
generate_path(shape, nil): meaningful for a symbol.
The generator's Macaw.Draw.IR.Path (a list of them for a rose and a needle, a map for
a percentile band); a pie, a rule and an x-band have none.
Sets height on a band.
Sets inner on a percentile_band.
Sets inner_radius on a arc, a rose.
Sets label on a rule, a x_band.
A line generator, Macaw.Draw.Shape.Line.new/0.
Sets median on a percentile_band.
A needle generator, Macaw.Draw.Shape.Needle.new/0.
Sets outer on a percentile_band.
Sets outer_radius on a arc, a rose.
Sets pad_angle on a arc, a pie, a rose.
Sets pad_radius on a arc.
A percentile-band generator, Macaw.Draw.Shape.PercentileBand.new/0.
A pie layout, Macaw.Draw.Shape.Pie.new/0.
A rose generator, Macaw.Draw.Shape.Rose.new/0.
A rule generator, Macaw.Draw.Shape.Rule.new/0.
Sets scale on a rule, a x_band, a rose, a needle.
Sets size on a symbol.
Sets sort on a pie.
Sets sort_values on a pie.
Sets start_angle on a arc, a pie.
A symbol generator, Macaw.Draw.Shape.Symbol.new/0.
Sets type on a symbol.
Sets the value accessor of a pie.
Sets width on a rose, a needle.
Sets x0 on a area, a band, a x_band.
Sets x1 on a area, a band, a x_band.
Sets x on a line, a area, a rule, a percentile_band.
An x-band generator, Macaw.Draw.Shape.XBand.new/0.
Sets y0 on a area, a rule, a x_band.
Sets y1 on a area, a rule, a x_band.
Sets y on a line, a area, a band.
Types
@type error() :: {:error, [Macaw.Base.Fault.t()]}
A refusal: faults with their paths.
@type generator() :: Macaw.Draw.Shape.Line.t() | Macaw.Draw.Shape.Area.t() | Macaw.Draw.Shape.Arc.t() | Macaw.Draw.Shape.Pie.t() | Macaw.Draw.Shape.Symbol.t() | Macaw.Draw.Shape.Band.t() | Macaw.Draw.Shape.Rule.t() | Macaw.Draw.Shape.XBand.t() | Macaw.Draw.Shape.PercentileBand.t() | Macaw.Draw.Shape.Rose.t() | Macaw.Draw.Shape.Needle.t()
Any of the generators the facade constructs.
Functions
Sets angle on a rose, a needle.
@spec arc() :: Macaw.Draw.Shape.Arc.t()
An arc generator, Macaw.Draw.Shape.Arc.new/0.
@spec area() :: Macaw.Draw.Shape.Area.t()
An area generator, Macaw.Draw.Shape.Area.new/0.
@spec band() :: Macaw.Draw.Shape.Band.t()
A band (state timeline) generator, Macaw.Draw.Shape.Band.new/0.
Sets corner_radius on a arc.
curve(shape, type, []).
Sets the curve of a line, an area or a percentile band: {:ok, shape} or {:error, faults} (§5.1).
Sets defined on a line, a area, a percentile_band.
Sets end_angle on a arc, a pie.
Sets fill on a band, a x_band.
generate(shape, nil): meaningful for a symbol.
The generator's output (§2): path data for a line, an area, an arc and a symbol; arc data for a pie; elements for a band, a rule and an x-band; a path map for a percentile band; and path data lists for a rose and a needle.
generate_path(shape, nil): meaningful for a symbol.
The generator's Macaw.Draw.IR.Path (a list of them for a rose and a needle, a map for
a percentile band); a pie, a rule and an x-band have none.
Sets height on a band.
Sets inner on a percentile_band.
Sets inner_radius on a arc, a rose.
Sets label on a rule, a x_band.
@spec line() :: Macaw.Draw.Shape.Line.t()
A line generator, Macaw.Draw.Shape.Line.new/0.
Sets median on a percentile_band.
@spec needle() :: Macaw.Draw.Shape.Needle.t()
A needle generator, Macaw.Draw.Shape.Needle.new/0.
Sets outer on a percentile_band.
Sets outer_radius on a arc, a rose.
Sets pad_angle on a arc, a pie, a rose.
Sets pad_radius on a arc.
@spec percentile_band() :: Macaw.Draw.Shape.PercentileBand.t()
A percentile-band generator, Macaw.Draw.Shape.PercentileBand.new/0.
@spec pie() :: Macaw.Draw.Shape.Pie.t()
A pie layout, Macaw.Draw.Shape.Pie.new/0.
@spec rose() :: Macaw.Draw.Shape.Rose.t()
A rose generator, Macaw.Draw.Shape.Rose.new/0.
@spec rule() :: Macaw.Draw.Shape.Rule.t()
A rule generator, Macaw.Draw.Shape.Rule.new/0.
Sets scale on a rule, a x_band, a rose, a needle.
Sets size on a symbol.
Sets sort on a pie.
Sets sort_values on a pie.
Sets start_angle on a arc, a pie.
@spec symbol() :: Macaw.Draw.Shape.Symbol.t()
A symbol generator, Macaw.Draw.Shape.Symbol.new/0.
Sets type on a symbol.
Sets the value accessor of a pie.
Sets width on a rose, a needle.
Sets x0 on a area, a band, a x_band.
Sets x1 on a area, a band, a x_band.
Sets x on a line, a area, a rule, a percentile_band.
@spec x_band() :: Macaw.Draw.Shape.XBand.t()
An x-band generator, Macaw.Draw.Shape.XBand.new/0.
Sets y0 on a area, a rule, a x_band.
Sets y1 on a area, a rule, a x_band.
Sets y on a line, a area, a band.