VisualVariable
esri/renderers/visualVariables/VisualVariable
The visual variable base class. See each of the subclasses that extend this class to learn how to create continuous data-driven thematic visualizations.
ColorVariable | SizeVariable | OpacityVariable | RotationVariable |
---|---|---|---|
![]() | ![]() | ![]() | ![]() |
Property Overview
Name | Type | Summary | Class | |
---|---|---|---|---|
String | The name of the class. more details | more details | Accessor | |
String | The name of the numeric attribute field that contains the data values used to determine the color/opacity/size/rotation of each feature. more details | more details | VisualVariable | |
Object | An object providing options for displaying the visual variable in the Legend. more details | more details | VisualVariable | |
String | The visual variable type. more details | more details | VisualVariable | |
String | An Arcade expression evaluating to a number. more details | more details | VisualVariable | |
String | The title identifying and describing the associated Arcade expression as defined in the valueExpression property. more details | more details | VisualVariable |
Property Details
The name of the class. The declared class name is formatted as
esri.folder.className
.
- field String
The name of the numeric attribute field that contains the data values used to determine the color/opacity/size/rotation of each feature.
- legendOptions Object
An object providing options for displaying the visual variable in the Legend.
- Properties:
- optionalshowLegend Boolean
Indicates whether to show the visual variable in the legend.
optionaltitle StringThe title describing the visualization of the visual variable in the Legend. This takes precedence over a field alias or valueExpressionTitle.
- type Stringreadonly
The visual variable type.
Possible values: color | opacity | rotation | size
- valueExpression String
An Arcade expression evaluating to a number. This expression can reference field values using the
$feature
global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over field. Therefore, this property is typically used as an alternative to field in visual variables.- See also:
- valueExpressionTitle String
The title identifying and describing the associated Arcade expression as defined in the valueExpression property. This is displayed as the title of the corresponding visual variable in the Legend in the absence of a provided
title
in the legendOptions property.
Method Overview
Name | Return Type | Summary | Class | |
---|---|---|---|---|
* | Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. more details | more details | VisualVariable | |
Object | Converts an instance of this class to its ArcGIS portal JSON representation. more details | more details | VisualVariable |
Method Details
- fromJSON(json){*}static
Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input
json
parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.Parameter:json ObjectA JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.
Returns:Type Description * Returns a new instance of this class.
- toJSON(){Object}
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() topic in the Guide for more information.
Returns:Type Description Object The ArcGIS portal JSON representation of an instance of this class.