GeoBlazor Pro
layout: pro title: FeatureReductionCluster parent: Pro Classes grand_parent: GeoBlazor Pro —
dymaptic.GeoBlazor.Pro
dymaptic.GeoBlazor.Pro.Components.Layers
FeatureReductionCluster Class
This class configures clustering as a means of reducing and summarizing point features in a FeatureLayer, CSVLayer, GeoJSONLayer, WFSLayer, or OGCFeatureLayer. This feature reduction method spatially groups points into clusters based on an area of influence defined in screen space (i.e. the clusterRadius). By default, the size of each cluster is proportional to the number of features within the cluster.
Point clustering only applies to layers with Point geometries in a MapView. It does not apply to layers with polyline and polygon geometries.
While this can be thought of as a visualization technique, clustering is actually a method of reducing features in the view. It is therefore independent of the layer’s Renderer. The style, labels, and popup of each cluster summarizes the features it represents.
ArcGIS Maps SDK for JavaScript
public class FeatureReductionCluster : dymaptic.GeoBlazor.Pro.Components.Layers.FeatureReduction
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 dymaptic.GeoBlazor.Core.Components.MapComponent 🡒 FeatureReduction 🡒 FeatureReductionCluster
Constructors
FeatureReductionCluster() Constructor
Parameterless constructor for use as a Razor Component
public FeatureReductionCluster();
FeatureReductionCluster(Dimension, Dimension, Dimension, Nullable, Nullable, Nullable, IReadOnlyCollection, IReadOnlyCollection
Constructor for use in code
public FeatureReductionCluster(dymaptic.GeoBlazor.Core.Objects.Dimension? clusterMaxSize=null, dymaptic.GeoBlazor.Core.Objects.Dimension? clusterMinSize=null, dymaptic.GeoBlazor.Core.Objects.Dimension? clusterRadius=null, System.Nullable<bool> labelsVisible=null, System.Nullable<double> maxScale=null, System.Nullable<bool> popupEnabled=null, System.Collections.Generic.IReadOnlyCollection<dymaptic.GeoBlazor.Pro.Components.Layers.AggregateField>? fields=null, System.Collections.Generic.IReadOnlyCollection<dymaptic.GeoBlazor.Core.Components.Layers.Label>? labelingInfo=null, dymaptic.GeoBlazor.Core.Components.Popups.PopupTemplate? popupTemplate=null, dymaptic.GeoBlazor.Core.Components.Renderers.Renderer? renderer=null, dymaptic.GeoBlazor.Core.Components.Symbols.Symbol? symbol=null);
Parameters
clusterMaxSize
dymaptic.GeoBlazor.Core.Objects.Dimension
Defines the symbol size of the largest cluster in points (or pixels if specified). Adjusting clusterMaxSize generally should be considered if the clusterRadius is modified.
clusterMinSize
dymaptic.GeoBlazor.Core.Objects.Dimension
Defines the symbol size of the smallest cluster in points (or pixels if specified). If labeling clusters with a count or some other information in the center of the cluster, then having a clusterMinSize larger than the default is generally preferred.
clusterRadius
dymaptic.GeoBlazor.Core.Objects.Dimension
Defines the radius in points (or pixels if specified) of the area in which multiple points will be grouped and visualized as a single cluster. Adjusting clusterRadius generally should be considered if the clusterMaxSize is modified.
labelsVisible
System.Nullable<System.Boolean>
Indicates whether to display labels for the clusters. If true, labels will appear as defined in the labelingInfo property.
maxScale
System.Nullable<System.Double>
Defines the maximum view scale at which clustering is enabled. If the user zooms in beyond the scale specified here, clustering will be disabled and only individual features will be displayed in the view. Once the user zooms out past this scale, clustering will be re-enabled. A value of 0 means clustering is always enabled, and therefore clusters may be visible at any view scale.
popupEnabled
System.Nullable<System.Boolean>
Indicates whether to display the cluster popup. If true, popups will open when the user clicks or taps a cluster. If false, the popup as defined in the popupTemplate will be persisted, but won’t be displayed on click/tap.
fields
System.Collections.Generic.IReadOnlyCollection<AggregateField>
An array of aggregate fields that summarize layer fields from features contained within each cluster. These fields may be used by the popupTemplate, labelingInfo, and renderer.
labelingInfo
System.Collections.Generic.IReadOnlyCollection<dymaptic.GeoBlazor.Core.Components.Layers.Label>
Defines labels for clusters as an array of Label. When set, labels independent of the layer.LabelingInfo are used to convey information about each cluster. This can include the count of all features in the cluster, the average, or sum of a numeric attribute.
popupTemplate
dymaptic.GeoBlazor.Core.Components.Popups.PopupTemplate
The PopupTemplate to apply to clusters. When set, a popupTemplate independent of the layer.popupTemplate is used. This popup can display summary information for each cluster, such as feature count or any other field defined in fields.
renderer
dymaptic.GeoBlazor.Core.Components.Renderers.Renderer
The renderer used to style the clusters. Depending on the renderer type, clusters may be visualized with the same symbol or with varying symbols based on the values of the provided fields. Since clusters are defined geometrically as polygons, only renderer and symbol types suited for polygon geometries are supported (e.g. HeatmapRenderer is not supported).
symbol
dymaptic.GeoBlazor.Core.Components.Symbols.Symbol
The symbol used to represent each cluster. If a custom renderer is defined for cluster, then this property is ignored and cluster symbols are determined using the renderer.
Properties
FeatureReductionCluster.ClusterMaxSize Property
Defines the symbol size of the largest cluster in points (or pixels if specified). Adjusting clusterMaxSize generally should be considered if the clusterRadius is modified.
For example, if you prefer cluster icons to not overlap, then the clusterMaxSize should be substantially smaller than the clusterRadius.
If a custom renderer is defined for cluster, and that renderer contains a esri/renderers/visualVaribles/SizeVariable, then this property is ignored and cluster sizes are determined using the renderer’s size variable.
Default Value:37.5
public dymaptic.GeoBlazor.Core.Objects.Dimension? ClusterMaxSize { get; set; }
Property Value
dymaptic.GeoBlazor.Core.Objects.Dimension
FeatureReductionCluster.ClusterMinSize Property
Defines the symbol size of the smallest cluster in points (or pixels if specified). If labeling clusters with a count or some other information in the center of the cluster, then having a clusterMinSize larger than the default is generally preferred.
Keep in mind that this size may be smaller than the symbol size of individual non-clustered features in the layer. In that scenario, you should either reduce the size of the symbol(s) in the layer’s renderer or increase the clusterMinSize to be larger than the size of individual points to avoid confusion for the end user. This is most likely to happen when cluster size represents feature count.
If a custom renderer is defined for cluster, and that renderer contains a esri/renderers/visualVaribles/SizeVariable, then this property is ignored and cluster sizes are determined using the renderer’s size variable.
Default Value:9
public dymaptic.GeoBlazor.Core.Objects.Dimension? ClusterMinSize { get; set; }
Property Value
dymaptic.GeoBlazor.Core.Objects.Dimension
FeatureReductionCluster.ClusterRadius Property
Defines the radius in points (or pixels if specified) of the area in which multiple points will be grouped and visualized as a single cluster. Adjusting clusterRadius generally should be considered if the clusterMaxSize is modified.
For example, if you prefer cluster graphics to not overlap, then the clusterRadius should be substantially larger than the clusterMaxSize.
Default Value:60
public dymaptic.GeoBlazor.Core.Objects.Dimension? ClusterRadius { get; set; }
Property Value
dymaptic.GeoBlazor.Core.Objects.Dimension
FeatureReductionCluster.Fields Property
An array of aggregate fields that summarize layer fields from features contained within each cluster. These fields may be used by the popupTemplate, labelingInfo, and renderer.
Some fields are internally automatically created by the JS API’s rendering engine for use in default cluster renderers (not set by the developer). The AggregateField.isAutoGenerated property indicates whether a field was internally created by the JS API. All auto-generated fields are read-only. They are discarded and replaced with new fields each time the user changes the underlying layer’s renderer. Therefore, auto-generated fields should always be used with caution.
public System.Collections.Generic.IReadOnlyCollection<dymaptic.GeoBlazor.Pro.Components.Layers.AggregateField> Fields { get; set; }
Property Value
System.Collections.Generic.IReadOnlyCollection<AggregateField>
FeatureReductionCluster.LabelingInfo Property
Defines labels for clusters as an array of LabelClass. When set, labels independent of the layer.labelingInfo are used to convey information about the clusters, including the count of all features in the cluster, the average, or predominant values of fields mapped by the renderer.
Label expressions may only refer to aggregate fields defined in the fields property. Auto-generated fields may be used, but are at risk of being discarded if the underlying layer’s renderer changes. See fields for more information.
It is advisable to turn off label deconfliction when labeling clusters with a count in the center of the cluster. To generate suggested labels for your cluster configuration based on the layer’s renderer, see clusterLabelCreator.
Multiple Label classes with different where clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of clusters (e.g. blue labels for small clusters and red labels for large ones).
public System.Collections.Generic.IReadOnlyCollection<dymaptic.GeoBlazor.Core.Components.Layers.Label> LabelingInfo { get; set; }
Property Value
System.Collections.Generic.IReadOnlyCollection<dymaptic.GeoBlazor.Core.Components.Layers.Label>
FeatureReductionCluster.LabelsVisible Property
Indicates whether to display labels for the clusters. If true, labels will appear as defined in the labelingInfo property.
Default Value:true
public System.Nullable<bool> LabelsVisible { get; set; }
Property Value
System.Nullable<System.Boolean>
FeatureReductionCluster.MaxScale Property
Defines the maximum view scale at which clustering is enabled. If the user zooms in beyond the scale specified here, clustering will be disabled and only individual features will be displayed in the view. Once the user zooms out past this scale, clustering will be re-enabled. A value of 0 means clustering is always enabled, and therefore clusters may be visible at any view scale.
Default Value:0
public System.Nullable<double> MaxScale { get; set; }
Property Value
System.Nullable<System.Double>
FeatureReductionCluster.PopupEnabled Property
Indicates whether to display the cluster popup. If true, popups will open when the user clicks or taps a cluster. If false, the popup as defined in the popupTemplate will be persisted, but won’t be displayed on click/tap.
Default Value:true
public System.Nullable<bool> PopupEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
FeatureReductionCluster.PopupTemplate Property
The PopupTemplate to apply to clustered graphics. When set, a popupTemplate independent of the layer.popupTemplate is used. This popup can display summary information for the cluster, including the count of all features in the cluster and the average or predominant values of fields mapped by the renderer.
To generate a suggested predefined popup template for your cluster configuration based on the layer’s renderer, see clusterPopupTemplateCreator.
The PopupTemplate may contain one or more Arcade expressions following the specification defined by the Arcade Feature Reduction Popup Profile. Expressions must return a string or a number and may access data values from the cluster and its aggregated features with the $feature and $aggregatedFeatures profile variables.
Popup expressions may only refer to aggregate fields defined in the fields property. Auto-generated fields may be used, but are at risk of being discarded if the underlying layer’s renderer changes. See fields for more information about this behavior.
public dymaptic.GeoBlazor.Core.Components.Popups.PopupTemplate? PopupTemplate { get; set; }
Property Value
dymaptic.GeoBlazor.Core.Components.Popups.PopupTemplate
FeatureReductionCluster.Renderer Property
The renderer used to override the default style of the clusters. All fields used by this renderer must be AggregateFields defined in the fields property in this class.
By default, when you enable clustering, each cluster will be styled with a symbol summarizing the points included in the cluster based on the underlying layer’s renderer configuration. See Styles and configurations for more information about this behavior. In this scenario, the renderer will be persisted when the layer is saved to the web map, but it will be flagged as “auto generated” in the isAutoGenerated property of the the renderer.authoringInfo object. All auto generated renderers are discarded and replaced each time the underlying layer’s renderer is changed.
This property allows you to override the default cluster styling using any renderer type suitable for point geometries. For example, if you want to render clusters as pie charts, you can define a PieChartRenderer in this property. Custom renderers set on this property are not discarded when the underlying layer’s renderer changes. Setting this property to null will cause clusters to render using the default style based on auto generated fields.
Keep in mind that the renderer defined here overrides the style of all features in the view, including individual features (clusters of size 1). If you want to define a dedicated cluster symbol, but retain the layer’s renderer for individual features, then use the symbol property.
public dymaptic.GeoBlazor.Core.Components.Renderers.Renderer? Renderer { get; set; }
Property Value
dymaptic.GeoBlazor.Core.Components.Renderers.Renderer
FeatureReductionCluster.Symbol Property
A symbol used to override the default cluster style. Unlike the renderer property, this symbol doesn’t affect individual features (i.e. clusters of size 1). Use this property to create a dedicated cluster symbol while retaining the symbology of individual features.
public dymaptic.GeoBlazor.Core.Components.Symbols.Symbol? Symbol { get; set; }
Property Value
dymaptic.GeoBlazor.Core.Components.Symbols.Symbol
Remarks
Currently only supports dymaptic.GeoBlazor.Core.Components.Symbols.MarkerSymbols
FeatureReductionCluster.Type Property
The type of Feature Reduction
public override string Type { get; }