require(["esri/renderers/smartMapping/statistics/classBreaks"], function(classBreaks) { /* code goes here */ });
Function: esri/renderers/smartMapping/statistics/classBreaks
Since: ArcGIS API 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

  • Only FeatureLayer and SceneLayer layer types are supported, except in the following scenarios:
    • FeatureLayers created with source graphics or feature collections.
    • SceneLayers without the supportsRenderer and supportsLayerQuery capabilties enabled, unless a predefined statistics object is passed to the statistics parameter of the method in conjuction with the layer. To check a SceneLayer's capabilities, use the getFieldInfoUsage() method.

Method Overview

NameReturn TypeSummary
Promise

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

more details
more details

Method Details

classBreaks(params){Promise}

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

Parameters:
params Object

See the table below for details about parameters that may be passed to this function.

Specification:

The layer from which to generate class breaks.

field String
optional

The class breaks will be generated based on values of this field. If a field is provided, the values from the given field from all features will be queried in the service.

normalizationField String
optional

The field by which to normalize the values returned from the given field.

classificationMethod String
optional

The method for classifying the data. See the table below for a list of possible values.

Possible ValueDescription
natural-breaksData values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values.
equal-intervalEach class has an equal range of values; in other words, the difference between the high and low value is equal for each class. You should use this method if your data is evenly distributed and you want to emphasize the difference in values between the features.
quantileEach class has roughly the same number of features. If your data is evenly distributed and you want to emphasize the difference in relative position between features, you should use the quantile classification method. If, for example, the point values are divided into five classes, points in the highest class would fall into the top fifth of all points.
standard-deviationClass breaks are placed above and below the mean value at intervals of 1, 0.5, or 0.25 standard deviations until all the data values are included in a class.
standardDeviationInterval Number
optional

When classificationMethod = "standard-deviation", this sets the interval at which each class break should be set (e.g. 0.25, 0.33, 0.5, 1).

minValue Number
optional

The minimum bounding value for the class breaks definition. Use this in conjunction with maxValue to generate class breaks between lower and upper bounds.

maxValue Number
optional

The maximum bounding value for the class breaks definition. Use this in conjunction with minValue to generate class breaks between lower and upper bounds.

numClasses Number
optional

Indicates the number of classes to generate for the class breaks definition.

Returns:
TypeDescription
PromiseResolves 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
  var breakInfos = response.classBreakInfos;
});

Type Definitions

ClassBreaksResult

Object returned from the classBreaks() method. This object describes classes generated from data in a FeatureLayer for a given field with a specified classification method.

Properties:
classBreaksInfos Object[]

An array of objects describing the class breaks generated from the classBreaks() method.

Specification:
label String

The label describing the given class break for use in the Legend.

minValue Number

The lower bound of the class break.

maxValue Number

The upper bound of the class break.

minValue Number

The minimum value of features in the dataset. This will be the lower bound of the lowest class break.

maxValue Number

The maximum value of features in the dataset. This will be the upper bound of the highest class break.

API Reference search results

NameTypeModule

There were no match results from your search criteria.