Add function type "identity" to color, radius, height stops
ryanbaumann opened this issue · 3 comments
Problem
As a data scientist or developer, I want to build an application where a visualization's "height", "radius", or "color" is encoded directly into the source data as a property - for example, `"height": 2001. This matters because I can create buildings that are the exact correct height in a 3D extrusion visualization.
Solution
Add identity
function to
mapboxgl-jupyter/mapboxgl/viz.py
Line 589 in 6e95434
@ryanbaumann Would this be similar to setting height_function_type='match'
and specifying the height_property='height'
? It's a little clumsy, but just wanted to check if that's the same behavior you're looking for. I like your idea of including height_function_type='identity'
. Then we can have the viz automatically specify the height property without the user having to edit two arguments.
@akacarlyann instead of using a height_function_type
that was match
, we want to create a Mapbox GL expression under the hood that sets the value from the data column directly equal to the value used in the map. The identity
keyword would indicate to pass ['get', 'myColumnName
]` as the expression to the layer created by the Python Viz function.
@ryanbaumann cool cool. That's what I started in #161. Definitely nice to have this option.