Skip to content

Commit 6cfcc85

Browse files
authored
Merge pull request #1207 from jasongrout/schema
WIP: Document of the attributes for each model
2 parents c59ad01 + 49c8325 commit 6cfcc85

File tree

8 files changed

+992
-10
lines changed

8 files changed

+992
-10
lines changed

ipywidgets/widgets/domwidget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class DOMWidget(Widget):
1313
"""Widget that can be inserted into the DOM"""
1414

1515
_model_name = Unicode('DOMWidgetModel').tag(sync=True)
16-
_dom_classes = Tuple(help="DOM classes applied to widget.$el.").tag(sync=True)
16+
_dom_classes = Tuple(help="CSS classes applied to widget DOM element").tag(sync=True)
1717
layout = LayoutTraitType().tag(sync=True, **widget_serialization)
1818

1919
@default('layout')

ipywidgets/widgets/widget_box.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Box(DOMWidget, CoreWidget):
2525
# Child widgets in the container.
2626
# Using a tuple here to force reassignment to update the list.
2727
# When a proper notifying-list trait exists, that is what should be used here.
28-
children = Tuple().tag(sync=True, **widget_serialization)
28+
children = Tuple().tag(sync=True, help="List of widget children", **widget_serialization)
2929

3030
box_style = CaselessStrEnum(
3131
values=['success', 'info', 'warning', 'danger', ''], default_value='',

ipywidgets/widgets/widget_button.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class ButtonStyle(Style, CoreWidget):
2222
"""Button style widget."""
2323
_model_name = Unicode('ButtonStyleModel').tag(sync=True)
24-
button_color = Color(None, allow_none=True).tag(sync=True)
24+
button_color = Color(None, allow_none=True, help="Color of the button").tag(sync=True)
2525
font_weight = Unicode().tag(sync=True)
2626

2727

ipywidgets/widgets/widget_float.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ class FloatProgress(_BoundedFloat):
174174

175175
bar_style = CaselessStrEnum(
176176
values=['success', 'info', 'warning', 'danger', ''],
177-
default_value='', allow_none=True, help="""Use a predefined styling for
178-
the progess bar.""").tag(sync=True)
177+
default_value='', allow_none=True,
178+
help="Use a predefined styling for the progess bar.").tag(sync=True)
179179

180180
style = Instance(ProgressStyle).tag(sync=True, **widget_serialization)
181181

ipywidgets/widgets/widget_link.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
class WidgetTraitTuple(Tuple):
1616
"""Traitlet for validating a single (Widget, 'trait_name') pair"""
1717

18+
info_text = "A (Widget, 'trait_name') pair"
19+
1820
def __init__(self, **kwargs):
1921
super(WidgetTraitTuple, self).__init__(Instance(Widget), Unicode, **kwargs)
2022

@@ -43,8 +45,8 @@ class Link(CoreWidget):
4345
_model_module = Unicode('jupyter-js-widgets').tag(sync=True)
4446
_view_module = Unicode('jupyter-js-widgets').tag(sync=True)
4547
_model_name = Unicode('LinkModel').tag(sync=True)
46-
target = WidgetTraitTuple().tag(sync=True, **widget_serialization)
47-
source = WidgetTraitTuple().tag(sync=True, **widget_serialization)
48+
target = WidgetTraitTuple(help="The target (widget, 'trait_name') pair").tag(sync=True, **widget_serialization)
49+
source = WidgetTraitTuple(help="The source (widget, 'trait_name') pair").tag(sync=True, **widget_serialization)
4850

4951
def __init__(self, source, target, **kwargs):
5052
kwargs['source'] = source

ipywidgets/widgets/widget_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Output(DOMWidget, CoreWidget):
3838
_model_name = Unicode('OutputModel').tag(sync=True)
3939
_model_module = Unicode('jupyter-js-widgets').tag(sync=True)
4040
_view_module = Unicode('jupyter-js-widgets').tag(sync=True)
41-
msg_id = Unicode('').tag(sync=True)
41+
msg_id = Unicode('', help="Parent message id of messages to capture").tag(sync=True)
4242

4343
def clear_output(self, *pargs, **kwargs):
4444
with self:

ipywidgets/widgets/widget_selection.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ class ToggleButtons(_Selection):
217217

218218
button_style = CaselessStrEnum(
219219
values=['primary', 'success', 'info', 'warning', 'danger', ''],
220-
default_value='', allow_none=True, help="""Use a predefined styling for
221-
the buttons.""").tag(sync=True)
220+
default_value='', allow_none=True, help="""Use a predefined styling for the buttons.""").tag(sync=True)
222221

223222

224223
@register('Jupyter.Dropdown')

jupyter-widgets-schema/jupyterwidgetmodels.md

Lines changed: 981 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)