Skip to content
import classBreaks from "@arcgis/core/smartMapping/statistics/classBreaks.js";
Since
ArcGIS Maps SDK for JavaScript 4.2

Function for generating class breaks for an input field in a FeatureLayer based on a given classification method and normalization type.

Known Limitations

SceneLayers must have the supportsRenderer and supportsLayerQuery capabilities enabled unless a predefined statistics object is provided to the statistics parameter of the method. To check a SceneLayer's capabilities, use the SceneLayer.getFieldUsageInfo() method. You cannot generate statistics using SQL expressions for client-side FeatureLayers in a SceneView.

Functions

NameReturn TypeObject

classBreaks

Function

Generates class breaks for an input field (or expression) of a FeatureLayer based on a given classification method and normalization type.

Signature
classBreaks (parameters: ClassBreaksParameters): Promise<ClassBreaksResult>
Parameters
ParameterTypeDescriptionRequired
parameters

The function parameters.

Returns
Promise<ClassBreaksResult>

Resolves to an instance of ClassBreaksResult.

Example
classBreaks({
layer: featureLayer,
field: "COL_DEG",
normalizationField: "TOT_POP",
classificationMethod: "quantile",
numClasses: 5
}).then(function(response){
// class break infos that may be passed to the
// constructor of a ClassBreaksRenderer
let breakInfos = response.classBreakInfos;
});