This function generates an interpolation expression that can be used to style your data.
interpolate(
column = NULL,
property = NULL,
type = "linear",
values,
stops,
na_color = NULL
)
A list representing the interpolation expression.
The name of the column to use for the interpolation. If specified, property
should be NULL.
The name of the property to use for the interpolation. If specified, column
should be NULL.
The interpolation type. Can be one of "linear"
, c("exponential", base)
where base
specifies the rate at which the output increases, or c("cubic-bezier", x1, y1, x2, y2)
where you define a cubic bezier curve with control points.
A numeric vector of values at which stops occur.
A vector of corresponding stops (colors, sizes, etc.) for the interpolation.
The color to use for missing values. Mapbox GL JS defaults to black if this is not supplied.
interpolate(
column = "estimate",
type = "linear",
values = c(1000, 200000),
stops = c("#eff3ff", "#08519c")
)
Run the code above in your browser using DataLab