mapbox / mapbox/mapbox-gl-js

Add fallback option for ramps, scales and curves

Open
#8,258 2 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api :memo: cross-platform :tv: feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the interpolate, interpolate-hcl, interpolate-lab, and step expressions handle out-of-range inputs. Define completion as allowing the proposed fallback output to control the result instead of always using black, while preserving the existing interpolation forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.