VisualVariable

Class: esri/renderers/visualVariables/VisualVariable
Inheritance: VisualVariable Accessor
Since: ArcGIS API for JavaScript 4.10

The visual variable base class. See each of the subclasses that extend this class to learn how to create continuous data-driven thematic visualizations.

ColorVariableSizeVariableOpacityVariableRotationVariable
renderer-vv-colorrenderer-vv-extrusionrenderer-vv-opacityrenderer-vv-rotation
See also:

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
String

The name of the class.

more details
more detailsAccessor
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 detailsVisualVariable
String|Number

The index of the visual variable in relation to its position in the visualVariables property of the renderer.

more details
more detailsVisualVariable
Object

An object providing options for displaying the visual variable in the Legend.

more details
more detailsVisualVariable
String

The visual variable type.

more details
more detailsVisualVariable
String

An Arcade expression evaluating to a number.

more details
more detailsVisualVariable
String

The title identifying and describing the associated Arcade expression as defined in the valueExpression property.

more details
more detailsVisualVariable

Property Details

declaredClassStringreadonly inherited

The name of the class. The declared class name is formatted as esri.folder.className.

fieldString

The name of the numeric attribute field that contains the data values used to determine the color/opacity/size/rotation of each feature.

The index of the visual variable in relation to its position in the visualVariables property of the renderer.

legendOptionsObject

An object providing options for displaying the visual variable in the Legend.

Properties:
showLegend Boolean
optional

Indicates whether to show the visual variable in the legend.

title String
optional

The title describing the visualization of the visual variable in the Legend. This takes precedence over a field alias or valueExpressionTitle.

typeStringreadonly

The visual variable type.

Possible values: color | opacity | rotation | size

valueExpressionString

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:
valueExpressionTitleString

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

NameReturn TypeSummaryClass
*

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 detailsVisualVariable
Object

Converts an instance of this class to its ArcGIS portal JSON representation.

more details
more detailsVisualVariable

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 Object

A 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:
TypeDescription
*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:
TypeDescription
ObjectThe ArcGIS portal JSON representation of an instance of this class.

API Reference search results

NameTypeModule
Loading...