getredash / redash

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.
http://redash.io/
BSD 2-Clause "Simplified" License
26.33k stars 4.37k forks source link

Choropleth map visualization #2317

Closed arikfr closed 6 years ago

arikfr commented 6 years ago

image

Possible libraries:

deecay commented 6 years ago
SylvainMassol commented 6 years ago

Yes leafletjs is a good library, support many formats like GeoJson, and it's already use in Redash.

deecay commented 6 years ago

I'm fiddling around with leaflet-choropleth module, and found out visualization shown below can be done quite easily. image

However, I do not have real-life use cases, so I'm not sure what to do from here.

  1. Visualize one property from "properties" within geoJSON column in query result. (geoJSON for above example).
  2. Query result column "value" has value to visualize and column geoJSON has the polygons.
  3. Query result is just a table of columns "id" and "value", and this table should be merged with some other source of geoJSON.
arikfr commented 6 years ago

The first use case we want to accomodate is to be able to visualize a dataset the looks like:

Country Users Count
JP 3201
US 2912
UK 215

I.e. take value per country and visualize it on a map.

Later we can expand this to be more granular (zoom in on specific continent, cities, etc).

This is why I feel like Leaflet might not be the try solution as it starts with too much details.

arikfr commented 6 years ago

But it has different base maps we can use so maybe one of them is what we need?

deecay commented 6 years ago

Yes. There are different base maps.

The example polygons on the example page just happened to be district-size. Leaflet/geoJSON can have country level polygons too. There are several versions of country level polygons available, so I will try to find suitable one and come back with visual example.

arikfr commented 6 years ago

Any "catalog" of those base maps?

kravets-levko commented 6 years ago

@deecay FYI - I'm already on this issue, and will create PR tomorrow (I see you're also experimenting with it, so I decided to tell you)

deecay commented 6 years ago

Oh, that's nice. Can't wait to see it!

deecay commented 6 years ago

Please allow me to ask one question here. Now that this is merged, how do we go about adding geojson files?

Due to highly individual needs and large file size, I think there should be some kind of way for admin to add their own geojson, and not to include all the country or city geojson in the bundle.

arikfr commented 6 years ago

The geojson files are not in the bundle -- they are loaded separately. It probably shouldn't be too complex to add a way to load custom files from a URL.

RichardLitt commented 6 years ago

@deecay if it is too complex, let us know! That probably just means we should document it better somewhere.

sergikpas commented 6 years ago

@arikfr when you plan release this feature? Any plans for next RC or Release?