Skip to content

Hakowan: A 3D Data Visualization Grammar

Hakowan teaser

Hakowan is a 3D data visualization grammar based on the concept of The Grammar of Graphics. It is designed for creating compelling SIGGRAPH-quality 3D data visualizations with minimal setup. It provides a concise, high-level declarative API in python and is powered by project Lagrange for geometry processing and supports three rendering backends: WebGL (default, interactive browser viewer), Mitsuba (photorealistic), and Blender (Cycles/EEVEE).

Installation

Hakowan can be installed via pip from PyPI. The WebGL backend ships with the base install; the heavier Mitsuba and Blender backends are optional extras:

pip install hakowan                  # WebGL only (default)
pip install "hakowan[mitsuba]"         # add the Mitsuba backend
pip install "hakowan[blender]"         # add the Blender backend (Python 3.13)
pip install "hakowan[mitsuba,blender]" # all backends

Note that Hakowan requires Python 3.11 and above (Python 3.13 for the Blender backend).

Quick start

Let shape.obj be a mesh that you would like to visualize:

import hakowan as hkw

base = hkw.layer("shape.obj")
hkw.render(base, filename="output.html")

The above code creates a single visualization layer using shape.obj as the data. This layer is then rendered with the default WebGL backend into an interactive viewer named output.html, which you can open in any modern browser.

The shortest scalar-field visualization is one additional method call. Hakowan infers the numeric domain and adds a viridis color map and legend:

temperature = hkw.layer("mesh.ply").color_by("temperature")
hkw.render(temperature, filename="temperature.html")

Use hkw.inspect("mesh.ply") first when the available attribute names are not already known.

For deterministic WebGL captures, install hakowan[observe] and Chromium; see the capture setup. Use observe() for one or more views, passes, or programmatic inspection.

figure = hkw.figure(temperature).camera("fit", direction="isometric")
observation = hkw.observe(figure, passes=["beauty"])
capture = observation.snapshot("figure", "beauty")
capture.image.save("temperature.png")

Use hkw.observe() when the task needs several views, render passes, visual diagnostics, or machine-readable visibility evidence. See the rendering and viewers guide to choose between render and observe.

Hakowan's grammar decomposes a 3D visualization into layers, where each layer provides a specification of one or more of the following items:

  • Data: consists of the geometry as well as attributes associated with the geometry.

  • Mark: determines the geometry type (e.g. point, curve or surface).

  • Channel: defines the mapping from data attributes to the available visual channels.

  • Transform: is the data transformation that should be carried out before visualization.

Citation

@software{hakowan,
    title = {Hakowan: A 3D Data Visualization Grammar},
    version = {0.6.1},
    year = 2026,
}