Types
import type { HistogramResult, HistogramBin, SummaryStatisticsParameters, SummaryStatisticsResult, ClassBreaksParameters } from "@arcgis/core/smartMapping/statistics/types.js";
Since
ArcGIS Maps SDK for JavaScript 4.33

A module for importing types used in smart mapping statistics modules.

Type definitions

HistogramResult

Type definition

The result returned from the histogram() method.

bins

Property
Type
HistogramBin[]

An array of objects representing each bin in the histogram.

maxValue

Property
Type
number | null | undefined

The maximum value returned by the field.

minValue

Property
Type
number | null | undefined

The minimum value returned by the field.

normalizationTotal

Property
Type
number | null | undefined

The number used to normalize all values when percent-of-total is specified as the normalizationType.

HistogramBin

Type definition

Represents the bin of a histogram. A bin consists of a minimum and a maximum value and a count. It indicates the number of values in a dataset that lie between the min and max values.

minValue

Property
Type
number

The minimum value (or bound) of the bin.

maxValue

Property
Type
number

The maximum value (or bound) of the bin.

count

Property
Type
number

The number of values in a dataset that are contained between the indicated minValue and maxValue.

SummaryStatisticsParameters

Type definition
Supertypes
AbortOptions

layer

Property
Type
Exclude<SupportedLayer, PointCloudLayer> | null | undefined

The layer from which to generate statistics for the given field.

field

Property
Type
string | null | undefined

The name of the numeric or string field for which the summary statistics will be generated. This property is ignored if a valueExpression is used.

valueExpression

Property
Type
string | null | undefined

An Arcade expression following the specification defined by the Arcade Visualization Profile. Expressions may reference field values using the $feature profile variable and must return a number. This property overrides the field property and therefore is used instead of an input field value. The view parameter is required if specifying a valueExpression. When using a valueExpression, client-side statistics are calculated based on the features in the view's extent. To generate statistics for the entire layer, set an equivalent sqlExpression.

sqlExpression

Property
Type
string | null | undefined

A SQL expression evaluating to a number. When provided, statistics are queried from the server for the entire layer. Only use this parameter when querying statistics based on an equivalent valueExpression. This parameter is ignored for client-side layer types.

sqlWhere

Property
Type
string | null | undefined

A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization.

normalizationType

Property
Type
NormalizationType | null | undefined

| | field | Divides the data value using the value of the field specified in the normalizationField parameter. A normalizationField must be provided if this value is used. | percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use normalizationTotal to define the total value by which to normalize. | log | Computes the base 10 logarithm of the data values. This can be a useful approach for viewing highly skewed data distributions because it reduces the influence of outliers. Only positive values are computed. You should avoid this normalization type if your data contains a significant number of negative values. | natural-log | Computes the natural logarithm of the data values. This can be a useful approach for viewing highly skewed data distributions because it reduces the influence of outliers. Only positive values are computed. You should avoid this normalization type if your data contains a significant number of negative values. | square-root | Computes the square root of the data values. This can be a useful approach for viewing highly skewed data distributions because it reduces the influence of outliers. Only positive values are computed. You should avoid this normalization type if your data contains a significant number of negative values. |

normalizationField

Property
Type
string | null | undefined

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

normalizationTotal

Property
Type
number | null | undefined

Only applies if normalizationType is percent-of-total. Indicates the total amount with which to normalize field values.

features

deprecated Property
Type
Graphic[] | FeatureJSON[] | null | undefined

A subset of features for which to calculate the statistics.

useFeaturesInView

Property
Type
boolean | null | undefined

Only applicable when the input layer is a service-backed FeatureLayer. When true, statistics will be calculated on the client from features visible in the view. If false, statistics will be requested from the service.

filter

Property
Type
FeatureFilter | null | undefined

When defined, only features included in the filter are considered in the attribute and spatial statistics calculations when determining the final renderer. This is useful when a lot of variation exists in the data that could result in undesired data ranges. A common use case would be to set a filter that only includes features in the current extent of the view where the data is most likely to be viewed. Currently, only geometry filters with an intersects spatial relationship are supported. All other filter types (including where) are ignored.

minValue

Property
Type
number | null | undefined

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

maxValue

Property
Type
number | null | undefined

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

forBinning

Property
Type
boolean | null | undefined

Indicates whether the generated statistics are for a binning or clustering visualization. If true, then the input field(s) in this method should refer to aggregate fields defined in the featureReduction property of the layer.

outStatisticTypes

Property
Type
OutStatisticTypes | null | undefined

Indicates the statistics to calculate. If not defined, all statistics are calculated by default. The object should have the following properties.

view

Property
Type
MapViewOrSceneView | null | undefined

A SceneView or MapView instance is required when a valueExpression is specified.

SummaryStatisticsResult

Type definition

The statistics returned from the summaryStatistics() query.

avg

Property
Type
number | null | undefined

The average of all values returned from the field or expression.

count

Property
Type
number | null | undefined

The total number of features with a non-null value for the given field.

max

Property
Type
number | null | undefined

The maximum of all values returned from the field or expression.

min

Property
Type
number | null | undefined

The minimum of all values returned from the field or expression.

stddev

Property
Type
number | null | undefined

The standard deviation calculated from values returned from the field or expression.

sum

Property
Type
number | null | undefined

The sum of all values returned from the field or expression.

variance

Property
Type
number | null | undefined

The calculated variance from all values returned from the field or expression.

nullcount

Property
Type
number | null | undefined

The number of null values stored in the given field. Only applies to summary statistics calculated with a field value at version 4.20 or later.

median

Property
Type
number | string | null | undefined

The median of all values returned from the field or expression.

ClassBreaksParameters

Type definition
Supertypes
AbortOptions

layer

Property
Type
Exclude<SupportedLayer, PointCloudLayer> | null | undefined

The layer from which to generate class breaks. When a client-side layer type is provided, attribute and spatial statistics are calculated only from features in the view's extent. When a server-side layer type is provided, the statistics are calculated from the entire layer.

field

Property
Type
string | null | undefined

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.

valueExpression

Property
Type
string | null | undefined

An Arcade expression following the specification defined by the Arcade Visualization Profile. Expressions may reference field values using the $feature profile variable and must return a number. This property overrides the field property and therefore is used instead of an input field value. The view parameter is required if specifying a valueExpression. When using a valueExpression, client-side statistics are calculated based on the features in the view's extent.

standardDeviationInterval

Property
Type
number | null | undefined

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). See the table below for a list of possible values.

Possible ValueDescription
fieldDivides the data value using the attribute value of the field specified in the normalizationField property. A normalizationField must be provided if This value is used.
logComputes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values.
percent-of-totalDivides the data value by the sum of all data values then multiplies by 100. Use normalizationTotal to define the total value by which to normalize.
then set the total amount with which to normalize field values.

normalizationField

Property
Type
string | null | undefined

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

minValue

Property
Type
number | null | undefined

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

Property
Type
number | null | undefined

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

classificationMethod

Property
Type
ClassificationMethod | null | undefined

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.

numClasses

Property
Type
number | null | undefined

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

features

deprecated Property
Type
Graphic[] | FeatureJSON[] | null | undefined

A subset of features for which to generate the class breaks.

useFeaturesInView

Property
Type
boolean | null | undefined

Only applicable when the input layer is a service-backed FeatureLayer. When true, statistics will be calculated on the client from features visible in the view. If false, statistics will be requested from the service.

filter

Property
Type
FeatureFilter | null | undefined

A feature filter used to filter statistic queries by geometry. This parameter is only used for filtering statistics by geometry. Any attribute filters set on the FeatureFilter.where property are ignored. Currently, only the intersects spatial relationship is supported. This is useful if you already define a feature filter by geometry on your layer and want to calculate statistics for the included features.

forBinning

Property
Type
boolean | null | undefined

Indicates whether the generated statistics are for a binning or clustering visualization. If true, then the input field(s) in this method should refer to aggregate fields defined in the featureReduction property of the layer.

view

Property
Type
MapViewOrSceneView | null | undefined

A SceneView or MapView instance is required when a valueExpression is specified.

ClassBreaksResult

Type definition

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.

minValue

Property
Type
number | null | undefined

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

maxValue

Property
Type
number | null | undefined

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

classBreakInfos

Property
Type
ClassBreak[]

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

normalizationTotal

Property
Type
number | null | undefined

The normalization total if normalizationType is set to percent-of-total when generating class breaks with createClassBreaksRenderer().

ClassBreak

Type definition

An object describing a single class break generated from the classBreaks() method.

minValue

Property
Type
number

The lower bound of the class break.

maxValue

Property
Type
number

The upper bound of the class break.

label

Property
Type
string | null | undefined

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

HistogramParameters

Type definition
Supertypes
AbortOptions

layer

Property
Type
Exclude<SupportedLayer, PointCloudLayer> | null | undefined

The layer for which to generate a histogram. When a client-side layer type is provided, attribute and spatial statistics are calculated only from features in the view's extent. When a server-side layer type is provided, the statistics are calculated from the entire layer, unless a valueExpression is provided.

field

Property
Type
string | null | undefined

The name of the numeric field for which the histogram will be generated. This property is ignored if a valueExpression is used.

classificationMethod

Property
Type
ClassificationMethod | null | undefined

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.

normalizationField

Property
Type
string | null | undefined

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

normalizationType

Property
Type
NormalizationType | null | undefined

| | field | Divides the data value using the value of the field specified in the normalizationField parameter. A normalizationField must be provided if this value is used. | percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use normalizationTotal to define the total value by which to normalize. | log | Computes the base 10 logarithm of the data values. This can be a useful approach for viewing highly skewed data distributions because it reduces the influence of outliers. Only positive values are computed. You should avoid this normalization type if your data contains a significant number of negative values. | natural-log | Computes the natural logarithm of the data values. This can be a useful approach for viewing highly skewed data distributions because it reduces the influence of outliers. Only positive values are computed. You should avoid this normalization type if your data contains a significant number of negative values. | square-root | Computes the square root of the data values. This can be a useful approach for viewing highly skewed data distributions because it reduces the influence of outliers. Only positive values are computed. You should avoid this normalization type if your data contains a significant number of negative values. |

normalizationTotal

Property
Type
number | null | undefined

Only applies if normalizationType is percent-of-total. Indicates the total amount with which to normalize field values.

numBins

Property
Type
number | null | undefined

Indicates the number of classes to generate for the histogram.

Default value
10

standardDeviationInterval

Property
Type
number | null | undefined

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).

valueExpression

Property
Type
string | null | undefined

An Arcade expression following the specification defined by the Arcade Visualization Profile. Expressions may reference field values using the $feature profile variable and must return a number. This property overrides the field property and therefore is used instead of an input field value. The view parameter is required if specifying a valueExpression. When using a valueExpression, client-side statistics are calculated based on the features in the view's extent. To generate statistics for the entire layer, set an equivalent sqlExpression.

sqlExpression

Property
Type
string | null | undefined

A SQL expression evaluating to a number. When provided, statistics are queried from the server for the entire layer. Only use this parameter when querying statistics based on an equivalent valueExpression. This parameter is ignored for client-side layer types.

sqlWhere

Property
Type
string | null | undefined

A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization.

minValue

Property
Type
number | null | undefined

The minimum bounding value for the histogram. Use this in conjunction with maxValue to generate a histogram between custom lower and upper bounds.

maxValue

Property
Type
number | null | undefined

The maximum bounding value for the histogram. Use this in conjunction with minValue to generate a histogram between custom lower and upper bounds.

features

deprecated Property
Type
Graphic[] | FeatureJSON[] | null | undefined

A subset of features for which to generate the histogram.

useFeaturesInView

Property
Type
boolean | null | undefined

Only applicable when the input layer is a service-backed FeatureLayer. When true, statistics will be calculated on the client from features visible in the view. If false, statistics will be requested from the service.

filter

Property
Type
FeatureFilter | null | undefined

A feature filter used to filter statistic queries by geometry. This parameter is only used for filtering statistics by geometry. Any attribute filters set on the FeatureFilter.where property are ignored. Currently, only the intersects spatial relationship is supported. This is useful if you already define a feature filter by geometry on your layer and want to calculate statistics for the included features.

forBinning

Property
Type
boolean | null | undefined

Indicates whether the generated statistics are for a binning or clustering visualization. If true, then the input field(s) in this method should refer to aggregate fields defined in the featureReduction property of the layer.

view

Property
Type
MapViewOrSceneView | null | undefined

A SceneView or MapView instance is required when a valueExpression is specified.

UniqueValuesParameters

Type definition
Supertypes
AbortOptions

layer

Property
Type
Exclude<SupportedLayer, PointCloudLayer> | null | undefined

The layer from which to query for unique values. When a client-side layer type is provided, attribute and spatial statistics are calculated only from features in the view's extent. When a server-side layer type is provided, the statistics are calculated from the entire layer, unless a valueExpression is provided.

field

Property
Type
string | null | undefined

The name of the numeric or string field from which the unique values will be obtained. This property is ignored if a valueExpression is used.

valueExpression

Property
Type
string | null | undefined

An Arcade expression following the specification defined by the Arcade Visualization Profile. Expressions may reference field values using the $feature profile variable and must return a string or a number. This property overrides the field property and therefore is used instead of an input field value. The view parameter is required if specifying a valueExpression. When using a valueExpression, client-side statistics are calculated based on the features in the view's extent. To generate statistics for the entire layer, set an equivalent sqlExpression.

sqlExpression

Property
Type
string | null | undefined

A SQL expression evaluating to a number or string. When provided, statistics are queried from the server for the entire layer. Only use this parameter when querying statistics based on an equivalent valueExpression. This parameter is ignored for client-side layer types.

sqlWhere

Property
Type
string | null | undefined

A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization.

features

deprecated Property
Type
Graphic[] | FeatureJSON[] | null | undefined

A subset of features for which to generate the unique values.

useFeaturesInView

Property
Type
boolean | null | undefined

Only applicable when the input layer is a service-backed FeatureLayer. When true, statistics will be calculated on the client from features visible in the view. If false, statistics will be requested from the service.

filter

Property
Type
FeatureFilter | null | undefined

A feature filter used to filter statistic queries by geometry. This parameter is only used for filtering statistics by geometry. Any attribute filters set on the FeatureFilter.where property are ignored. Currently, only the intersects spatial relationship is supported. This is useful if you already define a feature filter by geometry on your layer and want to calculate statistics for the included features.

returnAllCodedValues

Property
Type
boolean | null | undefined

Indicates that all domain codes should be returned if the given field has domain values.

forBinning

Property
Type
boolean | null | undefined

Indicates whether the generated statistics are for a binning or clustering visualization. If true, then the input field(s) in this method should refer to aggregate fields defined in the featureReduction property of the layer.

view

Property
Type
MapViewOrSceneView | null | undefined

A SceneView or MapView instance is required when a valueExpression is specified.

UniqueValuesResult

Type definition

An object that contains the unique values returned from the uniqueValues() query of a layer's field.

uniqueValueInfos

Property
Type
UniqueValueCountInfo[]

An array of objects, each containing a unique value/type/category present in the field specified in the uniqueValues() query. See table below for the specification of each object.

UniqueValueCountInfo

Type definition

value

Property
Type
string | number | null | undefined

A unique value representing a type or category of features in the layer.

count

Property
Type
number

The number of features belonging to the predominant category.

label

Property
Type
string | null | undefined

The label describing the predominant category, or field name.

HeatmapStatisticsParameters

Type definition
Supertypes
AbortOptions

layer

Property
Type
Exclude<SupportedLayer, PointCloudLayer> | null | undefined

The layer from which to generate statistics for the pixel intensity values and a given field if provided.

field

Property
Type
string | null | undefined

The name of the numeric field for which the statistics will be generated.

radius

Property
Type
number | null | undefined

The area of influence for each point as a radius in points from the point.

view

Property
Type
MapViewOrSceneView | null | undefined

A view instance used to calculate pixel intensity values based on the features in the current view.

HeatmapStatisticsResult

Type definition

The statistics returned from the heatmapStatistics() function.

min

Property
Type
number | null | undefined

The minimum kernel density value of all pixels in the view.

max

Property
Type
number | null | undefined

The maximum kernel density value of all pixels in the view.

PredominantCategoriesParameters

Type definition
Supertypes
AbortOptions

layer

Property
Type
Exclude<SupportedLayer, PointCloudLayer>

The layer from which to generate predominant categories for the given set of fields.

fields

Property
Type
string[]

An array of numeric fields from which to determine predominant categories. The fields must all be number fields and they must be competing or complementary (e.g. population totals by language spoken at home, or harvested acres by crop type, or the results of an election by candidate or party).

forBinning

Property
Type
boolean | null | undefined

Indicates whether the generated statistics are for a binning or clustering visualization. If true, then the input field(s) in this method should refer to aggregate fields defined in the featureReduction property of the layer.

view

Property
Type
MapViewOrSceneView | null | undefined

The view in which features will be rendered.

PredominantCategoriesResult

Type definition

The statistics returned from the predominantCategories() function.

predominantCategoryInfos

Property
Type
UniqueValueCountInfo[]

An array of objects describing the count of each predominant category.

SummaryStatisticsForAgeParameters

Type definition
Supertypes
AbortOptions

layer

Property
Type
Exclude<SupportedLayer, PointCloudLayer>

The layer from which to generate age statistics for the given startTime and endTime.

startTime

Property
Type
DateProperties

The start time for the age calculation. This can be a field name or a date value, such as Date.now(). If a Date is provided, then the endTime parameter must be a field name.

endTime

Property
Type
DateProperties

The end time for the age calculation. This can be a field name or a date value, such as Date.now(). If a Date is provided, then the startTime parameter must be a field name.

unit

Property
Type
SmartMappingTimeUnit | null | undefined

The desired units of the age result.

view

Property
Type
MapViewOrSceneView | null | undefined

The view in which features will be rendered.

outStatisticTypes

Property
Type
OutStatisticTypes | null | undefined

Indicates the statistics to calculate. If not defined, all statistics are calculated by default. The object should have the following properties.

filter

Property
Type
FeatureFilter | null | undefined

When defined, only features included in the filter are considered in the attribute and spatial statistics calculations when determining the final renderer. This is useful when a lot of variation exists in the data that could result in undesired data ranges. A common use case would be to set a filter that only includes features in the current extent of the view where the data is most likely to be viewed. Currently, only geometry filters with an intersects spatial relationship are supported. All other filter types (including where) are ignored.

Attribute

Type definition

field

Property
Type
string | null | undefined

The name of a numeric field.

valueExpression

Property
Type
string | null | undefined

An Arcade expression following the specification defined by the Arcade Visualization Profile. Expressions may reference field values using the $feature profile variable and must return a number. This property overrides the field property and therefore is used instead of an input field value if both are specified.

label

Property
Type
string | null | undefined

The label describing the field name (or category) in the legend. This is should be used if the given field doesn't have an intuitive field name or alias. For example, for a field named dem representing the total vote count for the Democratic party, you can set the label to Democrat to clarify the name of the category in the final visualization.

valueExpressionTitle

Property
Type
string | null | undefined

Text describing the value returned from the valueExpression. This will display in the legend.