chart
chart
Mojo module 🡭
chart
A chart whose mark is a type (#828). Chart[M] holds one M, the settings every mark shares, the mark style and the annotations; each encode_*() forwards to the mark, which either accepts it or refuses it at compile time. Plot is the entry point: settings only, until a mark_*() picks the mark and the chain becomes a Chart of that type. Beside Plot for now; it replaces it once every entry point is generic over M.
Structs
Chart: One chart of mark typeM: the mark’s own columns inmark, and everything every mark shares beside it. Built throughPlot.AnyChart: A chart whose mark type has been erased, so charts of different marks can share aListfor layers, facets and figures. It keeps everything a chart shares by value, copies of the shared channel structs the composition code reads (empty for a mark without them), the mark id, and the mark itself behind a pointer with the functions that draw, copy and free it, specialized when the chart is erased. Only the marks a program erases get instantiated.
Traits
ChartLike: What the render pipeline needs from a chart, whether its mark is a type (Chart[M]) or erased (AnyChart): the shared settings by value, the mark id, the canvas size, the continuous columns the smooth and best-fit annotations regress over, and the mark’s own draw. Trait methods cannot return references, so the settings come back as copies; the pipeline takes them once per render.