The layout model (spec/03 §9): a layout assigns the positions, and the frame runs its layout once per realization; its layers read the layout's outputs.
- What it owns (§9.1): the key
layout(absent when the frame's layers lay themselves out by their spatial steps, as the catalog's hierarchies and graphs do, spec/13 §5), a node ofkind(orop, a layout's name:tree,cluster,pack,partition,treemap,sankey,chord,force), its options, and its slots:nodes(a hierarchy's single slot, a graph's optional node slot) andlinks(a graph's flows). A hierarchy's rows carryidandparent(andvalue); a network's linkssource,targetandvalue, its nodesid. An op the drawing library lacks is{:unknown, :layout, name}at the layout'skind. The default margin is zero. - One run per realization (§9.2):
realize/3runs the layout over its slots' deliveries throughMacaw.Draw.Layout's modules and holds one table per output (nodes,links,groups,chords) as the model'slayout; a layer readingoutput: "links"(the document'sdata: %{"layout" => "links"}) reads that table. The run repeats only on a delivery to a slot it reads and onsize. A warm force starts from the carried simulation (warm:), reheated toalpha0.3 and stepped at most 3 ticks; a cold one runs d3's 300 from alpha 1. - Placement and furniture (§9.3): every positional channel is pixels;
place/2of{id}is the node's position; no axes on positions and no grid;sizedefaults to the plot, a ring's center is the plot's center. - Hit-testing, writes and summary (§9.4): a pick of a node emits its identity, of a
link its
sourceandtargetwhen the slot declares none;invert/2is:none; the summary names the layout's kind, its node and link counts, a hierarchy's depth.
Summary
Functions
A pick (§9.4): of a node, its declared identity (its slot's, else its id); of a link,
its source and target pair when the links slot declares none.
The layers to outline when a node is hovered (§9.4): each {layer, row} of the link
outputs whose source or target is the node's identity, read by column.
The layouts a layout frame may run.
The layout run over its slots (§9.2): {:ok, %{op, outputs, simulation, depth}},
outputs a Macaw.Data.Table per output, or the layout's faults. slots holds each
slot's %{table: ...}; warm a force simulation carried from the last realization.
The slots a layout node reads (§9.1), each with the roles it reads from it:
%{"nodes" => {slot, roles}, "links" => {slot, roles}}.
Functions
A pick (§9.4): of a node, its declared identity (its slot's, else its id); of a link,
its source and target pair when the links slot declares none.
@spec linked(Macaw.Frame.Coordinates.Model.t(), term()) :: [non_neg_integer()]
The layers to outline when a node is hovered (§9.4): each {layer, row} of the link
outputs whose source or target is the node's identity, read by column.
@spec ops() :: [String.t()]
The layouts a layout frame may run.
The layout run over its slots (§9.2): {:ok, %{op, outputs, simulation, depth}},
outputs a Macaw.Data.Table per output, or the layout's faults. slots holds each
slot's %{table: ...}; warm a force simulation carried from the last realization.
The slots a layout node reads (§9.1), each with the roles it reads from it:
%{"nodes" => {slot, roles}, "links" => {slot, roles}}.