The feature reduction cluster drawingInfo object contains drawing information, such as labelingInfo, for featureReduction (e.g. clustering) on a feature layer.
Referenced by: Feature Reduction Cluster
Properties
Property | Details |
---|---|
labelingInfo[] | An object defining the properties used for labeling clusters. |
renderer | An object defining the symbology of the cluster which provides the symbology for the layer. If not defined, web clients will infer a cluster style from the layer's renderer. Other clients may infer a style or set a default cluster style. If no visual variables are present in a simpleRenderer or a pieChartRenderer, then cluster sizes will automatically be rendered based on the clusterMinSize and clusterMaxSize. |
Clusters with labels. No defined renderer. Example
{
"labelingInfo": [
{
"labelExpressionInfo": {
"expression": "Text( $feature[\"cluster_count\"], \"#,###\");"
},
"useCodedValues": false,
"maxScale": 0,
"minScale": 0,
"where": "",
"labelPlacement": "esriServerPointLabelPlacementCenterCenter",
"deconflictionStrategy": "none",
"symbol": {
"color": [
51,
51,
51,
255
],
"type": "esriTS",
"horizontalAlignment": "center",
"rightToLeft": false,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"text": "",
"rotated": false,
"kerning": true,
"font": {
"size": 9,
"style": "normal",
"decoration": "none",
"weight": "bold",
"family": "Arial"
}
}
}
]
}
Clusters with labels and a simple renderer to override the cluster symbol. Example
The client will size clusters based off clusterMinSize and clusterMaxSize.
{
"renderer": {
"type": "simple",
"symbol": {
"color": [
0,
0,
128,
128
],
"size": 15,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"type": "esriSMS",
"style": "esriSMSCircle",
"outline": {
"color": [
0,
0,
128,
255
],
"width": 0.99975,
"type": "esriSLS",
"style": "esriSLSSolid"
}
}
},
"labelingInfo": [
{
"labelExpressionInfo": {
"expression": "Text( $feature[\"cluster_count\"], \"#,###\");"
},
"useCodedValues": false,
"maxScale": 0,
"minScale": 0,
"where": "",
"labelPlacement": "esriServerPointLabelPlacementCenterCenter",
"deconflictionStrategy": "none",
"symbol": {
"color": [
51,
51,
51,
255
],
"type": "esriTS",
"horizontalAlignment": "center",
"rightToLeft": false,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"text": "",
"rotated": false,
"kerning": true,
"font": {
"size": 9,
"style": "normal",
"decoration": "none",
"weight": "bold",
"family": "Arial"
}
}
}
]
}
Clusters visualized with a simple renderer to override the cluster symbol and a color variable to color the cluster by count. Example
The client will size clusters based off clusterMinSize and clusterMaxSize because no size variable is present.
{
"renderer": {
"type": "simple",
"symbol": {
"color": [
0,
0,
128,
128
],
"size": 15,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"type": "esriSMS",
"style": "esriSMSCircle",
"outline": {
"color": [
0,
0,
128,
255
],
"width": 0.99975,
"type": "esriSLS",
"style": "esriSLSSolid"
}
},
"visualVariables": [
{
"type": "colorInfo",
"field": "cluster_count",
"stops": [
{
"value": 1,
"color": [
255,
252,
212,
255
]
},
{
"value": 500,
"color": [
98,
158,
176,
255
]
},
{
"value": 1000,
"color": [
13,
38,
68,
255
]
}
]
}
]
}
}
Visualizes clusters based off the sum of an attribute. Example
The client will ignore clusterMinSize and clusterMaxSize in this scenario.
{
"renderer": {
"type": "simple",
"symbol": {
"color": [
0,
0,
128,
128
],
"size": 15,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"type": "esriSMS",
"style": "esriSMSCircle",
"outline": {
"color": [
0,
0,
128,
255
],
"width": 0.99975,
"type": "esriSLS",
"style": "esriSLSSolid"
}
},
"visualVariables": [
{
"type": "sizeInfo",
"field": "sum_population",
"valueUnit": "unknown",
"minSize": 6,
"maxSize": 37.5,
"minDataValue": 100,
"maxDataValue": 100000
}
]
}
}
Visualizes clusters as pie charts dynamically sized by cluster count depending on the LOD. Example
The client will use clusterMinSize and clusterMaxSize for the sizes in this scenario.
{
"renderer": {
"type": "pieChart",
"attributes": [
{
"color": [
217,
43,
48,
255
],
"field": "SUM_MOTORIST_INJURED",
"label": "Injured motorists"
},
{
"color": [
0,
149,
186,
255
],
"field": "SUM_CYCLIST_INJURED",
"label": "Injured cyclists"
},
{
"color": [
60,
204,
180,
255
],
"field": "SUM_PEDESTRIANS_INJURED",
"label": "Injured pedestrians"
},
{
"color": [
255,
223,
60,
255
],
"field": "SUM_KILLED",
"label": "Fatalities"
},
{
"color": [
194,
124,
48,
64
],
"valueExpression": "$feature.cluster_count - $feature.SUM_KILLED - $feature.SUM_PERSONS_INJURED",
"valueExpressionTitle": "No injuries"
}
],
"holePercentage": 0,
"othersCategory": {
"color": [
0,
0,
0,
0
],
"threshold": 0
},
"outline": {
"type": "esriSLS",
"color": [
255,
255,
255,
255
],
"width": 0,
"style": "esriSLSSolid"
},
"size": 8
}
}
Visualizes clusters as pie charts sized by an aggregate field. Example
The client will ignore clusterMinSize and clusterMaxSize in this scenario.
{
"renderer": {
"type": "pieChart",
"visualVariables": [
{
"type": "sizeInfo",
"field": "SUM_ALL_INJURED",
"stops": [
{
"size": 8,
"value": 1
},
{
"size": 12,
"value": 100
},
{
"size": 40,
"value": 400
}
]
}
],
"attributes": [
{
"color": [
217,
43,
48,
255
],
"field": "SUM_MOTORIST_INJURED",
"label": "Injured motorists"
},
{
"color": [
0,
149,
186,
255
],
"field": "SUM_CYCLIST_INJURED",
"label": "Injured cyclists"
},
{
"color": [
60,
204,
180,
255
],
"field": "SUM_PEDESTRIANS_INJURED",
"label": "Injured pedestrians"
},
{
"color": [
255,
223,
60,
255
],
"field": "SUM_KILLED",
"label": "Fatalities"
},
{
"color": [
194,
124,
48,
64
],
"valueExpression": "$feature.cluster_count - $feature.SUM_KILLED - $feature.SUM_PERSONS_INJURED",
"valueExpressionTitle": "No injuries"
}
],
"holePercentage": 0,
"othersCategory": {
"color": [
0,
0,
0,
0
],
"threshold": 0
},
"outline": {
"type": "esriSLS",
"color": [
255,
255,
255,
255
],
"width": 0,
"style": "esriSLSSolid"
},
"size": 8
}
}