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

Unable to load three-globe in ObservableHQ #96

Open
emileaben opened this issue Aug 1, 2024 · 1 comment
Open

Unable to load three-globe in ObservableHQ #96

emileaben opened this issue Aug 1, 2024 · 1 comment

Comments

@emileaben
Copy link

Describe the bug
I'm unable to load three-globe in an ObservableHQ notebook

To Reproduce
Steps to reproduce the behavior:

  1. Goto the observableHQ require-debugger Create a notebook on ObservableHQ
  2. Enter 'three-globe' in the search box there
  3. This shows that none of the module loading techniques tried there work

Expected behavior

When putting this javascript code in an ObservableHQ notebook cell, I would expect three-globe to load:
ThreeGlobe = require('three-globe')

Desktop (please complete the following information):

Additional context
I'm unsure to what extent this is an ObservableHQ or three-globe problem, but since ObservableHQ has this module-require debugger, which recommends asking module authors, I think it's reasonable to enquire here first on what the issue might be.

@vasturiano
Copy link
Owner

Emile!!! Fancy seeing you here. 😄

Ok, so I don't know for sure why Observable is choking on this pkg, but I highly suspect it's because it needs ThreeJS as peer dependency.

This means in order to get it to work inside Observable you need to somehow import the core of ThreeJS itself and then load this package. Normally in an app that's easily done via imports, but in the Observable env, I don't know. Maybe by loading it all into globals via UMDs but sounds tricky.

However, you might not need to bother with any of that, if you require instead the package globe.gl it comes already pre-packaged with its own version of ThreeJS, and you don't need to bother with scene / camera /renderer scaffoldings either.

Observable loads that pkg just fine, here's a notebook example that uses it: https://observablehq.com/@vasturiano/solar-terminator

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

No branches or pull requests

2 participants