mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.18k stars 2.22k forks source link

Add fallback option for ramps, scales and curves #8258

Open gabimoncha opened 5 years ago

gabimoncha commented 5 years ago

Motivation

Mapbox already asigns the colour black as a fallback output for out-of-range inputs, so why not leave the use decide which colour should that be?

Implementation

["interpolate" | "interpolate-hcl" | "interpolate-lab" | "step",
    interpolation: ["linear"] | ["exponential", base] | ["cubic-bezier", x1, y1, x2, y2 ], // if not discrete
    input: number,
    stop_output_0: OutputType,
    stop_input_1: number, stop_output_1: OutputType,
    stop_input_n: number, stop_output_n: OutputType,
    ...,
    fallback: OutputType
]: OutputType
strech345 commented 4 years ago

not only out of range, also null

andest01 commented 2 years ago

...given that it would have to be cross platform, I can understand this wouldn't get pushed to the top right away. If we have a work-around for this, I would like to see it.