12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.24/esri/copyright.txt for details.
- */
- 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{toPt as r}from"../core/screenUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{enumeration as i}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{collectArcadeFieldNames as p}from"../layers/support/fieldUtils.js";import a from"./Renderer.js";import{VisualVariablesMixin as n}from"./mixins/VisualVariablesMixin.js";import m from"./support/AttributeColorInfo.js";import{OthersCategory as u}from"./support/OthersCategory.js";import{PieChartLegendOptions as y}from"./support/PieChartLegendOptions.js";import c from"../symbols/SimpleMarkerSymbol.js";import d from"../symbols/SimpleFillSymbol.js";import h from"../symbols/SimpleLineSymbol.js";let b=class extends(n(o(a))){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 u,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){return new c({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol]}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 p(t,e,o.valueExpression),o.field&&t.add(o.field)}};t([s({type:[m],json:{write:!0}})],b.prototype,"attributes",void 0),t([s({type:d,json:{default:null,write:!0}})],b.prototype,"backgroundFillSymbol",void 0),t([s({type:e,json:{write:!0}})],b.prototype,"defaultColor",void 0),t([s({type:String,json:{write:!0}})],b.prototype,"defaultLabel",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],b.prototype,"holePercentage",void 0),t([s({type:u,json:{write:!0}})],b.prototype,"othersCategory",void 0),t([s({type:y,json:{write:!0}})],b.prototype,"legendOptions",void 0),t([s({type:h,json:{default:null,write:!0}})],b.prototype,"outline",void 0),t([s({type:Number,cast:r,json:{write:!0}})],b.prototype,"size",void 0),t([i({pieChart:"pie-chart"})],b.prototype,"type",void 0),b=t([l("esri.renderers.PieChartRenderer")],b);const f=b;export{f as default};
|