kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
227 lines (226 loc) • 8.99 kB
TypeScript
import * as arrow from 'apache-arrow';
import Layer, { LayerBaseConfig, LayerBaseConfigPartial, LayerColorConfig, LayerSizeConfig, LayerStrokeColorConfig } from '../base-layer';
import { DataContainerInterface } from '@kepler.gl/utils';
import { default as KeplerTable } from '@kepler.gl/table';
import PointLayerIcon from './point-layer-icon';
import { FindDefaultLayerProps } from '../layer-utils';
import { GeojsonPointDataMaps } from '../geojson-layer/geojson-utils';
import { ColorRange, Merge, RGBColor, VisConfigBoolean, VisConfigColorRange, VisConfigColorSelect, VisConfigNumber, VisConfigRange, LayerColumn, Field, AnimationConfig } from '@kepler.gl/types';
export declare type PointLayerVisConfigSettings = {
radius: VisConfigNumber;
fixedRadius: VisConfigBoolean;
opacity: VisConfigNumber;
outline: VisConfigBoolean;
thickness: VisConfigNumber;
strokeColor: VisConfigColorSelect;
colorRange: VisConfigColorRange;
strokeColorRange: VisConfigColorRange;
radiusRange: VisConfigRange;
filled: VisConfigBoolean;
};
export declare type PointLayerColumnsConfig = {
lat: LayerColumn;
lng: LayerColumn;
altitude?: LayerColumn;
neighbors?: LayerColumn;
geojson: LayerColumn;
geoarrow: LayerColumn;
};
export declare type PointLayerVisConfig = {
radius: number;
fixedRadius: boolean;
opacity: number;
outline: boolean;
thickness: number;
strokeColor: RGBColor;
colorRange: ColorRange;
strokeColorRange: ColorRange;
radiusRange: [number, number];
filled: boolean;
billboard: boolean;
allowHover: boolean;
showNeighborOnHover: boolean;
showHighlightColor: boolean;
};
export declare type PointLayerVisualChannelConfig = LayerColorConfig & LayerSizeConfig & LayerStrokeColorConfig;
export declare type PointLayerConfig = Merge<LayerBaseConfig, {
columns: PointLayerColumnsConfig;
visConfig: PointLayerVisConfig;
}> & PointLayerVisualChannelConfig;
export declare type PointLayerData = {
position: number[];
index: number;
neighbors: any[];
};
export declare const pointPosAccessor: ({ lat, lng, altitude }: PointLayerColumnsConfig) => (dc: DataContainerInterface) => (d: {
index: number;
}) => any[];
export declare const geojsonPosAccessor: ({ geojson }: {
geojson: LayerColumn;
}) => (d: any) => any;
export declare const geoarrowPosAccessor: ({ geoarrow }: PointLayerColumnsConfig) => (dataContainer: DataContainerInterface) => (d: {
index: number;
}) => any[];
export declare const COLUMN_MODE_POINTS = "points";
export declare const COLUMN_MODE_GEOJSON = "geojson";
export declare const COLUMN_MODE_GEOARROW = "geoarrow";
export declare const pointRequiredColumns: ['lat', 'lng'];
export declare const pointOptionalColumns: ['altitude', 'neighbors'];
export declare const geojsonRequiredColumns: ['geojson'];
export declare const geoarrowRequiredColumns: ['geoarrow'];
export declare const pointVisConfigs: {
radius: 'radius';
fixedRadius: 'fixedRadius';
opacity: 'opacity';
outline: 'outline';
thickness: 'thickness';
strokeColor: 'strokeColor';
colorRange: 'colorRange';
strokeColorRange: 'strokeColorRange';
radiusRange: 'radiusRange';
filled: VisConfigBoolean;
billboard: 'billboard';
allowHover: 'allowHover';
showNeighborOnHover: 'showNeighborOnHover';
showHighlightColor: 'showHighlightColor';
};
export default class PointLayer extends Layer {
config: PointLayerConfig;
visConfigSettings: PointLayerVisConfigSettings;
dataToFeature: GeojsonPointDataMaps;
dataContainer: DataContainerInterface | null;
geoArrowVector: arrow.Vector | undefined;
filteredIndex: Uint8ClampedArray | null;
filteredIndexTrigger: number[];
constructor(props: any);
get type(): 'point';
get isAggregated(): false;
get layerIcon(): typeof PointLayerIcon;
get optionalColumns(): ["altitude", "neighbors"];
get columnPairs(): import("@kepler.gl/types").ColumnPairs;
get supportedColumnModes(): ({
key: string;
label: string;
requiredColumns: ["lat", "lng"];
optionalColumns: ["altitude", "neighbors"];
verifyField?: undefined;
} | {
key: string;
label: string;
requiredColumns: ["geojson"];
verifyField: (f: any) => boolean;
optionalColumns?: undefined;
} | {
key: string;
label: string;
requiredColumns: ["geoarrow"];
verifyField: (f: any) => boolean;
optionalColumns?: undefined;
})[];
get noneLayerDataAffectingProps(): string[];
get visualChannels(): {
color: {
accessor: string;
condition: (config: any) => any;
defaultValue: (config: any) => any;
property: string;
field: string;
scale: string;
domain: string;
range: string;
key: string;
channelScaleType: string;
nullValue?: any;
defaultMeasure?: any;
getAttributeValue?: ((config: any) => (d: any) => any) | undefined;
fixed?: any;
supportedFieldTypes?: import("@kepler.gl/types").SupportedFieldTypes[] | undefined;
aggregation?: import("@kepler.gl/types").VisualChannelAggregation | undefined;
};
strokeColor: {
property: string;
key: string;
field: string;
scale: string;
domain: string;
range: string;
channelScaleType: "color";
accessor: string;
condition: (config: any) => any;
defaultValue: (config: any) => any;
};
size: {
property: string;
range: string;
fixed: string;
channelScaleType: string;
accessor: string;
defaultValue: number;
field: string;
scale: string;
domain: string;
key: string;
nullValue?: any;
defaultMeasure?: any;
condition?: ((config: any) => boolean) | undefined;
getAttributeValue?: ((config: any) => (d: any) => any) | undefined;
supportedFieldTypes?: import("@kepler.gl/types").SupportedFieldTypes[] | undefined;
aggregation?: import("@kepler.gl/types").VisualChannelAggregation | undefined;
};
};
setInitialLayerConfig(dataset: any): this;
static findDefaultLayerProps(dataset: KeplerTable): {
props: FindDefaultLayerProps[];
altProps?: undefined;
} | {
props: FindDefaultLayerProps[];
altProps: FindDefaultLayerProps[];
};
getDefaultLayerConfig(props: LayerBaseConfigPartial): {
columnMode: string;
strokeColorField: null;
strokeColorDomain: number[];
strokeColorScale: string;
colorUI: {
strokeColorRange: import("@kepler.gl/types").ColorUI;
color: import("@kepler.gl/types").ColorUI;
colorRange: import("@kepler.gl/types").ColorUI;
};
dataId: string;
label: string;
color: RGBColor;
columns: import("@kepler.gl/types").LayerColumns;
isVisible: boolean;
isConfigActive: boolean;
highlightColor: RGBColor | import("@kepler.gl/types").RGBAColor;
hidden: boolean;
visConfig: import("@kepler.gl/types").LayerVisConfig;
textLabel: import("@kepler.gl/types").LayerTextLabel[];
animation: {
enabled: boolean;
domain?: [number, number] | null | undefined;
};
aggregatedBins?: import("@kepler.gl/types").AggregatedBin[] | undefined;
heightField?: import("@kepler.gl/types").VisualChannelField | undefined;
heightDomain?: import("@kepler.gl/types").VisualChannelDomain | undefined;
heightScale?: string | undefined;
colorField?: import("@kepler.gl/types").VisualChannelField | undefined;
colorDomain?: import("@kepler.gl/types").VisualChannelDomain | undefined;
colorScale?: string | number | symbol | undefined;
sizeDomain?: import("@kepler.gl/types").VisualChannelDomain | undefined;
sizeScale?: string | number | symbol | undefined;
sizeField?: import("@kepler.gl/types").VisualChannelField | undefined;
};
calculateDataAttribute({ filteredIndex, dataContainer }: KeplerTable, getPosition: any): arrow.Table<any> | PointLayerData[];
formatLayerData(datasets: any, oldLayerData: any): {};
updateLayerMeta(dataset: KeplerTable): void;
renderLayer(opts: any): any[];
hasHoveredObject(objectInfo: {
index: number;
}): any;
getHoverData(object: {
index: number;
} | arrow.StructRow | undefined, dataContainer: DataContainerInterface, fields: Field[], animationConfig: AnimationConfig, hoverInfo: {
index: number;
}): import("@kepler.gl/utils").DataRow | null;
}