UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 3.04 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import{isSome as r}from"../core/arrayUtils.js";import o from"../core/Clonable.js";import{toPt as s}from"../core/screenUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{enumeration as l}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{collectArcadeFieldNames as a}from"../layers/support/fieldUtils.js";import n from"./Renderer.js";import{VisualVariablesMixin as m}from"./mixins/VisualVariablesMixin.js";import u from"./support/AttributeColorInfo.js";import{rendererBackgroundFillSymbolProperty as y}from"./support/commonProperties.js";import{OthersCategory as c}from"./support/OthersCategory.js";import d from"./support/RendererLegendOptions.js";import b from"./visualVariables/OpacityVariable.js";import h from"./visualVariables/SizeVariable.js";import f from"./visualVariables/VisualVariable.js";import j from"../symbols/SimpleLineSymbol.js";import g from"../symbols/SimpleMarkerSymbol.js";const v={base:f,key:"type",typeMap:{size:h,opacity:b}};let S=class extends(m(o.ClonableMixin(n))){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new t([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new c,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart",this.visualVariables=null}getSymbol(){return new g({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}get symbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(r)}getAttributeHash(){return this.visualVariables?.reduce(((e,t)=>e+t.getAttributeHash()),"")??""}getMeshHash(){return this.symbols.reduce(((e,t)=>e+JSON.stringify(t)),"")}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const r of this.attributes)r.valueExpression&&await a(e,t,r.valueExpression),r.field&&e.add(r.field)}};e([i({type:[u],json:{write:!0}})],S.prototype,"attributes",void 0),e([i(y)],S.prototype,"backgroundFillSymbol",void 0),e([i({type:t,json:{write:!0}})],S.prototype,"defaultColor",void 0),e([i({type:String,json:{write:!0}})],S.prototype,"defaultLabel",void 0),e([i({type:Number,range:{min:0,max:1},json:{write:!0}})],S.prototype,"holePercentage",void 0),e([i({type:c,json:{write:!0}})],S.prototype,"othersCategory",void 0),e([i({type:d,json:{write:!0}})],S.prototype,"legendOptions",void 0),e([i({type:j,json:{default:null,write:!0}})],S.prototype,"outline",void 0),e([i({type:Number,cast:s,json:{write:!0}})],S.prototype,"size",void 0),e([l({pieChart:"pie-chart"})],S.prototype,"type",void 0),e([i({types:[v]})],S.prototype,"visualVariables",void 0),S=e([p("esri.renderers.PieChartRenderer")],S);export{S as default};