Closed nmearl closed 5 years ago
One issue that might be confusing things is that ipyastroimage (now bqplot-image-gl) and the scatter viewer in glue-jupyter both depend on the latest developer version of bqplot (but your app uses the latest stable version). To keep things simple, I'd recommend trying the following widget code:
[
"filename = '/Users/tom/Projects/STScI/jdaviz/examples/manga-7495-12704-LOGCUBE_fixed.fits'",
"from glue_jupyter import jglue",
"app = jglue()",
"data = app.load_data(filename)[0]",
"",
"app.profile1d(data=data)"
]
and if that still doesn't work,
[
"filename = '/Users/tom/Projects/STScI/jdaviz/examples/manga-7495-12704-LOGCUBE_fixed.fits'",
"from glue_jupyter import jglue",
"app = jglue()",
"data = app.load_data(filename)[0]",
"",
"app.profile1d(data=data, widget='matplotlib')"
]
to use the Matplotlib widget.
I was unable to run this locally to debug, as I ran into the following error:
Uncaught ReferenceError: require is not defined
at (index):16
but if you can provide advice on how to solve that, I can investigate further.
Uncaught ReferenceError: require is not defined at (index):16
Can be ignored -- it's only used when the website is wrapped in electron and show not effect the normal website operation. If you'd rather not see the error, you can comment out line 16 of the index.html
file.
For some reason I'm getting the following error when running yarn run build
:
ERROR in ./node_modules/bqplot-image-gl/lib/imagegl.js
Module not found: Error: Can't resolve 'raw-loader' in '/home/tom/Projects/STScI/jdaviz/web/node_modules/bqplot-image-gl/lib'
@ ./node_modules/bqplot-image-gl/lib/imagegl.js 113:36-88
@ ./node_modules/bqplot-image-gl/lib/index.js
@ ./dist/manager.js
@ ./dist/index.js
ERROR in ./node_modules/bqplot-image-gl/lib/imagegl.js
Module not found: Error: Can't resolve 'raw-loader' in '/home/tom/Projects/STScI/jdaviz/web/node_modules/bqplot-image-gl/lib'
@ ./node_modules/bqplot-image-gl/lib/imagegl.js 112:34-84
@ ./node_modules/bqplot-image-gl/lib/index.js
@ ./dist/manager.js
@ ./dist/index.js
error Command failed with exit code 2.
any idea what this could be caused by? (I updated the code locally to use bqplot-image-gl instead of ipyastroimage)
Module not found: Error: Can't resolve 'raw-loader' in '/home/tom/Projects/STScI/jdaviz/web/node_modules/bqplot-image-gl/lib'
This suggests that the raw-loader
isn't in the dependencies
section of the bqplot-image-gl
package.json
(as opposed to the devDependencies
).
@astrofrog and I were able to get a test version of the plots in glue-jupyter to run. It is quite the setup, and he correctly pointed out that the dev versions of the bqplot libraries are absolutely required as well as the new (and npm-installable) bqplot-image-gl
library.
Currently, the setup looks like this:
cd
to the bqplot/js
directory and run an npm install
.cd
to jdaviz/web
.yarn add /path/to/bqplot/js
.yarn run build
then yarn run host
.python -m notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''
yarn run host
command.Glad to hear it @nmearl!
Just to be clear though: once release versions of all this stuff are out its only really 6-8 that are necessary, right?
This ticket is now being tracked at DATJPP-85
This ticket is now being tracked at DATJPP-100
This ticket is now being tracked at DATJPP-108
@eteq That's right (also note that current install instructions can be found here).
Also, it now works, so closing. 😛
Currently, there's an issue with rendering bqplots that are provided by the glue interface. While normal bqplots render fine in the desktop and web page environments, when utilizing glue to generate the plots as part of the ipywidgets "application", the rendering is mangled with various errors in the browser console.