mapboxgl-powerbi
mapboxgl-powerbi copied to clipboard
Add support for color-based bivariate choropleth
After some trial and error I've come to the conclusion that extrusion (as per https://github.com/mapbox/mapboxgl-powerbi/issues/188) works really well to create 3D maps at a relatively small scale with few map sections, typically the neighborhoods of a city. However things become quickly unreadable and a 3D choropleth of say, the US by state, let alone by county, is just unreadable.
I suggest adding the possibility of putting two variables in the Color field of choropleth maps, which allows the creation of legible maps like this:
Prior art:
- Observable (the example above).
- YouTube video explaining the added value of such maps.
- Halftone with Mapbox gl
In the absence of native support, I believe this could be done manually with some DAX magic and a separate legend in a matrix using conditional formatting. I'll give it a try and post here if I get something conclusive.
As I suspected all it takes is 1) a few nested switch statements in DAX to determine the right color, and 2) support for expression-based coloring in the map visual, as illustrated below with the default Map visual using the "Format by field value" option:
TLDR: if Mapbox implements https://github.com/mapbox/mapboxgl-powerbi/issues/266 then it will be possible to create bivariate choropleth with a bit of conditional DAX (leaving aside how to render the two-axes legend).
cc/ @samgehret
Any updates on this issue?
Same! This feature and a simple demo example will be extremely helpful!