Macaw.Frame.Document.Schema.Frame (macaw_frame v0.1.0)

Copy Markdown View Source

The frame's node kinds of the frame document (spec/02 §4): the frame, its margin, scales, axes and their ticks and measures, legend, the model-specific nodes and the transition node.

Macaw.Frame.Document.Schema builds the tables once, at compile time; read them through it. A model-specific node (:projection, :fit, :layout, :facet, :viewport) is its model's, validated by the model ([03-coordinates]); the table here is what spec/02 §4.6 gives of it.

Summary

Functions

The key specs of a frame-level node kind, in the order of its table in spec/02; {:error, [{[], {:enum, kinds}}]} for a kind this module does not describe.

The node kinds this module describes, in spec/02 §1.2's order.

The margin a frame draws with when it gives none (§4.1).

The scale kinds of macaw_draw spec/06 a :scale node names (§4.3).

Functions

describe(arg1)

@spec describe(term()) :: [Macaw.Frame.Document.Schema.Spec.t()] | {:error, list()}

The key specs of a frame-level node kind, in the order of its table in spec/02; {:error, [{[], {:enum, kinds}}]} for a kind this module does not describe.

iex> Enum.map(Macaw.Frame.Document.Schema.Frame.describe(:margin), & &1.key)
[:top, :right, :bottom, :left]

kinds()

@spec kinds() :: [atom(), ...]

The node kinds this module describes, in spec/02 §1.2's order.

margin()

@spec margin() :: %{top: 20, right: 20, bottom: 30, left: 40}

The margin a frame draws with when it gives none (§4.1).

scale_kinds()

@spec scale_kinds() :: [atom(), ...]

The scale kinds of macaw_draw spec/06 a :scale node names (§4.3).