kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
83 lines (82 loc) • 2.27 kB
TypeScript
import { HexColor, MiniColorRange, ValueOf } from '@kepler.gl/types';
declare type GetColors = (steps: number) => HexColor[];
declare type GetLinear = () => (n: number) => string;
export declare type CategoricalPalette = {
name: string;
type: 'qualitative';
category: ValueOf<typeof CATEGORIES>;
colorBlindSafe: boolean;
colors: GetColors;
maxStep: number;
};
export declare type SequentialPalette = {
name: string;
type: 'sequential' | 'diverging' | 'cyclical';
category: ValueOf<typeof CATEGORIES>;
colorBlindSafe: boolean;
colors: GetColors;
linear: GetLinear;
};
export declare type ColorPalette = CategoricalPalette | SequentialPalette;
export declare const CATEGORIES: {
COLORBREWER: string;
D3: string;
UBER: string;
COLORBLIND: string;
};
export declare const PALETTE_TYPES: {
SEQ: 'sequential';
QUA: 'qualitative';
DIV: 'diverging';
CYC: 'cyclical';
};
export declare const COLORBREWER_SCHEME: {
sequential: string[];
diverging: string[];
qualitative: string[];
};
export declare const D3_COLOR_CHROMATIC_SCHEME: {
cyclical: string[];
sequential: string[];
qualitative: string[];
};
export declare const DataVizColors: {
aqua: string;
tumbleweed: string;
mule_fawn: string;
tree_poppy: string;
flame: string;
sapphire: string;
orchid: string;
chathams_blue: string;
med_aquamarine: string;
crocodile: string;
java: string;
chalky: string;
light_taupe: string;
peach_orange: string;
apricot: string;
portage: string;
light_orchid: string;
blue_green: string;
bermuda: string;
cloudy: string;
};
/**
* Build Categorical color palette
*/
export declare function buildCategoricalPalette({ name, category, colors, colorBlindSafe }: {
name: string;
category: ValueOf<typeof CATEGORIES>;
colors?: HexColor[];
colorBlindSafe?: boolean;
}): CategoricalPalette;
export declare const KEPLER_COLOR_PALETTES: ColorPalette[];
/**
* create color range from palette, with steps and reversed as config
*/
export declare function colorPaletteToColorRange(colorPalette: ColorPalette, colorConfig: {
reversed: boolean;
steps: number;
}): MiniColorRange;
export {};