| 123456789 |
- // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- // See https://js.arcgis.com/4.7/esri/copyright.txt for details.
- //>>built
- define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang ../request ../core/promiseUtils ../core/accessorSupport/decorators ../layers/support/layerSourceUtils ../renderers/support/jsonUtils ./QueryTask ./Task ./support/Query ./support/StatisticDefinition".split(" "),function(w,x,m,f,h,n,p,c,q,r,t,u,v,k){return function(l){function b(a){a=l.call(this,a)||this;a._field=null;a.checkValueRange=null;a.gdbVersion=null;a.source=null;return a}m(b,l);
- Object.defineProperty(b.prototype,"parsedUrl",{get:function(){var a=this._parseUrl(this.url);a.path+="/generateRenderer";return a},enumerable:!0,configurable:!0});b.prototype.execute=function(a,b){var d=a.classificationDefinition;a=h.mixin(a.toJSON(),{f:"json"});this._field="esri.tasks.support.ClassBreaksDefinition"===d.declaredClass?d.classificationField:d.attributeField;this.source&&(d={source:q.sourceToJSON(this.source)},a.layer=JSON.stringify(d));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);
- a.classificationDef&&(a.classificationDef=JSON.stringify(a.classificationDef));d={query:a,callbackParamName:"callback"};if(this.requestOptions||b)d=h.mixin({},this.requestOptions,b,d);return n(this.parsedUrl.path,d).then(this._handleExecuteResponse.bind(this))};b.prototype._handleExecuteResponse=function(a){var b=this,d=a&&a.data;if(d){if(!this.checkValueRange)return a=this._processRendererJSON(d),p.resolve(a);a=new t(this.url);var e=new k({statisticType:"min",onStatisticField:this._field}),g=new k({statisticType:"max",
- onStatisticField:this._field}),e=new v({outStatistics:[e,g]});return a.execute(e).then(function(a){a=a.features[0].attributes;var g=null,e=null,c;for(c in a)0===c.toLowerCase().indexOf("min")?g=a[c]:e=a[c];return b._processRendererJSON(d,g,e)})}};b.prototype._processRendererJSON=function(a,b,d){if("classBreaks"===a.type){var c=r.fromJSON(a);return{classBreaks:c.classBreakInfos.map(function(a,e){0===e&&void 0!==b&&null!==b&&(a.minValue=b);e===c.classBreakInfos.length-1&&void 0!==d&&null!==d&&(a.maxValue=
- d);return{minValue:a.minValue,maxValue:a.maxValue,label:a.label}}),normalizationTotal:c.normalizationTotal}}return{uniqueValues:a.uniqueValueInfos.map(function(c,e){0===e&&void 0!==b&&null!==b&&(c.value=b);e===a.uniqueValueInfos.length-1&&void 0!==d&&null!==d&&(c.value=d);return{count:c.count,value:c.value,label:c.label}})}};f([c.property()],b.prototype,"checkValueRange",void 0);f([c.property()],b.prototype,"gdbVersion",void 0);f([c.property()],b.prototype,"source",void 0);f([c.property({readOnly:!0,
- dependsOn:["url"]})],b.prototype,"parsedUrl",null);return b=f([c.subclass("esri.tasks.GenerateRendererTask")],b)}(c.declared(u))});
|