Skip to content
import { createRenderer } from "@arcgis/core/smartMapping/raster/renderers/classBreaks.js";
Since
ArcGIS Maps SDK for JavaScript 4.20

This object contains helper methods for generating class breaks visualizations for raster layers (i.e. ImageryLayer, ImageryTileLayer, or WCSLayer) based on a cell or field value.

The createRenderer() method in this module generates a renderer that may be applied directly to the input layer.

Type definitions

RasterClassBreaksRendererParameters

Type definition

colorRamp

Property
Type
AlgorithmicColorRamp | MultipartColorRamp | undefined
Since
ArcGIS Maps SDK for JavaScript 5.0

The color ramp to apply to the renderer.

colors

Property
Type
number[][] | undefined
Since
ArcGIS Maps SDK for JavaScript 5.0

The colors to apply to each class break. This must be a two-dimensional array where each item of the first dimension is an array of 3-4 numbers representing the RGB or RGBA values of each class break. This overrides colorRamp.

field

Property
Type
string | undefined
Since
ArcGIS Maps SDK for JavaScript 5.0

The field whose data will be used in the classification.

Default value
value

numClasses

Property
Type
number | undefined
Since
ArcGIS Maps SDK for JavaScript 5.0

The number of class breaks to generate for the classification. This is ignored if a standard-deviation classification method is specified.

Default value
5

classificationMethod

Property
Type
Exclude<ClassificationMethod, "manual"> | undefined
Since
ArcGIS Maps SDK for JavaScript 5.0

The classification method used for generating breaks.

Default value
natural-breaks

definedInterval

Property
Type
number | undefined
Since
ArcGIS Maps SDK for JavaScript 5.0

Only applicable when classificationMethod is defined-interval. Specifies the interval of each break. Note this may cause the last break to extend beyond the actual data max.

RasterClassBreaksResult

Type definition

The result object of the createRenderer() method. See the table below for details of each property.

renderer

Property
Type
ClassBreaksRenderer

The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's renderer property to update its visualization.

classBreaksResult

Property
Type
ClassBreaksResult

This object describes class breaks generated from data in a layer for a given field with a specified classification method.

Functions

createRenderer

Function

Generates a ClassBreaksRenderer used to render imagery data. Depending on the classificationMethod, class breaks (or data ranges) are generated based on the statistics of the data. Each cell is assigned a color based on the class break in which the value of the cell or field falls.

Signature
createRenderer (parameters: RasterClassBreaksRendererParameters): Promise<RasterClassBreaksResult>
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for generating a classed color visualization for raster data returned from the cell value or a given field.

Returns
Promise<RasterClassBreaksResult>

Resolves with an object containing a ClassBreaksRenderer that can be set on the input layer.