Gordon Ball
a096d01310
Test case for setting only lower or upper, no sensible default so should be an error
12 years ago
Gordon Ball
a12b1a50a9
Change `range` trait to `_range`
12 years ago
Gordon Ball
b8c0afbb55
Merge master
12 years ago
Brian E. Granger
94f717781d
Merge pull request #6125 from jdfreder/flex
...
Embrace the flexible box model in the widgets
12 years ago
Jonathan Frederic
be3ba35736
Fix typo in deprecated class name.
12 years ago
Gordon Ball
8838762b30
Remove a rogue print statement
12 years ago
Gordon Ball
08895738f2
Merge master
12 years ago
Gordon Ball
05f07f1f71
Add a number of extra tests for the range widgets
12 years ago
Gordon Ball
2be045fe25
Support both value tuple and upper, lower traits for both int and float widgets
12 years ago
Jonathan Frederic
8877d32c4e
Merge pull request #6194 from SylvainCorlay/immediate-widget-comm
...
Allow model id to be set externally on creation of the widget.
12 years ago
Jason Grout
0e5ceca059
Make the widget property_lock store the JSON state, not the original object
...
Comparison between arbitrary python objects can get crazy, whereas we really
only care about if the JSON state we are syncing is different. So with this change,
we store and check against the JSON state.
12 years ago
Jonathan Frederic
690059f8f8
Merge pull request #6296 from jasongrout/sync-hold
...
Add a new context manager, Widget.hold_sync(), which holds any syncing until the manager exits
12 years ago
Jonathan Frederic
2db702fa57
Filenames s/container/box
12 years ago
Jonathan Frederic
d985ee86c6
s/Container/Box
12 years ago
Jason Grout
5cd46788f9
Before syncing a widget's state, check first for the property lock, then for the widget state lock
12 years ago
Jason Grout
af26d9cc24
Add a new context manager, Widget.hold_sync(), which holds any syncing until the manager exits
...
Sometimes for consistency or efficiency purposes, it makes sense to update
a group of properties all at once. This context manager makes this possible.
We also fix a bug where send_state was not passing the key on to get_state.
12 years ago
Sylvain Corlay
f9fa4ada06
allowing widet id to be set externally
12 years ago
Jason Grout
8513f673e3
Make the widget comm attribute more straigtforward
...
Instead of automagically instantiating a comm when it is accessed, require a call to open(). This makes the comm attribute much less magical, and hopefully more understandable.
12 years ago
Jason Grout
16c366d1b5
Automatically open a comm on creation of widgets
...
This will immediately create a model on the javascript side when a widget is created. This means that, for example, a widget that only interacts with its model can work without "displaying" it.
12 years ago
Jonathan Frederic
36721c73c6
Added some doc strings on the widgets.
...
Also address the comments Matthias left me.
12 years ago
Jonathan Frederic
dbb88f95cd
Make HBox and VBox helper functions
12 years ago
Sylvain Corlay
c9ed512d54
adding hbox and vbox
...
Conflicts:
IPython/html/static/widgets/js/widget_container.js
IPython/html/widgets/widget_container.py
12 years ago
Jonathan Frederic
170b13102e
Fix interact tests for rename
12 years ago
Jonathan Frederic
ba3033971e
Renamed *Widget to *,
...
depracted old names.
12 years ago
Jonathan Frederic
37f00f73d7
Added baseline and stretch
12 years ago
Jonathan Frederic
6faf86ee77
Embrace flexible box model
12 years ago
Gordon Ball
8c5218b581
Default to 25-75% of min-max if no value is set instead of 0-1
12 years ago
Jason Grout
d64627380b
Default view should be the base widget view class
12 years ago
Gordon Ball
ff3f952b18
Merge branch 'master' into interact-range-widgets
...
Conflicts:
IPython/html/static/style/ipython.min.css
IPython/html/static/style/style.min.css
IPython/html/static/widgets/js/widget_int.js
12 years ago
Jonathan Frederic
ba0a805404
Merge pull request #6226 from jasongrout/css-top-default
...
Remove $el_to_style from the widget javascript code; '' now defaults to this.$el
12 years ago
MinRK
09c1354ea7
avoid unregistering widget model twice
...
widgets are registered when the comm is created;
closing unregisters them. Calling `close` a second time
should be a no-op.
12 years ago
Sylvain Corlay
1bbc915ac0
setting _comm to None
12 years ago
Sylvain Corlay
ea52ef8704
del Widget.widgets[seld.model_id] in close rather than in __del__
12 years ago
Jason Grout
eccc20ce1a
Remove $el_to_style from the widget javascript code; '' now defaults to this.$el
...
This seems to make it easiest to select the top-level element. An alternative is to use special syntax for top-level elements, like in https://github.com/ipython/ipython/pull/6185
This will be followed up by other fixes that let the user set specific common properties of different elements.
This change also adds the .addBack() call, which means that nonempty selectors now apply to this.$el and its descendants, rather than just the descendants of this.$el.
12 years ago
sylvain.corlay
a9c34b679b
decoupling the comm lifetime from the widget lifetime
12 years ago
Brian E. Granger
372507e3f1
Merge pull request #6128 from jasongrout/widget-trait-serialization
...
Widget trait serialization
12 years ago
Jason Grout
8fb0ae4d36
Change serialize/deserialize to to_json/from_json
12 years ago
Jason Grout
97141c6bca
Simplify the code for picking json serialization functions to expose the logic better
12 years ago
Jason Grout
3235f42d12
Container assumes the children attribute is not None
...
Thanks to @SylvainCorlay for pointing this out.
12 years ago
Jason Grout
06084e996c
Change serialization terminology to serialize/deserialize
12 years ago
Jason Grout
eed0715a09
Prepend a sentinel value to model ids to distinguish them from normal UUIDs (from Sylvain Corlay).
12 years ago
Jason Grout
14f3897b56
Make Container widgets take children as the first positional argument
...
This makes creating containers less cumbersome: Container([list, of, children]), rather than Container(children=[list, of, children])
12 years ago
Jason Grout
0c72fddaba
Update widget serializer/unserializer to allow custom serialization on a trait-by-trait basis.
...
Serializers/unserializers are given as the trait metadata keys `to_json` and `from_json`.
12 years ago
Jonathan Frederic
636362787b
Fixed buggy behavior
12 years ago
Jonathan Frederic
14ff754cdf
Allow a widget to be displayed more than once within a parent widget.
12 years ago
Gordon Ball
bfd029f5ab
Remove tests for 4-5 tuples, add tests for validate logic
12 years ago
Gordon Ball
b7bb76f073
Fix validate logic if min/max are changed
12 years ago
Gordon Ball
1cb0cbf4b9
Remove 4-5 tuple forms from interact()
12 years ago
Gordon Ball
7e4cd6abc1
Add tests for the on_demand option
12 years ago
Gordon Ball
c85155b25d
Add some tests for the 4-5 int/float form in interact()
12 years ago
Gordon Ball
59a461f928
Fix format problem when showing an error
12 years ago
Gordon Ball
5eea47203b
Disable run button until the function finishes
12 years ago
Gordon Ball
5524077e87
Add an extended range abbreviation including a step value
12 years ago
Gordon Ball
945a840674
Add float implementation of range widget
12 years ago
Gordon Ball
3178a184c0
Add initial implementation of 2-handle range sliders for integers.
12 years ago
Gordon Ball
4752b83feb
Add 'on_demand' option to interact() so that long-running functions can be started only when explicitly requested
12 years ago
Raffaele De Feo
694f33e2ba
Validate initial value of "_BoundedFloatWidget".
12 years ago
Jonathan Frederic
74483d77da
Change css dict to a list,
...
even though this introduces O(N) complexity, it fixes a bug
where path dependent css traits could be executed out of order,
making it impossible to actually set the traits from the back-end.
12 years ago
Jessica B. Hamrick
287e9a5cbd
Add tests for default/custom description
12 years ago
Jessica B. Hamrick
31812159af
Only set widget description in interact if it does not already exist
12 years ago
Maximilian Albert
fb11e70f53
Fix copy & paste error in docstring.
12 years ago
Jessica B. Hamrick
e436850582
Add placeholder attribute to text widgets
12 years ago
jdavidheiser
e0a40d54cb
Update widget_selection.py
12 years ago
jdavidheiser
52e58dce6d
Update widget_selection.py
12 years ago
jdavidheiser
9810033988
widget_selection update
...
Fix for the fact that dictionary randomization sometimes switches the order of the arguments passed to the class on initialization. This means that, potentially, 'value' can be updated BEFORE 'values', and since the method to update 'value' checks to see whether it exists in 'values', this breaks things.
12 years ago
Thomas Kluyver
95dc697e3b
Remove Widget.closed attribute
...
Closes gh-5282
12 years ago
Jonathan Frederic
673577cf6c
Merge pull request #5207 from Zaharid/childfireevent
...
Children fire event
12 years ago
MinRK
d8b6a1a0ba
don't validate ContainerWidget.children
...
just use a plain Tuple, so we don't have to define a new Trait
12 years ago
MinRK
cc1ba8b1f7
remove incorrect is instance check in children_changed
12 years ago
MinRK
c89ec19fca
don't check shape of ContainerWidget.children
12 years ago
Jonathan Frederic
7855de2f13
s/CTuple/Tuple
12 years ago
Jonathan Frederic
dedbc3b0e1
Changed children list to CTuple.
...
Also removed some unused refences in the widget code
and added support for tuples in the pack/unpack code.
12 years ago
zah
439003d709
Children fire event
...
Now when a container widget is displayed, the _handle_displayed method
of each of its children is fired.
12 years ago
Brian E. Granger
708c30c912
Merge pull request #5136 from minrk/interact-default
...
set default value from signature defaults in interact
12 years ago
MinRK
62f318c777
undo failed changes
...
before raising
otherwise, invalid values were still accepted
12 years ago
MinRK
b51cc50357
further tests for default values in interact
...
both valid and invalid
12 years ago
MinRK
acfc2d5308
set default value from dict
12 years ago
Jonathan Frederic
0eebd9e05b
Added msg_throttle sync=True widget traitlet
12 years ago
MinRK
e91ef370dd
remove no-op adding abbreviations from always-empty dict
12 years ago
MinRK
8a2d92010a
set default value from signature defaults in interact
...
If available, use the default value from the signature for the initial condition,
when using range/choice abbreviations.
Not affected:
- single-value abbreviations (`@interact(a=5)` sets `a=5`)
- explicit Widgets
12 years ago
MinRK
d772b4c3da
catch errors at a lower level in interact
...
for cleaner tracebacks in the interact callback than the fallback case
12 years ago
MinRK
ddc22152ea
show traceback in widget handlers
...
rather than logging
closes #5064
12 years ago
MinRK
813e32dfea
set readout=True as default on SliderWidgets
12 years ago
MinRK
7861bee65f
test widget interaction (Python)
12 years ago
MinRK
6d555b7aee
return f with @interact, not just @interact(**kwargs)
12 years ago
MinRK
031b69895c
fix ValueError format message
12 years ago
MinRK
48a56d3156
simplify float/int slider abbreviation logic
...
fixes unhanded case where only one entry is a float
12 years ago
MinRK
7911c6c237
finish removing *args support
12 years ago
MinRK
ad6109692d
ensure range widgets get value that is on a step
12 years ago
MinRK
a58ca8a0a0
s/const/fixed/
12 years ago
MinRK
2d2c5beb0e
move @annotate to py3compat
12 years ago
MinRK
3053a855a9
remove positional arg support from interact
12 years ago
MinRK
feab63754d
update interact now that SelectionWidget.values is a dict
12 years ago
Brian E. Granger
88fb17b182
Adding const pseudo-widget for fixing arguments to interact.
12 years ago
Brian E. Granger
6e8c63ea19
Adding decorator forms of interact. Yeah!
12 years ago
Brian E. Granger
dd9a6efaed
Utter interact insanity.
...
This involves a bunch of really complicated logic to handle the
different ways that function parameters can be processed in Python.
Most importantly, this includes support for *args in interact.
12 years ago
Brian E. Granger
55cddce784
Fixing interact imports.
12 years ago
Brian E. Granger
2ef393aaa3
Renaming interact.py->interaction.py to improve imports.
12 years ago
Thomas Kluyver
a96c228554
Get widgets from function annotations and default arguments.
...
Also, preserve the order of function parameters from the signature where
possible.
This uses a backport of the Python 3.3 signature machinery that @minrk
found and improved.
12 years ago
Brian E. Granger
5853bb8ff7
Adding .widget to function.
12 years ago
Brian E. Granger
93047f1d3c
Updating interact to work with latest state of widgets.
12 years ago
Brian E. Granger
faebb43e01
Updating interact to new APIs.
12 years ago
Brian E. Granger
1d6cde4877
Adding interact.py.
12 years ago
MinRK
5823b875eb
don't allow empty selection in selection widgets
...
raises KeyError on failed lookup (in both directions)
12 years ago
MinRK
ca0afa1d8b
value_names is read-only
12 years ago
MinRK
3e1f2e22f8
Make `SelectionWidget.values` a dict
...
rename 'labels' and '_value' to 'value_names' and 'value_name'.
To specify a mapping of value names and values, use a dict.
If you specify `values=[list]`, then an OrderedDict will be used.
Assignment after construction only supports a dict.
12 years ago
Brian E. Granger
2b7310f794
Merge pull request #4933 from jdfreder/widget-model-name
...
Small Widget inconsistency fixes
12 years ago
Brian E. Granger
cef93c8cfb
Adding initial version of readout to sliders.
12 years ago
Thomas Kluyver
c633256fc9
Fix some formatting in widget docstrings
12 years ago
Jonathan Frederic
865c7330a9
s/model_name/_model_name
12 years ago
Jonathan Frederic
75b148d40b
Renamed widgets...
...
TextWidget, TextareaWidget, CheckboxWidget, and SelectWidget
12 years ago
MinRK
36db60eacb
review pass on Python-side of widgets
...
- remove variable signature complexity
- use a few more traitlets as appropriate
12 years ago
Jonathan Frederic
e793d022b5
Callback dispatcher return callback value.
...
Also import it with the widgets namespace so it can be used elsewhere.
12 years ago
Jonathan Frederic
00b39af9cf
Fixed type in container
...
._children was not being set... Instead the value was being returned (useless).
12 years ago
Jonathan Frederic
91e82218a8
Changed selection widget API to use labels list
...
for mapping custom str reprs to items in the selection list
12 years ago
Jonathan Frederic
288b8a0ced
s/view_name/_view_name
12 years ago
Jonathan Frederic
2d13d05e9c
Replace O(N^2) algorithm with a faster one.
12 years ago
Jonathan Frederic
9e643f5692
Support multiple types in selection widget.
12 years ago
Jonathan Frederic
629d65da89
Fixed context errors and a couple of typos to get the tests working again
12 years ago
Jonathan Frederic
d7b86104b8
Fixed typo - else -> elif
12 years ago
Jonathan Frederic
046280b51a
s/ModalView/PopupView
12 years ago
Jonathan Frederic
e323f64e6d
Create base widget classes
12 years ago
Jonathan Frederic
b432b4840f
Use CUnicode for width and height in ImageWidget
12 years ago
Jonathan Frederic
e823d386ab
Fixed name conflict with _property_lock
12 years ago
Jonathan Frederic
077bd5c6ca
Added new CallbackDispatcher class
12 years ago
Jonathan Frederic
611614b6eb
Document in widget packing that vaues must be JSON-able.
12 years ago
Jonathan Frederic
cf05ef015a
ict comprehension and list comprehension in pack/unpack widgets
12 years ago
Jonathan Frederic
cb6094281c
s/custom_content/content
12 years ago
Jonathan Frederic
5fe860ed26
Added doc strings to properties in widget.py
12 years ago
Jonathan Frederic
1689eed2f6
Reorganized attrs in widget.py
12 years ago
Jonathan Frederic
d317532a38
Halign dict colons
12 years ago
Jonathan Frederic
7387f886c6
containers and selectioncontainers now only allow one of any single child
12 years ago
Jonathan Frederic
bfdebf9632
More PEP8 changes
12 years ago
Jonathan Frederic
ff39989b8b
s/Int/CInt s/Float/CFloat
12 years ago
Jonathan Frederic
74185a68e7
Got containers and mutlicontainers working! Yay
12 years ago
Jonathan Frederic
4017c7b27a
Fixed *almost* all of the test-detected bugs
12 years ago
Jonathan Frederic
c085593e2a
More fixes
12 years ago
Jonathan Frederic
d694666e66
A lot of bug fixes...
...
Related to 1-to-1 changes
12 years ago
Jonathan Frederic
047a90538f
1-to-1 widget / view mapping
12 years ago
Jonathan Frederic
c1c7bb7563
Everyone uses one model
12 years ago
Jonathan Frederic
b16171ac76
Added sync=True to all view name attrs
12 years ago
Jonathan Frederic
cfe8a07337
Added sync= attr to DOMWidget
12 years ago
Jonathan Frederic
b4a83b6044
sync=True isntead of a keys list
12 years ago
Jonathan Frederic
00650fd64a
Dev meeting Jan 2014, widget review day 2
12 years ago
Jonathan Frederic
d3ffd25107
Dev meeting widget review day 1
12 years ago
Paul Ivanov
897d51a567
fix typos
12 years ago
Paul Ivanov
95e99c0c61
remove unused imports
12 years ago
Jonathan Frederic
d103c682c5
Many checks off the todo list, test fixes
12 years ago
Jonathan Frederic
0f715170b3
Add a comment that explains the notion of the default element
...
to be styled in set_css's' doc string.
12 years ago
Jonathan Frederic
be268dcf98
Implement a context manager as a property locking mechanism in Widget.
12 years ago
Jonathan Frederic
70c6a295d0
Finished renaming Multicontainer to SelectionContainer
12 years ago
Jonathan Frederic
a528610e07
renamed: ../static/notebook/js/widgets/widget_multicontainer.js -> ../static/notebook/js/widgets/widget_selectioncontainer.js
...
renamed: widget_multicontainer.py -> widget_selectioncontainer.py
12 years ago
Jonathan Frederic
c62b496b0e
s/image_format/format
12 years ago
Jonathan Frederic
261e92de74
re-order handle custom msg and handle recieve state
12 years ago
Jonathan Frederic
15dabce113
send_state only once for dict signature of set_css
12 years ago
Jonathan Frederic
6c11760a89
Fixed comments for optional kwargs so they are redundant.
12 years ago
Jonathan Frederic
670f4881ec
remove 3rd callback type from on_displayed
12 years ago
Jonathan Frederic
7e6c8e4f1d
Remove view_name from display
12 years ago
Jonathan Frederic
463bcf85ee
Fixed _send so it can open a comm if needed.
...
It no longer returns anything.
12 years ago
Jonathan Frederic
85b5adff58
Remove first three lines of repr widgets
12 years ago
Jonathan Frederic
4e19dd7933
s/_handle_widget_constructed/_call_widget_constructed
12 years ago
Jonathan Frederic
39aaf7bf88
s/default_view_name/view_name
12 years ago
Jonathan Frederic
21a14e11a4
s/Widget/DOMWidget s/BaseWidget/Widget
12 years ago
Jonathan Frederic
696a6e4c28
add/remove_class now can accept a list of classes
12 years ago
Jonathan Frederic
2600913067
Removed ViewWidget
12 years ago
Jason Grout
a0b2cc40b8
Make widget keys have more explicit inheritance
12 years ago
Jason Grout
ce98452180
Get rid of keys magic; make the keys very explicit
12 years ago
Jason Grout
f0a4b9ea30
Make the widget keys property traverse the superclasses and accumulate the _keys attributes.
...
This caches the result, overwriting the property.
12 years ago
Jonathan Frederic
7c3b21d239
Fixed typo in model_id property
12 years ago
Jonathan Frederic
57f3057ca5
Moved view widget into widget.py
12 years ago
Jonathan Frederic
46e88dc205
Fixed indent of line 450
...
... caused Travis to get mad
12 years ago
Jonathan Frederic
a2235efbea
Further indentation cleanup
12 years ago
Jonathan Frederic
35a536f3b8
Re-decoupled comm_id from widget models
12 years ago
Jonathan Frederic
1b4e2ad6fe
Added ViewWidget
12 years ago
Jason Grout
b41f77e635
Fix the python side of the add/remove class functions to send custom messages
12 years ago
Jason Grout
747b219771
Move some Widget class references to BaseWidget
12 years ago
Jason Grout
07ffef8392
Make sure containers transmit the children; take care of case where children is possibly empty.
12 years ago
Jason Grout
18beaff887
Remove unused code and debugging statements
12 years ago
Jason Grout
72f7d2fe09
Remove the automatic _children_attr and _children_lists_attr.
...
When serializing, any Widget object is encoded as its comm_id. The view should know how to deal with the attribute, and should know that the attribute is a comm_id.
12 years ago
Jason Grout
ad1e23bfc2
Intermediate changes to javascript side of backbone widgets
12 years ago
Jason Grout
518cb4c647
Separate the display from the models on the python side, creating a BaseWidget class.
...
Conflicts:
IPython/html/widgets/widget.py
12 years ago
Jonathan Frederic
2df05bc5b8
Display handler now supports full kwargs
12 years ago
Jonathan Frederic
996d133710
Remove redundent _handle_close method
12 years ago
Jonathan Frederic
857ae831fb
Decoupled Python Widget from Comm
...
Fixed conflicts:
IPython/html/widgets/widget.py
12 years ago
Jonathan Frederic
f2fefe20ff
Added event for widget construction
12 years ago
Jonathan Frederic
ea27ae599b
Added parent parameter to on_display callback
12 years ago
Jonathan Frederic
1b02e8f607
Add ImageWidget
12 years ago
Jonathan Frederic
8e1c52382c
Added `method` property to messages from the front-end
12 years ago
Jonathan Frederic
0f34affc35
Dont send add and remove class calls if no comm exists
12 years ago
Jonathan Frederic
4e1e091648
Added ModalView
12 years ago
Jonathan Frederic
4333c84907
Fix scroll_to_bottom
12 years ago
Jonathan Frederic
6aac36ee13
Remove on_click, doesn't apply
12 years ago
Jonathan Frederic
4f663d896d
Made scroll to bottom use msgs
...
allow multiple msg handlers
added send to view to automatically hookup callbacks
changed send signature to optionally accept a cell to connect callbacks
12 years ago
Jonathan Frederic
cc96589afc
Changed on_submit to use custom messages instead of stateful communcation
12 years ago
Jonathan Frederic
10002f5a81
Changed button to use custom messages instead of state to communicate events.
12 years ago
Jonathan Frederic
c299022cc7
Changed add_class and remove_class to use messages instead of stateful communication
12 years ago
Jonathan Frederic
d795654251
Add scroll_to_bottom method for TextAreaView (StringWidget).
12 years ago
Jonathan Frederic
9019b639d1
Fixed a bug that didn't allow callbacks to set a property
...
on the widget that triggered the callback.
12 years ago
Jonathan Frederic
0d7428a903
Added TextBox submit event
12 years ago
Jonathan Frederic
c0ff518107
Added support for custom widget msgs
12 years ago