UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

95 lines (94 loc) 3.87 kB
import { Layer } from '@kepler.gl/layers'; import { Datasets, KeplerTable } from '@kepler.gl/table'; import { SpatialJoinGeometries } from '@openassistant/geoda'; import { AddDataToMapPayload } from '@kepler.gl/types'; /** * Check if the dataset exists * @param datasets The kepler.gl datasets * @param datasetName The name of the dataset * @param functionName The name of the function * @returns The result of the check */ export declare function checkDatasetNotExists(datasets: Datasets, datasetName: string, functionName: string): { name: string; result: { success: boolean; details: string; }; } | null; /** * Check if the field exists * @param dataset The kepler.gl dataset * @param fieldName The name of the field * @param functionName The name of the function * @returns The result of the check */ export declare function checkFieldNotExists(dataset: KeplerTable, fieldName: string, functionName: string): { type: string; name: string; result: { success: boolean; details: string; }; } | null; /** * Interpolate the colors from the original colors with the given number of colors * @param originalColors The original colors * @param numberOfColors The number of colors * @returns The interpolated colors */ export declare function interpolateColor(originalColors: string[], numberOfColors: number): string[]; /** * Get the values from a dataset for a variable * @param datasets * @param datasetName * @param variableName * @returns {number[]} */ export declare function getValuesFromDataset(datasets: Datasets, datasetName: string, variableName: string): number[]; /** * Get the x and y values from a dataset for a scatterplot * @param datasets * @param datasetName * @param xVariableName * @param yVariableName * @returns {x: number[], y: number[]} */ export declare function getScatterplotValuesFromDataset(datasets: Datasets, datasetName: string, xVariableName: string, yVariableName: string): { x: number[]; y: number[]; }; /** * Highlight the rows in a dataset * @param datasets The kepler.gl datasets * @param layers The kepler.gl layers * @param datasetName The name of the dataset * @param selectedRowIndices The indices of the rows to highlight * @param layerSetIsValid The function to set the layer validity */ export declare function highlightRows(datasets: Datasets, layers: Layer[], datasetName: string, selectedRowIndices: number[], layerSetIsValid: (layer: Layer, isValid: boolean) => void): void; /** * Get the dataset context, which is used to provide the dataset information to the AI assistant * @param datasets The kepler.gl datasets * @param layers The kepler.gl layers * @returns The dataset context */ export declare function getDatasetContext(datasets: Datasets, layers: Layer[]): string; /** * Get the geometries from a dataset * @param datasets The kepler.gl datasets * @param layers The kepler.gl layers * @param layerData The layer data * @param datasetName The name of the dataset * @returns The geometries */ export declare function getGeometriesFromDataset(datasets: Datasets, layers: Layer[], layerData: any[], datasetName: string): SpatialJoinGeometries; /** * Save the data as a new dataset by joining it with the left dataset * @param datasets The kepler.gl datasets * @param datasetName The name of the left dataset * @param data The data to save * @param addDataToMap The function to add the data to the map */ export declare function saveAsDataset(datasets: Datasets, datasetName: string, data: Record<string, number[]>, addDataToMap: (data: AddDataToMapPayload) => void): void; export declare function highlightRowsByColumnValues(datasets: Datasets, layers: Layer[], datasetName: string, columnName: string, selectedValues: unknown[], layerSetIsValid: (layer: Layer, isValid: boolean) => void): void;