jupyter-widgets / ipywidgets

Interactive Widgets for the Jupyter Notebook

Home Page:https://ipywidgets.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Output with traitlets class only update once in jupyterlab

CnBDM-Su opened this issue · comments

What I am doing is like this, I want to display the data where I select.
image

The selected data is oberved and stored in a traitlets class well. However, it cannot display well in widgets.Output()

@data_output.capture()
def show_dataframe(change):
if change is not None:
tmp_frame = data_frame.iloc[change['new']][:10]
clear_output()
display(tmp_frame, display_id=99)
js2py_memory.observe(show_dataframe, names=["data"])

If I display the result in a new cell instead of in widgets.Output(), it works well.
image

Is there any way I can put the result in Output? Because I want to put both table and plot in single cell. If Output cannot realize this, is there other way?

Thanks