Skip to content

Conversation

ATL2001
Copy link
Collaborator

@ATL2001 ATL2001 commented Sep 21, 2025

as we discussed in discussion #711 I was unable to get the DataFilterExtension to work for filtering data with categories.

I finally spent some time looking into what was going on, and the FilterValueAccessor was being used for the get_filter_category property, but that accessor is set up to work in conjunction with the filter_size parameter of the DataFilterExtension. I created a new FilterCategoryAccessor accessor modeled after the FilterValueAccessor that works with the category_size parameter and does not do any casting of values to Float32, because looking at the DeckGL docs it appears that the category_filter should be able to work with string data.

Using the new accessor for the get_filter_category on the data filter extension I'm now able to change filter_categories on the layer and the features are filtered as expected for numeric data. What I've got still isn't working for filtering with string data, but I figured this was worth throwing out there to see if anyone else had an idea how to get the filter working with those as well.

I've added a notebook to the examples folder that I do not intend to actually check into the repo, which creates a DFE for a layer and links it to a widget to show that the category_filter is working for the numeric data, but not the string data. If we get the strings working I'd be happy to make a better example notebook that showcases category filters

@ATL2001 ATL2001 changed the title fix DataFilterExtension get_filter_category fix: DataFilterExtension get_filter_category Sep 21, 2025
@github-actions github-actions bot added the fix label Sep 21, 2025
@ATL2001
Copy link
Collaborator Author

ATL2001 commented Sep 21, 2025

a couple screenshots to show the selector changing the filtered points on my map:
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant