API Reference macaw_layers v#0.2.2

Copy Markdown View Source

Modules

A portable set of documents (spec/03 §3): the transitive closure of what a page needs, with where it came from, in a map form and a JSON form so it can leave the node it was made on, and imported into another store as a relocation (Macaw.Layers.Store.relocate/3).

Colors (spec/04 §1): parsing, construction in RGB, HSL, Lab, HCL, OKLab and OKLCH, conversion, manipulation and interpolation.

Color-vision simulation: how a color reads to a person with one of the three dichromacies (spec/04 §1.5, visualize D-139).

Composites (spec/02 §8): a fragment whose content is a list of use sites and its own variable declarations, stored as structure and flattened at deployment.

Reading a document through the gates, in order (spec/01 §5).

A fault in a document, {path, reason}, and the one formatter that words it (spec/01 §3).

A document's map form and JSON form, exact inverses for valid values (spec/01 §6).

Fragments and stacking (spec/02): the fragment-type behavior, and the operations over fragments of a type.

Sanity limits on a document read from elsewhere (spec/01 §5).

Names a document declares (spec/01 §1): a source, a field, a variable, a frame, a style, a fragment's key.

The depth and items limits checked on encoded JSON, before it is decoded (spec/01 §5, gate 2).

Where documents live (spec/03 §1): the store behavior, the assign's functions, typed ids (§2) and import as a relocation (§3.3).

The default store, held in memory (spec/03 §1.2): an Agent the host starts under its own supervisor, its context the agent.

A document type's table of $ tags (spec/01 §6).

The colors, fonts and sizes a page draws with (spec/04 §2, §3).

A theme as a document (spec/04 §5): stored and shipped as a value, and read back through every gate.

What an adopter registers beyond the library's vocabulary (spec/04 §3.4), so one theme styles it: palette names in a group of the palette, and names of the color table, each with its default.

A theme compiled to a stylesheet (spec/04 §6): custom properties scoped by a class, .mw-theme-<name>, so every element under that class draws in the theme and a page switches theme by its class alone. Adopters emit the same class and properties, so a visualize chart standalone and on a page reads the same properties.

A use site (spec/02 §7): a fragment used at a position, resolved ref → local → mask → bind → stack.

A variable (spec/02 §5): a term allowed wherever a value can appear, carrying only its name, a string. Its default is declared once by the document that uses it, so two fragments cannot disagree about it. A variable is a struct, so it is a leaf of every walk: it stands for a value rather than being one.

One version line per document type, and stepwise migration (spec/01 §4).

A closed vocabulary read from a string (spec/01 §2).