MagicMirror² v2.5.0 is available! For more information about this release, check out this topic.

Developing USGS Earthquake Map (2MB GIf warning) Topic 2



  • The forum moderators and admins want us to make new topics if we need to update our modules with new releases. So that is what I am going to do.

    Image
    I’m using d3.v4.js to put together a spinning map of Earthquakes from the United States Geological Survey. Here is my current code.

    There are two major bugs I need to fix before release:

    • I’m getting incredible slowdowns after a minute of running in firefox on my desktop pc. I hate to see what would happen on a pi. I’m at a bit of the loss on what the issue is, but I am sure it is how I’m setting up and updating the dom. Any performance profiling tool suggestions?

    • “Flatten” out the dots into the sphere and hide them when they are on the far side.


  • Moderator

    This may help you get going with hiding http://zeleniy.me/globe.html also this seems to do what you are trying to achieve http://bl.ocks.org/PatrickStotz/1f19b3e4cb848100ffd7



  • Yes! Thank you. I think one of the problems I am running into is that I am currently rendering in a canvas, while many examples, including the ones you link, are svg based. I’ve started researching this a bit and it looks like svg is preferred except for games.

    I’ve also poked the firefox developer tools, I have a memory leak and it is with some arrays, but I can’t figure out any further details. Any suggestions?



  • Thank you for the inspiration. At the moment, this is a work in progress.
    Globe module - Work in progress

    It’s a very basic implementation of planetary.js. But it seems to be a mature framework.



  • That looks real nice! That was one of the frameworks I was eyeing


  • Admin

    You can now also edit your posts, once you fixed your last bugs 🙂 Just make sure the conversation stays understandable by not removing your original post but instead adding a second section:


    Version 2



  • @croxis Thank you. The plan is to get it working and then release it as MMM-GlobeJS. Then try it using the WebGL rendering and release that one as MMM-GlobeGL. We’ll see if my ambitions get the better of me.

    It only took a few hours to get the globe up, but my Javascript skills are rudimentary. Also, I haven’t tested this on a Pi, as I’m building the next mirror for my office and they gave me a FitLet PC to use for the project.



  • @bhepler would be nice to see it as one module with the ability to choose between canvas and webgl in config



  • @strawberry-3.141 Hah! Don’t ask for much, do you? Have you seen my Javascript skills?

    That said… good idea!



  • I feel you on the javascript skills. I switched from canvas to svg and now nothing is rendering sigh.

    The reason why I went with d3 (which planetary.js is based on) is because d3 can also render flat maps. Rasp pis might not have enough oomph to run spinning globes so my hope was to have flat maps as an option