API Reference
API Reference
Mojo package 🡭
dataviz
The package’s concise public API: chart constructors, the Plot/Theme core, rendering operations, and commonly used plotting enums.
Specialist vocabulary stays in its named public module: colors in
dataviz.core.colors, colormaps in dataviz.core.colormaps, categorical palettes in
dataviz.core.palettes, histogram utilities in
dataviz.binned.histogram, scales in dataviz.core.scale/dataviz.core.color_scale, theme
presets in dataviz.core.themes, markers in dataviz.core.marker, and custom-container
traits in dataviz.core.array_like.
Modules
chart: A chart whose mark is a type (#828).Chart[M]holds oneM, the settings every mark shares, the mark style and the annotations; eachencode_*()forwards to the mark, which either accepts it or refuses it at compile time.Plotis the entry point: settings only, until amark_*()picks the mark and the chain becomes aChartof that type. BesidePlotfor now; it replaces it once every entry point is generic overM.facets:render_facets(): one plot per cell, laid out in a uniform grid.frame_facets: Splitting a frame into one sub-frame per level, for facets (#364).layers:render_layers(): several plots sharing one frame.layout: Cell layout: the one corerender_facets()andrender_grid()share.mark_type: The trait a chart’s mark type implements (#828): a runtimeMarkid for the tables and messages that still key on it, a renderer over the mark’s own columns, and everyencode_*()the package has, each with a default body that refuses at compile time. A mark overrides the encoders it accepts, soChart[M].encode_x()is a compile error on any otherM.marks: Every mark as a type (#828), one struct perMarkconstant, over the renderers and encoders phase 2 left behind. A mark holds only the columns its renderer and encoders touch;Chart[M]holds what every mark shares. Generated fromPlot’s setters,encode_*()methods and the_render_*_plotadapters, which stay the source of truth untilPlotitself becomesChart.plot:Plot, the entry point of every chart: settings only, until amark_*()call picks the mark and the chain becomes aChartof that mark’s type (#828).Plot().mark_gantt()is aChart[Gantt], and from thereencode_gantt()exists andencode_categorical()does not, which the compiler says rather thanrender().rendering: The rendering pipeline and every output entry point:render(),render_svg(),render_pdf(), therender_tight*()variants,save()and the accessible-SVG writers, plus the[T: DrawTarget]core they share (_render_generic,_draw_figure_into) and the supersample, dpi and output-format resolution around it.
Packages
aggregation: Estimates computed from raw observations: group means, counts and fitted residuals, rather than values supplied per category.basic: The core chart types: one mark, default theme.binned: Counts collected into bins or cells rather than plotted per observation.categorical: Charts built around one categorical dimension: rankings, timelines, progress, period-over-period comparisons and process stages.core: Infrastructure the marks draw against: scales, frames, text, color and the small shared enums (#524).distributions: The shape of a sample: boxes, densities, per-category spreads and event times, plus the OHLC candlestick, which draws the same per-category box-with-wicks on the same categorical frame.grid: A value per cell of a grid, mostly two categorical dimensions; imshow and pcolormesh are the continuous-axis pair for an array rather than a table.hierarchy_marks: A tree, not a value per category: one flattened id/parent_id/value row per node.multivariate: Several numeric dimensions compared at once on one shared layout, not a single value per category.radial: Charts on a polar (angle plus radius) coordinate system instead of a cartesian one.relationships: Weighted connections between entities, not a value per category.spatial: Charts that project a third dimension onto the page (#345): the camera and frame live indataviz.core, the marks here.