-
Notifications
You must be signed in to change notification settings - Fork 472
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
Interactive canvas within Jupyter Notebooks #364
Comments
Hi @dennissergeev, thanks for providing your input! You're right that PyVista previously leveraged The in-notebook rendering with import pyvista as pv
sphere = pv.Sphere()
p = pv.Plotter()
p.add_mesh(sphere)
p.show(auto_close=False, use_panel=True) (When doing this, you may need to call I am currently trying to overhaul the notebook rendering abilities in #268, #300, and hoping to start using Until we switch to using
Also, import pyvista as pv
from pyvista import examples
from itkwidgets import view
mesh = examples.download_nefertiti()
view(geometries=mesh, geometry_colors='w') |
Thanks a lot for the detailed explanation, @banesullivan. Looking forward to new versions of this great package! |
Hello, I confirm plotting is static in Jupyter notebooks. What shall I do? I tried |
Hello @banesullivan, no I don't. I guess I should... I'll try. |
Really cool! In the glacier and Euler method examples (links on the home page) there are already some cool map interaction tools, with zoom, pan etc. It's already here! I also really like the joint zoom in the Euler method example. Thanks! |
FYI, |
This is great, thanks @banesullivan! Does this mean that exporting a scene to file (.vtkjs specifically) has more features now? |
Nope, the VTKjs export script is still the same and has limited functionality as it was there to demo that we could put scenes in a notebook. We likely will not expand that export script for a long time (I’m bit over committed to handle it) as we want to move towards full integration with a tool like Sent with GitHawk |
That's cool. Looking forward to using it more in Jupyter! Is it specifically VTKjs limitation? Are more features available if I export the scene to a different format? |
Scene export still seems somewhat limited for both Try out the new |
Thanks, @akaszynski ! Regarding Do you know what could be causing it? pyvista report``` Date: Tue Feb 04 10:40:10 2020 GMT
Python 3.7.6 | packaged by conda-forge | (default, Jan 7 2020, 22:33:48)
|
I had the exact same problem. I recommend updating jupyterlab, |
As I understand, in new versions it does not work
Result:
|
Yep. Panel was always a half-baked, experimental feature and it was removed in favor of ipyvtk. See https://docs.pyvista.org/plotting/notebook_plotting/index.html |
New link: https://docs.pyvista.org/plotting/plotting.html#plotting-in-a-jupyter-notebook |
New link: https://docs.pyvista.org/user-guide/jupyter/index.html |
Pyvista output appears in Jupyter Notebooks as a static image, not as an interactive canvas.
This happens both in Jupyter Lab and Notebook. I also noticed that the same happens on pyvista's binder.
I can only get interactivity by using
notebook=False
inplot()
method, which opens a separate window. It would be great to have it within a notebook, under the code cell. I think it worked for me until recently, but after updating my conda environment it doesn't.I noticed there are some ongoing issues with widgets and pyvista (e.g. #332), but since widgets work fine in my case, I thought maybe there is a simple solution to my current problem.
Thanks.
Notes:
pyvista
.ipywidgets
package works OK, with the widgets showing up and responding correctly.panel
andpyviz_comms
within the same environment, but the only thing that changed is thatipywidgets
output now appears with a grey background (see screenshot below).To Reproduce
Please include a code snippet to reproduce the bug in the block below:
Screenshots
If applicable, add screenshots to help explain your problem.
System Information:
Please run the following code wherever you are experiencing the bug and paste the output below. This report helps us track down bugs and it is critical to addressing your bug:
# Paste system info here -------------------------------------------------------------------------------- Date: Fri Aug 16 16:34:13 2019 BST Linux : OS 8 : CPU(s) x86_64 : Machine 64bit : Architecture 31.3 GB : RAM Jupyter : Environment Python 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21) [GCC 7.3.0] 0.21.4 : pyvista 8.2.0 : vtk 1.17.0 : numpy 2.5.0 : imageio 1.4.3 : appdirs 0.4.3 : scooby 3.1.1 : matplotlib 5.9.2 : PyQt5 7.7.0 : IPython 7.5.1 : ipywidgets 0.6.2 : panel --------------------------------------------------------------------------------
The text was updated successfully, but these errors were encountered: