Tangle Widgets API#
TangleSlider#
Bases: AnyWidget
Inline slider inspired by Bret Victor's Tangle UI.
Examples:
Create a slider suitable for inline Tangle interactions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
Optional[float]
|
Starting value; defaults to midpoint of bounds. |
None
|
min_value
|
float
|
Lower bound. |
-100
|
max_value
|
float
|
Upper bound. |
100
|
step
|
float
|
Increment size. |
1.0
|
pixels_per_step
|
int
|
Drag distance per step. |
2
|
prefix
|
str
|
Text shown before the value. |
''
|
suffix
|
str
|
Text shown after the value. |
''
|
digits
|
int
|
Number formatting precision. |
1
|
**kwargs
|
Any
|
Forwarded to |
{}
|
Source code in wigglystuff/tangle.py
Synced traitlets#
| Traitlet | Type | Notes |
|---|---|---|
amount |
float |
Current value. |
min_value |
float |
Lower bound. |
max_value |
float |
Upper bound. |
step |
float |
Step size. |
pixels_per_step |
int |
Drag distance per step. |
prefix |
str |
Text before the value. |
suffix |
str |
Text after the value. |
digits |
int |
Decimal precision for display. |
TangleChoice#
Bases: AnyWidget
Inline choice widget that cycles through labeled options.
Examples:
Create a TangleChoice widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
choices
|
List[str]
|
Ordered sequence of options (min two). |
required |
**kwargs
|
Any
|
Forwarded to |
{}
|
Source code in wigglystuff/tangle.py
Synced traitlets#
| Traitlet | Type | Notes |
|---|---|---|
choice |
str |
Current selection. |
choices |
list[str] |
Available options. |
TangleSelect#
Bases: AnyWidget
Dropdown-based take on the Tangle choice pattern.
Examples:
Create a TangleSelect dropdown.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
choices
|
List[str]
|
Ordered sequence of options (min two). |
required |
**kwargs
|
Any
|
Forwarded to |
{}
|
Source code in wigglystuff/tangle.py
Synced traitlets#
| Traitlet | Type | Notes |
|---|---|---|
choice |
str |
Current selection. |
choices |
list[str] |
Available options. |