from manywidgets import Dropdown
Dropdown(label="Chart type", options=["line", "bar", "scatter"], value="line")API¶
| Trait | Type | Default | Description |
|---|---|---|---|
options | List | — | Scalars ([‘a’, ‘b’]) or [label, value] pairs. |
value | Any | None | The selected value. |
label | Unicode | '' | Label shown above the dropdown. |
widget_id | Unicode | '' | Stable unique id used for cross-widget linking (auto-assigned). |
options is a list of scalars or [label, value] pairs.
Linking¶
Link like any widget (see the linking guide):
from ipywidgets import jsdlink
from manywidgets import Chart, Dropdown
chart = Chart()
kind = Dropdown(options=["line", "bar", "scatter"], value="line")
jsdlink((kind, "value"), (chart, "chart_type"))