PieChartRenderer.js 2.8 KB

12345
  1. /*
  2. All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. See https://js.arcgis.com/4.25/esri/copyright.txt for details.
  4. */
  5. import{_ as t}from"../chunks/tslib.es6.js";import e from"../Color.js";import"../symbols.js";import{ClonableMixin as o}from"../core/Clonable.js";import{isSome as r}from"../core/maybe.js";import{toPt as s}from"../core/screenUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.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{OthersCategory as y}from"./support/OthersCategory.js";import{PieChartLegendOptions as c}from"./support/PieChartLegendOptions.js";import d from"../symbols/SimpleMarkerSymbol.js";import h from"../symbols/SimpleFillSymbol.js";import b from"../symbols/SimpleLineSymbol.js";let f=class extends(m(o(n))){constructor(t){super(t),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new e([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new y,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){return new d({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(r)}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce(((t,e)=>t+e.getAttributeHash()),"")}getMeshHash(){return this.getSymbols().reduce(((t,e)=>t+JSON.stringify(e)),"")}async collectRequiredFields(t,e){await this.collectVVRequiredFields(t,e);for(const o of this.attributes)o.valueExpression&&await a(t,e,o.valueExpression),o.field&&t.add(o.field)}};t([i({type:[u],json:{write:!0}})],f.prototype,"attributes",void 0),t([i({type:h,json:{default:null,write:!0}})],f.prototype,"backgroundFillSymbol",void 0),t([i({type:e,json:{write:!0}})],f.prototype,"defaultColor",void 0),t([i({type:String,json:{write:!0}})],f.prototype,"defaultLabel",void 0),t([i({type:Number,range:{min:0,max:1},json:{write:!0}})],f.prototype,"holePercentage",void 0),t([i({type:y,json:{write:!0}})],f.prototype,"othersCategory",void 0),t([i({type:c,json:{write:!0}})],f.prototype,"legendOptions",void 0),t([i({type:b,json:{default:null,write:!0}})],f.prototype,"outline",void 0),t([i({type:Number,cast:s,json:{write:!0}})],f.prototype,"size",void 0),t([l({pieChart:"pie-chart"})],f.prototype,"type",void 0),f=t([p("esri.renderers.PieChartRenderer")],f);const j=f;export{j as default};