vasturiano / globe.gl

UI component for Globe Data Visualization using ThreeJS/WebGL
https://vasturiano.github.io/globe.gl/example/world-population/
MIT License
1.97k stars 293 forks source link

Globe.gl with Angular ? #138

Closed ClementVaugoyeau closed 1 year ago

ClementVaugoyeau commented 1 year ago

Describe the bug Hello, I try to use Globe.gl in an Angular component, but I have problem with the DOM render of angular I think. In a classic htlm JavaScript file, the function Globe() is rendered well, but I can't convert this function to a renderable element in Angular. Sorry it's not really a bug, is anyone succeed to import globe.gl with Angular 14 maybe there is a same problem in React ? And thank you for this great library.

Expected behavior The Globe() function is render in the htlm element.

Desktop (please complete the following information):

dunlavy commented 1 year ago

You can either write a custom directive to manage the data layers or use a service to initialize GlobeGL the typical way.

I'm using imports, too, and not a CDN.

image

It works - don't expect that because you're in Angular there aren't ways to use it:

image

dunlavy commented 1 year ago

But I will say I'm having unexpected behavior in #148. Furthermore, with imports you could have trouble with build optimizers but for my project we do not engage them (we're not really worried about transit).

ClementVaugoyeau commented 1 year ago

Thank you for your response, I managed a way around it, but your solution is a lot cleaner than mine, aha.