kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
157 lines (156 loc) • 5.94 kB
TypeScript
import MapboxGLLayer, { MapboxLayerGLConfig } from '../mapboxgl-layer';
import HeatmapLayerIcon from './heatmap-layer-icon';
import { LayerBaseConfigPartial, LayerWeightConfig, VisualChannels } from '../base-layer';
import { ColorRange, VisConfigColorRange, VisConfigNumber, Merge, LayerColumn } from '@kepler.gl/types';
import { DataContainerInterface } from '@kepler.gl/utils';
import { KeplerTable } from '@kepler.gl/table';
import { FindDefaultLayerPropsReturnValue } from '../layer-utils';
export declare type HeatmapLayerVisConfigSettings = {
opacity: VisConfigNumber;
colorRange: VisConfigColorRange;
radius: VisConfigNumber;
};
export declare type HeatmapLayerColumnsConfig = {
lat: LayerColumn;
lng: LayerColumn;
geoarrow: LayerColumn;
};
export declare type HeatmapLayerVisConfig = {
opacity: number;
colorRange: ColorRange;
radius: number;
};
export declare type HeatmapLayerVisualChannelConfig = LayerWeightConfig;
export declare type HeatmapLayerConfig = Merge<MapboxLayerGLConfig, {
columns: HeatmapLayerColumnsConfig;
visConfig: HeatmapLayerVisConfig;
}> & HeatmapLayerVisualChannelConfig;
export declare const MAX_ZOOM_LEVEL = 18;
export declare const pointPosAccessor: ({ lat, lng }: HeatmapLayerColumnsConfig) => (dc: DataContainerInterface) => (d: {
index: number;
}) => number[];
export declare const geoarrowPosAccessor: ({ geoarrow }: HeatmapLayerColumnsConfig) => (dc: DataContainerInterface) => (d: {
index: number;
}) => number[];
export declare const pointColResolver: ({ lat, lng, geoarrow }: HeatmapLayerColumnsConfig, columnMode: any) => string;
export declare const heatmapVisConfigs: {
opacity: 'opacity';
colorRange: 'colorRange';
radius: 'heatmapRadius';
};
export declare const pointRequiredColumns: string[];
export declare const geoarrowRequiredColumns: string[];
export declare const COLUMN_MODE_POINTS = "points";
export declare const COLUMN_MODE_GEOARROW = "geoarrow";
declare class HeatmapLayer extends MapboxGLLayer {
visConfigSettings: HeatmapLayerVisConfigSettings;
config: HeatmapLayerConfig;
constructor(props: any);
get type(): 'heatmap';
get supportedColumnModes(): {
key: string;
label: string;
requiredColumns: string[];
}[];
hasAllColumns(): boolean;
static findDefaultLayerProps(dataset: KeplerTable): FindDefaultLayerPropsReturnValue;
get visualChannels(): VisualChannels;
get layerIcon(): typeof HeatmapLayerIcon;
getVisualChannelDescription(channel: any): {
label: string;
measure: string;
};
getDefaultLayerConfig(props: LayerBaseConfigPartial): HeatmapLayerConfig;
updateLayerMeta(dataset: KeplerTable): void;
columnsSelector: (config: any) => string;
visConfigSelector: (config: any) => any;
weightFieldSelector: (config: any) => any;
weightDomainSelector: (config: any) => any;
paintSelector: ((state: any) => {
'heatmap-weight': number | any[];
'heatmap-intensity': (string | number | string[])[];
'heatmap-color': (string | number | string[])[];
'heatmap-radius': any[];
'heatmap-opacity': any;
}) & import("reselect").OutputSelectorFields<(args_0: any, args_1: any, args_2: any) => {
'heatmap-weight': number | any[];
'heatmap-intensity': (string | number | string[])[];
'heatmap-color': (string | number | string[])[];
'heatmap-radius': any[];
'heatmap-opacity': any;
}, {
clearCache: () => void;
}> & {
clearCache: () => void;
};
computeHeatmapConfiguration: ((state: any, datasets: any) => {
filter?: any[] | null | undefined;
type: string;
id: string;
source: string;
layout: {
visibility: string;
};
paint: {
'heatmap-weight': number | any[];
'heatmap-intensity': (string | number | string[])[];
'heatmap-color': (string | number | string[])[];
'heatmap-radius': any[];
'heatmap-opacity': any;
};
}) & import("reselect").OutputSelectorFields<(args_0: string, args_1: any[] | null, args_2: {
'heatmap-weight': number | any[];
'heatmap-intensity': (string | number | string[])[];
'heatmap-color': (string | number | string[])[];
'heatmap-radius': any[];
'heatmap-opacity': any;
}) => {
filter?: any[] | null | undefined;
type: string;
id: string;
source: string;
layout: {
visibility: string;
};
paint: {
'heatmap-weight': number | any[];
'heatmap-intensity': (string | number | string[])[];
'heatmap-color': (string | number | string[])[];
'heatmap-radius': any[];
'heatmap-opacity': any;
};
}, {
clearCache: () => void;
}> & {
clearCache: () => void;
};
formatLayerData(datasets: any, oldLayerData: any): {
columns?: undefined;
config?: undefined;
data?: undefined;
weightField?: undefined;
getPosition?: undefined;
} | {
columns: HeatmapLayerColumnsConfig;
config: {
filter?: any[] | null | undefined;
type: string;
id: string;
source: string;
layout: {
visibility: string;
};
paint: {
'heatmap-weight': number | any[];
'heatmap-intensity': (string | number | string[])[];
'heatmap-color': (string | number | string[])[];
'heatmap-radius': any[];
'heatmap-opacity': any;
};
};
data: never[] | undefined;
weightField: import("@kepler.gl/types").VisualChannelField;
getPosition: (...args: any[]) => any;
};
}
export default HeatmapLayer;