UNPKG

@jupyter-widgets/schema

Version:

Schemas for the Jupyter interactive Widgets

342 lines (308 loc) 199 kB
# 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 8. ## 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, 2.0.0); LayoutView (@jupyter-widgets/base, 2.0.0) | Attribute | Type | Default | Help | | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ---------------------------------------------------------------- | | `_model_module` | string | `'@jupyter-widgets/base'` | The namespace for the model. | | `_model_module_version` | string | `'2.0.0'` | A semver requirement for namespace version containing the model. | | `_model_name` | string | `'LayoutModel'` | | `_view_module` | string | `'@jupyter-widgets/base'` | | `_view_module_version` | string | `'2.0.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_bottom` | `null` or string | `null` | The border bottom CSS attribute. | | `border_left` | `null` or string | `null` | The border left CSS attribute. | | `border_right` | `null` or string | `null` | The border right CSS attribute. | | `border_top` | `null` or string | `null` | The border top 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. | | `justify_items` | `null` or string (one of `'flex-start'`, `'flex-end'`, `'center'`, `'inherit'`, `'initial'`, `'unset'`) | `null` | The justify-items 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. | | `object_fit` | `null` or string (one of `'contain'`, `'cover'`, `'fill'`, `'scale-down'`, `'none'`) | `null` | The object-fit CSS attribute. | | `object_position` | `null` or string | `null` | The object-position CSS attribute. | | `order` | `null` or string | `null` | The order CSS attribute. | | `overflow` | `null` or string | `null` | The overflow 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, 2.0.0); AccordionView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'AccordionModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.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) | `null` | The index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected. | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `titles` | array of string | `[]` | Titles of the pages | | `tooltip` | `null` or string | `null` | A tooltip caption. | ### AudioModel (@jupyter-widgets/controls, 2.0.0); AudioView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'AudioModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.0'` | | `_view_name` | string | `'AudioView'` | | `autoplay` | boolean | `true` | When true, the audio starts when it's displayed | | `controls` | boolean | `true` | Specifies that audio controls should be displayed (such as a play/pause button etc) | | `format` | string | `'mp3'` | The format of the audio. | | `layout` | reference to Layout widget | reference to new instance | | `loop` | boolean | `true` | When true, the audio will start from the beginning after finishing | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `tooltip` | `null` or string | `null` | A tooltip caption. | | `value` | Bytes | `b''` | The media data as a memory view of bytes. | ### BoundedFloatTextModel (@jupyter-widgets/controls, 2.0.0); FloatTextView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'BoundedFloatTextModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.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_allow_html` | boolean | `false` | Accept HTML in the 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 | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `tooltip` | `null` or string | `null` | A tooltip caption. | | `value` | number (float) | `0.0` | Float value | ### BoundedIntTextModel (@jupyter-widgets/controls, 2.0.0); IntTextView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'BoundedIntTextModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.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_allow_html` | boolean | `false` | Accept HTML in the 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 | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `tooltip` | `null` or string | `null` | A tooltip caption. | | `value` | number (integer) | `0` | Int value | ### BoxModel (@jupyter-widgets/controls, 2.0.0); BoxView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'BoxModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.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 | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `tooltip` | `null` or string | `null` | A tooltip caption. | ### ButtonModel (@jupyter-widgets/controls, 2.0.0); ButtonView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'ButtonModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.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 names, without the 'fa-' prefix. | | `layout` | reference to Layout widget | reference to new instance | | `style` | reference to ButtonStyle widget | reference to new instance | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `tooltip` | `null` or string | `null` | A tooltip caption. | ### ButtonStyleModel (@jupyter-widgets/controls, 2.0.0); StyleView (@jupyter-widgets/base, 2.0.0) | Attribute | Type | Default | Help | | ----------------------- | ---------------- | ----------------------------- | ------------------------- | | `_model_module` | string | `'@jupyter-widgets/controls'` | | `_model_module_version` | string | `'2.0.0'` | | `_model_name` | string | `'ButtonStyleModel'` | | `_view_module` | string | `'@jupyter-widgets/base'` | | `_view_module_version` | string | `'2.0.0'` | | `_view_name` | string | `'StyleView'` | | `button_color` | `null` or string | `null` | Color of the button | | `font_family` | `null` or string | `null` | Button text font family. | | `font_size` | `null` or string | `null` | Button text font size. | | `font_style` | `null` or string | `null` | Button text font style. | | `font_variant` | `null` or string | `null` | Button text font variant. | | `font_weight` | `null` or string | `null` | Button text font weight. | | `text_color` | `null` or string | `null` | Button text color. | | `text_decoration` | `null` or string | `null` | Button text decoration. | ### CheckboxModel (@jupyter-widgets/controls, 2.0.0); CheckboxView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'CheckboxModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.0'` | | `_view_name` | string | `'CheckboxView'` | | `description` | string | `''` | Description of the control. | | `description_allow_html` | boolean | `false` | Accept HTML in the 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 CheckboxStyle widget | reference to new instance | Styling customizations | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `tooltip` | `null` or string | `null` | A tooltip caption. | | `value` | boolean | `false` | Bool value | ### CheckboxStyleModel (@jupyter-widgets/controls, 2.0.0); StyleView (@jupyter-widgets/base, 2.0.0) | Attribute | Type | Default | Help | | ----------------------- | ---------------- | ----------------------------- | ---------------------------------------------------- | | `_model_module` | string | `'@jupyter-widgets/controls'` | | `_model_module_version` | string | `'2.0.0'` | | `_model_name` | string | `'CheckboxStyleModel'` | | `_view_module` | string | `'@jupyter-widgets/base'` | | `_view_module_version` | string | `'2.0.0'` | | `_view_name` | string | `'StyleView'` | | `background` | `null` or string | `null` | Background specifications. | | `description_width` | string | `''` | Width of the description to the side of the control. | ### ColorPickerModel (@jupyter-widgets/controls, 2.0.0); ColorPickerView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'ColorPickerModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.0'` | | `_view_name` | string | `'ColorPickerView'` | | `concise` | boolean | `false` | Display short version with just a color selector. | | `description` | string | `''` | Description of the control. | | `description_allow_html` | boolean | `false` | Accept HTML in the 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 | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `tooltip` | `null` or string | `null` | A tooltip caption. | | `value` | string | `'black'` | The color value. | ### ColorsInputModel (@jupyter-widgets/controls, 2.0.0); ColorsInputView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'ColorsInputModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.0'` | | `_view_name` | string | `'ColorsInputView'` | | `allow_duplicates` | boolean | `true` | | `allowed_tags` | array | `[]` | | `description` | string | `''` | Description of the control. | | `description_allow_html` | boolean | `false` | Accept HTML in the description. | | `layout` | reference to Layout widget | reference to new instance | | `placeholder` | string | `'\u200b'` | | `style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `tooltip` | `null` or string | `null` | A tooltip caption. | | `value` | array | `[]` | List of string tags | ### ComboboxModel (@jupyter-widgets/controls, 2.0.0); ComboboxView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'ComboboxModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.0'` | | `_view_name` | string | `'ComboboxView'` | | `continuous_update` | boolean | `true` | 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_allow_html` | boolean | `false` | Accept HTML in the description. | | `disabled` | boolean | `false` | Enable or disable user changes | | `ensure_option` | boolean | `false` | If set, ensure value is in options. Implies continuous_update=False. | | `layout` | reference to Layout widget | reference to new instance | | `options` | array of string | `[]` | Dropdown options for the combobox | | `placeholder` | string | `'\u200b'` | Placeholder text to display when nothing has been typed | | `style` | reference to TextStyle widget | reference to new instance | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `tooltip` | `null` or string | `null` | A tooltip caption. | | `value` | string | `''` | String value | ### ControllerAxisModel (@jupyter-widgets/controls, 2.0.0); ControllerAxisView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'ControllerAxisModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.0'` | | `_view_name` | string | `'ControllerAxisView'` | | `layout` | reference to Layout widget | reference to new instance | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `tooltip` | `null` or string | `null` | A tooltip caption. | | `value` | number (float) | `0.0` | The value of the axis. | ### ControllerButtonModel (@jupyter-widgets/controls, 2.0.0); ControllerButtonView (@jupyter-widgets/controls, 2.0.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 | `'2.0.0'` | | `_model_name` | string | `'ControllerButtonModel'` | | `_view_module` | string | `'@jupyter-widgets/controls'` | | `_view_module_version` | string | `'2.0.0'` | | `_view_name` | string | `'ControllerButtonView'` | | `layout` | reference to Layout widget | reference to new instance | | `pressed` | boolean | `false` | Whether the button is pressed. | | `tabbable` | `null` or boolean | `null` | Is widget tabbable? | | `tooltip` | `null` or string | `null` | A tooltip caption. | | `value` | number (float) | `0.0` | The val