fix: polygon filtered index per layer, instead of per dataset - #3452
Merged
Conversation
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes polygon filtering behavior so that polygon filters are applied per-layer rather than at the shared dataset level, preventing unintended cross-layer filtering when multiple layers share a dataset (and avoiding the prior “AND across layers” behavior when multiple layers are selected).
Changes:
- Excludes polygon filters from the dataset-level CPU filter pipeline so
dataset.filteredIndexis no longer impacted by polygon filtering. - Adds
filteredIndexByLayerto datasets and computes per-layer polygon-filtered indices inKeplerTable.filterTable. - Updates layer data/update triggers to use the per-layer filtered index when present, and adjusts unit tests/helpers accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/node/reducers/vis-state-test.js | Updates polygon filter tests to assert per-layer filtering and unchanged dataset filteredIndex. |
| test/helpers/comparison-utils.js | Adjusts dataset comparisons to optionally ignore the new internal filteredIndexByLayer field. |
| src/utils/src/filter-utils.ts | Removes polygon filters from dataset CPU filtering via getFilterRecord while keeping them tracked in the record. |
| src/table/src/kepler-table.ts | Introduces filteredIndexByLayer and computes per-layer polygon-filtered indices during dataset filtering. |
| src/layers/src/mapboxgl-layer.ts | Uses per-layer filtered index for update triggers / data building in Mapbox GL layer. |
| src/layers/src/base-layer.ts | Uses per-layer filtered index when updating meta and calculating data attributes for a layer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 5 commits
May 24, 2026 20:09
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
lixun910
approved these changes
Aug 8, 2026
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3277 by applying polygon filters per layer instead of on the shared dataset
filteredIndex.When layers share a dataset (e.g. pickup/dropoff), targeting one layer no longer strips points from the others, and selecting multiple layers no longer ANDs positions across layers.
Changes
getFilterRecord); addfilteredIndexByLayercomputed per targeted layerfilteredIndexByLayer[layerId](fallback:filteredIndex)mergePolygonLayerIndexesfilteredIndexByLayeronimportData/updateto avoid stale indexes after Arrow batch reloadscopyTableAndUpdatefor the per-layer dataset view (keepsKeplerTabletyping)Test plan