ParallelCoordinates API#
Bases: AnyWidget
Interactive parallel coordinates plot powered by HiPlot.
Wraps Facebook Research's HiPlot library to provide brush filtering on axes, axis reordering via drag, and coloring lines by a selected dimension -- all inside a notebook widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Dataset as a list of dictionaries, pandas DataFrame, or polars DataFrame. Each row becomes one polyline in the chart. |
None
|
|
color_by
|
str
|
Column name used to color lines. Leave empty for a single default color. |
''
|
height
|
int
|
Widget height in pixels. |
600
|
width
|
int
|
Widget width in pixels. Set to 0 for container width. |
0
|
Examples:
from wigglystuff import ParallelCoordinates
import polars as pl
df = pl.DataFrame({
"x": [1, 2, 3, 4, 5],
"y": [5, 4, 3, 2, 1],
"label": ["a", "a", "b", "b", "b"],
})
widget = ParallelCoordinates(df, color_by="label")
widget
Create a ParallelCoordinates widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Dataset as a list of dicts, pandas DataFrame, or polars DataFrame. Each dict/row is one data point. |
None
|
|
color_by
|
str
|
Column name to color lines by. Empty string for uniform color. |
''
|
height
|
int
|
Widget height in pixels. |
600
|
width
|
int
|
Widget width in pixels. Set to 0 for container width. |
0
|
Source code in wigglystuff/parallel_coords.py
Synced traitlets#
| Traitlet | Type | Notes |
|---|---|---|
data |
list[dict] |
Input rows rendered as polylines. |
color_by |
str |
Column used for line coloring. |
height |
int |
Plot height in pixels. |
filtered_indices |
list[int] |
Indices currently passing filters/selection. |
selected_indices |
list[int] |
Indices currently selected in the active brush. |