Macaw.Frame.Layers.Rect (macaw_frame v0.1.0)

Copy Markdown View Source

The rect kind (spec/04 §4.12), copied from visualize's Visualize.Chart.Mark.Generic rect: a bar, a heatmap cell, a treemap tile.

ChannelRole, familyTypes
x0, x1edge, xtime, number, categoryreq
y0, y1edge, ynumber, categoryreq
valuecolor, colornumber, category
seriesseriescategory, text, number

Options: corner_radius (0). Parts: fill, stroke. Paint: fill; value reaches the color scale as the element's own fill. One rect per row: x = min(x0, x1), width = |x1 − x0|, likewise y and height, rx and ry when the corner radius is positive. Grouping is offset: %{"x" => series} with an x_offset band scale. In polar it bends to an annular sector. A bar is provisional when its x0 is at or after the claim or its x1 after it. Anchor: the center; edge anchors apply. Extent: its width, its height holding the font. Budget: ceil(w / 2). Summary: "bar chart", "grouped bar chart" with an offset, "stacked bar chart" after a stack, "heatmap" when both families read fields at both ends and value is given, "rectangle chart" otherwise, "radial bar chart" in polar, "treemap" or "icicle" over those layouts.