Skip to content

Commit 21e58ed

Browse files
committed
Complete metadata for python package
1 parent e8aea36 commit 21e58ed

File tree

2 files changed

+89
-1
lines changed

2 files changed

+89
-1
lines changed

python/README.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,65 @@
11
# Grandscatter
22

3-
An [anywidget](https://anywidget.dev) Python package for grandscatter.
3+
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.
4+
5+
Built on [anywidget](https://anywidget.dev) and WebGL.
6+
7+
## Installation
8+
9+
```bash
10+
pip install grandscatter
11+
```
12+
13+
## Quick start
14+
15+
```python
16+
from grandscatter import Scatter
17+
import pandas as pd
18+
19+
df = pd.read_csv("my_data.csv")
20+
21+
widget = Scatter(
22+
df,
23+
axis_fields=["x1", "x2", "x3", "x4", "x5"],
24+
label_field="category",
25+
label_colors={"A": "#e23838", "B": "#2196f3", "C": "#4caf50"},
26+
)
27+
widget
28+
```
29+
30+
## Features
31+
32+
- **Interactive axis rotation** -- drag axis handles to rotate the projection and explore your data from any angle.
33+
- **Orthogonal projections** -- the projection matrix is always kept orthonormal, ensuring geometrically correct linear projections.
34+
- **Perspective and orthographic modes** -- switch between projection types on the fly.
35+
- **WebGL rendering** -- fast, anti-aliased point rendering with depth sorting.
36+
- **Categorical legend** -- click legend items to highlight categories.
37+
- **Live trait sync** -- update properties like `projection`, `axis_length`, `view_angle`, and `base_point_size` from Python and see changes reflected immediately.
38+
39+
## API
40+
41+
### `Scatter(df, axis_fields, label_field, label_colors, **kwargs)`
42+
43+
| Parameter | Type | Description |
44+
|---|---|---|
45+
| `df` | `pd.DataFrame` | Input data |
46+
| `axis_fields` | `list[str]` | Column names to use as projection dimensions |
47+
| `label_field` | `str` | Column name for categorical labels |
48+
| `label_colors` | `dict[str, str]` or `list[str]` | Mapping of category names to hex colors, or a list of colors in category order |
49+
| `projection` | `str` | `"orthographic"` (default) or `"perspective"` |
50+
| `axis_length` | `float` or `None` | Length of axis lines (`None` for auto) |
51+
| `camera_z` | `float` or `None` | Camera z-position for perspective mode |
52+
| `view_angle` | `float` | Field of view in degrees (default `45`) |
53+
| `base_point_size` | `float` | Point radius in pixels (default `6`) |
54+
55+
All keyword parameters are traitlets and can be updated after creation:
56+
57+
```python
58+
widget.projection = "perspective"
59+
widget.base_point_size = 4
60+
widget.view_angle = 90
61+
```
62+
63+
## License
64+
65+
MIT

python/pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,40 @@ name = "grandscatter"
77
version = "0.1.0"
88
description = "Interactive multidimensional scatterplot Jupyter widget"
99
readme = "README.md"
10+
license = "MIT"
1011
requires-python = ">=3.11"
12+
authors = [
13+
{ name = "Nezar Abdennur", email = "nabdennur@gmail.com" },
14+
]
15+
keywords = [
16+
"jupyter",
17+
"widget",
18+
"scatterplot",
19+
"visualization",
20+
"multidimensional",
21+
"grand-tour",
22+
]
23+
classifiers = [
24+
"Development Status :: 3 - Alpha",
25+
"Framework :: Jupyter",
26+
"Framework :: Jupyter :: JupyterLab",
27+
"Intended Audience :: Science/Research",
28+
"License :: OSI Approved :: MIT License",
29+
"Programming Language :: Python :: 3",
30+
"Topic :: Scientific/Engineering :: Visualization",
31+
]
1132
dependencies = [
1233
"anywidget>=0.9.21",
1334
"pandas>=3.0.0",
1435
"pyarrow>=23.0.1",
1536
"traitlets>=5.14.3",
1637
]
1738

39+
[project.urls]
40+
Homepage = "https://github.com/abdenlab/grandscatter"
41+
Repository = "https://github.com/abdenlab/grandscatter"
42+
"Bug Tracker" = "https://github.com/abdenlab/grandscatter/issues"
43+
1844
[dependency-groups]
1945
dev = [
2046
"anywidget[dev]>=0.9.21",

0 commit comments

Comments
 (0)