Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipywidgets compatibility with IPython.display.update_display? #1180

Closed
gnestor opened this issue Mar 2, 2017 · 7 comments
Closed

ipywidgets compatibility with IPython.display.update_display? #1180

gnestor opened this issue Mar 2, 2017 · 7 comments
Labels
answered The issue has been answered by a community member. closing as answered The issue will be closed as answered soon unless there is further follow-up. needs info question
Milestone

Comments

@gnestor
Copy link
Contributor

gnestor commented Mar 2, 2017

I created an example notebook to demonstrate update_display for IPython.display.HTML and ipywidgets.widgets.IntProgress and the progress bar doesn't update.

https://gist.github.com/gnestor/867a1bd14125fbeba30dadf9c19c68a9

@jasongrout
Copy link
Member

Has the ipython with the update_display command been released yet? Is it in 5.3.0? I'm having troubles importing it.

@gnestor
Copy link
Contributor Author

gnestor commented Mar 2, 2017

No, I think it will be released with 6.0. Here is the PR: ipython/ipython#10048

@jasongrout jasongrout added this to the Backlog milestone Apr 8, 2017
@deisi
Copy link

deisi commented Aug 28, 2018

Does this work by now? I couldn't make it work up to now.
I want to update/change the currently displayed widgets inplace during runtime. E.g. I have a button "load" and once I click it, I want to dynamically add/remove widgets to the currently displayed.

Is this the right function for that?

@deisi
Copy link

deisi commented Aug 28, 2018

Ah I found #1764
I think that's what I need. Thx.

@saulshanabrook
Copy link

Here is a minimal example to show this behavior:

import ipywidgets
import IPython.display

inn = ipywidgets.IntSlider()
out = ipywidgets.Output()

def create_and_update_display():
        d = IPython.display.display(IPython.display.Code("hi"), display_id=True)
        d.update(IPython.display.Code("there"))

def update_output(value):
    out.clear_output()
    with out:
         create_and_update_display()

    return out.outputs

ipywidgets.dlink((inn, 'value'), (out, 'outputs'), update_output)
ipywidgets.VBox([inn, out])

I would expect it to display there but it displays hi.

This support is needed when you want to wrap some output that is updated asynchronously in a widget.

@gnestor
Copy link
Contributor Author

gnestor commented Feb 21, 2019

Here's a minimal example using interact that works and doesn't depend on update_display:

import altair as alt
import ipywidgets as widgets

cars = alt.load_dataset('cars')

def render_chart(x, y):
    return alt.Chart(cars).mark_point().encode(
        x=x,
        y=y,
        color='Origin',
    )

widgets.interact(render_chart, x=list(cars), y=list(cars));

@vidartf vidartf added the answered The issue has been answered by a community member. label Jul 6, 2021
@github-actions github-actions bot added the closing as answered The issue will be closed as answered soon unless there is further follow-up. label Aug 6, 2021
@martinRenou
Copy link
Member

Has this been fixed @vidartf ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered The issue has been answered by a community member. closing as answered The issue will be closed as answered soon unless there is further follow-up. needs info question
Projects
None yet
Development

No branches or pull requests

6 participants