Skip to content

Grammar-of-graphics charts, 
native to Mojo

One fluent Plot builder – mark, encode, theme – covers 40+ chart types,
rendered to SVG or raster.

See it before you build it

Every chart below comes straight from the example gallery.

Nine of the 40+ chart types this package builds -- see the rest, source next to rendered output, in the examples gallery.

Why dataviz_mojo?

A first chart

from dataviz_mojo import Plot, save

def main() raises:
    var x: List[Float64] = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]
    var y: List[Float64] = [2.3, 4.1, 3.6, 5.8, 5.1, 7.4, 6.9, 8.2, 9.0, 8.6]

    var plot = (
                Plot()
                .mark_point()
                .encode(x=x, y=y)
               )

    save(plot, "chart.svg")
The scatter plot that code produces

That’s the same pattern behind every mark type this package supports, plus color/size encoding, facets, multi-series layering, and the raster backend.

Quickstart →