Giter Site home page Giter Site logo

Comments (11)

nmearl avatar nmearl commented on August 27, 2024 2

@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:

  1. Clone and install the bqplot python package.
  2. cd to the bqplot/js directory and run an npm install.
  3. cd to jdaviz/web.
  4. Install the dev version of the bqplot node package: yarn add /path/to/bqplot/js.
  5. Run yarn run build then yarn run host.
  6. In another terminal, startup a jupyter kernel with python -m notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''
  7. Go to the web address printed after the yarn run host command.
  8. Profit.

from jdaviz.

astrofrog avatar astrofrog commented on August 27, 2024

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.

from jdaviz.

nmearl avatar nmearl commented on August 27, 2024

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.

from jdaviz.

astrofrog avatar astrofrog commented on August 27, 2024

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)

from jdaviz.

nmearl avatar nmearl commented on August 27, 2024

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).

from jdaviz.

eteq avatar eteq commented on August 27, 2024

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?

from jdaviz.

stscijgbot avatar stscijgbot commented on August 27, 2024

This ticket is now being tracked at DATJPP-85

from jdaviz.

stscijgbot avatar stscijgbot commented on August 27, 2024

This ticket is now being tracked at DATJPP-100

from jdaviz.

stscijgbot avatar stscijgbot commented on August 27, 2024

This ticket is now being tracked at DATJPP-108

from jdaviz.

nmearl avatar nmearl commented on August 27, 2024

@eteq That's right (also note that current install instructions can be found here).

from jdaviz.

nmearl avatar nmearl commented on August 27, 2024

Also, it now works, so closing. 😛

from jdaviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.