widgetti / ipyvolume

3d plotting for Python in the Jupyter notebook based on IPython widgets using WebGL
MIT License
1.94k stars 234 forks source link

quiver and scatter plots produce empty cubes #364

Open gawells opened 3 years ago

gawells commented 3 years ago

I just installed version 0.6.0a6 in anaconda (manjaro linux, kernel 5.4.85, python 3.7.8)

The following code blocks

import ipyvolume as ipv
import numpy as np
x, y, z = np.random.random((3, 10000))
ipv.quickscatter(x, y, z, size=1, marker="sphere"
import ipyvolume as ipv
import numpy as np
x, y, z, u, v, w = np.random.random((6, 1000))*2-1
selected = np.random.randint(0, 1000, 100)
ipv.figure()
quiver = ipv.quiver(x, y, z, u, v, w, size=5, size_selected=8, selected=selected)

from ipywidgets import FloatSlider, ColorPicker, VBox, jslink
size = FloatSlider(min=0, max=30, step=0.1)
size_selected = FloatSlider(min=0, max=30, step=0.1)
color = ColorPicker()
color_selected = ColorPicker()
jslink((quiver, 'size'), (size, 'value'))
jslink((quiver, 'size_selected'), (size_selected, 'value'))
jslink((quiver, 'color'), (color, 'value'))
jslink((quiver, 'color_selected'), (color_selected, 'value'))
VBox([ipv.gcc(), size, size_selected, color, color_selected])

from the documentation page just produce empty cubes. The Klein bottle and quickvolshow examples are working though.

cdeln commented 1 year ago

Getting same issue in Firefox browser. Switched to Chrome and then it works.

maartenbreddels commented 1 year ago

Do you see an error in your browser's javascript console that you think might be relevant?

cdeln commented 1 year ago

I run the following

import ipyvolume as ipv
hdz = ipv.datasets.hdz2000.fetch()
ipv.volshow(hdz.data)

Getting this error in the notebook

[Open Browser Console for more detailed log - Double click to close this message]
Failed to create view for 'VolumeView' from module 'ipyvolume' with model 'VolumeModel' from module 'ipyvolume'
render@http://localhost:8888/lab/extensions/ipyvolume/static/568.4fa1f9c91adf4c28e6ba.js?v=4fa1f9c91adf4c28e6ba:1:256264
6110/create_view/e.state_change<@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.1a6d6a3a0542a41bec5a.js?v=1a6d6a3a0542a41bec5a:1:2959

And this in the console

Could not create a view for model id daa4ce30d3cc459fa935ed35d90c1a1e [150.1a6d6a3a0542a41bec5a.js:1:3039](http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.1a6d6a3a0542a41bec5a.js?v=1a6d6a3a0542a41bec5a)
    state_change http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.1a6d6a3a0542a41bec5a.js?v=1a6d6a3a0542a41bec5a:1
    create_view http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.1a6d6a3a0542a41bec5a.js?v=1a6d6a3a0542a41bec5a:1
    renderModel http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.402424ef4079078b2e0e.js?v=402424ef4079078b2e0e:1
    createRenderedMimetype http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    createOutputItem http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    _insertOutput http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    onModelChanged http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    g http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    c http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    emit http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    _onListChanged http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    g http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    c http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    emit http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    push http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    _add http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    add http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    _onIOPub http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    _handleIOPub http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    handleMsg http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    _handleMessage http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    _msgChain http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2
    (Async: promise callback)
    _onWSMessage http://localhost:8888/static/lab/jlab_core.4d5114e25256eeddf4e4.js?v=4d5114e25256eeddf4e4:2