@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 6.49 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import{clone as s}from"../../core/lang.js";import{property as l,subclass as r}from"../../core/accessorSupport/decorators.js";import{Integer as a}from"../../core/accessorSupport/ensureType.js";import o from"./AuthoringInfoFieldInfo.js";import n from"./AuthoringInfoVisualVariable.js";import{fromJSON as u,types as p}from"../../rest/support/colorRamps.js";import{reader as d}from"../../core/accessorSupport/decorators/reader.js";var h;const c=new t({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),y=new t({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),m=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers"],f=["high-to-low","above-and-below","above","below"],v=["flow-line","wave-front"],w=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let b=h=class extends i{constructor(e){super(e),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const e=this._get("classificationMethod"),t=this.type;return t&&"relationship"!==t?"class-breaks-size"===t||"class-breaks-color"===t?e||"manual":null:e}set classificationMethod(e){this._set("classificationMethod",e)}readColorRamp(e){return e?u(e):void 0}get fields(){return this.type&&"predominance"!==this.type?null:this._get("fields")}set fields(e){this._set("fields",e)}get field1(){return this.type&&"relationship"!==this.type?null:this._get("field1")}set field1(e){this._set("field1",e)}get field2(){return this.type&&"relationship"!==this.type?null:this._get("field2")}set field2(e){this._set("field2",e)}get flowTheme(){return"flow"===this.type?this._get("flowTheme"):null}set flowTheme(e){this._set("flowTheme",e)}get focus(){return this.type&&"relationship"!==this.type?null:this._get("focus")}set focus(e){this._set("focus",e)}get numClasses(){return this.type&&"relationship"!==this.type?null:this._get("numClasses")}set numClasses(e){this._set("numClasses",e)}get statistics(){return"univariate-color-size"===this.type&&"above-and-below"===this.univariateTheme?this._get("statistics"):null}set statistics(e){this._set("statistics",e)}get standardDeviationInterval(){const e=this.type;return e&&"relationship"!==e&&"class-breaks-size"!==e&&"class-breaks-color"!==e||this.classificationMethod&&"standard-deviation"!==this.classificationMethod?null:this._get("standardDeviationInterval")}set standardDeviationInterval(e){this._set("standardDeviationInterval",e)}get type(){return this._get("type")}set type(e){let t=e;"classed-size"===e?t="class-breaks-size":"classed-color"===e&&(t="class-breaks-color"),this._set("type",t)}get univariateSymbolStyle(){return"univariate-color-size"===this.type&&"above-and-below"===this.univariateTheme?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(e){this._set("univariateSymbolStyle",e)}get univariateTheme(){return"univariate-color-size"===this.type?this._get("univariateTheme"):null}set univariateTheme(e){this._set("univariateTheme",e)}clone(){return new h({classificationMethod:this.classificationMethod,colorRamp:s(this.colorRamp),fadeRatio:s(this.fadeRatio),fields:this.fields?.slice(),field1:s(this.field1),field2:s(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(e=>e.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};e([l({type:c.apiValues,value:null,json:{type:c.jsonValues,read:c.read,write:c.write,origins:{"web-document":{default:"manual",type:c.jsonValues,read:c.read,write:c.write}}}})],b.prototype,"classificationMethod",null),e([l({types:p,json:{write:!0}})],b.prototype,"colorRamp",void 0),e([d("colorRamp")],b.prototype,"readColorRamp",null),e([l({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],b.prototype,"fadeRatio",void 0),e([l({type:[String],value:null,json:{write:!0}})],b.prototype,"fields",null),e([l({type:o,value:null,json:{write:!0}})],b.prototype,"field1",null),e([l({type:o,value:null,json:{write:!0}})],b.prototype,"field2",null),e([l({type:v,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],b.prototype,"flowTheme",null),e([l({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],b.prototype,"focus",null),e([l({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],b.prototype,"isAutoGenerated",void 0),e([l({type:Number,value:null,json:{type:a,write:!0}})],b.prototype,"numClasses",null),e([l({type:m,json:{type:m,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],b.prototype,"lengthUnit",void 0),e([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],b.prototype,"maxSliderValue",void 0),e([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],b.prototype,"minSliderValue",void 0),e([l({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],b.prototype,"statistics",null),e([l({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],b.prototype,"standardDeviationInterval",null),e([l({type:y.apiValues,value:null,json:{type:y.jsonValues,read:y.read,write:y.write}})],b.prototype,"type",null),e([l({type:[n],json:{write:!0}})],b.prototype,"visualVariables",void 0),e([l({type:w,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],b.prototype,"univariateSymbolStyle",null),e([l({type:f,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],b.prototype,"univariateTheme",null),b=h=e([r("esri.renderers.support.AuthoringInfo")],b);export{b as default};