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

Add anchor attribute to choose between right sidebar or main area #8

Merged
merged 7 commits into from Feb 19, 2021

Conversation

fcollonval
Copy link
Contributor

We are using a lot bokeh for plots. Unfortunately in JupyterLab cloning the output view into a separate widgets is not working as expected. In particular when using push_notebook, only the view in the notebook is updated not the other view.
So your sidecar project is really interesting. But to have a more flexible layout, I added an attribute anchor that can be right or main depending if the user wants the output in the right sidebar or in the main area.

I also try to add the widget in the left sidebar. But in such case, the tab is non closable (I did not figure out why).

As a side note, I think an option like anchor could be a nice to have in the standard Output widget (in the context of JupyterLab).

@jasongrout
Copy link
Member

What is push_notebook? Is it something that should be fixed somewhere, to have the view updated?

@fcollonval
Copy link
Contributor Author

Yes, Bokeh is not playing as nicely as bqplot or plotly.py 3.0.
To update a previously created plot, you need to explicitly push the new properties through a handle.

Here is the relevant documentation.

So you are right. The view update process should be fixed in bokeh. So I have opened an issue there.

Nota: I still think the ability to directly redirect the output in an side widget is interesting in the case where the same figure will be updated along side the execution of a notebook. It such case, updating the "regular" output in the notebook may even be a waste of ressources if it is hidden.

@phausamann
Copy link

Are there any plans to merge this PR? I have a similar use case with bokeh, large plots that I'd prefer to show in a separate tab rather than inline.

@ianhi
Copy link
Contributor

ianhi commented Jun 5, 2020

Other than a rebase is there anything holding back this PR? It adds some really nice functionality to this extension.

The one thing is that maybe the example shouldn't use plotly as not everyone will have installed

sidecar/sidecar.py Outdated Show resolved Hide resolved
src/plugin.ts Outdated Show resolved Hide resolved
@jasongrout
Copy link
Member

Other than a rebase is there anything holding back this PR? It adds some really nice functionality to this extension.

I've added a few comments.

Note that you can also right click on any output and select "Create new view for output" to get a tab with that output. It won't be programmatic, but it will be a tab in the main area.

@jasongrout
Copy link
Member

As a side note, I think an option like anchor could be a nice to have in the standard Output widget (in the context of JupyterLab).

Unfortunately, that would make the output widget very specific to JupyterLab.

@fcollonval
Copy link
Contributor Author

Thanks for the review @jasongrout

I rebased this PR and made the modifications.

Copy link
Contributor

@ianhi ianhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried it out. Works great!
(so long as you use npm instead of jlpm to install #57)

@fcollonval
Copy link
Contributor Author

This should be good to go.

@ianhi
Copy link
Contributor

ianhi commented Feb 18, 2021

Hi @fcollonval would you mind rebasing one final time?

@fcollonval
Copy link
Contributor Author

Hi @fcollonval would you mind rebasing one final time?

Done

Copy link
Contributor

@ianhi ianhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried it out again and it still works with jlab3 :)

@jasongrout I think this is good to merge now. (I can't merge stuff here otherwise I would deal with this)

@jasongrout
Copy link
Member

I can't merge stuff here otherwise I would deal with this

Fixed! You can do stuff here too.

@ianhi
Copy link
Contributor

ianhi commented Feb 19, 2021

Thanks @fcollonval !

(And thanks jason for fixing merging rights 😄 )

@ianhi ianhi merged commit 170718c into jupyter-widgets:master Feb 19, 2021
@fcollonval fcollonval deleted the anchor branch February 20, 2021 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants