-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
However, I'm wondering if we should consider improving this API in a follow-up. The current design feels a bit awkward:
- Simple cases require writing a function wrapper that always returns the same object
- The function --> class pattern isn't the most intuitive
Right now users must write:
def propertylayer_portrayal(layer):
return PropertyLayerStyle(colormap="viridis", colorbar=True)Where the function wrapper adds no value when the style is uniform across all layers.
What if we allowed the visualization to accept either:
- A
PropertyLayerStyleinstance directly (for simple uniform styling) - A callable function (for conditional/per-layer styling)
Similar to how Python's sorted() accepts both key=str.lower and key=lambda x: complex_logic(x).
Originally posted by @EwoutH in #2912 (comment)