kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
43 lines (42 loc) • 1.5 kB
TypeScript
/// <reference types="deck.gl" />
import { Layer, LayerExtension } from '@deck.gl/core';
export declare type FilterArrowExtensionProps = {
getFiltered?: () => number;
};
/**
* FilterArrowExtension - a deck.gl extension to filter arrow layer
*
* A simple extension to filter arrow layer based on the result of CPU filteredIndex,
* so we can avoid filtering on the raw Arrow table and recreating geometry attributes.
* Specifically, an attribute `filtered` is added to the layer to indicate whether the feature has been Filtered
* the shader module is modified to discard the feature if filtered value is 0
* the accessor getFiltered is used to get the value of `filtered` based on the value `filteredIndex` in Arrowlayer
*/
export default class FilterArrowExtension extends LayerExtension {
static defaultProps: {
getFiltered: {
type: string;
value: number;
};
};
static extensionName: string;
getShaders(): {
modules: {
name: string;
dependencies: {
name: string;
dependencies: any[];
vs: string;
getUniforms: (opts?: {} | undefined) => any;
}[];
vs: string;
fs: string;
inject: {
'vs:#main-start': string;
};
getUniforms: () => void;
}[];
defines: {};
};
initializeState(this: Layer<FilterArrowExtensionProps>): void;
}