import UniqueValue from "@arcgis/core/renderers/support/UniqueValue.js";const UniqueValue = await $arcgis.import("@arcgis/core/renderers/support/UniqueValue.js");- Inheritance:
- UniqueValue→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.25
Defines combinations of values to expect from up to three fields of categorical data in a UniqueValueRenderer. This value (or combination of values) is used to define the underlying data for a UniqueValueClass (i.e. a category) within a UniqueValueRenderer.
Example
// Features with only the combination values below from// field, field2, and field3 in the renderer// will be represented with the symbol defined in the class.uniqueValueClass.values = { value: 10, value2: "Republican", value3: "18-25"};Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
value
Defines a value (possibly in combination with value2 and value3) returned from the field referenced in UniqueValueRenderer.field or returned from an Arcade expression defined in UniqueValueRenderer.valueExpression to be categorized in a UniqueValueClass.
value2
Defines a value returned from the field referenced in UniqueValueRenderer.field2 to be categorized in combination with value (and possibly value3) in a UniqueValueClass.
value3
Defines a value returned from the field referenced in UniqueValueRenderer.field3 to be categorized in combination with value and value2 in a UniqueValueClass.
Methods
fromJSON
- Signature
-
fromJSON (json: any): any
Creates a new instance of this class and initializes it with values from a JSON object
generated from an ArcGIS product. 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.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | 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
- any
Returns a new instance of this class.
clone
- Signature
-
clone (): this
Creates a deep clone of this object. Any properties that store values by reference will be assigned copies of the referenced values on the cloned instance.
- Returns
- this
A deep clone of the class instance that invoked this method.
toJSON
- Signature
-
toJSON (): any
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
- Returns
- any
The ArcGIS portal JSON representation of an instance of this class.