Skip to content
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 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.
  • 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 core render_facets() and render_grid() share.
  • mark_type: The trait a chart’s mark type implements (#828): a runtime Mark id for the tables and messages that still key on it, a renderer over the mark’s own columns, and every encode_*() the package has, each with a default body that refuses at compile time. A mark overrides the encoders it accepts, so Chart[M].encode_x() is a compile error on any other M.
  • marks: Every mark as a type (#828), one struct per Mark constant, 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 from Plot’s setters, encode_*() methods and the _render_*_plot adapters, which stay the source of truth until Plot itself becomes Chart.
  • plot: Plot, the entry point of every chart: settings only, until a mark_*() call picks the mark and the chain becomes a Chart of that mark’s type (#828). Plot().mark_gantt() is a Chart[Gantt], and from there encode_gantt() exists and encode_categorical() does not, which the compiler says rather than render().
  • rendering: The rendering pipeline and every output entry point: render(), render_svg(), render_pdf(), the render_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 in dataviz.core, the marks here.