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

Fix 3D scatter overlay on volume viewer #390

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion glue_vispy_viewers/volume/jupyter/tests/test_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@
from ..volume_viewer import JupyterVispyVolumeViewer


def test_basic_jupyter_volume():
def test_jupyter_volume_basic():
app = jglue()
data = Data(x=np.arange(24).reshape((2, 3, 4)), label="cube data")
app.add_data(data)
app.new_data_viewer(JupyterVispyVolumeViewer, data=data)


def test_jupyter_volume_scatter_overlay():
app = jglue()
data1 = Data(x=np.arange(24).reshape((2, 3, 4)), label="cube data")
data2 = Data(x=[1, 2, 3], y=[1, 2, 3], z=[2, 3, 4], label="tabular data")
app.add_data(data1)
app.add_data(data2)
viewer = app.new_data_viewer(JupyterVispyVolumeViewer, data=data1)
viewer.add_data(data2)
5 changes: 5 additions & 0 deletions glue_vispy_viewers/volume/jupyter/volume_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
from .viewer_state_widget import Volume3DViewerStateWidget
from .layer_state_widget import Volume3DLayerStateWidget
from ...common.jupyter.toolbar import VispyJupyterToolbar
from ...scatter.jupyter.layer_state_widget import Scatter3DLayerStateWidget
from ..layer_artist import VolumeLayerArtist
from ...scatter.layer_artist import ScatterLayerArtist

__all__ = ['JupyterVispyVolumeViewer']

Expand All @@ -13,6 +16,8 @@ class JupyterVispyVolumeViewer(VispyVolumeViewerMixin, IPyWidgetView):

_options_cls = Volume3DViewerStateWidget
_layer_style_widget_cls = Volume3DLayerStateWidget
_layer_style_widget_cls = {VolumeLayerArtist: Volume3DLayerStateWidget,
ScatterLayerArtist: Scatter3DLayerStateWidget}
_toolbar_cls = VispyJupyterToolbar

def __init__(self, *args, **kwargs):
Expand Down