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

Refactored and improved VTK model and pane [doc-build] #337

Merged
merged 14 commits into from Mar 28, 2019
Merged

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Mar 27, 2019

Does some refactoring for the VTK pane and adds some features:

  • VTK pane now supports responsive sizing modes
  • VTK pane now supports syncing (and therefore linking) camera state

@xavArtley, review would be appreciated but I'll probably merge some time tomorrow in any case.

@dharhas, it currently only supports uni-directional links between objects, which is something I need to think about and address in general, but you could now link multiple plots together and then interact with the plot they are linked to:

vtk_link

@xavArtley
Copy link
Collaborator

@xavArtley xavArtley commented Mar 27, 2019

In notebook the vtk panel does not appear for me
image
If I use the show metho it seems to work
image

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Mar 27, 2019

Is that JupyterLab or classic notebook? I can't reproduce issues in either.

@xavArtley
Copy link
Collaborator

@xavArtley xavArtley commented Mar 27, 2019

jupyter lab

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Mar 27, 2019

Ah, have you updated the JupyterLab extension recently? We made a major change to the way output is published in the notebook.

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Mar 27, 2019

You'll need:

@pyviz/jupyterlab_pyviz v0.7.1

@xavArtley
Copy link
Collaborator

@xavArtley xavArtley commented Mar 27, 2019

Ok greats it works now.

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Mar 27, 2019

Actually bi-directional linking works okay, and there's no need for the trigger:

vtk = pn.pane.VTK('https://raw.githubusercontent.com/Kitware/vtk-js/master/Data/StanfordDragon.vtkjs',
                  sizing_mode='stretch_both')
vtk2 = pn.pane.VTK('https://raw.githubusercontent.com/Kitware/vtk-js/master/Data/StanfordDragon.vtkjs',
                   sizing_mode='stretch_both')

vtk.jslink(vtk2, camera='camera')
vtk2.jslink(vtk, camera='camera')

pn.Row(vtk, vtk2)

I'll probably add a bi-directional flag to the jslink method.

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Mar 27, 2019

@xavArtley Finally got vtk to run on Travis so we'll be able to add some more tests.

@philippjfr philippjfr changed the title Refactored and improved VTK model and pane Refactored and improved VTK model and pane [doc-build] Mar 28, 2019
@philippjfr philippjfr merged commit 0105693 into master Mar 28, 2019
2 of 3 checks passed
delete state.vtkCamera;
delete state.viewPlaneNormal;
this.model.camera = state;
this.model.properties.camera.change.emit();
Copy link
Collaborator

@xavArtley xavArtley Mar 28, 2019

Choose a reason for hiding this comment

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

Is it really necessary to emit change explicitly?
As we set a new value to model.camera, I would excpect the change event would be already emit

Copy link
Member Author

@philippjfr philippjfr Mar 28, 2019

Choose a reason for hiding this comment

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

I think you're right, thanks!

@philippjfr philippjfr deleted the vtk_enhancements branch Sep 9, 2019
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

2 participants