Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ build/
umd/
*/**/dist/

__pycache__/
.pytest_cache/
.ipynb_checkpoints/
bindings/python/keplergl/static/
typedoc/

examples/**/yarn.lock
Expand Down
5 changes: 4 additions & 1 deletion src/layers/src/geojson-layer/geojson-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,13 @@ export default class GeoJsonLayer extends Layer {
let dataAccessor;
if (this.config.columnMode === COLUMN_MODE_GEOJSON) {
filterValueAccessor = (dc, d, fieldIndex) => dc.valueAt(d.properties.index, fieldIndex);
// For GEOJSON mode, properties.index is the row index in the data container
dataAccessor = () => d => ({index: d.properties.index});
} else {
filterValueAccessor = getTableModeValueAccessor;
dataAccessor = () => d => ({index: d.properties.index});
// For TABLE mode, properties.index is the feature index (not row index).
// Use the first row from properties.values to get field values for color/size.
dataAccessor = () => d => d.properties.values[0];
}

const indexAccessor = f => f.properties.index;
Expand Down
7 changes: 6 additions & 1 deletion src/layers/src/trip-layer/trip-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,20 @@ export default class TripLayer extends Layer {
const {data} = this.updateData(datasets, oldLayerData);

let valueAccessor;
let dataAccessor;
if (this.config.columnMode === COLUMN_MODE_GEOJSON) {
valueAccessor = (dc: DataContainerInterface, f, fieldIndex: number) => {
return dc.valueAt(f.properties.index, fieldIndex);
};
// For GEOJSON mode, properties.index is the row index in the data container
dataAccessor = () => d => ({index: d.properties.index});
} else {
valueAccessor = getTableModeValueAccessor;
// For TABLE mode, properties.index is the feature index (not row index).
// Use the first row from properties.values to get field values for color/size.
dataAccessor = () => d => d.properties.values[0];
}
const indexAccessor = f => f.properties.index;
const dataAccessor = () => d => ({index: d.properties.index});
const accessors = this.getAttributeAccessors({dataAccessor, dataContainer});
const getFilterValue = gpuFilter.filterValueAccessor(dataContainer)(
indexAccessor,
Expand Down
Loading