-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helper methods - Color categories #649
Comments
note:
|
category color ramps above for all geometries |
@Jesus89 as a first pass, let's call this helper thanks! |
Hi @makella, @Jesus89, nice work with styles! As we have discussed before, the 'helpers' would probably be even more useful at the Layer level. That way we could include at the same time what we want to add also for Legend or even Popup. for each one of them. That means that this helper API could be built as something like: # 1. Minimum (just field is required)
aLayer = mapping.colorCategoryLayer(source, { field: 'myCategoryField' });
# or even...
aLayer = mapping.colorCategoryLayer(source, 'myCategoryField'); The This approach is of course compatible with setting custom parameters for that, as in: #2. Custom number of categories or palette (optional params)
aLayer = mapping.colorCategoryLayer(source, {
field: 'myCategoryField',
top_categories: 10,
palette: 'antique'
}); |
Regarding to altering individual properties in those helpers (style 'overrides'), I think that, as @jorgesancha said, we should think before about finishing them all with good defaults. After that, we can explore the Style |
OK. Thanks for the clarification Victor! My initial thoughts were about methods to include in the current API, but this is a new API over on top of the current API. So it would be nice to add each of these mini examples in all the tickets regarding helpers to have the definition before starting to implement the code. (Just updating the JS functions The good point is that the insights implemented for the geom type detection are compatible with this final API too so it won't be hard to implement them as soon as they are defined. NOTE: IMO there pure style helper methods have intrinsic value "per se" so we could consider to revisit them in the future once we have completed the layer helper methods. |
Let's shaare a PoC of that first one |
I love the I like the second legend (with large filled circles, the other confused me into thinking it was a classed numeric ramp). On the others, could we get the name changed to just "Others"? |
Great 😄
Yes, I'm using that legend 'basic' instead of the first one
Yes, but I think this should be done in Airship cc @rjimenezda If we are happy with the approach we can define all the layer helpers using this pattern:
|
nice @Jesus89 regarding your legend question, yes, what we envision is assigning default legends that are appropriate for each helper + geometry type. So in the case above, the helper |
OK @makella I think this is a feature we should add in the VL bridge, which has the information about the geom_type. cc @rjimenezda. |
yep! it will come from the bridge :) |
Closed via #692 |
For
The text was updated successfully, but these errors were encountered: