AMD: require(["esri/smartMapping/raster/renderers/classBreaks"], (rasterClassBreaksCreator) => { /* code goes here */ });
ESM: import * as rasterClassBreaksCreator from "@arcgis/core/smartMapping/raster/renderers/classBreaks.js";
Object: esri/smartMapping/raster/renderers/classBreaks
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.

Method Overview

Name Return Type Summary Object

Generates a ClassBreaksRenderer used to render imagery data.


Method Details


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.

params Object

Input parameters for generating a classed color visualization for raster data returned from the cell value or a given field. See the table below for details of each parameter.


The input layer for which the renderer is generated.

renderingRule RasterFunction

Deprecated since 4.27. Use rasterFunction instead.

rasterFunction RasterFunction

Specifies the function for how the requested image should be processed. When rasterFunction is applied, the server returns updated service information that reflects custom processing as defined by the raster function. If not provided, the output renderer is created using the layer's rasterFunction.

field String
Default Value: value

The field whose data will be used in the classification.

classificationMethod String
Default Value: natural-breaks

The classification method used for generating breaks.

Possible Values:"equal-interval"|"natural-breaks"|"quantile"|"standard-deviation"|"defined-interval"

variableName String

Only applicable to multidimensional datasets where a raster layer can contain more than one variable (such as temperature, humidity, wind speed) with different statistics. Indicate the variable name here.

numClasses Number
Default Value: 5

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


The color ramp to apply to the renderer.

colors Number[][]

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.

definedInterval Number

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.

signal AbortSignal

Allows for cancelable requests. If canceled, the promise will be rejected with an error named AbortError. See also AbortController.

Type Description
Promise<RasterClassBreaksResult> Resolves with an object containing a ClassBreaksRenderer that can be set on the input layer.

Type Definitions


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


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 ClassBreaksResult

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

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.