Skip to content

Datoviz: high-performance GPU scientific data visualization C/C++ library

[Installation]   [Usage]   [User guide]   [Examples]   [API reference]  

⚡️ Datoviz is a cross-platform, open-source, high-performance GPU scientific data visualization library written in C/C++ on top of the Khronos Vulkan graphics API and the glfw window library. It provides raw ctypes bindings in Python 🐍. In the long term, Datoviz will mostly be used as a VisPy 2.0 backend.

Designed for speed, visual quality, and scalability to datasets comprising millions of points, it supports 2D/3D interactive rendering and minimal GUIs via Dear ImGui.

⚠️ Warning: Although Datoviz has been years in the making, it is still in its early stages and would greatly benefit from increased community feedback, particularly concerning package and hardware compatibility. The API is still evolving, so expect regular (though hopefully minimal) breaking changes for now. The current version is v0.2. The previous v0.1 version is now deprecated.

🕐 Roadmap. In the medium term: increasing OS and hardware compatibility, providing more visuals, interactivity patterns, and GUI controls. In the long term: picking, custom visuals and shaders, nonlinear transforms, WebGPU/WebAssembly compatibility, integration with IPython, Jupyter and Qt.

🖼️ Screenshots from the v0.1 version

Credits: mouse brain volume: Allen SDK. France: Natural Earth. Molecule: Crystal structure of S. pyogenes Cas9 from PDB (thanks to Eric for conversion to OBJ mesh). Earth: Pixabay. Raster plot: IBL. 3D human brain: Anneke Alkemade et al. 2020, thanks to Pierre-Louis Bazin and Julia Huntenburg.

✨ Features

  • 📊 High-quality antialiased 2D visuals: markers, lines, paths, glyphs
  • 🌐 3D visuals: meshes, volumes, volume slices
  • 🌈 150 colormaps included (from matplotlib, colorcet, MATLAB)
  • 🖱️ High-level interactivity: pan & zoom for 2D, arcball for 3D (more later)
  • 🎥 Manual control of cameras: custom interactivity
  • 𓈈 Figure subplots (aka "panels")
  • 🖥️ Minimal GUIs using Dear ImGui

List of visuals

List of visuals

Work in progress

These features are currently planned for v0.3:

  • ➕ Axes: ticks, grids, labels
  • 🎨 Colorbars
  • 🖱️ More interactivity patterns
  • 📖 More documentation

Future work

These features are currently planned for v0.4 and later:

  • 📐 More visuals: arrows, polygons, planar straight-line graphs (PSLG), histograms, areas, graphs
  • 🎯 Picking
  • 📈 Nonlinear transforms
  • 🖌️ Dynamic shaders
  • 🌐 WebGPU/WebAssembly compatibility
  • 🧮 Compute shaders
  • 🐍 IPython, Jupyter, Qt integration

🛠️ Installation instructions

Requirements:

  • A supported OS (Linux, macOS 12+, Windows 10+)
  • A Vulkan-capable graphics chipset (either integrated or dedicated graphics process unit)
  • Python and NumPy

Note: You no longer need to install the Vulkan SDK or to manually build the library. Precompiled wheels for Linux, Windows, and macOS have been uploaded to PyPI.

pip install datoviz

🚀 Usage

Simple scatter plot example (points with random positions, colors, and sizes) in Python, which closely follow the C API.

import numpy as np
import datoviz as dvz

app = dvz.app(0)
batch = dvz.app_batch(app)
scene = dvz.scene(batch)

figure = dvz.figure(scene, 800, 600, 0)
panel = dvz.panel_default(figure)
dvz.panel_panzoom(panel)
visual = dvz.point(batch, 0)

n = 100_000
dvz.point_alloc(visual, n)

pos = np.random.normal(size=(n, 3), scale=.25).astype(np.float32)
dvz.point_position(visual, 0, n, pos, 0)

color = np.random.uniform(size=(n, 4), low=50, high=240).astype(np.uint8)
dvz.point_color(visual, 0, n, color, 0)

size = np.random.uniform(size=(n,), low=10, high=30).astype(np.float32)
dvz.point_size(visual, 0, n, size, 0)

dvz.panel_visual(panel, visual, 0)
dvz.scene_run(scene, app, 0)
dvz.scene_destroy(scene)
dvz.app_destroy(app)

Check out the examples documentation for more usage examples.

📚 Documentation

🕰️ History and current status

In 2012, developers of various GPU scientific visualization libraries (Galry, Glumpy, pyqtgraph, visvis) collaborated to create VisPy, an OpenGL-based scientific visualization library for Python.

In 2015, Vulkan, the successor to OpenGL, was announced by Khronos, sparking the idea of a future Vulkan-based visualization library.

In 2019, Cyrille Rossant, one of the original VisPy developers, began experimenting with Vulkan.

In 2021, the first experimental version of Datoviz v0.1 was released. This initial release laid the groundwork for further development.

Over the next three years, the technology matured, aided by a Chan Zuckerberg Initiative (CZI) grant awarded to VisPy in 2021.

In 2024, Datoviz v0.2 is released. This version is redesigned from the ground up to enhance modularity and stability, ensuring it can keep pace with the continuous advancements in GPU hardware and graphics rendering APIs. It features a modular architecture that will allow the porting of Datoviz technology to non-Vulkan environments, such as WebGPU-enabled web browsers (thanks to a second CZI grant).

Datoviz is closely related to VisPy, as it is being developed by one of the VisPy cofounders. VisPy 2.0, initiated by Cyrille Rossant and Nicolas Rougier, will offer a high-level scientific API on top of Datoviz, matplotlib, and other renderers via a common medium-level visualization layer called "graphics server protocol (GSP)".

The long-term vision is for high-performance GPU-based 2D/3D scientific visualization to be uniformly available across multiple platforms, environments (desktop, web, cloud-based remote visualization), and programming languages (C/C++, Python, Julia, Rust, etc.).

🤝 Contributing

See the contributing notes.

📄 License

See the MIT license.

🙏 Credits

Datoviz is developed by Cyrille Rossant at the International Brain Laboratory, a consortium of neuroscience research labs around the world.

It is funded notably by Chan Zuckerberg Initiative's Essential Open Source Software for Science program.