Coder Social home page Coder Social logo

Responsive view about globe.gl HOT 8 CLOSED

vasturiano avatar vasturiano commented on July 26, 2024 2
Responsive view

from globe.gl.

Comments (8)

wobsoriano avatar wobsoriano commented on July 26, 2024 8

Adding this made it responsive. Thank you.

window.addEventListener('resize', (event) => {
  world.width([event.target.innerWidth])
  world.height([event.target.innerHeight])
});

from globe.gl.

vasturiano avatar vasturiano commented on July 26, 2024 5

@sorxrob nice implementation! I've made a similar one at https://observablehq.com/@vasturiano/corona-virus-covid-19-globe

Regarding making it responsive, you can do that by manipulating the width and height properties. And if you prefer you can use something like element-resize-detector to detect changes to your window size.

from globe.gl.

snshn avatar snshn commented on July 26, 2024 2

Ah, perfect, thank you so much @wobsoriano!

from globe.gl.

wobsoriano avatar wobsoriano commented on July 26, 2024

This is the website btw https://covid-3d.now.sh

from globe.gl.

wobsoriano avatar wobsoriano commented on July 26, 2024

@sorxrob nice implementation! I've made a similar one at https://observablehq.com/@vasturiano/corona-virus-covid-19-globe

Regarding making it responsive, you can do that by manipulating the width and height properties. And if you prefer you can use something like element-resize-detector to detect changes to your window size.

Nice! Thanks for the API. I'm still checking how to set the width/height dynamically in your docs. Thanks!

from globe.gl.

kqwq avatar kqwq commented on July 26, 2024

thanks so much @wobsoriano

from globe.gl.

chavinlo avatar chavinlo commented on July 26, 2024

Thanks @wobsoriano

from globe.gl.

ralyodio avatar ralyodio commented on July 26, 2024

i get a flash of white when i resize. how do i fix this?

from globe.gl.

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.