When adding a Legend through the Bridge, Airship creates a baseStyle object with default values for each style property from the viz. This is not 100% accurate, cause it's getting a single value for each property. When the property is an expression that depends on a feature, this doesn't work.
From my perspective, the best solution is to use the getLegendData for each style property. This will imply some changes in the widget data, but it's the correct way to proceed.
What is happening?
When adding a Legend through the Bridge, Airship creates a
baseStyle
object with default values for each style property from the viz. This is not 100% accurate, cause it's getting a single value for each property. When the property is an expression that depends on a feature, this doesn't work.https://github.com/CartoDB/airship/blob/1b52c881f758828baaa23f8faa39d5544d47dfdc/packages/bridge/src/vl/legends/index.ts#L28-L40
What should happen?
From my perspective, the best solution is to use the
getLegendData
for each style property. This will imply some changes in the widget data, but it's the correct way to proceed.Steps to Reproduce
Use this html example: