Skip to content

Releases: jupyter-widgets/ipywidgets

Release 8.1.1

13 Sep 09:49
Compare
Choose a tag to compare

What's Changed

Bug fixed

Docs

New Contributors

Full Changelog: 8.1.0...8.1.1

Release 8.1.0

01 Aug 07:41
Compare
Choose a tag to compare

Improvements

  • Allow CSS variables to be used as values in the Color trait by @nurbo in #3796
  • Replace ipykernel dependency by the comm dependency by @martinRenou in #3811

Documentation

Maintenance

New Contributors

Full Changelog: 8.0.7...8.1.0

Release 8.0.7

04 Jul 15:19
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 8.0.6...8.0.7

Release 8.0.6

04 Jul 15:19
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 8.0.5...8.0.6

Release 8.0.5

22 Mar 11:45
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 8.0.4...8.0.5

Release 8.0.4

22 Mar 11:45
Compare
Choose a tag to compare

What's Changed

Full Changelog: 8.0.3...8.0.4

Release 8.0.3

22 Mar 11:45
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 8.0.2...8.0.3

Release 8.0.2

22 Mar 11:44
Compare
Choose a tag to compare

What's Changed

Full Changelog: 8.0.1...8.0.2

Release 8.0.1

22 Mar 11:44
Compare
Choose a tag to compare

Full Changelog: 8.0.0...8.0.1

8.0.0

18 Aug 10:08
Compare
Choose a tag to compare

What's Changed

See the 8.0.0 changelog for a more comprehensive summary of changes. To see the full list of pull requests and issues, see the 8.0 milestone on GitHub, or the full list of changes since 7.x.

Users

Here are some highlights of user-visible changes in ipywidgets 8.0.

Date and time pickers

In addition to the existing DatePicker widget, we now have new DatetimePicker and TimePicker widgets. (#2715)

from ipywidgets import VBox, TimePicker, DatetimePicker
VBox([
  TimePicker(description='Time'),
  DatetimePicker(description='Date/Time')
])

Tags input widget

The new TagsInput widget provides an easy way to collect and manage tags in a widget. You can drag and drop tags to reorder them, limit them to a set of allowed values, or even prevent making duplicate tags. (#2591, #3272)

from ipywidgets import TagsInput
TagsInput(
    value=['pizza', 'fries'],
    allowed_tags=['pizza', 'fries', 'tomatoes', 'steak'],
    allow_duplicates=False
)

Similarly, the new ColorsInput widget provides a way to select colors as tags

from ipywidgets import ColorsInput
ColorsInput(
    value=['red', '#2f6d30'],
    # allowed_tags=['red', 'blue', 'green'],
    # allow_duplicates=False
)

Stack widget

The new Stack container widget shows only the selected child widget, while other child widgets remain hidden. This can be useful if you want to have a area that displays different widgets depending on some other interaction.

from ipywidgets import Stack, Button, IntSlider, Dropdown, VBox, link
s = Stack([Button(description='Click here'), IntSlider()], selected_index=0)
d = Dropdown(options=['button', 'slider'])
link((dropdown, 'index'), (stacked, 'selected_index'))
VBox([d, s])

File upload widget

The file upload widget has been overhauled to handle multiple files in a more useful format:

  • The .value attribute is now a list of dictionaries, rather than a dictionary mapping the uploaded name to the content.
  • The contents of each uploaded file is a memory view in the .content key, e.g., uploader.value[0].content.
  • The .data attribute has been removed.
  • The .metadata attribute has been removed.

See the user migration guide for details on how to migrate your code.

(#2767, #2724, #2666, #2480)

More styling options

Many style and layout options have been added to core widgets:

  • Tooltips are now supported for many core widgets, rather than just a few description tooltips (#2680)
    from ipywidgets import Button
    Button(description="Click me", tooltip='An action')
  • Borders can be styled independently with the layout's border_top, border_right, border_bottom, border_left attributes (#2757, #3269)
    from ipywidgets import Button
    Button(description="Click me", layout={'border_bottom': '3px solid blue'})
  • Descriptions are now plain text by default for security, but you can set them to allow HTML with the description_allow_html attribute (HTML content is still sanitized for security). (#2785)
    from ipywidgets import Text
    Text(description="<b>Name</b>", description_allow_html=True)
  • Many other styling attributes can be set on core widgets, such as font family, size, style, weight, text color, and text decoration. See the table in the documentation for a reference. (#2728)
  • The SelectionSlider now has a handle_color style attribute (#3142)
  • To control keyboard navigation, widgets can be set to be tabbable or not (i.e., that the tab key will traverse to the widget) (#2640)

Selection container titles

The Accordion, Tab, and Stack widgets now have a .titles attribute that you can use to get and set titles from the constructor or as an attribute. (#2746, #3296, #3477)

from ipywidgets import Tab, IntSlider, Text
Tab([IntSlider(), Text()], titles=('Slider', 'Text'))

Slider implementation

The slider implementation in the core widgets now uses nouislider. This enables us to fix long-standing bugs and introduce new features, like dragging the range in a RangeSlider. (#2712, #630, #3216, #2834)

Collaboration

By default, ipywidgets 8 enables a collaboration mode, where widget updates from one frontend are reflected back to other frontends, enabling a consistent state between multiple users and fixing synchronization between the kernel and frontend. You may want to disable these update echo messages if they are using too much bandwidth or causing slower interactivity. To disable echo update messages across ipywidgets, set the environment variable JUPYTER_WIDGETS_ECHO to 0. For widget authors, to opt a specific attribute of custom widget out of echo updates (for example, if the attribute contains a lot of data that does not need to be synchronized), tag the attribute with echo_update=False metadata (we do this in core for the FileUpload widget's data attribute). (#3195, #3343, #3394, #3407)

CDN for html manager

We have made it easier to load widgets from content delivery networks.

Other changes

Here is a short list of some of the other changes in ipywidgets 8.0.

  • Add a cookiecutter-based tutorial to build a custom widget (#2919)
  • Change media widgets to use memory views. (#2723)
  • Upgrade to FontAwesome 5 in html-manager (#2713)
  • Play widget now toggles between play and pause button as needed (#2703, #2671)
  • Drop support for mapping types as selection options (#2679, #1958)
  • Focus or blur a widget. (#2664, #2692, #2691, #2690)
  • Drop notebook dependency from widgetsnbextension (#2590)
  • Cast 'value' in range sliders to a tuple (#2441)
  • Play widget: expose playing and repeat (#2283, #1897)
  • Fix debouncing and throttling code (#3060)
  • Fix regression on spinning icons (#2685, #2477)
  • Fix selection container default index (#1823)
  • Remove deprecated overflow properties (#2688)
  • Select: Do not force a selec...
Read more