import VoxelTransferFunctionStyle from "@arcgis/core/layers/voxel/VoxelTransferFunctionStyle.js";const VoxelTransferFunctionStyle = await $arcgis.import("@arcgis/core/layers/voxel/VoxelTransferFunctionStyle.js");- Inheritance:
- VoxelTransferFunctionStyle→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.25
The VoxelTransferFunctionStyle allows you to define how an individual continuous variable is rendered as a volume or as sections. The stretchRange is the range in the data to apply the colorStops and opacityStops to. The rangeFilter defines which data values will draw.
Values outside the stretchRange, but within the range of the rangeFilter (if one is defined), will draw with the color and transparency assigned to either the minimum or maximum value in the stretchRange.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Example
// Typical usagelet transferFunction = new VoxelTransferFunctionStyle({ stretchRange: [327.1, 2941.5], colorStops: [{ color: [34, 44, 246, 255], position: 0 }, { color: [68,166, 22, 255], position: 0.5 }, { color: [252, 146, 251, 255], position: 1 }], rangeFilter: { range: [0, 3266] }});Properties
| Property | Type | Class |
|---|---|---|
| | ||
declaredClass readonly inherited | ||
| | ||
| | ||
| |
colorStops
- Type
- Collection<VoxelColorStop>
A collection of colors and normalized positions which describe how to colorize the data values that are within the stretchRange.
opacityStops
- Type
- Collection<VoxelOpacityStop>
A collection of transparency values and normalized positions which describe how to apply transparency to the data values that are within the stretchRange.
rangeFilter
- Type
- VoxelRangeFilter | null | undefined
Defines the data range which will be rendered.
stretchRange
The data range to apply the color and alpha stops to, specified as [minimum, maximum] in the units of the data. Values outside this range, but within the rangeFilter (if there is one), will draw with the color assigned to either the minimum or maximum value in the stretchRange.
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.