Ribbit-Network / ribbit-network-dashboard

The web dashboard for the world's largest crowdsourced network of open-source, low-cost, CO2 Gas Detection Sensors.
MIT License
18 stars 16 forks source link

Replace globe with 2D map #14

Closed brianstrauch closed 3 years ago

brianstrauch commented 3 years ago

As the number of sensors grow, the current globe model will start to lag (since all points are shown at once). We should use the following and render only the visible sensors: https://plotly.com/python/scatter-plots-on-maps/

spestana commented 3 years ago

I tried my hand at replacing the globe with a different map style in #16 . It's also set up to color points based on the latest CO2 measurement.

keenanjohnson commented 3 years ago

I guess I don't really understand why this flat map would perform better than the globe?

spestana commented 3 years ago

Right, I'm not sure if the globe actually loads more slowly than other types of plots?

brianstrauch commented 3 years ago

The idea is that as we get more and more sensors, we'll have to query data for all of them, and render all of them. For 100+ sensors this could take a lot of time.

If we use a 2D graph, we only need to query the sensors within the box that's currently visible on the screen. InfluxDB can do this really efficiently.

keenanjohnson commented 3 years ago

So are you imagining that eventually we'll have some logic that wouldn't show the whole map when the page loads initially? I guess if that's the case this makes sense. I'm a bit sad because I thought the globe looked nice, but understood if you all feel the flat map is the way to go.

brianstrauch commented 3 years ago

Yeah, that's what PurpleAir does. Looks like they have well over 1000 sensors. Try zooming out all the way and watch how long it takes for everything to load (https://www.purpleair.com/map?opt=1/mAQI/a10/cC0#0.25/0/-122.1)

keenanjohnson commented 3 years ago

Makes sense to me :)

On Fri, Sep 3, 2021 at 11:21 PM Brian Strauch @.***> wrote:

Yeah, that's what PurpleAir does. Looks like they have well over 1000 sensors. Try zooming out all the way and watch how long it takes for everything to load ( https://www.purpleair.com/map?opt=1/mAQI/a10/cC0#0.25/0/-122.1)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Ribbit-Network/ribbit-network-dashboard/issues/14#issuecomment-912918240, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATQ3FXUVRHD565YBLYIAVLUAG3GPANCNFSM5DIB33XA .

keenanjohnson commented 3 years ago

I merged the PR to move to the flat map for now. We can always go back if we like this look less :).

Thanks all!

image