@maptiler/weather
Version:
Weather layers for MapTiler Cloud and MapTiler SDK
411 lines (410 loc) • 12.5 kB
TypeScript
import { ColorStop } from './ColoringFragment';
import { RgbaColor } from '../utils';
/**
* A RGBA color as per the array definition
*/
export type ArrayColor = [number, number, number, number];
/**
* A color ramp stop as per array definition
*/
export type ArrayColorRampStop = [
/**
* Real world value in a real world unit
*/
number,
/**
* Color RGBA
*/
ArrayColor
];
/**
* A color ramp as per array definition
*/
export type ArrayColorRamp = Array<ArrayColorRampStop>;
export type ColorRampOptions = {
/**
* The value the colorramp starts
*/
min?: number;
/**
* The value the colorramp ends
*/
max?: number;
/**
* Some color stops to copy from
*/
stops?: Array<ColorStop>;
};
declare class ColorRamp extends Array<ColorStop> {
/**
* Converts a array-definition color ramp definition into a usable ColorRamp instance.
* Note: units are not converted and may need to to be converted beforehand (eg. kelvin to centigrade)
* @param cr
* @returns
*/
static fromArrayDefinition(cr: ArrayColorRamp): ColorRamp;
private min;
private max;
constructor(options?: ColorRampOptions);
setStops(stops: Array<ColorStop>, options?: {
clone?: boolean;
}): ColorRamp;
scale(min: number, max: number, options?: {
clone?: boolean;
}): ColorRamp;
at(pos: number): ColorStop;
clone(): ColorRamp;
getRawColorStops(): Array<ColorStop>;
reverse(options?: {
clone?: boolean;
}): ColorRamp;
getBounds(): {
min: number;
max: number;
};
getColor(value: number, options?: {
smooth?: boolean;
}): RgbaColor;
getCanvasStrip(options?: {
horizontal?: boolean;
size?: number;
smooth?: boolean;
}): HTMLCanvasElement;
static builtin: {
/**
* A fully transparent [0, 0, 0, 0] colorramp to hide data.
* Defined in interval [0, 1], without unit.
*/
NULL: ColorRamp;
/**
* Classic jet color ramp.
* Defined in interval [0, 1], without unit.
*/
JET: ColorRamp;
/**
* Classic HSV color ramp (hue, saturation, value).
* Defined in interval [0, 1], without unit.
*/
HSV: ColorRamp;
/**
* Classic hot color ramp.
* Defined in interval [0, 1], without unit.
*/
HOT: ColorRamp;
/**
* Classic spring color ramp.
* Defined in interval [0, 1], without unit.
*/
SPRING: ColorRamp;
/**
* Classic summer color ramp.
* Defined in interval [0, 1], without unit.
*/
SUMMER: ColorRamp;
/**
* Classic autommn color ramp.
* Defined in interval [0, 1], without unit.
*/
AUTOMN: ColorRamp;
/**
* Classic winter color ramp.
* Defined in interval [0, 1], without unit.
*/
WINTER: ColorRamp;
/**
* Classic bone color ramp.
* Defined in interval [0, 1], without unit.
*/
BONE: ColorRamp;
/**
* Classic copper color ramp.
* Defined in interval [0, 1], without unit.
*/
COPPER: ColorRamp;
/**
* Classic greys color ramp.
* Defined in interval [0, 1], without unit.
*/
GREYS: ColorRamp;
/**
* Classic yignbu color ramp (blue to light yellow).
* Defined in interval [0, 1], without unit.
*/
YIGNBU: ColorRamp;
/**
* Classic greens color ramp.
* Defined in interval [0, 1], without unit.
*/
GREENS: ColorRamp;
/**
* Classic yiorrd color ramp (red to light yellow).
* Defined in interval [0, 1], without unit.
*/
YIORRD: ColorRamp;
/**
* Classic blue-red color ramp.
* Defined in interval [0, 1], without unit.
*/
BLUERED: ColorRamp;
/**
* Classic rdbu color ramp.
* Defined in interval [0, 1], without unit.
*/
RDBU: ColorRamp;
/**
* Classic picnic color ramp.
* Defined in interval [0, 1], without unit.
*/
PICNIC: ColorRamp;
/**
* Classic rainbow color ramp.
* Defined in interval [0, 1], without unit.
*/
RAINBOW: ColorRamp;
/**
* Classic Portland color ramp.
* Defined in interval [0, 1], without unit.
*/
PORTLAND: ColorRamp;
/**
* Classic blackbody color ramp.
* Defined in interval [0, 1], without unit.
*/
BLACKBODY: ColorRamp;
/**
* Classic earth color ramp.
* Defined in interval [0, 1], without unit.
*/
EARTH: ColorRamp;
/**
* Classic electric color ramp.
* Defined in interval [0, 1], without unit.
*/
ELECTRIC: ColorRamp;
/**
* Classic viridis color ramp.
* Defined in interval [0, 1], without unit.
*/
VIRIDIS: ColorRamp;
/**
* Classic inferno color ramp.
* Defined in interval [0, 1], without unit.
*/
INFERNO: ColorRamp;
/**
* Classic magma color ramp.
* Defined in interval [0, 1], without unit.
*/
MAGMA: ColorRamp;
/**
* Classic plasma color ramp.
* Defined in interval [0, 1], without unit.
*/
PLASMA: ColorRamp;
/**
* Classic warm color ramp.
* Defined in interval [0, 1], without unit.
*/
WARM: ColorRamp;
/**
* Classic cool color ramp.
* Defined in interval [0, 1], without unit.
*/
COOL: ColorRamp;
/**
* Classic rainboz soft color ramp.
* Defined in interval [0, 1], without unit.
*/
RAINBOW_SOFT: ColorRamp;
/**
* Classic bathymetry color ramp.
* Defined in interval [0, 1], without unit.
*/
BATHYMETRY: ColorRamp;
/**
* Classic cdom color ramp.
* Defined in interval [0, 1], without unit.
*/
CDOM: ColorRamp;
/**
* Classic chlorophyll color ramp.
* Defined in interval [0, 1], without unit.
*/
CHLOROPHYLL: ColorRamp;
/**
* Classic density color ramp.
* Defined in interval [0, 1], without unit.
*/
DENSITY: ColorRamp;
/**
* Classic freesurface blue color ramp.
* Defined in interval [0, 1], without unit.
*/
FREESURFACE_BLUE: ColorRamp;
/**
* Classic freesurface red color ramp.
* Defined in interval [0, 1], without unit.
*/
FREESURFACE_RED: ColorRamp;
/**
* Classic oxygen color ramp.
* Defined in interval [0, 1], without unit.
*/
OXYGEN: ColorRamp;
/**
* Classic par color ramp.
* Defined in interval [0, 1], without unit.
*/
PAR: ColorRamp;
/**
* Classic phase color ramp.
* Defined in interval [0, 1], without unit.
*/
PHASE: ColorRamp;
/**
* Classic salinity color ramp.
* Defined in interval [0, 1], without unit.
*/
SALINITY: ColorRamp;
/**
* Classic temperature color ramp.
* Defined in interval [0, 1], without unit.
*/
TEMPERATURE: ColorRamp;
/**
* Classic turbidity color ramp.
* Defined in interval [0, 1], without unit.
*/
TURBIDITY: ColorRamp;
/**
* Classic velocity blue color ramp.
* Defined in interval [0, 1], without unit.
*/
VELOCITY_BLUE: ColorRamp;
/**
* Classic velocity green color ramp.
* Defined in interval [0, 1], without unit.
*/
VELOCITY_GREEN: ColorRamp;
/**
* Classic cube helix color ramp.
* Defined in interval [0, 1], without unit.
*/
CUBEHELIX: ColorRamp;
/**
* The cividis color ramp is color blind friendly.
* Read more here https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0199239
* Defined in interval [0, 1], without unit.
*/
CIVIDIS: ColorRamp;
/**
* Classic turbo color ramp.
* This is a luminance-constant alternative to the jet, making it more
* clor-blind friendly.
* Defined in interval [0, 1], without unit.
*/
TURBO: ColorRamp;
/**
* The rocket color ramp is perceptually uniform, which makes it more
* color bliend friendly than the classic magma color ramp.
* Defined in interval [0, 1], without unit.
*/
ROCKET: ColorRamp;
/**
* The mako color ramp is perceptually uniform and can be seen as
* a color blind friendly alternative to bathymetry or yignbu.
* Defined in interval [0, 1], without unit.
*/
MAKO: ColorRamp;
/**
* Elevation terrain, values are in meter.
* Defined in interval [-10001, 8000].
*/
TERRAIN: ColorRamp;
/**
* Atmospheric pressure, values in hPa (or millibar)
* Defined in interval [900, 1080].
*/
PRESSURE: ColorRamp;
/**
* Atmospheric pressure, values in hPa (or millibar).
* Defined in interval [900, 1080].
*/
PRESSURE_2: ColorRamp;
/**
* Atmospheric pressure, values in hPa (or millibar).
* Defined in interval [900, 1080].
*/
PRESSURE_3: ColorRamp;
/**
* Atmospheric pressure, values in hPa (or millibar).
* Defined in interval [900, 1080]. The main difference
* with PRESSURE_3 is the true neutral zone (pale gray)
* from 1012.5 to 1013.5hPa
*/
PRESSURE_4: ColorRamp;
/**
* Temperatures in degree Celsius.
* Defined in interval [-70.15, 46.85].
*/
TEMPERATURE_2: ColorRamp;
/**
* Temperatures in degrees Celsius.
* Defined in interval [-65, 55].
*/
TEMPERATURE_3: ColorRamp;
/**
* Precipitation in mm per hour.
* Defined in interval [0, 50].
*/
PRECIPITATION: ColorRamp;
/**
* precipitation in mm per hour.
* Defined in interval [0, 50].
*/
PRECIPITATION_2: ColorRamp;
/**
* Radar color ramp from NOAA in dBZ.
* Defined in interval [0, 75].
*/
RADAR: ColorRamp;
/**
* Intended to be used with Radar data to create a slighly blue-tinted greyscale
* to represent cloud coverage. Values are in dBZ.
* Defined in interval [4, 60].
*/
RADAR_CLOUD: ColorRamp;
/**
* This atmospheric pressure color ramp is based on cividis,
* hence it is more clor bliend friendly. Values are in hPa (or millibar).
* Defined in interval [900, 1080].
*/
PRESSURE_CIVIDIS: ColorRamp;
/**
* This rocket color ramp scaled for radar data is a color blind
* friendly alternative. Values are in dBZ.
* Defined in interval [0, 75]
*/
RADAR_ROCKET: ColorRamp;
/**
* This rocket color ramp scaled for wind speed is a color blind
* friendly alternative. Values are in m/sec.
* Defined in interval [0, 30]
*/
WIND_ROCKET: ColorRamp;
/**
* This mako color ramps is scale for precipitation is a color blind
* friendly alternative. Values are in mm/hour
* Defined in interval [0, 50].
*/
MAKO_PRECIPITATION: ColorRamp;
/**
* Based on the turbo color ramp, this one is scaled
* to render temperatures in degree Celcius.
* This is a perceptually uniform alternative to jet, making it more color bliend friendly.
* Defined in interval [-65, 55].
*/
TEMPERATURE_TURBO: ColorRamp;
};
}
export { ColorRamp };