layout: default title: ColorVariable parent: Core Classes —

dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Components.Layers

ColorVariable Class

The color visual variable is used to visualize features along a continuous color ramp based on the values of a numeric attribute field or an expression. The color ramp is defined along a sequence of stops, where color values are mapped to data values. Data values that fall between two stops are assigned a color that is linearly interpolated based on the value’s position relative to the closest defined stops.
ArcGIS Maps SDK for JavaScript

public class ColorVariable : dymaptic.GeoBlazor.Core.Components.Layers.VisualVariable

Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 VisualVariable 🡒 ColorVariable

Constructors

ColorVariable() Constructor

Parameterless constructor for using as a razor component

public ColorVariable();

ColorVariable(string, string, IReadOnlyList) Constructor

Constructs a new ColorVariable in code with parameters

public ColorVariable(string field, string? normalizationField=null, System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.Layers.ColorStop>? stops=null);

Parameters

field System.String

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

normalizationField System.String

The name of the numeric attribute field by which to normalize the data. If this field is used, then the values in stops should be normalized as percentages or ratios.

stops System.Collections.Generic.IReadOnlyList<ColorStop>

An array of sequential objects, or stops, that defines a continuous color ramp. You must specify 2 - 8 stops. In most cases, no more than five are needed. Features with values that fall between the given stops will be assigned colors linearly interpolated along the ramp in relation to the nearest stop values. The stops must be listed in ascending order based on the value of the value property in each stop.

Properties

ColorVariable.NormalizationField Property

Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in stops should be normalized as percentages or ratios.

public string? NormalizationField { get; set; }

Property Value

System.String

ColorVariable.Stops Property

An array of sequential objects, or stops, that defines a continuous color ramp. You must specify 2 - 8 stops. In most cases, no more than five are needed. Features with values that fall between the given stops will be assigned colors linearly interpolated along the ramp in relation to the nearest stop values. The stops must be listed in ascending order based on the value of the value property in each stop.

public System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.Layers.ColorStop>? Stops { get; set; }

Property Value

System.Collections.Generic.IReadOnlyList<ColorStop>

ColorVariable.VariableType Property

The visual variable type.

public override dymaptic.GeoBlazor.Core.Components.Layers.VisualVariableType VariableType { get; }

Property Value

VisualVariableType

Methods

ColorVariable.RegisterChildComponent(MapComponent) Method

Called from dymaptic.GeoBlazor.Core.Components.MapComponent.OnInitializedAsync to “Register” the current component with it’s parent.

public override System.Threading.Tasks.Task RegisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);

Parameters

child MapComponent

The calling, child component to register

Returns

System.Threading.Tasks.Task

Exceptions

InvalidChildElementException
Throws if the current child is not a valid sub-component to the parent.

Remarks

This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method. If you see no other way to register a child component, please open an issue on GitHub.

ColorVariable.UnregisterChildComponent(MapComponent) Method

Undoes the “Registration” of a child with its parent.

public override System.Threading.Tasks.Task UnregisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);

Parameters

child MapComponent

The child to unregister

Returns

System.Threading.Tasks.Task

Remarks

This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method.