The grid and the axes a model places (spec/03 §3, §3.1, §3.2), and the order a frame's groups draw in.
- The order (§3,
compose/3): the grid, the layers (a layer kind declaringorder: :beneathfirst), the axes, the legend, the labels, the same in every model. Grid and axes groups arearia-hidden; a frame's clip reaches its layers alone. - The grid (§3.1):
grid: trueon an axis draws a line at each of its ticks across the plot, in one groupclass="mw-grid"behind every layer, in thegridstyle. - Axes (§3.2,
axis/3):Macaw.Draw.Axisover the realized scale, oriented by itsside, placed by the model (cartesian:bottomattranslate(0, h),rightattranslate(w, 0)); the derived tick count is the axis's length at 80 pixels a tick across and 35 down, clamped to2..10; the derived format follows the scale; ameasure(the axis's own, else its bound field'sunitandquantityfrom the slot's schema, spec/02 §4.4) scales the ticks into the display unit under the viewer's system, and an axis whose ticks cannot carry the unit draws the measure's title unless a label anchors there. The group isclass="mw-axis mw-axis-<side>".
Furniture is drawn into Macaw.Draw.IR elements. Copied from visualize's
Visualize.Chart.Frame.Furniture, colors as theme roles.
The options every function here takes: :theme, :mode (:css or :literal),
:styles (the design's styles), :labels (the frame's labels), :schemas (each
slot's schema, for declared names and measures) and :bindings (the cell's binding of
each slot's roles to fields).
Summary
Functions
The Macaw.Draw.Axis an axis node describes over the model's realized scale (§3.2),
its derived defaults filled from the model's geometry: {:ok, axis}, or a fault at the
axis's path for a scale the frame does not realize or cannot draw an axis on. Options
as the module says, and :length (the axis's length in pixels, its range's span by
default) and :run (the side its labels are spaced as, its own by default).
The frame's axis nodes, as written.
The cartesian parts of a model (§3.1, §3.2): the grid of every axis asking for one, the
axes at their sides, the legend and the labels; axes is the list of a frame's axis
nodes to draw (all by default). The answer of a model's furniture/2 with parts: true, and its flat list without.
The frame's groups in order (§3): its model's grid, the layers given (each an element,
or {element, order} with order :beneath drawn first), its axes, its legend and its
labels. In a model whose layers draw about an origin (the polar model's center) the
grid, the layers and the model's own axes share one group translated there.
Types
@type parts() :: %{ grid: [Macaw.Draw.IR.Element.t()], axes: [Macaw.Draw.IR.Element.t()], outer: [Macaw.Draw.IR.Element.t()], legend: [Macaw.Draw.IR.Element.t()], labels: [Macaw.Draw.IR.Element.t()], origin: {number(), number()} }
A frame's furniture by part, and the translation its layers draw under.
Functions
@spec axis(term(), term(), term()) :: {:ok, Macaw.Draw.Axis.t()} | {:error, list()}
The Macaw.Draw.Axis an axis node describes over the model's realized scale (§3.2),
its derived defaults filled from the model's geometry: {:ok, axis}, or a fault at the
axis's path for a scale the frame does not realize or cannot draw an axis on. Options
as the module says, and :length (the axis's length in pixels, its range's span by
default) and :run (the side its labels are spaced as, its own by default).
@spec axis_nodes(Macaw.Frame.Coordinates.Model.t()) :: [map()]
The frame's axis nodes, as written.
@spec cartesian(Macaw.Frame.Coordinates.Model.t(), keyword()) :: {:ok, parts() | [Macaw.Draw.IR.Element.t()]} | {:error, list()}
The cartesian parts of a model (§3.1, §3.2): the grid of every axis asking for one, the
axes at their sides, the legend and the labels; axes is the list of a frame's axis
nodes to draw (all by default). The answer of a model's furniture/2 with parts: true, and its flat list without.
@spec compose(term(), term(), term()) :: {:ok, [Macaw.Draw.IR.Element.t()]} | {:error, list()}
The frame's groups in order (§3): its model's grid, the layers given (each an element,
or {element, order} with order :beneath drawn first), its axes, its legend and its
labels. In a model whose layers draw about an origin (the polar model's center) the
grid, the layers and the model's own axes share one group translated there.