Skip to main content

3D scatterplots are useless, but fun

Project description

scattered: a composable library for 3D scatterplots

3D scatterplots probably suck, but they're much more fun than regular scatterplots!

[!CAUTION] This project is as Work-In-Progress as it gets.

teaser

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)

use in python

Install:

uv add scattered

or: 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)

use in javascript

Install:

pnpm add scattered

or: 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);
}

about

This project is developed by David Kouřil (web, bsky).

why

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:

  1. learn a bit of webgpu
  2. explore the composability principles for visualization tools
  3. 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.

related and inspo

From researching 3D scatterplots in the wild.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scattered-0.1.0.tar.gz (290.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scattered-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file scattered-0.1.0.tar.gz.

File metadata

  • Download URL: scattered-0.1.0.tar.gz
  • Upload date:
  • Size: 290.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for scattered-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8e54603cde048dc01c8df1e4fd48c4682e111a8e596863fe187eff8d865019a3
MD5 dbec463554c72d5f98e1416a31c845d5
BLAKE2b-256 f21ba24cd15cdc86680f0ed9ecb6af79cd3a1172f4e54ab5e8b8f104cc2fd99c

See more details on using hashes here.

File details

Details for the file scattered-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: scattered-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for scattered-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eecef56edfaa67d235e08bb23bc253934f11894ce22ee14a5edaa89f2acc1ace
MD5 e957cd6dabc3c5da5636aaf5da2b5d74
BLAKE2b-256 a100127e50e326cf47cf3f5a1e995ae338c33e565f0c62e2f387faeafc90feb9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page