@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.46 kB
JavaScript
import{_ as t}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import o from"./VisualVariable.js";import r from"./support/ColorStop.js";var i;let p=i=class extends o{constructor(t){super(t),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(t){t&&Array.isArray(t)&&(t=t.filter((t=>!!t))).sort(((t,s)=>t.value-s.value)),this._set("stops",t)}clone(){return new i({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map((t=>t.clone())),legendOptions:this.legendOptions&&this.legendOptions.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map((t=>t.value||0))}};t([s({readOnly:!0})],p.prototype,"cache",null),t([s({type:["color"],json:{type:["colorInfo"]}})],p.prototype,"type",void 0),t([s({type:String,json:{write:!0}})],p.prototype,"normalizationField",void 0),t([s({type:[r],json:{write:!0}})],p.prototype,"stops",null),p=i=t([e("esri.renderers.visualVariables.ColorVariable")],p);const a=p;export{a as default};