Slider2D API#
Bases: AnyWidget
Two dimensional slider for simultaneous adjustments.
Emits synchronized x/y floats that stay within configurable bounds
while rendering to a pixel canvas sized via width/height.
Examples:
Create a Slider2D widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
Initial x coordinate. |
0.0
|
y
|
float
|
Initial y coordinate. |
0.0
|
width
|
int
|
Canvas width in pixels. |
400
|
height
|
int
|
Canvas height in pixels. |
400
|
x_bounds
|
tuple[float, float]
|
Min/max tuple for x. |
(-1.0, 1.0)
|
y_bounds
|
tuple[float, float]
|
Min/max tuple for y. |
(-1.0, 1.0)
|
**kwargs
|
Any
|
Forwarded to |
{}
|
Source code in wigglystuff/slider2d.py
Synced traitlets#
| Traitlet | Type | Notes |
|---|---|---|
x |
float |
Current x position. |
y |
float |
Current y position. |
x_bounds |
tuple[float, float] |
Min/max x bounds. |
y_bounds |
tuple[float, float] |
Min/max y bounds. |
width |
int |
Canvas width in pixels. |
height |
int |
Canvas height in pixels. |