3D scatterplots probably suck, but they're much more fun than regular scatterplots!
Caution
This project is as Work-In-Progress as it gets.
The basic idea is:
- arrow/dataframe as input (with 'x', 'y', 'z' columns)
- minimal dependencies & small bundle size
- webgpu rendering
- javascript library (npm), jupyter widget (pypi), web page (like quak)
Install:
uv add scatteredor: pip install scattered
Then use:
import scattered
import numpy as np
import pandas as pd
df = pd.DataFrame({
"x": np.random.rand(5),
"y": np.random.rand(5),
"z": np.random.rand(5),
})
scattered.Widget(df)Install:
pnpm add scatteredor: npm install scattered or yarn add scattered
Then use:
import * as sctrd from "scattered";
const url = "https://raw.githubusercontent.com/dvdkouril/sample-3d-scatterplot-data/main/penguins.arrow";
const c = sctrd.display(url,
{ // encoding
x: "x",
y: "y",
z: "z",
color: "category",
});
let appEl = document.querySelector('#app');
if (c) {
appEl.appendChild(c);
}This project is developed by David Kouřil (web, bsky).
I think we're missing a modern, simple to use library for interactive 3D scatterplots. Visualization libraries are typically centered around 2D plots to make exporting as vector graphics easier.
However, learning is the primary motivation:
- learn a bit of webgpu
- explore the composability principles for visualization tools
- learn about bundling, and how to maintain multi-package project
scattered is very much inspired by quak and also follow
the structure of that repo.
From researching 3D scatterplots in the wild.
