classBreaks

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

Generates a ClassBreaksRenderer used to render imagery data.

more detailsclassBreaks

Method Details

createRenderer(params){Promise<RasterClassBreaksResult>}

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.

Parameters:
Specification:
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.

Specification:

The input layer for which the renderer is generated.

renderingRule RasterFunction
optional

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

field String
optional
Default Value: value

The field whose data will be used in the classification.

classificationMethod String
optional
Default Value: natural-breaks

The classification method used for generating breaks.

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

variableName String
optional

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
optional
Default Value: 5

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

optional

The color ramp to apply to the renderer.

colors Number[][]
optional

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
optional

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
optional

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

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

Type Definitions

RasterClassBreaksResult

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

Properties:

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.