Skip to main content

Interactive multidimensional scatterplot Jupyter widget

Project description

Grandscatter

Interactive multidimensional scatterplot widget for Jupyter notebooks. Rotate projection axes by dragging to explore high-dimensional point clouds with correct linear projections at all times.

Built on anywidget and WebGL.

Installation

pip install grandscatter

Quick start

from grandscatter import Scatter
import pandas as pd

df = pd.read_csv("my_data.csv")

widget = Scatter(
    df,
    axis_fields=["x1", "x2", "x3", "x4", "x5"],
    label_field="category",
    label_colors={"A": "#e23838", "B": "#2196f3", "C": "#4caf50"},
)
widget

Features

  • Interactive axis rotation -- drag axis handles to rotate the projection and explore your data from any angle.
  • Orthogonal projections -- the projection matrix is always kept orthonormal, ensuring geometrically correct linear projections.
  • Perspective and orthographic modes -- switch between projection types on the fly.
  • WebGL rendering -- fast, anti-aliased point rendering with depth sorting.
  • Categorical legend -- click legend items to highlight categories.
  • Live trait sync -- update properties like projection, axis_length, view_angle, and base_point_size from Python and see changes reflected immediately.

API

Scatter(df, axis_fields, label_field, label_colors, **kwargs)

Parameter Type Description
df pd.DataFrame Input data
axis_fields list[str] Column names to use as projection dimensions
label_field str Column name for categorical labels
label_colors dict[str, str] or list[str] Mapping of category names to hex colors, or a list of colors in category order
projection str "orthographic" (default) or "perspective"
axis_length float or None Length of axis lines (None for auto)
camera_z float or None Camera z-position for perspective mode
view_angle float Field of view in degrees (default 45)
base_point_size float Point radius in pixels (default 6)

All keyword parameters are traitlets and can be updated after creation:

widget.projection = "perspective"
widget.base_point_size = 4
widget.view_angle = 90

License

MIT

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

grandscatter-0.1.0.tar.gz (68.6 kB view details)

Uploaded Source

Built Distribution

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

grandscatter-0.1.0-py3-none-any.whl (69.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grandscatter-0.1.0.tar.gz
  • Upload date:
  • Size: 68.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for grandscatter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6335054a9f8a2da7d834ab1a025742b7c943f3e7e76ec9721c32237250620348
MD5 5cd5ec5e91b3a0d171ad9db4be5e45d5
BLAKE2b-256 8506c77efdc0057c93807b88dfdb70d6217fc2b54df7e2ad55ac21cd705de58a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for grandscatter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ade0368e83d98f4c96e3cfcfd24ea9f5086facec2ba6ea5ca6b1c0adafbab0ae
MD5 f5d7c45d01eb4a00a90f40606582b73d
BLAKE2b-256 df6560a9a558b92ebc717b952d6deb256d11c7d5071e48265cd981395cd17b09

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