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
HistogramBin
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.
count
- Type
- number
The number of values in a dataset that are
contained between the indicated minValue and maxValue.
SummaryStatisticsParameters
- Supertypes
- AbortOptions
layer
- Type
- Exclude<SupportedLayer, PointCloudLayer> | null | undefined
The layer from which to generate statistics for the given field.
valueExpression
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.
normalizationType
- 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. |
features
- Type
- Graphic[] | FeatureJSON[] | null | undefined
A subset of features for which to calculate the statistics.
filter
- 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.
forBinning
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
- 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
- Type
- MapViewOrSceneView | null | undefined
ClassBreaksParameters
- Supertypes
- AbortOptions
layer
- 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.
valueExpression
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
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 Value | Description |
|---|---|
| field | Divides 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. |
| log | Computes 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-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. |
| then set the total amount with which to normalize field values. |
classificationMethod
- Type
- ClassificationMethod | null | undefined
The method for classifying the data. See the table below for a list of possible values.
| Possible Value | Description |
|---|---|
| natural-breaks | Data 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-interval | Each 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. |
| quantile | Each 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-deviation | Class 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. |
features
- Type
- Graphic[] | FeatureJSON[] | null | undefined
A subset of features for which to generate the class breaks.
filter
- 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
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
- Type
- MapViewOrSceneView | null | undefined
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.
classBreakInfos
- Type
- ClassBreak[]
An array of objects describing the class breaks generated from the classBreaks() method.
normalizationTotal
The normalization total if normalizationType is set to percent-of-total
when generating class breaks with createClassBreaksRenderer().
ClassBreak
An object describing a single class break generated from the classBreaks() method.
HistogramParameters
- Supertypes
- AbortOptions
layer
- 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.
classificationMethod
- Type
- ClassificationMethod | null | undefined
The method for classifying the data. See the table below for a list of possible values.
| Possible Value | Description |
|---|---|
| natural-breaks | Data 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-interval | Each 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. |
| quantile | Each 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-deviation | Class 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. |
normalizationType
- 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. |
valueExpression
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.
features
- Type
- Graphic[] | FeatureJSON[] | null | undefined
A subset of features for which to generate the histogram.
filter
- 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
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
- Type
- MapViewOrSceneView | null | undefined
UniqueValuesParameters
- Supertypes
- AbortOptions
layer
- 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.
valueExpression
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.
features
- Type
- Graphic[] | FeatureJSON[] | null | undefined
A subset of features for which to generate the unique values.
filter
- 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
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
- Type
- MapViewOrSceneView | null | undefined
UniqueValuesResult
An object that contains the unique values returned from the uniqueValues() query of a layer's field.
uniqueValueInfos
- 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.
HeatmapStatisticsParameters
- Supertypes
- AbortOptions
layer
- Type
- Exclude<SupportedLayer, PointCloudLayer> | null | undefined
The layer from which to generate statistics for the pixel intensity values and a given field if provided.
view
- Type
- MapViewOrSceneView | null | undefined
A view instance used to calculate pixel intensity values based on the features in the current view.
HeatmapStatisticsResult
The statistics returned from the heatmapStatistics() function.
PredominantCategoriesParameters
- Supertypes
- AbortOptions
layer
- Type
- Exclude<SupportedLayer, PointCloudLayer>
The layer from which to generate predominant categories for the given set of fields.
fields
- 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
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
- Type
- MapViewOrSceneView | null | undefined
The view in which features will be rendered.
PredominantCategoriesResult
The statistics returned from the predominantCategories() function.
predominantCategoryInfos
- Type
- UniqueValueCountInfo[]
An array of objects describing the count of each predominant category.
SummaryStatisticsForAgeParameters
- Supertypes
- AbortOptions
layer
- Type
- Exclude<SupportedLayer, PointCloudLayer>
The layer from which to generate age statistics for the given startTime and endTime.
startTime
- 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
- 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.
view
- Type
- MapViewOrSceneView | null | undefined
The view in which features will be rendered.
outStatisticTypes
- 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
- 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
valueExpression
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
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.