This renderer is a type of UniqueValue renderer which is based off the valueExpression property rather than field. Optionally, size and/or transparency visual variables may be included with valueExpression. Note that this renderer is supported for ArcGIS Online hosted feature services and feature collections.
Referenced by: renderer
Properties
| Property | Details |
|---|---|
| authoringInfo | An object containing metadata about the authoring process for creating a renderer object. This allows the authoring clients to save specific overridable settings so that next time it is accessed via the UI, their selections are remembered. Non-authoring clients can ignore it. |
| backgroundFillSymbol | A symbol used for polygon features as a background if the renderer uses point symbols, e.g. for bivariate types & size rendering. Only applicable to polygon layers. PictureFillSymbols can also be used outside of the Map Viewer for Size and Predominance and Size renderers. |
| defaultLabel | Default label for the default symbol used to draw unspecified values. |
| defaultSymbol | Symbol used when a value cannot be classified. |
| rotationExpression | A constant value or an expression that derives the angle of rotation based on a feature attribute value. When an attribute name is specified, it’s enclosed in square brackets. Rotation is set using a visual variable of type rotationInfo with a specified field or valueExpression property |
| rotationType | String value which controls the origin and direction of rotation on point features. If the rotationType is defined as arithmetic, the symbol is rotated from East in a counter-clockwise direction where East is the 0 degree axis. If the rotationType is defined as geographic, the symbol is rotated from North in a clockwise direction where North is the 0 degree axis.Valid values:
|
| type | Specifies the type of renderer used. Valid value of this property uniqueValue |
| uniqueValueInfos[] | An array of uniqueValueInfo objects. |
| valueExpression | An Arcade expression evaluating to either a string or a number. |
| valueExpressionTitle | The title identifying and describing the associated Arcade expression as defined in the valueExpression property. |
| visualVariables[] | An array of objects used to set rendering properties. |
Example
{ "visualVariables": [ { "type": "transparencyInfo", "valueExpression": "var fieldNames = [ \"POP10_CY\", \"POP40_CY\", \"POP60_CY\", \"POP20_CY\", \"POP30_CY\" ];\nvar numFields = 5;\nvar maxValueField = null;\nvar maxValue = -Infinity;\nvar value, i, totalValue = null;\nfor(i = 0; i < numFields; i++) {\nvalue = $feature[fieldNames[i]];\nif(value > 0) {\nif(value > maxValue) {\nmaxValue = value;\nmaxValueField = fieldNames[i];\n}\nelse if (value == maxValue) {\nmaxValueField = null;\n}\n}\nif(value != null && value >= 0) {\nif (totalValue == null) { totalValue = 0; }\ntotalValue = totalValue + value;\n}\n}\nvar strength = null;\nif (maxValueField != null && totalValue > 0) {\nstrength = (maxValue / totalValue) * 100;\n}\nreturn strength;", "stops": [ { "value": 25, "transparency": 85 }, { "value": 50, "transparency": 0 } ], "legendOptions": { "title": "Strength of predominance" } }, { "type": "sizeInfo", "target": "outline", "expression": "view.scale", "stops": [ { "size": 2, "value": 1075387 }, { "size": 1, "value": 3360583 }, { "size": 0.5, "value": 13442332 }, { "size": 0, "value": 26884663 } ] } ], "authoringInfo": { "type": "predominance", "fields": [ "POP10_CY", "POP40_CY", "POP60_CY", "POP20_CY", "POP30_CY" ], "visualVariables": [ { "type": "transparencyInfo", "minSliderValue": 0, "maxSliderValue": 100 } ] }, "type": "uniqueValue", "valueExpression": "var fieldNames = [ \"POP10_CY\", \"POP40_CY\", \"POP60_CY\", \"POP20_CY\", \"POP30_CY\" ];\nvar numFields = 5;\nvar maxValueField = null;\nvar maxValue = -Infinity;\nvar value, i, totalValue = null;\nfor(i = 0; i < numFields; i++) {\nvalue = $feature[fieldNames[i]];\nif(value > 0) {\nif(value > maxValue) {\nmaxValue = value;\nmaxValueField = fieldNames[i];\n}\nelse if (value == maxValue) {\nmaxValueField = null;\n}\n}\n}\nreturn maxValueField;", "uniqueValueInfos": [ { "value": "POP10_CY", "symbol": { "color": [ 160, 53, 0, 255 ], "width": 3.75, "type": "esriSLS", "style": "esriSLSSolid" }, "label": "POP10_CY" }, { "value": "POP40_CY", "symbol": { "color": [ 50, 100, 200, 255 ], "width": 3.75, "type": "esriSLS", "style": "esriSLSSolid" }, "label": "POP40_CY" }, { "value": "POP60_CY", "symbol": { "color": [ 114, 179, 142, 255 ], "width": 3.75, "type": "esriSLS", "style": "esriSLSSolid" }, "label": "POP60_CY" }, { "value": "POP20_CY", "symbol": { "color": [ 217, 180, 0, 255 ], "width": 3.75, "type": "esriSLS", "style": "esriSLSSolid" }, "label": "POP20_CY" }, { "value": "POP30_CY", "symbol": { "color": [ 152, 107, 161, 255 ], "width": 3.75, "type": "esriSLS", "style": "esriSLSSolid" }, "label": "POP30_CY" } ]}