@jupyter-widgets/schema
Version:
Schemas for the Jupyter interactive Widgets
354 lines (314 loc) • 130 kB
Markdown
# Model State
This is a description of the model state for each widget in the core Jupyter widgets library. The model ID of a widget is the id of the comm object the widget is using. A reference to a widget is serialized to JSON as a string of the form `"IPY_MODEL_<MODEL_ID>"`, where `<MODEL_ID>` is the model ID of a previously created widget of the specified type.
This model specification is for ipywidgets 7.3._, @jupyter-widgets/base 1.1._, and @jupyter-widgets/controls 1.3.\*.
## Model attributes
Each widget in the Jupyter core widgets is represented below. The heading represents the model name, module, and version, view name, module, and version that the widget is registered with.
### LayoutModel (@jupyter-widgets/base, 1.1.0); LayoutView (@jupyter-widgets/base, 1.1.0)
| Attribute | Type | Default | Help |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ---------------------------------------------------------------- |
| `_model_module` | string | `'@jupyter-widgets/base'` | The namespace for the model. |
| `_model_module_version` | string | `'1.1.0'` | A semver requirement for namespace version containing the model. |
| `_model_name` | string | `'LayoutModel'` |
| `_view_module` | string | `'@jupyter-widgets/base'` |
| `_view_module_version` | string | `'1.1.0'` |
| `_view_name` | string | `'LayoutView'` |
| `align_content` | `null` or string (one of `'flex-start'`, `'flex-end'`, `'center'`, `'space-between'`, `'space-around'`, `'space-evenly'`, `'stretch'`, `'inherit'`, `'initial'`, `'unset'`) | `null` | The align-content CSS attribute. |
| `align_items` | `null` or string (one of `'flex-start'`, `'flex-end'`, `'center'`, `'baseline'`, `'stretch'`, `'inherit'`, `'initial'`, `'unset'`) | `null` | The align-items CSS attribute. |
| `align_self` | `null` or string (one of `'auto'`, `'flex-start'`, `'flex-end'`, `'center'`, `'baseline'`, `'stretch'`, `'inherit'`, `'initial'`, `'unset'`) | `null` | The align-self CSS attribute. |
| `border` | `null` or string | `null` | The border CSS attribute. |
| `bottom` | `null` or string | `null` | The bottom CSS attribute. |
| `display` | `null` or string | `null` | The display CSS attribute. |
| `flex` | `null` or string | `null` | The flex CSS attribute. |
| `flex_flow` | `null` or string | `null` | The flex-flow CSS attribute. |
| `grid_area` | `null` or string | `null` | The grid-area CSS attribute. |
| `grid_auto_columns` | `null` or string | `null` | The grid-auto-columns CSS attribute. |
| `grid_auto_flow` | `null` or string (one of `'column'`, `'row'`, `'row dense'`, `'column dense'`, `'inherit'`, `'initial'`, `'unset'`) | `null` | The grid-auto-flow CSS attribute. |
| `grid_auto_rows` | `null` or string | `null` | The grid-auto-rows CSS attribute. |
| `grid_column` | `null` or string | `null` | The grid-column CSS attribute. |
| `grid_gap` | `null` or string | `null` | The grid-gap CSS attribute. |
| `grid_row` | `null` or string | `null` | The grid-row CSS attribute. |
| `grid_template_areas` | `null` or string | `null` | The grid-template-areas CSS attribute. |
| `grid_template_columns` | `null` or string | `null` | The grid-template-columns CSS attribute. |
| `grid_template_rows` | `null` or string | `null` | The grid-template-rows CSS attribute. |
| `height` | `null` or string | `null` | The height CSS attribute. |
| `justify_content` | `null` or string (one of `'flex-start'`, `'flex-end'`, `'center'`, `'space-between'`, `'space-around'`, `'inherit'`, `'initial'`, `'unset'`) | `null` | The justify-content CSS attribute. |
| `left` | `null` or string | `null` | The left CSS attribute. |
| `margin` | `null` or string | `null` | The margin CSS attribute. |
| `max_height` | `null` or string | `null` | The max-height CSS attribute. |
| `max_width` | `null` or string | `null` | The max-width CSS attribute. |
| `min_height` | `null` or string | `null` | The min-height CSS attribute. |
| `min_width` | `null` or string | `null` | The min-width CSS attribute. |
| `order` | `null` or string | `null` | The order CSS attribute. |
| `overflow` | `null` or string (one of `'visible'`, `'hidden'`, `'scroll'`, `'auto'`, `'inherit'`, `'initial'`, `'unset'`) | `null` | The overflow CSS attribute. |
| `overflow_x` | `null` or string (one of `'visible'`, `'hidden'`, `'scroll'`, `'auto'`, `'inherit'`, `'initial'`, `'unset'`) | `null` | The overflow-x CSS attribute. |
| `overflow_y` | `null` or string (one of `'visible'`, `'hidden'`, `'scroll'`, `'auto'`, `'inherit'`, `'initial'`, `'unset'`) | `null` | The overflow-y CSS attribute. |
| `padding` | `null` or string | `null` | The padding CSS attribute. |
| `right` | `null` or string | `null` | The right CSS attribute. |
| `top` | `null` or string | `null` | The top CSS attribute. |
| `visibility` | `null` or string (one of `'visible'`, `'hidden'`, `'inherit'`, `'initial'`, `'unset'`) | `null` | The visibility CSS attribute. |
| `width` | `null` or string | `null` | The width CSS attribute. |
### AccordionModel (@jupyter-widgets/controls, 1.3.0); AccordionView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | -------------------------------------------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'AccordionModel'` |
| `_titles` | object | `{}` | Titles of the pages |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'AccordionView'` |
| `box_style` | string (one of `'success'`, `'info'`, `'warning'`, `'danger'`, `''`) | `''` | Use a predefined styling for the box. |
| `children` | array of reference to Widget widget | `[]` | List of widget children |
| `layout` | reference to Layout widget | reference to new instance |
| `selected_index` | `null` or number (integer) | `0` | The index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected. |
### BoundedFloatTextModel (@jupyter-widgets/controls, 1.3.0); FloatTextView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | ------------------------------------ | ----------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'BoundedFloatTextModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'FloatTextView'` |
| `continuous_update` | boolean | `false` | Update the value as the user types. If False, update on submission, e.g., pressing Enter or navigating away. |
| `description` | string | `''` | Description of the control. |
| `description_tooltip` | `null` or string | `null` | Tooltip for the description (defaults to description). |
| `disabled` | boolean | `false` | Enable or disable user changes |
| `layout` | reference to Layout widget | reference to new instance |
| `max` | number (float) | `100.0` | Max value |
| `min` | number (float) | `0.0` | Min value |
| `step` | `null` or number (float) | `null` | Minimum step to increment the value |
| `style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations |
| `value` | number (float) | `0.0` | Float value |
### BoundedIntTextModel (@jupyter-widgets/controls, 1.3.0); IntTextView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | ------------------------------------ | ----------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'BoundedIntTextModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'IntTextView'` |
| `continuous_update` | boolean | `false` | Update the value as the user types. If False, update on submission, e.g., pressing Enter or navigating away. |
| `description` | string | `''` | Description of the control. |
| `description_tooltip` | `null` or string | `null` | Tooltip for the description (defaults to description). |
| `disabled` | boolean | `false` | Enable or disable user changes |
| `layout` | reference to Layout widget | reference to new instance |
| `max` | number (integer) | `100` | Max value |
| `min` | number (integer) | `0` | Min value |
| `step` | number (integer) | `1` | Minimum step to increment the value |
| `style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations |
| `value` | number (integer) | `0` | Int value |
### BoxModel (@jupyter-widgets/controls, 1.3.0); BoxView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | -------------------------------------------------------------------- | ----------------------------- | ----------------------------------------- |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'BoxModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'BoxView'` |
| `box_style` | string (one of `'success'`, `'info'`, `'warning'`, `'danger'`, `''`) | `''` | Use a predefined styling for the box. |
| `children` | array of reference to Widget widget | `[]` | List of widget children |
| `layout` | reference to Layout widget | reference to new instance |
### ButtonModel (@jupyter-widgets/controls, 1.3.0); ButtonView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | --------------------------------------------------------------------------------- | ----------------------------- | ------------------------------------------------- |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'ButtonModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'ButtonView'` |
| `button_style` | string (one of `'primary'`, `'success'`, `'info'`, `'warning'`, `'danger'`, `''`) | `''` | Use a predefined styling for the button. |
| `description` | string | `''` | Button label. |
| `disabled` | boolean | `false` | Enable or disable user changes. |
| `icon` | string | `''` | Font-awesome icon name, without the 'fa-' prefix. |
| `layout` | reference to Layout widget | reference to new instance |
| `style` | reference to ButtonStyle widget | reference to new instance |
| `tooltip` | string | `''` | Tooltip caption of the button. |
### ButtonStyleModel (@jupyter-widgets/controls, 1.3.0); StyleView (@jupyter-widgets/base, 1.1.0)
| Attribute | Type | Default | Help |
| ----------------------- | ---------------- | ----------------------------- | ------------------------ |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'ButtonStyleModel'` |
| `_view_module` | string | `'@jupyter-widgets/base'` |
| `_view_module_version` | string | `'1.1.0'` |
| `_view_name` | string | `'StyleView'` |
| `button_color` | `null` or string | `null` | Color of the button |
| `font_weight` | string | `''` | Button text font weight. |
### CheckboxModel (@jupyter-widgets/controls, 1.3.0); CheckboxView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | ------------------------------------ | ----------------------------- | ------------------------------------------------------------------- |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'CheckboxModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'CheckboxView'` |
| `description` | string | `''` | Description of the control. |
| `description_tooltip` | `null` or string | `null` | Tooltip for the description (defaults to description). |
| `disabled` | boolean | `false` | Enable or disable user changes. |
| `indent` | boolean | `true` | Indent the control to align with other controls with a description. |
| `layout` | reference to Layout widget | reference to new instance |
| `style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations |
| `value` | boolean | `false` | Bool value |
### ColorPickerModel (@jupyter-widgets/controls, 1.3.0); ColorPickerView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | ------------------------------------ | ----------------------------- | ------------------------------------------------------ |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'ColorPickerModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'ColorPickerView'` |
| `concise` | boolean | `false` | Display short version with just a color selector. |
| `description` | string | `''` | Description of the control. |
| `description_tooltip` | `null` or string | `null` | Tooltip for the description (defaults to description). |
| `disabled` | boolean | `false` | Enable or disable user changes. |
| `layout` | reference to Layout widget | reference to new instance |
| `style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations |
| `value` | string | `'black'` | The color value. |
### ControllerAxisModel (@jupyter-widgets/controls, 1.3.0); ControllerAxisView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | -------------------------- | ----------------------------- | ----------------------------------------- |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'ControllerAxisModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'ControllerAxisView'` |
| `layout` | reference to Layout widget | reference to new instance |
| `value` | number (float) | `0.0` | The value of the axis. |
### ControllerButtonModel (@jupyter-widgets/controls, 1.3.0); ControllerButtonView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | -------------------------- | ----------------------------- | ----------------------------------------- |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'ControllerButtonModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'ControllerButtonView'` |
| `layout` | reference to Layout widget | reference to new instance |
| `pressed` | boolean | `false` | Whether the button is pressed. |
| `value` | number (float) | `0.0` | The value of the button. |
### ControllerModel (@jupyter-widgets/controls, 1.3.0); ControllerView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | ----------------------------------- | ----------------------------- | ----------------------------------------------------- |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'ControllerModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'ControllerView'` |
| `axes` | array of reference to Axis widget | `[]` | The axes on the gamepad. |
| `buttons` | array of reference to Button widget | `[]` | The buttons on the gamepad. |
| `connected` | boolean | `false` | Whether the gamepad is connected. |
| `index` | number (integer) | `0` | The id number of the controller. |
| `layout` | reference to Layout widget | reference to new instance |
| `mapping` | string | `''` | The name of the control mapping. |
| `name` | string | `''` | The name of the controller. |
| `timestamp` | number (float) | `0.0` | The last time the data from this gamepad was updated. |
### DatePickerModel (@jupyter-widgets/controls, 1.3.0); DatePickerView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | ------------------------------------ | ----------------------------- | ------------------------------------------------------ |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'DatePickerModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'DatePickerView'` |
| `description` | string | `''` | Description of the control. |
| `description_tooltip` | `null` or string | `null` | Tooltip for the description (defaults to description). |
| `disabled` | boolean | `false` | Enable or disable user changes. |
| `layout` | reference to Layout widget | reference to new instance |
| `style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations |
| `value` | `null` or Date | `null` |
### DescriptionStyleModel (@jupyter-widgets/controls, 1.3.0); StyleView (@jupyter-widgets/base, 1.1.0)
| Attribute | Type | Default | Help |
| ----------------------- | ------ | ----------------------------- | ---------------------------------------------------- |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'DescriptionStyleModel'` |
| `_view_module` | string | `'@jupyter-widgets/base'` |
| `_view_module_version` | string | `'1.1.0'` |
| `_view_name` | string | `'StyleView'` |
| `description_width` | string | `''` | Width of the description to the side of the control. |
### DirectionalLinkModel (@jupyter-widgets/controls, 1.3.0); None (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | ---------------- | ----------------------------- | -------------------------------------- |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'DirectionalLinkModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | `null` or string | `null` | Name of the view. |
| `source` | array | `[]` | The source (widget, 'trait_name') pair |
| `target` | array | `[]` | The target (widget, 'trait_name') pair |
### DropdownModel (@jupyter-widgets/controls, 1.3.0); DropdownView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | ------------------------------------ | ----------------------------- | ------------------------------------------------------ |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'DropdownModel'` |
| `_options_labels` | array of string | `[]` | The labels for the options. |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'DropdownView'` |
| `description` | string | `''` | Description of the control. |
| `description_tooltip` | `null` or string | `null` | Tooltip for the description (defaults to description). |
| `disabled` | boolean | `false` | Enable or disable user changes |
| `index` | `null` or number (integer) | `null` | Selected index |
| `layout` | reference to Layout widget | reference to new instance |
| `style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations |
### FloatLogSliderModel (@jupyter-widgets/controls, 1.3.0); FloatLogSliderView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | -------------------------------------------- | ----------------------------- | ----------------------------------------------------------------- |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'FloatLogSliderModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'FloatLogSliderView'` |
| `base` | number (float) | `10.0` | Base for the logarithm |
| `continuous_update` | boolean | `true` | Update the value of the widget as the user is holding the slider. |
| `description` | string | `''` | Description of the control. |
| `description_tooltip` | `null` or string | `null` | Tooltip for the description (defaults to description). |
| `disabled` | boolean | `false` | Enable or disable user changes |
| `layout` | reference to Layout widget | reference to new instance |
| `max` | number (float) | `4.0` | Max value for the exponent |
| `min` | number (float) | `0.0` | Min value for the exponent |
| `orientation` | string (one of `'horizontal'`, `'vertical'`) | `'horizontal'` | Vertical or horizontal. |
| `readout` | boolean | `true` | Display the current value of the slider next to it. |
| `readout_format` | string | `'.3g'` | Format for the readout |
| `step` | number (float) | `0.1` | Minimum step in the exponent to increment the value |
| `style` | reference to SliderStyle widget | reference to new instance |
| `value` | number (float) | `1.0` | Float value |
### FloatProgressModel (@jupyter-widgets/controls, 1.3.0); ProgressView (@jupyter-widgets/controls, 1.3.0)
| Attribute | Type | Default | Help |
| ----------------------- | ------------------------------------------------------------------------------ | ----------------------------- | ------------------------------------------------------ |
| `_dom_classes` | array of string | `[]` | CSS classes applied to widget DOM element |
| `_model_module` | string | `'@jupyter-widgets/controls'` |
| `_model_module_version` | string | `'1.3.0'` |
| `_model_name` | string | `'FloatProgressModel'` |
| `_view_module` | string | `'@jupyter-widgets/controls'` |
| `_view_module_version` | string | `'1.3.0'` |
| `_view_name` | string | `'ProgressView'` |
| `bar_style` | `null` or string (one of `'success'`, `'info'`, `'warning'`, `'danger'`, `''`) | `''` | Use a predefined styling for the progress bar. |
| `description` | string | `''` | Description of the control. |
| `description_tooltip` | `null` or string | `null` | Tooltip for the description (defaults to description). |
| `layout` | ref