MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

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

    Scheduled Pinned Locked Moved Development
    13 Posts 5 Posters 9.1k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      croxis
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • morozgrafixM Offline
        morozgrafix Moderator
        last edited by morozgrafix

        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

        1 Reply Last reply Reply Quote 0
        • C Offline
          croxis
          last edited by croxis

          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?

          1 Reply Last reply Reply Quote 0
          • bheplerB Offline
            bhepler Module Developer
            last edited by bhepler

            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.

            1 Reply Last reply Reply Quote 2
            • C Offline
              croxis
              last edited by

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

              bheplerB 1 Reply Last reply Reply Quote 0
              • paviroP Offline
                paviro
                last edited by

                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

                We're all stories in the end. Just make it a good one, eh?

                – The Doctor

                1 Reply Last reply Reply Quote 1
                • bheplerB Offline
                  bhepler Module Developer @croxis
                  last edited by

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

                  strawberry 3.141S 1 Reply Last reply Reply Quote 0
                  • strawberry 3.141S Offline
                    strawberry 3.141 Project Sponsor Module Developer @bhepler
                    last edited by

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

                    Please create a github issue if you need help, so I can keep track

                    bheplerB 1 Reply Last reply Reply Quote 0
                    • bheplerB Offline
                      bhepler Module Developer @strawberry 3.141
                      last edited by

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

                      That said… good idea!

                      strawberry 3.141S 1 Reply Last reply Reply Quote 0
                      • C Offline
                        croxis
                        last edited by

                        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

                        bheplerB 1 Reply Last reply Reply Quote 0
                        • strawberry 3.141S Offline
                          strawberry 3.141 Project Sponsor Module Developer @bhepler
                          last edited by

                          @bhepler i guess if you can do it in two, you are also able to do it in one. if you can’t there are enough people to help

                          Please create a github issue if you need help, so I can keep track

                          1 Reply Last reply Reply Quote 0
                          • bheplerB Offline
                            bhepler Module Developer @croxis
                            last edited by

                            @croxis Flat maps? Intruiging. I hadn’t considered that as an option, but I suppose it makes sense. I did find Cesium, which appears to support flat maps natively (as well as a host of other very useful features). But It looks processor-intensive right out of the gate. I’m not even going to bother trying that one on a Pi.

                            @strawberry-3-141 True that. It’s not like we’re hurting for disk space on these things. Just memory and computational cycles. I’ll give it a go and if I hit any problems, I’ll reach out. Not here, of course. I’ll start a new thread.

                            bheplerB 1 Reply Last reply Reply Quote 0
                            • bheplerB Offline
                              bhepler Module Developer @bhepler
                              last edited by

                              @bhepler Just an update: The globe with planetary.js is a bit of a processor hog. On a quad core i3, it’s maxing one core and the other three hover between 40-80% at any given time. I’m going to try WebGL next and see if the hardware acceleration can reduce that.

                              The FitLet runs hot. Of course, that may be due to one core always maxed at 100%. Even just staring at the desktop.

                              1 Reply Last reply Reply Quote 0

                              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                              With your input, this post could be even better 💗

                              Register Login
                              • 1 / 1
                              • First post
                                Last post
                              Enjoying MagicMirror? Please consider a donation!
                              MagicMirror created by Michael Teeuw.
                              Forum managed by Sam, technical setup by Karsten.
                              This forum is using NodeBB as its core | Contributors
                              Contact | Privacy Policy