Point clustering - filter popup features
This sample demonstrates how to query and filter features represented by point clusters using Arcade expressions in a cluster's popup.
Typically clusters display basic summary information about all features in the cluster, such as the total number of features, the predominant type, or the average value of a numeric field. Sometimes you may want to display information about a subset of important features, such as the number of fatalities in a cluster representing car crashes.
The cluster popup in this example displays the total number of power plants that generate power with coal, along with the amount of power they produce as a ratio to all power produced in the cluster. This is all accomplished with Arcade expressions. Within the context of a cluster popup, you can use Arcade to filter a cluster's features and perform statistics on those features.
Use Arcade to summarize clusters
Arcade expressions in cluster popups give you access to the cluster graphic itself (i.e. $feature
) and the features that make up the cluster (i.e. $aggregated
).
$feature
The $feature
profile variable allows you to reference aggregate fields used by the renderer, such as $feature.cluster_
. If the renderer visualizes population with a numeric POP
field, you will have access to the average population of features in the cluster by referencing $feature.cluster_
within the expression.
$aggregatedFeatures
The $aggregated
profile variable represents all features included in the cluster. You can use this profile variable to iterate through features, filter them, and calculate statistics with the features.
The Expects
Arcade function tells the clustered layer to request extra
fields required for the popup to function properly.
To use values returned from Arcade expressions within a popup, you must set the
Arcade expressions in the expression
property of the popupTemplate, then reference it using
the {expression/expression-name}
syntax.
Related samples and resources

Point clustering - basic configuration
Point clustering - basic configuration

Point clustering - generate suggested configuration
Point clustering - generate suggested configuration

Point clustering - query clusters
Point clustering - query clusters

Point clustering - advanced configuration
Point clustering - advanced configuration

Popup charts for point clusters
This sample demonstrates how to summarize clustered features using charts within a cluster's popup.

Point clustering with visual variables
Point clustering with visual variables
FeatureReductionCluster
Read the API Reference for more information.