realchart 1.4.6 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/gauge.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * RealChart Gauge v1.4.6
3
+ * RealChart Gauge v1.4.7
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("realchart")):"function"==typeof define&&define.amd?define(["exports","realchart"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).RealChartGauge={},e.RealChart)}(this,(function(e,t){"use strict";function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var s=i(t);class a extends t.GaugeItem{getRange(e,t){const i=this.$_internalRanges(e);if(i)for(const e of i)if(t>=e.fromValue&&t<e.toValue)return e}_doApply(e){const t=this;var i;super._doApply(e),(i=e.ranges)!==t._ranges&&(t._ranges=i,t._runRanges=null)}$_internalRanges(e){return this._runRanges||(this._runRanges=t.buildValueRanges(this._ranges,e.minValue,e.maxValue,this._op.rangeInclusive)),this._runRanges}}a.defaults=t.extend(t.ChartItem.defaults,{rangeInclusive:!0});class n extends a{getSegmentThickness(e){return t.calcPercent(this._segmentThicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"segmentThickness")}}n.defaults=t.extend(a.defaults,{segmentGap:0});class l extends a{getThickness(e){return t.calcPercent(this._thicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"thickness")}}l.defaults=t.extend(a.defaults,{thickness:"100%",stroked:!1});class r extends t.GaugeItem{}r.defaults=t.extend(t.ChartItem.defaults,{visible:!1});class h extends t.GaugeItem{getExtents(e){return{radius:t.calcPercent(this._radiusDim,e,0),length:t.calcPercent(this._lengthDim,e,0),offset:t.calcPercent(this._offsetDim,e,0)}}_doApply(e){super._doApply(e),this._setDims(e,"radius","length","offset")}}h.defaults=t.extend(t.ChartItem.defaults,{visible:!1,radius:3,length:"100%",offset:0});class o extends t.GaugeItem{getRadius(e){return t.calcPercent(this._radiusDim,e,0)}_doApply(e){super._doApply(e),this._setDim(e,"radius")}}o.defaults=t.extend(t.ChartItem.defaults,{visible:!1,radius:5});class c extends t.GaugeScale{_getStepMultiples(e){return[1,2,2.5,5,10]}}c.defaults=t.extend(t.GaugeScale.defaults,{visible:!1,stepPixels:72});class d extends t.CircularGauge{_doInit(e){super._doInit(e),e.band=(this._band=new t.GaugeRangeBand(this)).init(),e.scale=(this._scale=new c(this)).init(),e.rim=(this._rim=new n(this)).init(),e.valueRim=(this._valueRim=new l(this)).init(),e.hand=(this._hand=new h(this)).init(),e.pin=(this._pin=new o(this)).init()}get band(){return this._band}get scale(){return this._scale}get rim(){return this._rim}get valueRim(){return this._valueRim}get hand(){return this._hand}get pin(){return this._pin}getExtents(e){const i=super.getExtents(e),s=this.scale,a=this.band;let n=i.radius;const l=n-i.inner;if(a.visible)switch(i.bandThick=a.getThickness(l),a.options.position){case"inside":i.band=n-(l-i.bandThick)/2;break;case"opposite":i.band=i.inner-a.options.gap,i.inner=i.band-i.bandThick;break;default:i.band=n+=i.bandThick+a.options.gap}if(i.scaleTick=t.maxv(1,s.tick.options.length||0),i.scaleLabel=16,"opposite"===s.options.position)i.scale=i.inner-s.options.gap,i.inner=i.scale-i.scaleTick-i.scaleLabel;else i.scale=n+s.options.gap;return i}}d.type=t.CircleGaugeType;class u extends t.CircularGaugeGroup{_gaugesType(){return"circle"}}u.type=t.CircleGaugeGroupType,u.gaugeType=t.CircleGaugeType,u.defaults=t.extend(t.CircularGaugeGroup.defaults,{innerRadius:"50%"});class _ extends t.ValueGaugeView{}class g extends t.ScaleView{setExtents(e,t){this._center=e,this._exts=t}_createLine(e,i){return new t.ArcElement(e,i)}_doMeasure(e,t,i,s,a){const n=t._steps.length-(360===t.gauge.options.sweepAngle?1:0);return this._line.setVis(t.line.visible)&&this._line.internalSetStyleOrClass(t.line._style),this._tickContainer.setVis(t.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(t.tick._style),this._ticks.prepare(n)),this._labelContainer.setVis(t.label.visible)&&(this._labelContainer.internalSetStyleOrClass(t.label._style),this._labels.prepare(n)),{width:i,height:s}}_doLayout(e){const i=this.model,s=i._steps,a=i.gauge,n=a.options,l="opposite"===i.options.position?-1:1,r=a._props,h=this._center.x,o=this._center.y,c=this._exts.scale,d=c+this.model.tick.options.length*l,u=r._sweepRad,_=r._startRad,g=n.maxValue-n.minValue,p=n.clockwise;let b,w,m,x;if(this._line.visible&&this._line.setArc(h,o,c,_,p?u:-u,p),this._tickContainer.visible&&this._ticks.forEach(((e,a,n)=>{const l=i.getRate(s[a])*(p?u:-u)+_;b=h+t.cos(l)*c,w=o+t.sin(l)*c,m=h+t.cos(l)*d,x=o+t.sin(l)*d,e.setLine(b,w,m,x)})),this._labelContainer.visible){this._labels.get(0).setText(String(n.maxValue));const e=d+.2*this._labels.get(0).getBBox().height*l;this._labels.forEach(((a,r)=>{const c=i.getRate(s[r])*(p?u:-u)+_;a.setText(String(t.fixnum(n.minValue+i.getRate(s[r])*g))),a.setContrast(null).layout("center");const d=a.getBBox();m=h+t.cos(c)*(e+d.width/2*l)-d.width/2,x=o+t.sin(c)*(e+d.height/2*l)-d.height/2,a.trans(m,x)}))}}}let p=class extends t.ChartElement{constructor(e){super(e,"rct-circle-gauge-band"),this._sectorViews=new t.ElementPool(this,t.SectorElement),this.add(this._labelContainer=new t.LayerElement(e,"rct-circle-gauge-band-tick-labels")),this._labels=new t.ElementPool(this._labelContainer,t.TextElement)}setExtends(e,t){this._center=e,this._exts=t}_doLayout(e){const t=this.model,i=t.gauge,s=i.scale,a=i._props,n=this._center.x,l=this._center.y,r=this._exts.band,h=i.options.clockwise,o=1-this._exts.bandThick/r,c=t.getRanges(),d=a._sweepRad;i.options.maxValue,i.options.minValue;let u=a._startRad;this._sectorViews.prepare(c.length).forEach(((e,t)=>{const i=s.getRate(c[t].toValue-c[t].fromValue)*d;e.setSector({cx:n,cy:l,rx:r,ry:r,innerRadius:o,start:u,angle:i,clockwise:h}),e.internalClearStyleAndClass(),e.setFill(c[t].color),c[t].style&&e.addStyleOrClass(c[t].style),u+=h?i:-i}))}};class b extends t.PathElement{render(e,i){const s=e.getRadius(i);return s!==this._radius&&(this._radius=s,this.setPath((new t.PathBuilder).circle(0,0,s).end())),this.internalSetStyleOrClass(e._style),this}}class w extends t.PathElement{render(e,i){const s=e.getExtents(i);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const e=this._radius=s.radius,i=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new t.PathBuilder;s.move(-e,i).line(0,-this._length+i).line(e,i),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(e._style),this}}class m extends _{constructor(e){super(e,"rct-circle-gauge")}_doInitContents(e,i){i.add(this._rimView=new t.SectorElement(e,"rct-circle-gauge-rim")),i.add(this._valueView=new t.SectorElement(e,"rct-circle-gauge-value")),i.add(this._innerView=new t.SectorElement(e,"rct-circle-gauge-inner")),i.add(this._textView=new t.TextElement(e,"rct-circle-gauge-label")),i.add(this._handContainer=new t.LayerElement(e,void 0)),i.add(this._scaleView=new g(e)),i.add(this._bandView=new p(e))}_backgroundView(){return this._rimView}_prepareGauge(e,t){this._rimView.setVis(t.rim.visible),this._scaleView.setVis(t.scale.visible),this._bandView.setVis(t.band.visible),this._valueView.setVis(t.valueRim.visible),t.hand.visible?(this._handView||this._handContainer.add(this._handView=new w(e,"rct-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),t.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new b(e,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVis(t.labelVisible())&&this._textView.setStyleOrClass(t.label._style)}_renderGauge(e,i){const s=this.model,a=s.getCenter(e,i),n=s.getExtents(t.minv(e,i));this.$_renderBackground(s,a,n),this._renderValue()}_renderValue(){const e=this.model,i=e.options,s=e.scale,a=e.getProps(),n=e.getValue(),l=s.getRate(t.pickNum(n,0)),r=this._center,h=this._exts,o=e.valueRim.getThickness(h.radiusThick),c=this._textView;if(this._valueView.visible){const s=e.valueRim,c=s.options,d=s.getRange(i,n),u=h.value+(c.stroked?0:o/2),_=this._valueView;_.setStyleOrClass(s._style),d&&(_.setStyle(c.stroked?"stroke":"fill",d.color),d.style&&_.addStyleOrClass(d.style)),c.stroked&&(_.setFill("none"),_.setStyle("strokeWidth",t.pixel(o))),_.setBoolData("stroked",c.stroked),_.setSectorEx({cx:r.x,cy:r.y,rx:u,ry:u,innerRadius:(u-o)/u,start:a._startRad,angle:a._sweepRad*l,clockwise:i.clockwise},c.stroked)}if(this._handView){const i=(a._handRad+a._sweepRad*l)*t.RAD_DEG;this._handView.render(e.hand,h.radius).transp(r).rotate(e.options.clockwise?i:-i)}if(c.visible){const t=e.label;if(t.setText(e.getLabel(t,t.options.animatable?n:i.value)),c.text=t.options.text,t.buildSvg(c,null,NaN,NaN,e,t._domain),c.setBoolData("grouped",!!e._group),e._group)this.$_layoutGroupedLabel(e,c,h);else{const e=c.getBBox(),i=t.getOffset(this.width,this.height);c.trans(r.x+i.x,r.y-e.height/2+i.y)}}}$_renderBackground(e,t,i){const s=e.getProps(),a=s._startRad;this._center=t,this._exts=i,e.scale.buildSteps(i.scale*s._sweepRad,NaN),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(e.rim._style),this._rimView.setSector({cx:t.x,cy:t.y,rx:i.radius,ry:i.radius,innerRadius:1-i.radiusThick/i.radius,start:a,angle:s._sweepRad,clockwise:e.options.clockwise})),this._scaleView.visible&&(this._scaleView.setStyleOrClass(e.scale._style),this._scaleView.measure(this.doc,e.scale,this.width,this.height,0),this._scaleView.setExtents(t,i),this._scaleView.layout()),this._bandView.visible&&(this._bandView.setStyleOrClass(e.band._style),this._bandView.measure(this.doc,e.band,this.width,this.height,0),this._bandView.setExtends(t,i),this._bandView.layout()),this._innerView.setStyleOrClass(e.options.innerStyle);let n=i.inner;const l=getComputedStyle(this._innerView.dom),r=parseFloat(l.strokeWidth);r>1&&(n-=r/2),this._innerView.setSector({cx:t.x,cy:t.y,rx:n,ry:n,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(e.pin,n).trans(t.x,t.y)}$_layoutGroupedLabel(e,i,s){const a=i.getBBox(),n=this._rimView.getBBox(),l=+e._group.options.labelGap||0;i.anchor=t.TextAnchor.END,i.trans(n.x+n.width/2-l,n.y+(s.radius-s.inner-a.height)/2)}}class x extends t.GaugeGroupView{constructor(e){super(e,"rct-circle-gauge-group")}_createPool(e){return new t.ElementPool(e,m)}_doRenderGauges(e,i,s,a){const n=this.doc,l=this.model,r=l.props.getCenter(s,a),h=l.props.getExtents(t.minv(s,a));l.setChildExtents(h),s=a=2*h.radius,i.forEach(((e,t)=>{e.measure(n,l.getVisible(t),s,a,0),e.resize(s,a),e.layout()})),e.trans(r.x-h.radius,r.y-h.radius)}}class y extends t.GaugeScale{}class V extends t.GaugeLabel{getWidth(e){return t.calcPercent(this._widthDim,e)}getHeight(e){return t.calcPercent(this._heightDim,e)}getMaxWidth(e){return t.calcPercent(this._maxWidthDim,e)}getMaxHeight(e){return t.calcPercent(this._maxHeightDim,e)}getGap(e){return t.calcPercent(this._gapDim,e,0)}_doApply(e){super._doApply(e),this._setDims(e,"width","height","maxWidth","maxHeight","gap")}}V.defaults=t.extend(t.GaugeLabel.defaults,{maxWidth:"30%",maxHeight:"30%",gap:10});class v extends t.ValueGauge{_doInit(e){super._doInit(e),e.label=(this._label=new V(this.chart)).init(),e.scale=(this._scale=new y(this)).init()}get label(){return this._label}get scale(){return this._scale}isVertical(){return this._group?this._group.options.vertical:this._op.vertical}scaleVisible(){return!this._group&&this._scale.visible}calcedMinMax(){return this._scale.range()}_doPrepareRender(e){super._doPrepareRender(e),this._label._prepareRender()}}v.defaults=t.extend(t.ValueGauge.defaults,{reversed:!1});class f extends t.GaugeItem{constructor(){super(...arguments),this._args={gauge:null,value:NaN}}getStyle(e,t){if(this._op.styleCallback){this._args.gauge=e,this._args.value=t;return this._op.styleCallback(this._args)}}}class k extends v{_doInit(e){super._doInit(e),e.valueBar=(this._valueBar=new f(this)).init(),e.band=(this._band=new t.GaugeRangeBand(this)).init()}get valueBar(){return this._valueBar}get band(){return this._band}}k.type=t.LinearGaugeType;class C extends t.ChartItem{}C.defaults=t.extend(t.ChartItem.defaults,{opposite:!1,gap:10});class S extends V{}S.defaults=t.extend(V.defaults,{gap:10});class E extends t.GaugeGroup{_doInit(e){super._doInit(e),e.label=(this._label=new S(this.chart)).init(),e.itemLabel=(this._itemLabel=new C(this.chart)).init(),e.scale=(this._scale=new y(this)).init()}get label(){return this._label}get itemLabel(){return this._itemLabel}get scale(){return this._scale}calcedMinMax(){return this.scale.range()}}E.defaults=t.extend(t.GaugeGroup.defaults,{vertical:!1,itemGap:10});class R extends E{_doInit(e){super._doInit(e),e.band=(this._band=new t.GaugeRangeBand(this)).init()}get band(){return this._band}_gaugesType(){return"linear"}_doPrepareRender(e){super._doPrepareRender(e),this.band.visible&&this.band._prepareRender()}}R.type=t.LinearGaugeGroupType,R.gaugeType=t.LinearGaugeType;class G extends t.ScaleView{_createLine(e,i){return new t.LineElement(e,i)}_doMeasure(e,i,s,a,n){const l=i.options,r=i._reversed,h=i._vertical,o=i.label,c=i.tick,d=i._steps,u=d.length;let _=h?l.gap:s,g=h?a:l.gap;if(this._tickContainer.setVis(c.visible)&&(this._tickContainer.setStyleOrClass(c._style),this._ticks.prepare(u)),h?_+=c.options.length:g+=c.options.length,this._labelContainer.setVis(o.visible)&&(this._labels.prepare(u,(t=>{t.setModel(e,o,null,null)})),u>0))if(h){let e=0;this._labels.forEach(((i,s)=>{i.setText(o.getText(d[r?s:u-1-s])),e=t.maxv(i.getBBox().width)})),_+=e}else{let e=0;this._labels.forEach(((i,s)=>{i.setText(o.getText(d[r?u-1-s:s])),e=t.maxv(i.getBBox().height)})),g+=e}return{width:_,height:g}}_doLayout(){const e=this.model;e._vertical?this.$_layoutVert(e,this.width,this.height):this.$_layoutHorz(e,this.width,this.height)}$_layoutHorz(e,t,i){const s=e.options,a=this._line,n=e.tick,l=e._steps;l.length;const r="opposite"===s.position,h=r?-n.options.length:n.options.length;let o,c=r?i-s.gap:s.gap;if(a.setVis(e.line.visible)&&(a.setStyleOrClass(e.line._style),a.setHLine(c,0,t)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((i,s)=>{o=e.getRate(l[s])*t,i.setVLine(o,c,c+h)})),this._labelContainer.visible){const i=this._labelContainer.textAlign()||"center";let s=Number.MIN_SAFE_INTEGER;c=r?0:c+h,this._labels.forEach(((a,n)=>{a.layout(i);const r=a.getBBox();o=e.getRate(l[n])*t,a.setVis(o-r.width/2>s)&&(a.trans(o-r.width/2,c),s=o+r.width/2)}))}}$_layoutVert(e,t,i){const s=e.options,a=this._line,n=e.tick,l=e._steps;this.height,l.length;const r="opposite"===s.position,h=r?n.options.length:-n.options.length;let o,c=r?s.gap:t-s.gap;if(a.setVis(e.line.visible)&&(a.setStyleOrClass(e.line._style),a.setVLine(c,0,i)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((t,s)=>{o=e.getRate(l[s])*i,t.setHLine(o,c,c+h)})),this._labelContainer.visible){const a=this._labelContainer.textAlign()||(r?"left":"right");c=r?c+h:t-s.gap+h,this._labels.forEach(((t,s)=>{t.layout(a);const n=t.getBBox(),h=r?c:c-n.width;o=e.getRate(l[s])*i,t.trans(h,o-n.height/2)}))}}}class B extends t.ValueGaugeView{_measureLabelSize(e,i,s){const a=e.label,n=this.labelView();return a.setText(e.getLabel(a,e.options.value)),n.text=a.options.text,a.buildSvg(n,null,i,s,e,a._domain),t.rectToSize(n.getBBox())}_renderGauge(e,i){const s=this.model,a=t.pickNum(s._runValue,s.options.value);this._measureGauge(s,s.label,this.labelView(),a,s.isVertical(),e,i),this._renderValue()}_renderValue(){const e=this.model,i=e.label,s=e.scale,a=this.labelView(),n=t.pickNum(e._runValue,e.options.value),l=t.assignObj({},this._rBand);if(this._renderScale(l),this.background().setRect(l),l.height>0&&this._renderBand(e,l,n),"top"!==i._runPos&&"bottom"!==i._runPos||(this._rLabel.height=l.height),this._renderLabel(e,i,a,n),!this._vertical&&("left"===i._runPos||"right"===i._runPos)&&s.visible&&"opposite"===s.options.position){const e=a.getBBox();a.ty+e.height>this.height&&a.transY(t.maxv(0,this.height-e.height))}}_measureGauge(e,i,s,a,n,l,r){const h=this._rBand=t.createRect(0,0,l,r);if(this._vertical=e._group instanceof E?e._group.options.vertical:n,i.visible){const n=i._runPos=t.pickProp(i.options.position,this._vertical?"top":"left"),o=i._runVert="top"===n||"bottom"===n,c=e._group?e._group.itemLabel.options.gap:i._runGap=i.getGap(o?r:l);let d=o?l:i.getWidth(l),u=o?i.getHeight(r):r;const _=o?l:i.getMaxWidth(l),g=o?i.getMaxHeight(r):r,p=this._rLabel=t.createRect(0,0,l,r);s.setStyleOrClass(i._style),i.setText(e.getLabel(i,i.options.animatable?a:e.options.value)),s.text=i.options.text,i.buildSvg(s,null,t.pickNum(d,_),t.pickNum(u,g),e,i._domain);const b=s.getBBox();switch(o?(p.height=t.pickNum(u,b.height),h.height=t.maxv(0,h.height-(p.height+c))):(p.width=t.pickNum(d,b.width),this._wLabel=e._group?e._group._labelWidth:p.width,h.width=t.maxv(0,h.width-(this._wLabel+c))),n){case"top":h.y=p.height+c;break;case"bottom":p.y=h.height+c;break;case"right":p.x=h.width+c;break;default:h.x=this._wLabel+c}}else this._rLabel=null}_renderLabel(e,i,s,a){if(s.visible){const e=this._rLabel,a=s.getBBox();let n=e.x,l=e.y;switch(i._runPos){case"top":case"bottom":n+=e.width/2;break;case"right":n=this.width-e.width,s.anchor=t.TextAnchor.START,l+=t.maxv(0,(e.height-a.height)/2);break;default:s.anchor=t.TextAnchor.END,n+=this._wLabel,l+=t.maxv(0,(e.height-a.height)/2)}s.trans(n,l)}}_renderScale(e){const i=this.model,s=i.label,a=i.scale,n=this.scaleView(),l=this._vertical?e.height:e.width;let r,h;if(a._vertical=this._vertical,a._reversed=i.options.reversed,isNaN(i._runValue)&&a.buildSteps(l,i.options.value),n.setVis(i.scaleVisible())){const i=n.measure(this.doc,a,e.width,e.height,1);this._vertical?(r=0,h=e.y,e.width=t.maxv(0,e.width-i.width),"opposite"===a.options.position?r=e.x+e.width:(s._runVert||(r=e.x),e.x+=i.width)):(r=e.x,e.height=t.maxv(0,e.height-i.height),"opposite"===a.options.position?s._runVert?(h=e.y,e.y+=i.height):(this._rLabel.y=e.y+=i.height,h=e.y-i.height):h=e.y+e.height),n.resizeByMeasured().layout().trans(r,h)}}}class T extends t.ChartElement{constructor(e){super(e,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._labelGap=3,this._barViews=new t.ElementPool(this,t.RectElement),this.add(this._labelContainer=new t.LayerElement(e,"rct-linear-gauge-band-tick-labels")),this._labels=new t.ElementPool(this._labelContainer,t.TextElement)}_doMeasure(e,i,s,a,n){const l=i.gauge,r=this._vertical=l instanceof k?l.isVertical():l.options.vertical,h="inside"===i.options.position,o=this._thick=h?r?s:a:i.getThickness(r?s:a)+(this._gap=t.pickNum(i.options.gap,0));let c=r?o:s,d=r?a:o;const u=this._ranges=i.getRanges();if(this._labelContainer.setVis(i.tickLabel.visible&&u.length>0)){const e=[u[0].fromValue].concat(u.map((e=>e.toValue)));if(this._labelContainer.setStyleOrClass(i.tickLabel._style),this._labels.prepare(u.length+1),r){let i=0;this._labels.forEach(((s,a)=>{s.text=String(e[a]),i=t.maxv(s.getBBox().width)})),c+=i+this._labelGap}else{let i=0;this._labels.forEach(((s,a)=>{s.text=String(e[a]),i=t.maxv(s.getBBox().height)})),d+=i}}return{width:c,height:d}}_doLayout(e){const t=this.model,i=t.gauge,s=i.scale,a=s._max-s._min;this._labelContainer.setVis(this.$_layoutBars(i,a,this._ranges)&&this._labelContainer.visible&&"inside"!==t.options.position)&&this.$_layoutLabels(i,a,this._ranges)}$_layoutBars(e,t,i){if(this._barViews.prepare(i.length),!this._barViews.isEmpty&&t>0){const e=this._vertical,s="inside"===this.model.options.position,a="opposite"===this.model.options.position,n=this.width,l=this.height,r=e?l:n,h=this._thick;let o=0;return this._barViews.prepare(i.length).forEach(((c,d)=>{const u=i[d],_=r*(u.toValue-u.fromValue)/t;if(e){const e=s||a?0:n-h;c.setBounds(e,l-o-_,h,_)}else{const e=a?l-h:0;c.setBounds(o,e,_,this._thick)}c.internalClearStyleAndClass(),c.setFill(u.color),u.style&&c.addStyleOrClass(u.style),o+=_})),!0}}$_layoutLabels(e,i,s){const a="opposite"===this.model.options.position;if(this._vertical){const e=this.height,n=a?t.TextAnchor.START:t.TextAnchor.END,l=a?this._thick+this._labelGap:this.width-this._thick-this._labelGap;let r=this._labels.get(0);r.anchor=n,r.trans(l,e-r.getBBox().height/2);for(let t=1;t<=s.length;t++){const a=e-e*s[t-1].toValue/i;r=this._labels.get(t),r.anchor=n,r.trans(l,a-r.getBBox().height/2)}}else{const e=this.width,t=a?0:this._thick;this._labels.get(0).trans(0,t);for(let a=1;a<=s.length;a++){const n=e*s[a-1].toValue/i;this._labels.get(a).trans(n,t)}}}}class L extends B{constructor(e){super(e,"rct-linear-gauge")}_doInitContents(e,i){i.add(this._background=new t.RectElement(e,"rct-linear-gauge-background")),i.add(this._bandView=new T(e)),i.add(this._scaleView=new G(e)),i.add(this._valueView=new t.RectElement(e,"rct-linear-gauge-value")),i.add(this._labelView=new t.TextElement(e))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(e,t){}_renderScale(e){const t=this.model.band,i=this._bandView;if(super._renderScale(e),i.setVis(t.visible)){const s=+t.options.gap||0,a=i.measure(this.doc,t,e.width,e.height,1);i.resizeByMeasured().layout(),this._vertical?"inside"===t.options.position?i.trans(e.x,e.y):"opposite"===t.options.position?(i.trans(e.x+e.width-a.width,e.y),e.width-=a.width+s):(i.trans(e.x,e.y),e.width-=a.width+s,e.x+=a.width+s):"inside"===t.options.position?i.trans(e.x,e.y):"opposite"===t.options.position?(i.trans(e.x,e.y),e.height-=a.height+s,e.y+=a.height+s):(i.trans(e.x,e.y+e.height-a.height),e.height-=a.height+s)}}_renderBand(e,i,s){const a=this._valueView,n=e.options.reversed,l=e.valueBar,r=e._group?e._group.scale:e.scale;if(a.setVis(!t.isEmptyRect(i)&&l.visible&&!r.isEmpty()&&!isNaN(e.options.value)))if(a.setStyleOrClass(l._style),a.internalSetStyleOrClass(l.getStyle(e,s)),this._vertical){const e=i.height*r.getRate(s),t=n?i.y:i.y+i.height-e;a.setBounds(i.x,t,i.width,e)}else{const e=i.width*r.getRate(s),t=n?i.x+i.width-e:i.x;a.setBounds(t,i.y,e,i.height)}}}class P extends t.GaugeGroupView{constructor(e,t){super(e,t)}_doInitContents(e,i){super._doInitContents(e,i),i.insertFirst(this._scaleView=new G(e)),i.insertFirst(this._textView=new t.TextElement(e,"rct-linear-gauge-group-label"))}_prepareGauge(e,t){this._textView.setVis(t.label.visible)&&this._textView.setStyleOrClass(t.label._style),this._scaleView.setVis(t.scale.visible)&&this._scaleView.setStyleOrClass(t.scale._style),super._prepareGauge(e,t)}_doRenderGauges(e,i,s,a){const n=this.model,l=n.options,r=this._textView,h=t.createRect(0,0,s,a);if(r.visible){r.text=n.label.options.text,n.label.buildSvg(r,null,NaN,NaN,n,null);const e=this._textView.getBBox().height+n.label.getGap(a);h.y+=e,h.height-=e,r.trans(this.width/2,0)}n._labelWidth=n._labelHeight=0,this._gaugeViews.forEach(((e,i)=>{const l=e._measureLabelSize(n.get(i),s,a);n._labelWidth=t.maxv(n._labelWidth,l.width),n._labelHeight=t.maxv(n._labelHeight,l.height)}));const o=t.copyObj(h),c=n.itemLabel.options.gap;l.vertical?(o.height-=n._labelHeight+c,n.itemLabel.options.opposite||(o.y+=n._labelHeight+c)):(o.width-=n._labelWidth+c,n.itemLabel.options.opposite||(o.x+=n._labelWidth+c)),this._renderScale(n,h,o),l.vertical?this.$_layoutVert(this.doc,n,i,h):this.$_layoutHorz(this.doc,n,i,h)}_renderScale(e,t,i){const s=this._scaleView,a=e.scale,n=e.options.vertical,l=n?t.height:t.width,r=[];let h,o;if(this._gaugeViews.forEach(((t,i)=>{r.push(e.get(i).getValue())})),a.buildGroupSteps(l,r),a._vertical=n,s.setVis(a.visible)){const e=s.measure(this.doc,a,i.width,i.height,1);if(n){const s=e.width;i.width-=s,t.width-=s,o=i.y,"opposite"===a.options.position?h=i.x+i.width:(h=i.x,i.x+=s,t.x+=s)}else{const s=e.height;i.height-=s,t.height-=s,h=i.x,"opposite"===a.options.position?(o=i.y,i.y+=s,t.y+=s):o=i.y+i.height}s.resizeByMeasured().layout().trans(h,o)}}$_layoutVert(e,t,i,s){const a=s.height,n=(s.width-t.options.itemGap*(i.count-1))/i.count,l=s.y;let r=s.x;i.forEach(((i,s)=>{i.measure(e,t.get(s),n,a,0),i.resize(n,a),i.layout(),i.trans(r,l),r+=n+t.options.itemGap}))}$_layoutHorz(e,t,i,s){const a=t.options.itemGap,n=s.width,l=(s.height-a*(i.count-1))/i.count,r=s.x;let h=s.y;i.forEach(((i,s)=>{i.measure(e,t.get(s),n,l,0),i.resize(n,l),i.layout(),i.trans(r,h),h+=l+a}))}}class I extends P{constructor(e){super(e,"rct-linear-gauge-group")}_doInitContents(e,t){super._doInitContents(e,t),t.insertChild(this._bandView=new T(e),this._scaleView)}_createPool(e){return new t.ElementPool(e,L)}_renderScale(e,t,i){super._renderScale(e,t,i);const s=this._bandView,a=e.band;let n,l;if(s.setVis(a.visible)){const r=+a.options.gap||0,h=s.measure(this.doc,a,i.width,i.height,1);if(e.options.vertical){const e=h.width+r;i.width-=e,t.width-=e,l=i.y,"opposite"===a.options.position?n=i.x+i.width+r:(n=i.x,i.x+=e,t.x+=e)}else{const e=h.height+r;i.height-=e,t.height-=e,n=i.x,"opposite"===a.options.position?(l=i.y,i.y+=e,t.y+=e):l=i.y+i.height+r}s.resizeByMeasured().layout().trans(n,l)}}}class D extends t.ChartItem{constructor(e){super(e.chart),this.gauge=e}getRanges(){var e;return null===(e=this.$_internalRanges())||void 0===e?void 0:e.slice(0)}_doApply(e){const t=this;var i;super._doApply(e),(i=e.ranges)!==t._ranges&&(t._ranges=i,t._runRanges=null)}$_internalRanges(){if(!this._runRanges){const e=this.gauge.options;this._runRanges=t.buildValueRanges(this._ranges,e.minValue,e.maxValue,this._op.rangeInclusive)}return this._runRanges}}D.defaults=t.extend(t.ChartItem.defaults,{vertical:!0,rangeInclusive:!0});class O extends t.GaugeItem{}O.defaults=t.extend(t.ChartItem.defaults,{visible:!0});class N extends f{}class A extends v{_doInit(e){super._doInit(e),e.band=(this._band=new D(this)).init(),e.targetBar=(this._targetBar=new O(this)).init(),e.valueBar=(this._valueBar=new N(this)).init()}get band(){return this._band}get targetBar(){return this._targetBar}get valueBar(){return this._valueBar}getRanges(e,i,s){return t.buildValueRanges(this._op.ranges,e,i,t.pickProp(s,this._op.rangeInclusive))}}A.type=t.BulletGaugeType,A.defaults=t.extend(v.defaults,{rangeInclusive:!0});class H extends E{getRanges(e,i,s){return t.buildValueRanges(this._op.ranges,e,i,t.pickProp(s,this._op.rangeInclusive))}_gaugesType(){return"bullet"}}H.type=t.BulletGaugeGroupType,H.gaugeType=t.BulletGaugeType,H.defaults=t.extend(E.defaults,{rangeInclusive:!0});class $ extends B{constructor(e){super(e,"rct-bullet-gage")}_doInitContents(e,i){i.add(this._background=new t.RectElement(e,"rct-bullet-gauge-background")),i.add(this._barContainer=new t.LayerElement(e,void 0)),this._barViews=new t.ElementPool(this._barContainer,t.RectElement),i.add(this._valueView=new t.RectElement(e,"rct-bullet-gauge-value")),i.add(this._targetView=new t.RectElement(e,"rct-bullet-gauge-target")),i.add(this._scaleView=new G(e)),i.add(this._labelView=new t.TextElement(e))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(e,t){}_renderBand(e,i,s){const a=e.options,n=e._group,l=e.options.reversed,r=this._vertical,h=n?n.scale:e.scale,o=this._valueView,c=this._targetView;if(this._barContainer.setVis(!t.isEmptyRect(i)&&!h.isEmpty())){const t=e.getRanges(h._min,h._max,!1)||(null==n?void 0:n.getRanges(h._min,h._max,!1));t&&(this._barContainer.setRect(i),this._barViews.prepare(t.length),r?this._barViews.forEach(((e,s)=>{const a=t[s],n=i.height*h.getRate(a.toValue-a.fromValue),r=i.height*h.getRate(a.fromValue);e.setBounds(0,l?r:i.height-r-n,i.width,n),e.internalClearStyleAndClass(),e.setFill(a.color),a.style&&e.addStyleOrClass(a.style)})):this._barViews.forEach(((e,s)=>{const a=t[s],n=i.width*h.getRate(a.toValue-a.fromValue),r=i.width*h.getRate(a.fromValue);e.setBounds(l?i.width-n-r:r,0,n,i.height),e.internalClearStyleAndClass(),e.setFill(a.color),a.style&&e.addStyleOrClass(a.style)})))}if(o.setVis(e.valueBar.visible&&!h.isEmpty()&&!isNaN(s)))if(o.setStyleOrClass(e.valueBar._style),s<a.targetValue&&e.valueBar.options.belowStyle&&o.internalSetStyleOrClass(e.valueBar.options.belowStyle),o.internalSetStyleOrClass(e.valueBar.getStyle(e,s)),r){const e=i.height*h.getRate(s),t=l?i.y:i.y+i.height-e;o.setBounds(i.x+i.width/3,t,i.width/3,e)}else{const e=i.width*h.getRate(s),t=l?i.x+i.width-e:i.x;o.setBounds(t,i.y+i.height/3,e,i.height/3)}if(c.setVis(e.targetBar.visible&&!h.isEmpty()&&!isNaN(a.targetValue)))if(c.setStyleOrClass(e.targetBar._style),r&&i.width>10){let e=i.height*h.getRate(a.targetValue);e=l?i.y+e:i.y+i.height-e,c.setBounds(i.x+5,e-1,i.width-10,3)}else if(!r&&i.height>10){let e=i.width*h.getRate(a.targetValue);e=l?i.x+i.width-e:i.x+e,c.setBounds(e-1,i.y+5,3,i.height-10)}}}class M extends P{constructor(e){super(e,"rct-bullet-gauge-group")}_createPool(e){return new t.ElementPool(e,$)}}class z extends t.GaugeItem{getThickness(e){return t.calcPercent(this._thicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"thickness")}}z.defaults=t.extend(t.ChartItem.defaults,{thickness:7});class W extends t.GaugeItem{getLength(e){return t.calcPercent(this._lengthDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"length")}}W.defaults=t.extend(t.ChartItem.defaults,{thickness:7,length:"60%"});class F extends W{}F.defaults=t.extend(W.defaults,{thickness:5,length:"85%"});class j extends W{}j.defaults=t.extend(W.defaults,{thickness:2,length:"95%",animatable:!1,duration:200});class Y extends t.GaugeItem{constructor(e,t){super(e),this.length=t}}class X extends t.GaugeItem{}X.defaults=t.extend(t.ChartItem.defaults,{step:1,offset:1});class U extends t.GaugeItem{constructor(e,t){super(e),this.raidus=t}}class q extends t.ChartText{constructor(e){super(e.chart)}}q.defaults=t.extend(t.ChartText.defaults,{text:"RealChart Clock<br>ver1.0",position:"top"});class J extends t.Gauge{_doInit(e){super._doInit(e),e.rim=(this.rim=new z(this)).init(),e.hourHand=(this.hourHand=new W(this)).init(),e.minuteHand=(this.minuteHand=new F(this)).init(),e.secondHand=(this.secondHand=new j(this)).init(),e.tick=(this.tick=new Y(this,10)).init(),e.minorTick=(this.minorTick=new Y(this,5)).init(),e.tickLabel=(this.tickLabel=new X(this)).init(),e.pin=(this.pin=new U(this,5)).init(),e.label=(this.label=new q(this)).init()}getTime(){const e=this._op;return e.time instanceof Date?e.time:t.isString(e.time)?new Date(e.time):isNaN(e.time)?void 0:new Date(e.time)}getExtents(e,i){const s=t.minv(e,i);return{cx:t.calcPercent(this._centerXDim,e,e/2),cy:t.calcPercent(this._centerYDim,i,i/3),rd:t.calcPercent(this._radiusDim,s,s/2)}}_doApply(e){const i=this;var s,a,n;super._doApply(e),s=e.centerX,a=e.centerY,n=e.radius,(i._centerXDim||s!==i._centerX)&&(i._centerXDim=t.parsePercentSize(t.pickProp(i._centerX=s,t.CircularGauge.DEF_CENTER),!0)),i._centerYDim&&a===i._centerY||(i._centerYDim=t.parsePercentSize(t.pickProp(i._centerY=a,t.CircularGauge.DEF_CENTER),!0)),i._radiusDim&&n===i._radius||(i._radiusDim=t.parsePercentSize(t.pickProp(i._radius=n,t.CircularGauge.DEF_RADIUS),!0))}}J.type=t.ClockGaugeType,J.defaults=t.extend(t.Gauge.defaults,{centerX:"50%",centerY:"50%",radius:"40%",active:!0});class K extends t.RcAnimation{constructor(e){super(),this.view=e}_doUpdate(e){return this.view._secRate=e,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class Q extends t.GaugeView{constructor(e){super(e,"rct-clock-gauge"),this._rimThick=0,this._secRate=1}_doInitContents(e,i){i.add(this._faceView=new t.CircleElement(e,"rct-clock-gauge-face")),i.add(this._rimView=new t.SectorElement(e,"rct-clock-gauge-rim")),i.add(this._labelView=new t.TextElement(e,"rct-clock-gauge-label")),this._labelView.layout=t.TextLayout.MIDDLE,i.add(this._tickContainer=new t.LayerElement(e,"rct-clock-gauge-ticks")),i.add(this._tickLabelContainer=new t.LayerElement(e,"rct-clock-gauge-tick-labels")),i.add(this._hourView=new t.PathElement(e,"rct-clock-gauge-hour")),i.add(this._minuteView=new t.PathElement(e,"rct-clock-gauge-minute")),i.add(this._secondView=new t.PathElement(e,"rct-clock-gauge-second")),i.add(this._pinView=new t.CircleElement(e,"rct-clock-gauge-pin")),this._tickViews=new t.ElementPool(this._tickContainer,t.LineElement,"rct-clock-gauge-tick"),this._minorTickViews=new t.ElementPool(this._tickContainer,t.LineElement,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new t.ElementPool(this._tickLabelContainer,t.TextElement,"rct-clock-gauge-tick-label")}_prepareGauge(e,i){this._tickViews.prepare(i.tick.visible?12:0),this._minorTickViews.prepare(i.minorTick.visible?48:0);const s=Math.round(12/t.maxv(1,Math.floor(i.tickLabel.options.step)||1));this._tickLabelViews.prepare(i.tickLabel.visible?s:0,(e=>{e.layout=t.TextLayout.MIDDLE}))}_renderGauge(e,i){const s=this.model,a=this._exts=s.getExtents(e,i);this._secRate=1,this.$_renderFace(s,a),this.$_renderHands(s,a),s.options.active&&!s.getTime()?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(this.model,this._exts),t.absv(e-this._prevSec)>=1&&this._secondView.visible&&s.chart.animatable()&&s.secondHand.options.animatable&&this.$_moveSecond(e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(e,i){const s=this._labelView,a=this._rimView,n=this._minorTickViews,l=this._tickLabelViews,r=this._pinView,{cx:h,cy:o,rd:c}=i,d=this._rimThick=a.visible?e.rim.getThickness(c):0;this._faceView.setCircle(h,o,c),a.setVis(e.rim.visible)&&(a.internalSetStyleOrClass(e.rim._style),a.setSector({cx:h,cy:o,rx:c,ry:c,innerRadius:1-d/c,start:0,angle:2*Math.PI,clockwise:!0}));const u=c-d;let _=u-e.tick.length,g=t.ORG_ANGLE,p=t.PI_2/12;if(this._tickViews.forEach(((i,s)=>{i.setLine(h+t.cos(g)*u,o+t.sin(g)*u,h+t.cos(g)*_,o+t.sin(g)*_),i.internalSetStyleOrClass(e.tick._style),g+=p})),!n.isEmpty){let i=0;_=u-e.minorTick.length,g=t.ORG_ANGLE,p=t.PI_2/60,n.forEach((s=>{i%5==0&&(g+=p,i++),s.setLine(h+t.cos(g)*u,o+t.sin(g)*u,h+t.cos(g)*_,o+t.sin(g)*_),s.internalSetStyleOrClass(e.minorTick._style),g+=p,i++}))}if(!l.isEmpty){const i=12/l.count,s=t.PI_2/12*i;g=t.ORG_ANGLE,l.get(0).text="12",_=u-(e.tick.length+e.tickLabel.options.offset||0),_-=.5*l.get(0).getBBox().height,l.forEach(((a,n,l)=>{a.text=String(0===n?12:n*i),a.trans(h+t.cos(g)*_,o+t.sin(g)*_),a.internalSetStyleOrClass(e.tickLabel._style),g+=s}))}r.setVis(e.pin.visible)&&(r.setCircle(h,o,e.pin.raidus),r.setStyleOrClass(e.pin._style)),s.setVis(e.label.visible)&&(s.internalSetStyleOrClass(e.label._style),e.label.buildSvg(s,null,NaN,NaN,null,null),"bottom"===e.label.options.position?s.trans(h,o+_/2):s.trans(h,o-_/2))}$_getNow(){const e=this.model.options.timezone;let t=this.model.getTime()||new Date;if(!isNaN(e)){const i=t.getMinutes()+(t.getTimezoneOffset()+e);t.setMinutes(i)}return t}$_renderHands(e,i){const s=this.$_getNow(),a=s.getHours(),n=s.getMinutes(),l=s.getSeconds(),{cx:r,cy:h,rd:o}=i,c=new t.PathBuilder;let d,u,_,g;d=e.hourHand,u=this._hourView,u.setVis(d.visible)&&(g=t.PI_2*(a/12+n/60/12+l/60/60/12),_=d.getLength(o-this._rimThick),c.rect(-d.options.thickness/2,-_,d.options.thickness,_),u.internalSetStyleOrClass(d._style),u.setPath(c.close(!0)).trans(r,h).rotate(g*t.RAD_DEG)),d=e.minuteHand,u=this._minuteView,u.setVis(d.visible)&&(g=t.PI_2*(n/60+l/60/60),_=d.getLength(o-this._rimThick),c.rect(-d.options.thickness/2,-_,d.options.thickness,_),u.internalSetStyleOrClass(d._style),u.setPath(c.close(!0)).trans(r,h).rotate(g*t.RAD_DEG)),d=e.secondHand,u=this._secondView,u.setVis(d.visible)&&(g=this._secRate<1?t.PI_2*(this._aniSec+this._secRate)/60:t.PI_2*l/60,_=d.getLength(o-this._rimThick),c.rect(-d.options.thickness/2,-_,d.options.thickness,_),u.internalSetStyleOrClass(d._style),u.setPath(c.close(!0)).trans(r,h).rotate(g*t.RAD_DEG),this._prevSec=l)}$_moveSecond(e){if(!isNaN(e)){this._aniSec=e;const t=new K(this);t.duration=this.model.secondHand.options.duration||200,t.start()}}}function Z(e){(function(e){return e.Series&&e.SeriesView})(e)&&(e.Gauge.register(A,d,J,k),e.GaugeGroup.register(H,u,R),e.GaugeView.register([d,m],[k,L],[A,$],[J,Q],[u,x],[R,I],[H,M]))}Z(s),e.BulletGauge=A,e.CircleGauge=d,e.ClockGauge=J,e.LinearGauge=k,e.default=Z,Object.defineProperty(e,"__esModule",{value:!0})}));
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("realchart")):"function"==typeof define&&define.amd?define(["exports","realchart"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).RealChartGauge={},e.RealChart)}(this,(function(e,t){"use strict";function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var s=i(t);class a extends t.GaugeItem{getRange(e,t){const i=this.$_internalRanges(e);if(i)for(const e of i)if(t>=e.fromValue&&t<e.toValue)return e}_doApply(e){const t=this;var i;super._doApply(e),(i=e.ranges)!==t._ranges&&(t._ranges=i,t._runRanges=null)}$_internalRanges(e){return this._runRanges||(this._runRanges=t.buildValueRanges(this._ranges,e.minValue,e.maxValue,this._op.rangeInclusive)),this._runRanges}}a.defaults=t.extend(t.ChartItem.defaults,{rangeInclusive:!0});class n extends a{getSegmentThickness(e){return t.calcPercent(this._segmentThicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"segmentThickness")}}n.defaults=t.extend(a.defaults,{segmentGap:0});class l extends a{getThickness(e){return t.calcPercent(this._thicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"thickness")}}l.defaults=t.extend(a.defaults,{thickness:"100%",stroked:!1});class r extends t.GaugeItem{}r.defaults=t.extend(t.ChartItem.defaults,{visible:!1});class h extends t.GaugeItem{getExtents(e){return{radius:t.calcPercent(this._radiusDim,e,0),length:t.calcPercent(this._lengthDim,e,0),offset:t.calcPercent(this._offsetDim,e,0)}}_doApply(e){super._doApply(e),this._setDims(e,"radius","length","offset")}}h.defaults=t.extend(t.ChartItem.defaults,{visible:!1,radius:3,length:"100%",offset:0});class o extends t.GaugeItem{getRadius(e){return t.calcPercent(this._radiusDim,e,0)}_doApply(e){super._doApply(e),this._setDim(e,"radius")}}o.defaults=t.extend(t.ChartItem.defaults,{visible:!1,radius:5});class c extends t.GaugeScale{_getStepMultiples(e){return[1,2,2.5,5,10]}}c.defaults=t.extend(t.GaugeScale.defaults,{visible:!1,stepPixels:72});class d extends t.CircularGauge{_doInit(e){super._doInit(e),e.band=(this._band=new t.GaugeRangeBand(this)).init(),e.scale=(this._scale=new c(this)).init(),e.rim=(this._rim=new n(this)).init(),e.valueRim=(this._valueRim=new l(this)).init(),e.hand=(this._hand=new h(this)).init(),e.pin=(this._pin=new o(this)).init()}get band(){return this._band}get scale(){return this._scale}get rim(){return this._rim}get valueRim(){return this._valueRim}get hand(){return this._hand}get pin(){return this._pin}getExtents(e){const i=super.getExtents(e),s=this.scale,a=this.band;let n=i.radius;const l=n-i.inner;if(a.visible)switch(i.bandThick=a.getThickness(l),a.options.position){case"inside":i.band=n-(l-i.bandThick)/2;break;case"opposite":i.band=i.inner-a.options.gap,i.inner=i.band-i.bandThick;break;default:i.band=n+=i.bandThick+a.options.gap}if(i.scaleTick=t.maxv(1,s.tick.options.length||0),i.scaleLabel=16,"opposite"===s.options.position)i.scale=i.inner-s.options.gap,i.inner=i.scale-i.scaleTick-i.scaleLabel;else i.scale=n+s.options.gap;return i}}d.type=t.CircleGaugeType;class u extends t.CircularGaugeGroup{_gaugesType(){return"circle"}}u.type=t.CircleGaugeGroupType,u.gaugeType=t.CircleGaugeType,u.defaults=t.extend(t.CircularGaugeGroup.defaults,{innerRadius:"50%"});class _ extends t.ValueGaugeView{}class g extends t.ScaleView{setExtents(e,t){this._center=e,this._exts=t}_createLine(e,i){return new t.ArcElement(e,i)}_doMeasure(e,t,i,s,a){const n=t._steps.length-(360===t.gauge.options.sweepAngle?1:0);return this._line.setVis(t.line.visible)&&this._line.internalSetStyleOrClass(t.line._style),this._tickContainer.setVis(t.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(t.tick._style),this._ticks.prepare(n)),this._labelContainer.setVis(t.label.visible)&&(this._labelContainer.internalSetStyleOrClass(t.label._style),this._labels.prepare(n)),{width:i,height:s}}_doLayout(e){const i=this.model,s=i._steps,a=i.gauge,n=a.options,l="opposite"===i.options.position?-1:1,r=a._props,h=this._center.x,o=this._center.y,c=this._exts.scale,d=c+this.model.tick.options.length*l,u=r._sweepRad,_=r._startRad,g=n.maxValue-n.minValue,p=n.clockwise;let b,w,m,x;if(this._line.visible&&this._line.setArc(h,o,c,_,p?u:-u,p),this._tickContainer.visible&&this._ticks.forEach(((e,a,n)=>{const l=i.getRate(s[a])*(p?u:-u)+_;b=h+t.cos(l)*c,w=o+t.sin(l)*c,m=h+t.cos(l)*d,x=o+t.sin(l)*d,e.setLine(b,w,m,x)})),this._labelContainer.visible){this._labels.get(0).setText(String(n.maxValue));const e=d+.2*this._labels.get(0).getBBox().height*l;this._labels.forEach(((a,r)=>{const c=i.getRate(s[r])*(p?u:-u)+_;a.setText(String(t.fixnum(n.minValue+i.getRate(s[r])*g))),a.setContrast(null).layout("center");const d=a.getBBox();m=h+t.cos(c)*(e+d.width/2*l)-d.width/2,x=o+t.sin(c)*(e+d.height/2*l)-d.height/2,a.trans(m,x)}))}}}let p=class extends t.ChartElement{constructor(e){super(e,"rct-circle-gauge-band"),this._sectorViews=new t.ElementPool(this,t.SectorElement),this.add(this._labelContainer=new t.LayerElement(e,"rct-circle-gauge-band-tick-labels")),this._labels=new t.ElementPool(this._labelContainer,t.TextElement)}setExtends(e,t){this._center=e,this._exts=t}_doLayout(e){const t=this.model,i=t.gauge,s=i.scale,a=i._props,n=this._center.x,l=this._center.y,r=this._exts.band,h=i.options.clockwise,o=1-this._exts.bandThick/r,c=t.getRanges(),d=a._sweepRad;i.options.maxValue,i.options.minValue;let u=a._startRad;this._sectorViews.prepare(c.length).forEach(((e,t)=>{const i=s.getRate(c[t].toValue-c[t].fromValue)*d;e.setSector({cx:n,cy:l,rx:r,ry:r,innerRadius:o,start:u,angle:i,clockwise:h}),e.internalClearStyleAndClass(),e.setFill(c[t].color),c[t].style&&e.addStyleOrClass(c[t].style),u+=h?i:-i}))}};class b extends t.PathElement{render(e,i){const s=e.getRadius(i);return s!==this._radius&&(this._radius=s,this.setPath((new t.PathBuilder).circle(0,0,s).end())),this.internalSetStyleOrClass(e._style),this}}class w extends t.PathElement{render(e,i){const s=e.getExtents(i);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const e=this._radius=s.radius,i=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new t.PathBuilder;s.move(-e,i).line(0,-this._length+i).line(e,i),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(e._style),this}}class m extends _{constructor(e){super(e,"rct-circle-gauge")}_doInitContents(e,i){i.add(this._rimView=new t.SectorElement(e,"rct-circle-gauge-rim")),i.add(this._valueView=new t.SectorElement(e,"rct-circle-gauge-value")),i.add(this._innerView=new t.SectorElement(e,"rct-circle-gauge-inner")),i.add(this._textView=new t.TextElement(e,"rct-circle-gauge-label")),i.add(this._handContainer=new t.LayerElement(e,void 0)),i.add(this._scaleView=new g(e)),i.add(this._bandView=new p(e))}_backgroundView(){return this._rimView}_prepareGauge(e,t){this._rimView.setVis(t.rim.visible),this._scaleView.setVis(t.scale.visible),this._bandView.setVis(t.band.visible),this._valueView.setVis(t.valueRim.visible),t.hand.visible?(this._handView||this._handContainer.add(this._handView=new w(e,"rct-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),t.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new b(e,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVis(t.labelVisible())&&this._textView.setStyleOrClass(t.label._style)}_renderGauge(e,i){const s=this.model,a=s.getCenter(e,i),n=s.getExtents(t.minv(e,i));this.$_renderBackground(s,a,n),this._renderValue()}_renderValue(){const e=this.model,i=e.options,s=e.scale,a=e.getProps(),n=e.getValue(),l=s.getRate(t.pickNum(n,0)),r=this._center,h=this._exts,o=e.valueRim.getThickness(h.radiusThick),c=this._textView;if(this._valueView.visible){const s=e.valueRim,c=s.options,d=s.getRange(i,n),u=h.value+(c.stroked?0:o/2),_=this._valueView;_.setStyleOrClass(s._style),d&&(_.setStyle(c.stroked?"stroke":"fill",d.color),d.style&&_.addStyleOrClass(d.style)),c.stroked&&(_.setFill("none"),_.setStyle("strokeWidth",t.pixel(o))),_.setBoolData("stroked",c.stroked),_.setSectorEx({cx:r.x,cy:r.y,rx:u,ry:u,innerRadius:(u-o)/u,start:a._startRad,angle:a._sweepRad*l,clockwise:i.clockwise},c.stroked)}if(this._handView){const i=(a._handRad+a._sweepRad*l)*t.RAD_DEG;this._handView.render(e.hand,h.radius).transp(r).rotate(e.options.clockwise?i:-i)}if(c.visible){const t=e.label;if(t.setText(e.getLabel(t,t.options.animatable?n:i.value)),c.text=t.options.text,c.setBoolData("grouped",!!e._group),t.buildSvg(c,null,NaN,NaN,e,t._domain),e._group)this.$_layoutGroupedLabel(e,c,h);else{const e=c.getBBox(),i=t.getOffset(this.width,this.height);c.trans(r.x+i.x,r.y-e.height/2+i.y)}}}$_renderBackground(e,t,i){const s=e.getProps(),a=s._startRad;this._center=t,this._exts=i,e.scale.buildSteps(i.scale*s._sweepRad,NaN),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(e.rim._style),this._rimView.setSector({cx:t.x,cy:t.y,rx:i.radius,ry:i.radius,innerRadius:1-i.radiusThick/i.radius,start:a,angle:s._sweepRad,clockwise:e.options.clockwise})),this._scaleView.visible&&(this._scaleView.setStyleOrClass(e.scale._style),this._scaleView.measure(this.doc,e.scale,this.width,this.height,0),this._scaleView.setExtents(t,i),this._scaleView.layout()),this._bandView.visible&&(this._bandView.setStyleOrClass(e.band._style),this._bandView.measure(this.doc,e.band,this.width,this.height,0),this._bandView.setExtends(t,i),this._bandView.layout()),this._innerView.setStyleOrClass(e.options.innerStyle);let n=i.inner;const l=getComputedStyle(this._innerView.dom),r=parseFloat(l.strokeWidth);r>1&&(n-=r/2),this._innerView.setSector({cx:t.x,cy:t.y,rx:n,ry:n,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(e.pin,n).trans(t.x,t.y)}$_layoutGroupedLabel(e,i,s){const a=i.getBBox(),n=this._rimView.getBBox(),l=+e._group.options.labelGap||0;i.anchor=t.TextAnchor.END,i.trans(n.x+n.width/2-l,n.y+(s.radius-s.inner-a.height)/2)}}class x extends t.GaugeGroupView{constructor(e){super(e,"rct-circle-gauge-group")}_createPool(e){return new t.ElementPool(e,m)}_doRenderGauges(e,i,s,a){const n=this.doc,l=this.model,r=l.props.getCenter(s,a),h=l.props.getExtents(t.minv(s,a));l.setChildExtents(h),s=a=2*h.radius,i.forEach(((e,t)=>{e.measure(n,l.getVisible(t),s,a,0),e.resize(s,a),e.layout()})),e.trans(r.x-h.radius,r.y-h.radius)}}class y extends t.GaugeScale{}class V extends t.GaugeLabel{getWidth(e){return t.calcPercent(this._widthDim,e)}getHeight(e){return t.calcPercent(this._heightDim,e)}getMaxWidth(e){return t.calcPercent(this._maxWidthDim,e)}getMaxHeight(e){return t.calcPercent(this._maxHeightDim,e)}getGap(e){return t.calcPercent(this._gapDim,e,0)}_doApply(e){super._doApply(e),this._setDims(e,"width","height","maxWidth","maxHeight","gap")}}V.defaults=t.extend(t.GaugeLabel.defaults,{maxWidth:"30%",maxHeight:"30%",gap:10});class v extends t.ValueGauge{_doInit(e){super._doInit(e),e.label=(this._label=new V(this.chart)).init(),e.scale=(this._scale=new y(this)).init()}get label(){return this._label}get scale(){return this._scale}isVertical(){return this._group?this._group.options.vertical:this._op.vertical}scaleVisible(){return!this._group&&this._scale.visible}calcedMinMax(){return this._scale.range()}_doPrepareRender(e){super._doPrepareRender(e),this._label._prepareRender()}}v.defaults=t.extend(t.ValueGauge.defaults,{reversed:!1});class f extends t.GaugeItem{constructor(){super(...arguments),this._args={gauge:null,value:NaN}}getStyle(e,t){if(this._op.styleCallback){this._args.gauge=e,this._args.value=t;return this._op.styleCallback(this._args)}}}class k extends v{_doInit(e){super._doInit(e),e.valueBar=(this._valueBar=new f(this)).init(),e.band=(this._band=new t.GaugeRangeBand(this)).init()}get valueBar(){return this._valueBar}get band(){return this._band}}k.type=t.LinearGaugeType;class C extends t.ChartItem{}C.defaults=t.extend(t.ChartItem.defaults,{opposite:!1,gap:10});class S extends V{}S.defaults=t.extend(V.defaults,{gap:10});class E extends t.GaugeGroup{_doInit(e){super._doInit(e),e.label=(this._label=new S(this.chart)).init(),e.itemLabel=(this._itemLabel=new C(this.chart)).init(),e.scale=(this._scale=new y(this)).init()}get label(){return this._label}get itemLabel(){return this._itemLabel}get scale(){return this._scale}calcedMinMax(){return this.scale.range()}}E.defaults=t.extend(t.GaugeGroup.defaults,{vertical:!1,itemGap:10});class R extends E{_doInit(e){super._doInit(e),e.band=(this._band=new t.GaugeRangeBand(this)).init()}get band(){return this._band}_gaugesType(){return"linear"}_doPrepareRender(e){super._doPrepareRender(e),this.band.visible&&this.band._prepareRender()}}R.type=t.LinearGaugeGroupType,R.gaugeType=t.LinearGaugeType;class G extends t.ScaleView{_createLine(e,i){return new t.LineElement(e,i)}_doMeasure(e,i,s,a,n){const l=i.options,r=i._reversed,h=i._vertical,o=i.label,c=i.tick,d=i._steps,u=d.length;let _=h?l.gap:s,g=h?a:l.gap;if(this._tickContainer.setVis(c.visible)&&(this._tickContainer.setStyleOrClass(c._style),this._ticks.prepare(u)),h?_+=c.options.length:g+=c.options.length,this._labelContainer.setVis(o.visible)&&(this._labels.prepare(u,(t=>{t.setModel(e,o,null,null)})),u>0))if(h){let e=0;this._labels.forEach(((i,s)=>{i.setText(o.getText(d[r?s:u-1-s])),e=t.maxv(i.getBBox().width)})),_+=e}else{let e=0;this._labels.forEach(((i,s)=>{i.setText(o.getText(d[r?u-1-s:s])),e=t.maxv(i.getBBox().height)})),g+=e}return{width:_,height:g}}_doLayout(){const e=this.model;e._vertical?this.$_layoutVert(e,this.width,this.height):this.$_layoutHorz(e,this.width,this.height)}$_layoutHorz(e,t,i){const s=e.options,a=this._line,n=e.tick,l=e._steps;l.length;const r="opposite"===s.position,h=r?-n.options.length:n.options.length;let o,c=r?i-s.gap:s.gap;if(a.setVis(e.line.visible)&&(a.setStyleOrClass(e.line._style),a.setHLine(c,0,t)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((i,s)=>{o=e.getRate(l[s])*t,i.setVLine(o,c,c+h)})),this._labelContainer.visible){const i=this._labelContainer.textAlign()||"center";let s=Number.MIN_SAFE_INTEGER;c=r?0:c+h,this._labels.forEach(((a,n)=>{a.layout(i);const r=a.getBBox();o=e.getRate(l[n])*t,a.setVis(o-r.width/2>s)&&(a.trans(o-r.width/2,c),s=o+r.width/2)}))}}$_layoutVert(e,t,i){const s=e.options,a=this._line,n=e.tick,l=e._steps;this.height,l.length;const r="opposite"===s.position,h=r?n.options.length:-n.options.length;let o,c=r?s.gap:t-s.gap;if(a.setVis(e.line.visible)&&(a.setStyleOrClass(e.line._style),a.setVLine(c,0,i)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((t,s)=>{o=e.getRate(l[s])*i,t.setHLine(o,c,c+h)})),this._labelContainer.visible){const a=this._labelContainer.textAlign()||(r?"left":"right");c=r?c+h:t-s.gap+h,this._labels.forEach(((t,s)=>{t.layout(a);const n=t.getBBox(),h=r?c:c-n.width;o=e.getRate(l[s])*i,t.trans(h,o-n.height/2)}))}}}class B extends t.ValueGaugeView{_measureLabelSize(e,i,s){const a=e.label,n=this.labelView();return a.setText(e.getLabel(a,e.options.value)),n.text=a.options.text,a.buildSvg(n,null,i,s,e,a._domain),t.rectToSize(n.getBBox())}_renderGauge(e,i){const s=this.model,a=t.pickNum(s._runValue,s.options.value);this._measureGauge(s,s.label,this.labelView(),a,s.isVertical(),e,i),this._renderValue()}_renderValue(){const e=this.model,i=e.label,s=e.scale,a=this.labelView(),n=t.pickNum(e._runValue,e.options.value),l=t.assignObj({},this._rBand);if(this._renderScale(l),this.background().setRect(l),l.height>0&&this._renderBand(e,l,n),"top"!==i._runPos&&"bottom"!==i._runPos||(this._rLabel.height=l.height),this._renderLabel(e,i,a,n),!this._vertical&&("left"===i._runPos||"right"===i._runPos)&&s.visible&&"opposite"===s.options.position){const e=a.getBBox();a.ty+e.height>this.height&&a.transY(t.maxv(0,this.height-e.height))}}_measureGauge(e,i,s,a,n,l,r){const h=this._rBand=t.createRect(0,0,l,r);if(this._vertical=e._group instanceof E?e._group.options.vertical:n,i.visible){const n=i._runPos=t.pickProp(i.options.position,this._vertical?"top":"left"),o=i._runVert="top"===n||"bottom"===n,c=e._group?e._group.itemLabel.options.gap:i._runGap=i.getGap(o?r:l);let d=o?l:i.getWidth(l),u=o?i.getHeight(r):r;const _=o?l:i.getMaxWidth(l),g=o?i.getMaxHeight(r):r,p=this._rLabel=t.createRect(0,0,l,r);s.setStyleOrClass(i._style),i.setText(e.getLabel(i,i.options.animatable?a:e.options.value)),s.text=i.options.text,i.buildSvg(s,null,t.pickNum(d,_),t.pickNum(u,g),e,i._domain);const b=s.getBBox();switch(o?(p.height=t.pickNum(u,b.height),h.height=t.maxv(0,h.height-(p.height+c))):(p.width=t.pickNum(d,b.width),this._wLabel=e._group?e._group._labelWidth:p.width,h.width=t.maxv(0,h.width-(this._wLabel+c))),n){case"top":h.y=p.height+c;break;case"bottom":p.y=h.height+c;break;case"right":p.x=h.width+c;break;default:h.x=this._wLabel+c}}else this._rLabel=null}_renderLabel(e,i,s,a){if(s.visible){const e=this._rLabel,a=s.getBBox();let n=e.x,l=e.y;switch(i._runPos){case"top":case"bottom":n+=e.width/2;break;case"right":n=this.width-e.width,s.anchor=t.TextAnchor.START,l+=t.maxv(0,(e.height-a.height)/2);break;default:s.anchor=t.TextAnchor.END,n+=this._wLabel,l+=t.maxv(0,(e.height-a.height)/2)}s.trans(n,l)}}_renderScale(e){const i=this.model,s=i.label,a=i.scale,n=this.scaleView(),l=this._vertical?e.height:e.width;let r,h;if(a._vertical=this._vertical,a._reversed=i.options.reversed,isNaN(i._runValue)&&a.buildSteps(l,i.options.value),n.setVis(i.scaleVisible())){const i=n.measure(this.doc,a,e.width,e.height,1);this._vertical?(r=0,h=e.y,e.width=t.maxv(0,e.width-i.width),"opposite"===a.options.position?r=e.x+e.width:(s._runVert||(r=e.x),e.x+=i.width)):(r=e.x,e.height=t.maxv(0,e.height-i.height),"opposite"===a.options.position?s._runVert?(h=e.y,e.y+=i.height):(this._rLabel.y=e.y+=i.height,h=e.y-i.height):h=e.y+e.height),n.resizeByMeasured().layout().trans(r,h)}}}class T extends t.ChartElement{constructor(e){super(e,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._labelGap=3,this._barViews=new t.ElementPool(this,t.RectElement),this.add(this._labelContainer=new t.LayerElement(e,"rct-linear-gauge-band-tick-labels")),this._labels=new t.ElementPool(this._labelContainer,t.TextElement)}_doMeasure(e,i,s,a,n){const l=i.gauge,r=this._vertical=l instanceof k?l.isVertical():l.options.vertical,h="inside"===i.options.position,o=this._thick=h?r?s:a:i.getThickness(r?s:a)+(this._gap=t.pickNum(i.options.gap,0));let c=r?o:s,d=r?a:o;const u=this._ranges=i.getRanges();if(this._labelContainer.setVis(i.tickLabel.visible&&u.length>0)){const e=[u[0].fromValue].concat(u.map((e=>e.toValue)));if(this._labelContainer.setStyleOrClass(i.tickLabel._style),this._labels.prepare(u.length+1),r){let i=0;this._labels.forEach(((s,a)=>{s.text=String(e[a]),i=t.maxv(s.getBBox().width)})),c+=i+this._labelGap}else{let i=0;this._labels.forEach(((s,a)=>{s.text=String(e[a]),i=t.maxv(s.getBBox().height)})),d+=i}}return{width:c,height:d}}_doLayout(e){const t=this.model,i=t.gauge,s=i.scale,a=s._max-s._min;this._labelContainer.setVis(this.$_layoutBars(i,a,this._ranges)&&this._labelContainer.visible&&"inside"!==t.options.position)&&this.$_layoutLabels(i,a,this._ranges)}$_layoutBars(e,t,i){if(this._barViews.prepare(i.length),!this._barViews.isEmpty&&t>0){const e=this._vertical,s="inside"===this.model.options.position,a="opposite"===this.model.options.position,n=this.width,l=this.height,r=e?l:n,h=this._thick;let o=0;return this._barViews.prepare(i.length).forEach(((c,d)=>{const u=i[d],_=r*(u.toValue-u.fromValue)/t;if(e){const e=s||a?0:n-h;c.setBounds(e,l-o-_,h,_)}else{const e=a?l-h:0;c.setBounds(o,e,_,this._thick)}c.internalClearStyleAndClass(),c.setFill(u.color),u.style&&c.addStyleOrClass(u.style),o+=_})),!0}}$_layoutLabels(e,i,s){const a="opposite"===this.model.options.position;if(this._vertical){const e=this.height,n=a?t.TextAnchor.START:t.TextAnchor.END,l=a?this._thick+this._labelGap:this.width-this._thick-this._labelGap;let r=this._labels.get(0);r.anchor=n,r.trans(l,e-r.getBBox().height/2);for(let t=1;t<=s.length;t++){const a=e-e*s[t-1].toValue/i;r=this._labels.get(t),r.anchor=n,r.trans(l,a-r.getBBox().height/2)}}else{const e=this.width,t=a?0:this._thick;this._labels.get(0).trans(0,t);for(let a=1;a<=s.length;a++){const n=e*s[a-1].toValue/i;this._labels.get(a).trans(n,t)}}}}class L extends B{constructor(e){super(e,"rct-linear-gauge")}_doInitContents(e,i){i.add(this._background=new t.RectElement(e,"rct-linear-gauge-background")),i.add(this._bandView=new T(e)),i.add(this._scaleView=new G(e)),i.add(this._valueView=new t.RectElement(e,"rct-linear-gauge-value")),i.add(this._labelView=new t.TextElement(e))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(e,t){}_renderScale(e){const t=this.model.band,i=this._bandView;if(super._renderScale(e),i.setVis(t.visible)){const s=+t.options.gap||0,a=i.measure(this.doc,t,e.width,e.height,1);i.resizeByMeasured().layout(),this._vertical?"inside"===t.options.position?i.trans(e.x,e.y):"opposite"===t.options.position?(i.trans(e.x+e.width-a.width,e.y),e.width-=a.width+s):(i.trans(e.x,e.y),e.width-=a.width+s,e.x+=a.width+s):"inside"===t.options.position?i.trans(e.x,e.y):"opposite"===t.options.position?(i.trans(e.x,e.y),e.height-=a.height+s,e.y+=a.height+s):(i.trans(e.x,e.y+e.height-a.height),e.height-=a.height+s)}}_renderBand(e,i,s){const a=this._valueView,n=e.options.reversed,l=e.valueBar,r=e._group?e._group.scale:e.scale;if(a.setVis(!t.isEmptyRect(i)&&l.visible&&!r.isEmpty()&&!isNaN(e.options.value)))if(a.setStyleOrClass(l._style),a.internalSetStyleOrClass(l.getStyle(e,s)),this._vertical){const e=i.height*r.getRate(s),t=n?i.y:i.y+i.height-e;a.setBounds(i.x,t,i.width,e)}else{const e=i.width*r.getRate(s),t=n?i.x+i.width-e:i.x;a.setBounds(t,i.y,e,i.height)}}}class P extends t.GaugeGroupView{constructor(e,t){super(e,t)}_doInitContents(e,i){super._doInitContents(e,i),i.insertFirst(this._scaleView=new G(e)),i.insertFirst(this._textView=new t.TextElement(e,"rct-linear-gauge-group-label"))}_prepareGauge(e,t){this._textView.setVis(t.label.visible)&&this._textView.setStyleOrClass(t.label._style),this._scaleView.setVis(t.scale.visible)&&this._scaleView.setStyleOrClass(t.scale._style),super._prepareGauge(e,t)}_doRenderGauges(e,i,s,a){const n=this.model,l=n.options,r=this._textView,h=t.createRect(0,0,s,a);if(r.visible){r.text=n.label.options.text,n.label.buildSvg(r,null,NaN,NaN,n,null);const e=this._textView.getBBox().height+n.label.getGap(a);h.y+=e,h.height-=e,r.trans(this.width/2,0)}n._labelWidth=n._labelHeight=0,this._gaugeViews.forEach(((e,i)=>{const l=e._measureLabelSize(n.get(i),s,a);n._labelWidth=t.maxv(n._labelWidth,l.width),n._labelHeight=t.maxv(n._labelHeight,l.height)}));const o=t.copyObj(h),c=n.itemLabel.options.gap;l.vertical?(o.height-=n._labelHeight+c,n.itemLabel.options.opposite||(o.y+=n._labelHeight+c)):(o.width-=n._labelWidth+c,n.itemLabel.options.opposite||(o.x+=n._labelWidth+c)),this._renderScale(n,h,o),l.vertical?this.$_layoutVert(this.doc,n,i,h):this.$_layoutHorz(this.doc,n,i,h)}_renderScale(e,t,i){const s=this._scaleView,a=e.scale,n=e.options.vertical,l=n?t.height:t.width,r=[];let h,o;if(this._gaugeViews.forEach(((t,i)=>{r.push(e.get(i).getValue())})),a.buildGroupSteps(l,r),a._vertical=n,s.setVis(a.visible)){const e=s.measure(this.doc,a,i.width,i.height,1);if(n){const s=e.width;i.width-=s,t.width-=s,o=i.y,"opposite"===a.options.position?h=i.x+i.width:(h=i.x,i.x+=s,t.x+=s)}else{const s=e.height;i.height-=s,t.height-=s,h=i.x,"opposite"===a.options.position?(o=i.y,i.y+=s,t.y+=s):o=i.y+i.height}s.resizeByMeasured().layout().trans(h,o)}}$_layoutVert(e,t,i,s){const a=s.height,n=(s.width-t.options.itemGap*(i.count-1))/i.count,l=s.y;let r=s.x;i.forEach(((i,s)=>{i.measure(e,t.get(s),n,a,0),i.resize(n,a),i.layout(),i.trans(r,l),r+=n+t.options.itemGap}))}$_layoutHorz(e,t,i,s){const a=t.options.itemGap,n=s.width,l=(s.height-a*(i.count-1))/i.count,r=s.x;let h=s.y;i.forEach(((i,s)=>{i.measure(e,t.get(s),n,l,0),i.resize(n,l),i.layout(),i.trans(r,h),h+=l+a}))}}class I extends P{constructor(e){super(e,"rct-linear-gauge-group")}_doInitContents(e,t){super._doInitContents(e,t),t.insertChild(this._bandView=new T(e),this._scaleView)}_createPool(e){return new t.ElementPool(e,L)}_renderScale(e,t,i){super._renderScale(e,t,i);const s=this._bandView,a=e.band;let n,l;if(s.setVis(a.visible)){const r=+a.options.gap||0,h=s.measure(this.doc,a,i.width,i.height,1);if(e.options.vertical){const e=h.width+r;i.width-=e,t.width-=e,l=i.y,"opposite"===a.options.position?n=i.x+i.width+r:(n=i.x,i.x+=e,t.x+=e)}else{const e=h.height+r;i.height-=e,t.height-=e,n=i.x,"opposite"===a.options.position?(l=i.y,i.y+=e,t.y+=e):l=i.y+i.height+r}s.resizeByMeasured().layout().trans(n,l)}}}class D extends t.ChartItem{constructor(e){super(e.chart),this.gauge=e}getRanges(){var e;return null===(e=this.$_internalRanges())||void 0===e?void 0:e.slice(0)}_doApply(e){const t=this;var i;super._doApply(e),(i=e.ranges)!==t._ranges&&(t._ranges=i,t._runRanges=null)}$_internalRanges(){if(!this._runRanges){const e=this.gauge.options;this._runRanges=t.buildValueRanges(this._ranges,e.minValue,e.maxValue,this._op.rangeInclusive)}return this._runRanges}}D.defaults=t.extend(t.ChartItem.defaults,{vertical:!0,rangeInclusive:!0});class O extends t.GaugeItem{}O.defaults=t.extend(t.ChartItem.defaults,{visible:!0});class N extends f{}class A extends v{_doInit(e){super._doInit(e),e.band=(this._band=new D(this)).init(),e.targetBar=(this._targetBar=new O(this)).init(),e.valueBar=(this._valueBar=new N(this)).init()}get band(){return this._band}get targetBar(){return this._targetBar}get valueBar(){return this._valueBar}getRanges(e,i,s){return t.buildValueRanges(this._op.ranges,e,i,t.pickProp(s,this._op.rangeInclusive))}}A.type=t.BulletGaugeType,A.defaults=t.extend(v.defaults,{rangeInclusive:!0});class H extends E{getRanges(e,i,s){return t.buildValueRanges(this._op.ranges,e,i,t.pickProp(s,this._op.rangeInclusive))}_gaugesType(){return"bullet"}}H.type=t.BulletGaugeGroupType,H.gaugeType=t.BulletGaugeType,H.defaults=t.extend(E.defaults,{rangeInclusive:!0});class $ extends B{constructor(e){super(e,"rct-bullet-gage")}_doInitContents(e,i){i.add(this._background=new t.RectElement(e,"rct-bullet-gauge-background")),i.add(this._barContainer=new t.LayerElement(e,void 0)),this._barViews=new t.ElementPool(this._barContainer,t.RectElement),i.add(this._valueView=new t.RectElement(e,"rct-bullet-gauge-value")),i.add(this._targetView=new t.RectElement(e,"rct-bullet-gauge-target")),i.add(this._scaleView=new G(e)),i.add(this._labelView=new t.TextElement(e))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(e,t){}_renderBand(e,i,s){const a=e.options,n=e._group,l=e.options.reversed,r=this._vertical,h=n?n.scale:e.scale,o=this._valueView,c=this._targetView;if(this._barContainer.setVis(!t.isEmptyRect(i)&&!h.isEmpty())){const t=e.getRanges(h._min,h._max,!1)||(null==n?void 0:n.getRanges(h._min,h._max,!1));t&&(this._barContainer.setRect(i),this._barViews.prepare(t.length),r?this._barViews.forEach(((e,s)=>{const a=t[s],n=i.height*h.getRate(a.toValue-a.fromValue),r=i.height*h.getRate(a.fromValue);e.setBounds(0,l?r:i.height-r-n,i.width,n),e.internalClearStyleAndClass(),e.setFill(a.color),a.style&&e.addStyleOrClass(a.style)})):this._barViews.forEach(((e,s)=>{const a=t[s],n=i.width*h.getRate(a.toValue-a.fromValue),r=i.width*h.getRate(a.fromValue);e.setBounds(l?i.width-n-r:r,0,n,i.height),e.internalClearStyleAndClass(),e.setFill(a.color),a.style&&e.addStyleOrClass(a.style)})))}if(o.setVis(e.valueBar.visible&&!h.isEmpty()&&!isNaN(s)))if(o.setStyleOrClass(e.valueBar._style),s<a.targetValue&&e.valueBar.options.belowStyle&&o.internalSetStyleOrClass(e.valueBar.options.belowStyle),o.internalSetStyleOrClass(e.valueBar.getStyle(e,s)),r){const e=i.height*h.getRate(s),t=l?i.y:i.y+i.height-e;o.setBounds(i.x+i.width/3,t,i.width/3,e)}else{const e=i.width*h.getRate(s),t=l?i.x+i.width-e:i.x;o.setBounds(t,i.y+i.height/3,e,i.height/3)}if(c.setVis(e.targetBar.visible&&!h.isEmpty()&&!isNaN(a.targetValue)))if(c.setStyleOrClass(e.targetBar._style),r&&i.width>10){let e=i.height*h.getRate(a.targetValue);e=l?i.y+e:i.y+i.height-e,c.setBounds(i.x+5,e-1,i.width-10,3)}else if(!r&&i.height>10){let e=i.width*h.getRate(a.targetValue);e=l?i.x+i.width-e:i.x+e,c.setBounds(e-1,i.y+5,3,i.height-10)}}}class M extends P{constructor(e){super(e,"rct-bullet-gauge-group")}_createPool(e){return new t.ElementPool(e,$)}}class z extends t.GaugeItem{getThickness(e){return t.calcPercent(this._thicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"thickness")}}z.defaults=t.extend(t.ChartItem.defaults,{thickness:7});class W extends t.GaugeItem{getLength(e){return t.calcPercent(this._lengthDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"length")}}W.defaults=t.extend(t.ChartItem.defaults,{thickness:7,length:"60%"});class F extends W{}F.defaults=t.extend(W.defaults,{thickness:5,length:"85%"});class j extends W{}j.defaults=t.extend(W.defaults,{thickness:2,length:"95%",animatable:!1,duration:200});class Y extends t.GaugeItem{constructor(e,t){super(e),this.length=t}}class X extends t.GaugeItem{}X.defaults=t.extend(t.ChartItem.defaults,{step:1,offset:1});class U extends t.GaugeItem{constructor(e,t){super(e),this.raidus=t}}class q extends t.ChartText{constructor(e){super(e.chart)}}q.defaults=t.extend(t.ChartText.defaults,{text:"RealChart Clock<br>ver1.0",position:"top"});class J extends t.Gauge{_doInit(e){super._doInit(e),e.rim=(this.rim=new z(this)).init(),e.hourHand=(this.hourHand=new W(this)).init(),e.minuteHand=(this.minuteHand=new F(this)).init(),e.secondHand=(this.secondHand=new j(this)).init(),e.tick=(this.tick=new Y(this,10)).init(),e.minorTick=(this.minorTick=new Y(this,5)).init(),e.tickLabel=(this.tickLabel=new X(this)).init(),e.pin=(this.pin=new U(this,5)).init(),e.label=(this.label=new q(this)).init()}getTime(){const e=this._op;return e.time instanceof Date?e.time:t.isString(e.time)?new Date(e.time):isNaN(e.time)?void 0:new Date(e.time)}getExtents(e,i){const s=t.minv(e,i);return{cx:t.calcPercent(this._centerXDim,e,e/2),cy:t.calcPercent(this._centerYDim,i,i/3),rd:t.calcPercent(this._radiusDim,s,s/2)}}_doApply(e){const i=this;var s,a,n;super._doApply(e),s=e.centerX,a=e.centerY,n=e.radius,(i._centerXDim||s!==i._centerX)&&(i._centerXDim=t.parsePercentSize(t.pickProp(i._centerX=s,t.CircularGauge.DEF_CENTER),!0)),i._centerYDim&&a===i._centerY||(i._centerYDim=t.parsePercentSize(t.pickProp(i._centerY=a,t.CircularGauge.DEF_CENTER),!0)),i._radiusDim&&n===i._radius||(i._radiusDim=t.parsePercentSize(t.pickProp(i._radius=n,t.CircularGauge.DEF_RADIUS),!0))}}J.type=t.ClockGaugeType,J.defaults=t.extend(t.Gauge.defaults,{centerX:"50%",centerY:"50%",radius:"40%",active:!0});class K extends t.RcAnimation{constructor(e){super(),this.view=e}_doUpdate(e){return this.view._secRate=e,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class Q extends t.GaugeView{constructor(e){super(e,"rct-clock-gauge"),this._rimThick=0,this._secRate=1}_doInitContents(e,i){i.add(this._faceView=new t.CircleElement(e,"rct-clock-gauge-face")),i.add(this._rimView=new t.SectorElement(e,"rct-clock-gauge-rim")),i.add(this._labelView=new t.TextElement(e,"rct-clock-gauge-label")),this._labelView.layout=t.TextLayout.MIDDLE,i.add(this._tickContainer=new t.LayerElement(e,"rct-clock-gauge-ticks")),i.add(this._tickLabelContainer=new t.LayerElement(e,"rct-clock-gauge-tick-labels")),i.add(this._hourView=new t.PathElement(e,"rct-clock-gauge-hour")),i.add(this._minuteView=new t.PathElement(e,"rct-clock-gauge-minute")),i.add(this._secondView=new t.PathElement(e,"rct-clock-gauge-second")),i.add(this._pinView=new t.CircleElement(e,"rct-clock-gauge-pin")),this._tickViews=new t.ElementPool(this._tickContainer,t.LineElement,"rct-clock-gauge-tick"),this._minorTickViews=new t.ElementPool(this._tickContainer,t.LineElement,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new t.ElementPool(this._tickLabelContainer,t.TextElement,"rct-clock-gauge-tick-label")}_prepareGauge(e,i){this._tickViews.prepare(i.tick.visible?12:0),this._minorTickViews.prepare(i.minorTick.visible?48:0);const s=Math.round(12/t.maxv(1,Math.floor(i.tickLabel.options.step)||1));this._tickLabelViews.prepare(i.tickLabel.visible?s:0,(e=>{e.layout=t.TextLayout.MIDDLE}))}_renderGauge(e,i){const s=this.model,a=this._exts=s.getExtents(e,i);this._secRate=1,this.$_renderFace(s,a),this.$_renderHands(s,a),s.options.active&&!s.getTime()?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(this.model,this._exts),t.absv(e-this._prevSec)>=1&&this._secondView.visible&&s.chart.animatable()&&s.secondHand.options.animatable&&this.$_moveSecond(e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(e,i){const s=this._labelView,a=this._rimView,n=this._minorTickViews,l=this._tickLabelViews,r=this._pinView,{cx:h,cy:o,rd:c}=i,d=this._rimThick=a.visible?e.rim.getThickness(c):0;this._faceView.setCircle(h,o,c),a.setVis(e.rim.visible)&&(a.internalSetStyleOrClass(e.rim._style),a.setSector({cx:h,cy:o,rx:c,ry:c,innerRadius:1-d/c,start:0,angle:2*Math.PI,clockwise:!0}));const u=c-d;let _=u-e.tick.length,g=t.ORG_ANGLE,p=t.PI_2/12;if(this._tickViews.forEach(((i,s)=>{i.setLine(h+t.cos(g)*u,o+t.sin(g)*u,h+t.cos(g)*_,o+t.sin(g)*_),i.internalSetStyleOrClass(e.tick._style),g+=p})),!n.isEmpty){let i=0;_=u-e.minorTick.length,g=t.ORG_ANGLE,p=t.PI_2/60,n.forEach((s=>{i%5==0&&(g+=p,i++),s.setLine(h+t.cos(g)*u,o+t.sin(g)*u,h+t.cos(g)*_,o+t.sin(g)*_),s.internalSetStyleOrClass(e.minorTick._style),g+=p,i++}))}if(!l.isEmpty){const i=12/l.count,s=t.PI_2/12*i;g=t.ORG_ANGLE,l.get(0).text="12",_=u-(e.tick.length+e.tickLabel.options.offset||0),_-=.5*l.get(0).getBBox().height,l.forEach(((a,n,l)=>{a.text=String(0===n?12:n*i),a.trans(h+t.cos(g)*_,o+t.sin(g)*_),a.internalSetStyleOrClass(e.tickLabel._style),g+=s}))}r.setVis(e.pin.visible)&&(r.setCircle(h,o,e.pin.raidus),r.setStyleOrClass(e.pin._style)),s.setVis(e.label.visible)&&(s.internalSetStyleOrClass(e.label._style),e.label.buildSvg(s,null,NaN,NaN,null,null),"bottom"===e.label.options.position?s.trans(h,o+_/2):s.trans(h,o-_/2))}$_getNow(){const e=this.model.options.timezone;let t=this.model.getTime()||new Date;if(!isNaN(e)){const i=t.getMinutes()+(t.getTimezoneOffset()+e);t.setMinutes(i)}return t}$_renderHands(e,i){const s=this.$_getNow(),a=s.getHours(),n=s.getMinutes(),l=s.getSeconds(),{cx:r,cy:h,rd:o}=i,c=new t.PathBuilder;let d,u,_,g;d=e.hourHand,u=this._hourView,u.setVis(d.visible)&&(g=t.PI_2*(a/12+n/60/12+l/60/60/12),_=d.getLength(o-this._rimThick),c.rect(-d.options.thickness/2,-_,d.options.thickness,_),u.internalSetStyleOrClass(d._style),u.setPath(c.close(!0)).trans(r,h).rotate(g*t.RAD_DEG)),d=e.minuteHand,u=this._minuteView,u.setVis(d.visible)&&(g=t.PI_2*(n/60+l/60/60),_=d.getLength(o-this._rimThick),c.rect(-d.options.thickness/2,-_,d.options.thickness,_),u.internalSetStyleOrClass(d._style),u.setPath(c.close(!0)).trans(r,h).rotate(g*t.RAD_DEG)),d=e.secondHand,u=this._secondView,u.setVis(d.visible)&&(g=this._secRate<1?t.PI_2*(this._aniSec+this._secRate)/60:t.PI_2*l/60,_=d.getLength(o-this._rimThick),c.rect(-d.options.thickness/2,-_,d.options.thickness,_),u.internalSetStyleOrClass(d._style),u.setPath(c.close(!0)).trans(r,h).rotate(g*t.RAD_DEG),this._prevSec=l)}$_moveSecond(e){if(!isNaN(e)){this._aniSec=e;const t=new K(this);t.duration=this.model.secondHand.options.duration||200,t.start()}}}function Z(e){(function(e){return e.Series&&e.SeriesView})(e)&&(e.Gauge.register(A,d,J,k),e.GaugeGroup.register(H,u,R),e.GaugeView.register([d,m],[k,L],[A,$],[J,Q],[u,x],[R,I],[H,M]))}Z(s),e.BulletGauge=A,e.CircleGauge=d,e.ClockGauge=J,e.LinearGauge=k,e.default=Z,Object.defineProperty(e,"__esModule",{value:!0})}));
package/gauge.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * RealChart Gauge v1.4.6
3
+ * RealChart Gauge v1.4.7
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- import{extend as e,ChartItem as t,GaugeScale as s,CircleGaugeType as i,CircleGaugeGroupType as a,CircularGaugeGroup as n,GaugeItem as l,buildValueRanges as r,calcPercent as h,CircularGauge as o,GaugeRangeBand as c,maxv as d,SectorElement as _,TextElement as u,LayerElement as g,minv as p,pickNum as b,pixel as w,RAD_DEG as y,TextAnchor as V,GaugeGroupView as x,ElementPool as m,ValueGaugeView as v,ScaleView as f,ArcElement as k,cos as S,sin as C,fixnum as R,ChartElement as B,PathElement as L,PathBuilder as E,GaugeLabel as T,ValueGauge as D,LinearGaugeType as N,GaugeGroup as O,LinearGaugeGroupType as I,RectElement as G,isEmptyRect as H,LineElement as A,rectToSize as $,assignObj as M,createRect as P,pickProp as z,copyObj as W,BulletGaugeType as F,BulletGaugeGroupType as Y,ChartText as X,ClockGaugeType as U,Gauge as j,isString as q,parsePercentSize as J,GaugeView as K,CircleElement as Q,TextLayout as Z,absv as ee,ORG_ANGLE as te,PI_2 as se,RcAnimation as ie}from"./index.mjs";class ae extends l{getRange(e,t){const s=this.$_internalRanges(e);if(s)for(const e of s)if(t>=e.fromValue&&t<e.toValue)return e}_doApply(e){const t=this;var s;super._doApply(e),(s=e.ranges)!==t._ranges&&(t._ranges=s,t._runRanges=null)}$_internalRanges(e){return this._runRanges||(this._runRanges=r(this._ranges,e.minValue,e.maxValue,this._op.rangeInclusive)),this._runRanges}}ae.defaults=e(t.defaults,{rangeInclusive:!0});class ne extends ae{getSegmentThickness(e){return h(this._segmentThicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"segmentThickness")}}ne.defaults=e(ae.defaults,{segmentGap:0});class le extends ae{getThickness(e){return h(this._thicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"thickness")}}le.defaults=e(ae.defaults,{thickness:"100%",stroked:!1});(class extends l{}).defaults=e(t.defaults,{visible:!1});class re extends l{getExtents(e){return{radius:h(this._radiusDim,e,0),length:h(this._lengthDim,e,0),offset:h(this._offsetDim,e,0)}}_doApply(e){super._doApply(e),this._setDims(e,"radius","length","offset")}}re.defaults=e(t.defaults,{visible:!1,radius:3,length:"100%",offset:0});class he extends l{getRadius(e){return h(this._radiusDim,e,0)}_doApply(e){super._doApply(e),this._setDim(e,"radius")}}he.defaults=e(t.defaults,{visible:!1,radius:5});class oe extends s{_getStepMultiples(e){return[1,2,2.5,5,10]}}oe.defaults=e(s.defaults,{visible:!1,stepPixels:72});class ce extends o{_doInit(e){super._doInit(e),e.band=(this._band=new c(this)).init(),e.scale=(this._scale=new oe(this)).init(),e.rim=(this._rim=new ne(this)).init(),e.valueRim=(this._valueRim=new le(this)).init(),e.hand=(this._hand=new re(this)).init(),e.pin=(this._pin=new he(this)).init()}get band(){return this._band}get scale(){return this._scale}get rim(){return this._rim}get valueRim(){return this._valueRim}get hand(){return this._hand}get pin(){return this._pin}getExtents(e){const t=super.getExtents(e),s=this.scale,i=this.band;let a=t.radius;const n=a-t.inner;if(i.visible)switch(t.bandThick=i.getThickness(n),i.options.position){case"inside":t.band=a-(n-t.bandThick)/2;break;case"opposite":t.band=t.inner-i.options.gap,t.inner=t.band-t.bandThick;break;default:t.band=a+=t.bandThick+i.options.gap}if(t.scaleTick=d(1,s.tick.options.length||0),t.scaleLabel=16,"opposite"===s.options.position)t.scale=t.inner-s.options.gap,t.inner=t.scale-t.scaleTick-t.scaleLabel;else t.scale=a+s.options.gap;return t}}ce.type=i;class de extends n{_gaugesType(){return"circle"}}de.type=a,de.gaugeType=i,de.defaults=e(n.defaults,{innerRadius:"50%"});class _e extends v{}class ue extends f{setExtents(e,t){this._center=e,this._exts=t}_createLine(e,t){return new k(e,t)}_doMeasure(e,t,s,i,a){const n=t._steps.length-(360===t.gauge.options.sweepAngle?1:0);return this._line.setVis(t.line.visible)&&this._line.internalSetStyleOrClass(t.line._style),this._tickContainer.setVis(t.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(t.tick._style),this._ticks.prepare(n)),this._labelContainer.setVis(t.label.visible)&&(this._labelContainer.internalSetStyleOrClass(t.label._style),this._labels.prepare(n)),{width:s,height:i}}_doLayout(e){const t=this.model,s=t._steps,i=t.gauge,a=i.options,n="opposite"===t.options.position?-1:1,l=i._props,r=this._center.x,h=this._center.y,o=this._exts.scale,c=o+this.model.tick.options.length*n,d=l._sweepRad,_=l._startRad,u=a.maxValue-a.minValue,g=a.clockwise;let p,b,w,y;if(this._line.visible&&this._line.setArc(r,h,o,_,g?d:-d,g),this._tickContainer.visible&&this._ticks.forEach(((e,i,a)=>{const n=t.getRate(s[i])*(g?d:-d)+_;p=r+S(n)*o,b=h+C(n)*o,w=r+S(n)*c,y=h+C(n)*c,e.setLine(p,b,w,y)})),this._labelContainer.visible){this._labels.get(0).setText(String(a.maxValue));const e=c+.2*this._labels.get(0).getBBox().height*n;this._labels.forEach(((i,l)=>{const o=t.getRate(s[l])*(g?d:-d)+_;i.setText(String(R(a.minValue+t.getRate(s[l])*u))),i.setContrast(null).layout("center");const c=i.getBBox();w=r+S(o)*(e+c.width/2*n)-c.width/2,y=h+C(o)*(e+c.height/2*n)-c.height/2,i.trans(w,y)}))}}}let ge=class extends B{constructor(e){super(e,"rct-circle-gauge-band"),this._sectorViews=new m(this,_),this.add(this._labelContainer=new g(e,"rct-circle-gauge-band-tick-labels")),this._labels=new m(this._labelContainer,u)}setExtends(e,t){this._center=e,this._exts=t}_doLayout(e){const t=this.model,s=t.gauge,i=s.scale,a=s._props,n=this._center.x,l=this._center.y,r=this._exts.band,h=s.options.clockwise,o=1-this._exts.bandThick/r,c=t.getRanges(),d=a._sweepRad;s.options.maxValue,s.options.minValue;let _=a._startRad;this._sectorViews.prepare(c.length).forEach(((e,t)=>{const s=i.getRate(c[t].toValue-c[t].fromValue)*d;e.setSector({cx:n,cy:l,rx:r,ry:r,innerRadius:o,start:_,angle:s,clockwise:h}),e.internalClearStyleAndClass(),e.setFill(c[t].color),c[t].style&&e.addStyleOrClass(c[t].style),_+=h?s:-s}))}};class pe extends L{render(e,t){const s=e.getRadius(t);return s!==this._radius&&(this._radius=s,this.setPath((new E).circle(0,0,s).end())),this.internalSetStyleOrClass(e._style),this}}class be extends L{render(e,t){const s=e.getExtents(t);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const e=this._radius=s.radius,t=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new E;s.move(-e,t).line(0,-this._length+t).line(e,t),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(e._style),this}}class we extends _e{constructor(e){super(e,"rct-circle-gauge")}_doInitContents(e,t){t.add(this._rimView=new _(e,"rct-circle-gauge-rim")),t.add(this._valueView=new _(e,"rct-circle-gauge-value")),t.add(this._innerView=new _(e,"rct-circle-gauge-inner")),t.add(this._textView=new u(e,"rct-circle-gauge-label")),t.add(this._handContainer=new g(e,void 0)),t.add(this._scaleView=new ue(e)),t.add(this._bandView=new ge(e))}_backgroundView(){return this._rimView}_prepareGauge(e,t){this._rimView.setVis(t.rim.visible),this._scaleView.setVis(t.scale.visible),this._bandView.setVis(t.band.visible),this._valueView.setVis(t.valueRim.visible),t.hand.visible?(this._handView||this._handContainer.add(this._handView=new be(e,"rct-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),t.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new pe(e,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVis(t.labelVisible())&&this._textView.setStyleOrClass(t.label._style)}_renderGauge(e,t){const s=this.model,i=s.getCenter(e,t),a=s.getExtents(p(e,t));this.$_renderBackground(s,i,a),this._renderValue()}_renderValue(){const e=this.model,t=e.options,s=e.scale,i=e.getProps(),a=e.getValue(),n=s.getRate(b(a,0)),l=this._center,r=this._exts,h=e.valueRim.getThickness(r.radiusThick),o=this._textView;if(this._valueView.visible){const s=e.valueRim,o=s.options,c=s.getRange(t,a),d=r.value+(o.stroked?0:h/2),_=this._valueView;_.setStyleOrClass(s._style),c&&(_.setStyle(o.stroked?"stroke":"fill",c.color),c.style&&_.addStyleOrClass(c.style)),o.stroked&&(_.setFill("none"),_.setStyle("strokeWidth",w(h))),_.setBoolData("stroked",o.stroked),_.setSectorEx({cx:l.x,cy:l.y,rx:d,ry:d,innerRadius:(d-h)/d,start:i._startRad,angle:i._sweepRad*n,clockwise:t.clockwise},o.stroked)}if(this._handView){const t=(i._handRad+i._sweepRad*n)*y;this._handView.render(e.hand,r.radius).transp(l).rotate(e.options.clockwise?t:-t)}if(o.visible){const s=e.label;if(s.setText(e.getLabel(s,s.options.animatable?a:t.value)),o.text=s.options.text,s.buildSvg(o,null,NaN,NaN,e,s._domain),o.setBoolData("grouped",!!e._group),e._group)this.$_layoutGroupedLabel(e,o,r);else{const e=o.getBBox(),t=s.getOffset(this.width,this.height);o.trans(l.x+t.x,l.y-e.height/2+t.y)}}}$_renderBackground(e,t,s){const i=e.getProps(),a=i._startRad;this._center=t,this._exts=s,e.scale.buildSteps(s.scale*i._sweepRad,NaN),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(e.rim._style),this._rimView.setSector({cx:t.x,cy:t.y,rx:s.radius,ry:s.radius,innerRadius:1-s.radiusThick/s.radius,start:a,angle:i._sweepRad,clockwise:e.options.clockwise})),this._scaleView.visible&&(this._scaleView.setStyleOrClass(e.scale._style),this._scaleView.measure(this.doc,e.scale,this.width,this.height,0),this._scaleView.setExtents(t,s),this._scaleView.layout()),this._bandView.visible&&(this._bandView.setStyleOrClass(e.band._style),this._bandView.measure(this.doc,e.band,this.width,this.height,0),this._bandView.setExtends(t,s),this._bandView.layout()),this._innerView.setStyleOrClass(e.options.innerStyle);let n=s.inner;const l=getComputedStyle(this._innerView.dom),r=parseFloat(l.strokeWidth);r>1&&(n-=r/2),this._innerView.setSector({cx:t.x,cy:t.y,rx:n,ry:n,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(e.pin,n).trans(t.x,t.y)}$_layoutGroupedLabel(e,t,s){const i=t.getBBox(),a=this._rimView.getBBox(),n=+e._group.options.labelGap||0;t.anchor=V.END,t.trans(a.x+a.width/2-n,a.y+(s.radius-s.inner-i.height)/2)}}class ye extends x{constructor(e){super(e,"rct-circle-gauge-group")}_createPool(e){return new m(e,we)}_doRenderGauges(e,t,s,i){const a=this.doc,n=this.model,l=n.props.getCenter(s,i),r=n.props.getExtents(p(s,i));n.setChildExtents(r),s=i=2*r.radius,t.forEach(((e,t)=>{e.measure(a,n.getVisible(t),s,i,0),e.resize(s,i),e.layout()})),e.trans(l.x-r.radius,l.y-r.radius)}}class Ve extends s{}class xe extends T{getWidth(e){return h(this._widthDim,e)}getHeight(e){return h(this._heightDim,e)}getMaxWidth(e){return h(this._maxWidthDim,e)}getMaxHeight(e){return h(this._maxHeightDim,e)}getGap(e){return h(this._gapDim,e,0)}_doApply(e){super._doApply(e),this._setDims(e,"width","height","maxWidth","maxHeight","gap")}}xe.defaults=e(T.defaults,{maxWidth:"30%",maxHeight:"30%",gap:10});class me extends D{_doInit(e){super._doInit(e),e.label=(this._label=new xe(this.chart)).init(),e.scale=(this._scale=new Ve(this)).init()}get label(){return this._label}get scale(){return this._scale}isVertical(){return this._group?this._group.options.vertical:this._op.vertical}scaleVisible(){return!this._group&&this._scale.visible}calcedMinMax(){return this._scale.range()}_doPrepareRender(e){super._doPrepareRender(e),this._label._prepareRender()}}me.defaults=e(D.defaults,{reversed:!1});class ve extends l{constructor(){super(...arguments),this._args={gauge:null,value:NaN}}getStyle(e,t){if(this._op.styleCallback){this._args.gauge=e,this._args.value=t;return this._op.styleCallback(this._args)}}}class fe extends me{_doInit(e){super._doInit(e),e.valueBar=(this._valueBar=new ve(this)).init(),e.band=(this._band=new c(this)).init()}get valueBar(){return this._valueBar}get band(){return this._band}}fe.type=N;class ke extends t{}ke.defaults=e(t.defaults,{opposite:!1,gap:10});class Se extends xe{}Se.defaults=e(xe.defaults,{gap:10});class Ce extends O{_doInit(e){super._doInit(e),e.label=(this._label=new Se(this.chart)).init(),e.itemLabel=(this._itemLabel=new ke(this.chart)).init(),e.scale=(this._scale=new Ve(this)).init()}get label(){return this._label}get itemLabel(){return this._itemLabel}get scale(){return this._scale}calcedMinMax(){return this.scale.range()}}Ce.defaults=e(O.defaults,{vertical:!1,itemGap:10});class Re extends Ce{_doInit(e){super._doInit(e),e.band=(this._band=new c(this)).init()}get band(){return this._band}_gaugesType(){return"linear"}_doPrepareRender(e){super._doPrepareRender(e),this.band.visible&&this.band._prepareRender()}}Re.type=I,Re.gaugeType=N;class Be extends f{_createLine(e,t){return new A(e,t)}_doMeasure(e,t,s,i,a){const n=t.options,l=t._reversed,r=t._vertical,h=t.label,o=t.tick,c=t._steps,_=c.length;let u=r?n.gap:s,g=r?i:n.gap;if(this._tickContainer.setVis(o.visible)&&(this._tickContainer.setStyleOrClass(o._style),this._ticks.prepare(_)),r?u+=o.options.length:g+=o.options.length,this._labelContainer.setVis(h.visible)&&(this._labels.prepare(_,(t=>{t.setModel(e,h,null,null)})),_>0))if(r){let e=0;this._labels.forEach(((t,s)=>{t.setText(h.getText(c[l?s:_-1-s])),e=d(t.getBBox().width)})),u+=e}else{let e=0;this._labels.forEach(((t,s)=>{t.setText(h.getText(c[l?_-1-s:s])),e=d(t.getBBox().height)})),g+=e}return{width:u,height:g}}_doLayout(){const e=this.model;e._vertical?this.$_layoutVert(e,this.width,this.height):this.$_layoutHorz(e,this.width,this.height)}$_layoutHorz(e,t,s){const i=e.options,a=this._line,n=e.tick,l=e._steps;l.length;const r="opposite"===i.position,h=r?-n.options.length:n.options.length;let o,c=r?s-i.gap:i.gap;if(a.setVis(e.line.visible)&&(a.setStyleOrClass(e.line._style),a.setHLine(c,0,t)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((s,i)=>{o=e.getRate(l[i])*t,s.setVLine(o,c,c+h)})),this._labelContainer.visible){const s=this._labelContainer.textAlign()||"center";let i=Number.MIN_SAFE_INTEGER;c=r?0:c+h,this._labels.forEach(((a,n)=>{a.layout(s);const r=a.getBBox();o=e.getRate(l[n])*t,a.setVis(o-r.width/2>i)&&(a.trans(o-r.width/2,c),i=o+r.width/2)}))}}$_layoutVert(e,t,s){const i=e.options,a=this._line,n=e.tick,l=e._steps;this.height,l.length;const r="opposite"===i.position,h=r?n.options.length:-n.options.length;let o,c=r?i.gap:t-i.gap;if(a.setVis(e.line.visible)&&(a.setStyleOrClass(e.line._style),a.setVLine(c,0,s)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((t,i)=>{o=e.getRate(l[i])*s,t.setHLine(o,c,c+h)})),this._labelContainer.visible){const a=this._labelContainer.textAlign()||(r?"left":"right");c=r?c+h:t-i.gap+h,this._labels.forEach(((t,i)=>{t.layout(a);const n=t.getBBox(),h=r?c:c-n.width;o=e.getRate(l[i])*s,t.trans(h,o-n.height/2)}))}}}class Le extends v{_measureLabelSize(e,t,s){const i=e.label,a=this.labelView();return i.setText(e.getLabel(i,e.options.value)),a.text=i.options.text,i.buildSvg(a,null,t,s,e,i._domain),$(a.getBBox())}_renderGauge(e,t){const s=this.model,i=b(s._runValue,s.options.value);this._measureGauge(s,s.label,this.labelView(),i,s.isVertical(),e,t),this._renderValue()}_renderValue(){const e=this.model,t=e.label,s=e.scale,i=this.labelView(),a=b(e._runValue,e.options.value),n=M({},this._rBand);if(this._renderScale(n),this.background().setRect(n),n.height>0&&this._renderBand(e,n,a),"top"!==t._runPos&&"bottom"!==t._runPos||(this._rLabel.height=n.height),this._renderLabel(e,t,i,a),!this._vertical&&("left"===t._runPos||"right"===t._runPos)&&s.visible&&"opposite"===s.options.position){const e=i.getBBox();i.ty+e.height>this.height&&i.transY(d(0,this.height-e.height))}}_measureGauge(e,t,s,i,a,n,l){const r=this._rBand=P(0,0,n,l);if(this._vertical=e._group instanceof Ce?e._group.options.vertical:a,t.visible){const a=t._runPos=z(t.options.position,this._vertical?"top":"left"),h=t._runVert="top"===a||"bottom"===a,o=e._group?e._group.itemLabel.options.gap:t._runGap=t.getGap(h?l:n);let c=h?n:t.getWidth(n),_=h?t.getHeight(l):l;const u=h?n:t.getMaxWidth(n),g=h?t.getMaxHeight(l):l,p=this._rLabel=P(0,0,n,l);s.setStyleOrClass(t._style),t.setText(e.getLabel(t,t.options.animatable?i:e.options.value)),s.text=t.options.text,t.buildSvg(s,null,b(c,u),b(_,g),e,t._domain);const w=s.getBBox();switch(h?(p.height=b(_,w.height),r.height=d(0,r.height-(p.height+o))):(p.width=b(c,w.width),this._wLabel=e._group?e._group._labelWidth:p.width,r.width=d(0,r.width-(this._wLabel+o))),a){case"top":r.y=p.height+o;break;case"bottom":p.y=r.height+o;break;case"right":p.x=r.width+o;break;default:r.x=this._wLabel+o}}else this._rLabel=null}_renderLabel(e,t,s,i){if(s.visible){const e=this._rLabel,i=s.getBBox();let a=e.x,n=e.y;switch(t._runPos){case"top":case"bottom":a+=e.width/2;break;case"right":a=this.width-e.width,s.anchor=V.START,n+=d(0,(e.height-i.height)/2);break;default:s.anchor=V.END,a+=this._wLabel,n+=d(0,(e.height-i.height)/2)}s.trans(a,n)}}_renderScale(e){const t=this.model,s=t.label,i=t.scale,a=this.scaleView(),n=this._vertical?e.height:e.width;let l,r;if(i._vertical=this._vertical,i._reversed=t.options.reversed,isNaN(t._runValue)&&i.buildSteps(n,t.options.value),a.setVis(t.scaleVisible())){const t=a.measure(this.doc,i,e.width,e.height,1);this._vertical?(l=0,r=e.y,e.width=d(0,e.width-t.width),"opposite"===i.options.position?l=e.x+e.width:(s._runVert||(l=e.x),e.x+=t.width)):(l=e.x,e.height=d(0,e.height-t.height),"opposite"===i.options.position?s._runVert?(r=e.y,e.y+=t.height):(this._rLabel.y=e.y+=t.height,r=e.y-t.height):r=e.y+e.height),a.resizeByMeasured().layout().trans(l,r)}}}class Ee extends B{constructor(e){super(e,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._labelGap=3,this._barViews=new m(this,G),this.add(this._labelContainer=new g(e,"rct-linear-gauge-band-tick-labels")),this._labels=new m(this._labelContainer,u)}_doMeasure(e,t,s,i,a){const n=t.gauge,l=this._vertical=n instanceof fe?n.isVertical():n.options.vertical,r="inside"===t.options.position,h=this._thick=r?l?s:i:t.getThickness(l?s:i)+(this._gap=b(t.options.gap,0));let o=l?h:s,c=l?i:h;const _=this._ranges=t.getRanges();if(this._labelContainer.setVis(t.tickLabel.visible&&_.length>0)){const e=[_[0].fromValue].concat(_.map((e=>e.toValue)));if(this._labelContainer.setStyleOrClass(t.tickLabel._style),this._labels.prepare(_.length+1),l){let t=0;this._labels.forEach(((s,i)=>{s.text=String(e[i]),t=d(s.getBBox().width)})),o+=t+this._labelGap}else{let t=0;this._labels.forEach(((s,i)=>{s.text=String(e[i]),t=d(s.getBBox().height)})),c+=t}}return{width:o,height:c}}_doLayout(e){const t=this.model,s=t.gauge,i=s.scale,a=i._max-i._min;this._labelContainer.setVis(this.$_layoutBars(s,a,this._ranges)&&this._labelContainer.visible&&"inside"!==t.options.position)&&this.$_layoutLabels(s,a,this._ranges)}$_layoutBars(e,t,s){if(this._barViews.prepare(s.length),!this._barViews.isEmpty&&t>0){const e=this._vertical,i="inside"===this.model.options.position,a="opposite"===this.model.options.position,n=this.width,l=this.height,r=e?l:n,h=this._thick;let o=0;return this._barViews.prepare(s.length).forEach(((c,d)=>{const _=s[d],u=r*(_.toValue-_.fromValue)/t;if(e){const e=i||a?0:n-h;c.setBounds(e,l-o-u,h,u)}else{const e=a?l-h:0;c.setBounds(o,e,u,this._thick)}c.internalClearStyleAndClass(),c.setFill(_.color),_.style&&c.addStyleOrClass(_.style),o+=u})),!0}}$_layoutLabels(e,t,s){const i="opposite"===this.model.options.position;if(this._vertical){const e=this.height,a=i?V.START:V.END,n=i?this._thick+this._labelGap:this.width-this._thick-this._labelGap;let l=this._labels.get(0);l.anchor=a,l.trans(n,e-l.getBBox().height/2);for(let i=1;i<=s.length;i++){const r=e-e*s[i-1].toValue/t;l=this._labels.get(i),l.anchor=a,l.trans(n,r-l.getBBox().height/2)}}else{const e=this.width,a=i?0:this._thick;this._labels.get(0).trans(0,a);for(let i=1;i<=s.length;i++){const n=e*s[i-1].toValue/t;this._labels.get(i).trans(n,a)}}}}class Te extends Le{constructor(e){super(e,"rct-linear-gauge")}_doInitContents(e,t){t.add(this._background=new G(e,"rct-linear-gauge-background")),t.add(this._bandView=new Ee(e)),t.add(this._scaleView=new Be(e)),t.add(this._valueView=new G(e,"rct-linear-gauge-value")),t.add(this._labelView=new u(e))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(e,t){}_renderScale(e){const t=this.model.band,s=this._bandView;if(super._renderScale(e),s.setVis(t.visible)){const i=+t.options.gap||0,a=s.measure(this.doc,t,e.width,e.height,1);s.resizeByMeasured().layout(),this._vertical?"inside"===t.options.position?s.trans(e.x,e.y):"opposite"===t.options.position?(s.trans(e.x+e.width-a.width,e.y),e.width-=a.width+i):(s.trans(e.x,e.y),e.width-=a.width+i,e.x+=a.width+i):"inside"===t.options.position?s.trans(e.x,e.y):"opposite"===t.options.position?(s.trans(e.x,e.y),e.height-=a.height+i,e.y+=a.height+i):(s.trans(e.x,e.y+e.height-a.height),e.height-=a.height+i)}}_renderBand(e,t,s){const i=this._valueView,a=e.options.reversed,n=e.valueBar,l=e._group?e._group.scale:e.scale;if(i.setVis(!H(t)&&n.visible&&!l.isEmpty()&&!isNaN(e.options.value)))if(i.setStyleOrClass(n._style),i.internalSetStyleOrClass(n.getStyle(e,s)),this._vertical){const e=t.height*l.getRate(s),n=a?t.y:t.y+t.height-e;i.setBounds(t.x,n,t.width,e)}else{const e=t.width*l.getRate(s),n=a?t.x+t.width-e:t.x;i.setBounds(n,t.y,e,t.height)}}}class De extends x{constructor(e,t){super(e,t)}_doInitContents(e,t){super._doInitContents(e,t),t.insertFirst(this._scaleView=new Be(e)),t.insertFirst(this._textView=new u(e,"rct-linear-gauge-group-label"))}_prepareGauge(e,t){this._textView.setVis(t.label.visible)&&this._textView.setStyleOrClass(t.label._style),this._scaleView.setVis(t.scale.visible)&&this._scaleView.setStyleOrClass(t.scale._style),super._prepareGauge(e,t)}_doRenderGauges(e,t,s,i){const a=this.model,n=a.options,l=this._textView,r=P(0,0,s,i);if(l.visible){l.text=a.label.options.text,a.label.buildSvg(l,null,NaN,NaN,a,null);const e=this._textView.getBBox().height+a.label.getGap(i);r.y+=e,r.height-=e,l.trans(this.width/2,0)}a._labelWidth=a._labelHeight=0,this._gaugeViews.forEach(((e,t)=>{const n=e._measureLabelSize(a.get(t),s,i);a._labelWidth=d(a._labelWidth,n.width),a._labelHeight=d(a._labelHeight,n.height)}));const h=W(r),o=a.itemLabel.options.gap;n.vertical?(h.height-=a._labelHeight+o,a.itemLabel.options.opposite||(h.y+=a._labelHeight+o)):(h.width-=a._labelWidth+o,a.itemLabel.options.opposite||(h.x+=a._labelWidth+o)),this._renderScale(a,r,h),n.vertical?this.$_layoutVert(this.doc,a,t,r):this.$_layoutHorz(this.doc,a,t,r)}_renderScale(e,t,s){const i=this._scaleView,a=e.scale,n=e.options.vertical,l=n?t.height:t.width,r=[];let h,o;if(this._gaugeViews.forEach(((t,s)=>{r.push(e.get(s).getValue())})),a.buildGroupSteps(l,r),a._vertical=n,i.setVis(a.visible)){const e=i.measure(this.doc,a,s.width,s.height,1);if(n){const i=e.width;s.width-=i,t.width-=i,o=s.y,"opposite"===a.options.position?h=s.x+s.width:(h=s.x,s.x+=i,t.x+=i)}else{const i=e.height;s.height-=i,t.height-=i,h=s.x,"opposite"===a.options.position?(o=s.y,s.y+=i,t.y+=i):o=s.y+s.height}i.resizeByMeasured().layout().trans(h,o)}}$_layoutVert(e,t,s,i){const a=i.height,n=(i.width-t.options.itemGap*(s.count-1))/s.count,l=i.y;let r=i.x;s.forEach(((s,i)=>{s.measure(e,t.get(i),n,a,0),s.resize(n,a),s.layout(),s.trans(r,l),r+=n+t.options.itemGap}))}$_layoutHorz(e,t,s,i){const a=t.options.itemGap,n=i.width,l=(i.height-a*(s.count-1))/s.count,r=i.x;let h=i.y;s.forEach(((s,i)=>{s.measure(e,t.get(i),n,l,0),s.resize(n,l),s.layout(),s.trans(r,h),h+=l+a}))}}class Ne extends De{constructor(e){super(e,"rct-linear-gauge-group")}_doInitContents(e,t){super._doInitContents(e,t),t.insertChild(this._bandView=new Ee(e),this._scaleView)}_createPool(e){return new m(e,Te)}_renderScale(e,t,s){super._renderScale(e,t,s);const i=this._bandView,a=e.band;let n,l;if(i.setVis(a.visible)){const r=+a.options.gap||0,h=i.measure(this.doc,a,s.width,s.height,1);if(e.options.vertical){const e=h.width+r;s.width-=e,t.width-=e,l=s.y,"opposite"===a.options.position?n=s.x+s.width+r:(n=s.x,s.x+=e,t.x+=e)}else{const e=h.height+r;s.height-=e,t.height-=e,n=s.x,"opposite"===a.options.position?(l=s.y,s.y+=e,t.y+=e):l=s.y+s.height+r}i.resizeByMeasured().layout().trans(n,l)}}}class Oe extends t{constructor(e){super(e.chart),this.gauge=e}getRanges(){var e;return null===(e=this.$_internalRanges())||void 0===e?void 0:e.slice(0)}_doApply(e){const t=this;var s;super._doApply(e),(s=e.ranges)!==t._ranges&&(t._ranges=s,t._runRanges=null)}$_internalRanges(){if(!this._runRanges){const e=this.gauge.options;this._runRanges=r(this._ranges,e.minValue,e.maxValue,this._op.rangeInclusive)}return this._runRanges}}Oe.defaults=e(t.defaults,{vertical:!0,rangeInclusive:!0});class Ie extends l{}Ie.defaults=e(t.defaults,{visible:!0});class Ge extends ve{}class He extends me{_doInit(e){super._doInit(e),e.band=(this._band=new Oe(this)).init(),e.targetBar=(this._targetBar=new Ie(this)).init(),e.valueBar=(this._valueBar=new Ge(this)).init()}get band(){return this._band}get targetBar(){return this._targetBar}get valueBar(){return this._valueBar}getRanges(e,t,s){return r(this._op.ranges,e,t,z(s,this._op.rangeInclusive))}}He.type=F,He.defaults=e(me.defaults,{rangeInclusive:!0});class Ae extends Ce{getRanges(e,t,s){return r(this._op.ranges,e,t,z(s,this._op.rangeInclusive))}_gaugesType(){return"bullet"}}Ae.type=Y,Ae.gaugeType=F,Ae.defaults=e(Ce.defaults,{rangeInclusive:!0});class $e extends Le{constructor(e){super(e,"rct-bullet-gage")}_doInitContents(e,t){t.add(this._background=new G(e,"rct-bullet-gauge-background")),t.add(this._barContainer=new g(e,void 0)),this._barViews=new m(this._barContainer,G),t.add(this._valueView=new G(e,"rct-bullet-gauge-value")),t.add(this._targetView=new G(e,"rct-bullet-gauge-target")),t.add(this._scaleView=new Be(e)),t.add(this._labelView=new u(e))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(e,t){}_renderBand(e,t,s){const i=e.options,a=e._group,n=e.options.reversed,l=this._vertical,r=a?a.scale:e.scale,h=this._valueView,o=this._targetView;if(this._barContainer.setVis(!H(t)&&!r.isEmpty())){const s=e.getRanges(r._min,r._max,!1)||(null==a?void 0:a.getRanges(r._min,r._max,!1));s&&(this._barContainer.setRect(t),this._barViews.prepare(s.length),l?this._barViews.forEach(((e,i)=>{const a=s[i],l=t.height*r.getRate(a.toValue-a.fromValue),h=t.height*r.getRate(a.fromValue);e.setBounds(0,n?h:t.height-h-l,t.width,l),e.internalClearStyleAndClass(),e.setFill(a.color),a.style&&e.addStyleOrClass(a.style)})):this._barViews.forEach(((e,i)=>{const a=s[i],l=t.width*r.getRate(a.toValue-a.fromValue),h=t.width*r.getRate(a.fromValue);e.setBounds(n?t.width-l-h:h,0,l,t.height),e.internalClearStyleAndClass(),e.setFill(a.color),a.style&&e.addStyleOrClass(a.style)})))}if(h.setVis(e.valueBar.visible&&!r.isEmpty()&&!isNaN(s)))if(h.setStyleOrClass(e.valueBar._style),s<i.targetValue&&e.valueBar.options.belowStyle&&h.internalSetStyleOrClass(e.valueBar.options.belowStyle),h.internalSetStyleOrClass(e.valueBar.getStyle(e,s)),l){const e=t.height*r.getRate(s),i=n?t.y:t.y+t.height-e;h.setBounds(t.x+t.width/3,i,t.width/3,e)}else{const e=t.width*r.getRate(s),i=n?t.x+t.width-e:t.x;h.setBounds(i,t.y+t.height/3,e,t.height/3)}if(o.setVis(e.targetBar.visible&&!r.isEmpty()&&!isNaN(i.targetValue)))if(o.setStyleOrClass(e.targetBar._style),l&&t.width>10){let e=t.height*r.getRate(i.targetValue);e=n?t.y+e:t.y+t.height-e,o.setBounds(t.x+5,e-1,t.width-10,3)}else if(!l&&t.height>10){let e=t.width*r.getRate(i.targetValue);e=n?t.x+t.width-e:t.x+e,o.setBounds(e-1,t.y+5,3,t.height-10)}}}class Me extends De{constructor(e){super(e,"rct-bullet-gauge-group")}_createPool(e){return new m(e,$e)}}class Pe extends l{getThickness(e){return h(this._thicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"thickness")}}Pe.defaults=e(t.defaults,{thickness:7});class ze extends l{getLength(e){return h(this._lengthDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"length")}}ze.defaults=e(t.defaults,{thickness:7,length:"60%"});class We extends ze{}We.defaults=e(ze.defaults,{thickness:5,length:"85%"});class Fe extends ze{}Fe.defaults=e(ze.defaults,{thickness:2,length:"95%",animatable:!1,duration:200});class Ye extends l{constructor(e,t){super(e),this.length=t}}class Xe extends l{}Xe.defaults=e(t.defaults,{step:1,offset:1});class Ue extends l{constructor(e,t){super(e),this.raidus=t}}class je extends X{constructor(e){super(e.chart)}}je.defaults=e(X.defaults,{text:"RealChart Clock<br>ver1.0",position:"top"});class qe extends j{_doInit(e){super._doInit(e),e.rim=(this.rim=new Pe(this)).init(),e.hourHand=(this.hourHand=new ze(this)).init(),e.minuteHand=(this.minuteHand=new We(this)).init(),e.secondHand=(this.secondHand=new Fe(this)).init(),e.tick=(this.tick=new Ye(this,10)).init(),e.minorTick=(this.minorTick=new Ye(this,5)).init(),e.tickLabel=(this.tickLabel=new Xe(this)).init(),e.pin=(this.pin=new Ue(this,5)).init(),e.label=(this.label=new je(this)).init()}getTime(){const e=this._op;return e.time instanceof Date?e.time:q(e.time)?new Date(e.time):isNaN(e.time)?void 0:new Date(e.time)}getExtents(e,t){const s=p(e,t);return{cx:h(this._centerXDim,e,e/2),cy:h(this._centerYDim,t,t/3),rd:h(this._radiusDim,s,s/2)}}_doApply(e){const t=this;var s,i,a;super._doApply(e),s=e.centerX,i=e.centerY,a=e.radius,(t._centerXDim||s!==t._centerX)&&(t._centerXDim=J(z(t._centerX=s,o.DEF_CENTER),!0)),t._centerYDim&&i===t._centerY||(t._centerYDim=J(z(t._centerY=i,o.DEF_CENTER),!0)),t._radiusDim&&a===t._radius||(t._radiusDim=J(z(t._radius=a,o.DEF_RADIUS),!0))}}qe.type=U,qe.defaults=e(j.defaults,{centerX:"50%",centerY:"50%",radius:"40%",active:!0});class Je extends ie{constructor(e){super(),this.view=e}_doUpdate(e){return this.view._secRate=e,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class Ke extends K{constructor(e){super(e,"rct-clock-gauge"),this._rimThick=0,this._secRate=1}_doInitContents(e,t){t.add(this._faceView=new Q(e,"rct-clock-gauge-face")),t.add(this._rimView=new _(e,"rct-clock-gauge-rim")),t.add(this._labelView=new u(e,"rct-clock-gauge-label")),this._labelView.layout=Z.MIDDLE,t.add(this._tickContainer=new g(e,"rct-clock-gauge-ticks")),t.add(this._tickLabelContainer=new g(e,"rct-clock-gauge-tick-labels")),t.add(this._hourView=new L(e,"rct-clock-gauge-hour")),t.add(this._minuteView=new L(e,"rct-clock-gauge-minute")),t.add(this._secondView=new L(e,"rct-clock-gauge-second")),t.add(this._pinView=new Q(e,"rct-clock-gauge-pin")),this._tickViews=new m(this._tickContainer,A,"rct-clock-gauge-tick"),this._minorTickViews=new m(this._tickContainer,A,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new m(this._tickLabelContainer,u,"rct-clock-gauge-tick-label")}_prepareGauge(e,t){this._tickViews.prepare(t.tick.visible?12:0),this._minorTickViews.prepare(t.minorTick.visible?48:0);const s=Math.round(12/d(1,Math.floor(t.tickLabel.options.step)||1));this._tickLabelViews.prepare(t.tickLabel.visible?s:0,(e=>{e.layout=Z.MIDDLE}))}_renderGauge(e,t){const s=this.model,i=this._exts=s.getExtents(e,t);this._secRate=1,this.$_renderFace(s,i),this.$_renderHands(s,i),s.options.active&&!s.getTime()?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(this.model,this._exts),ee(e-this._prevSec)>=1&&this._secondView.visible&&s.chart.animatable()&&s.secondHand.options.animatable&&this.$_moveSecond(e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(e,t){const s=this._labelView,i=this._rimView,a=this._minorTickViews,n=this._tickLabelViews,l=this._pinView,{cx:r,cy:h,rd:o}=t,c=this._rimThick=i.visible?e.rim.getThickness(o):0;this._faceView.setCircle(r,h,o),i.setVis(e.rim.visible)&&(i.internalSetStyleOrClass(e.rim._style),i.setSector({cx:r,cy:h,rx:o,ry:o,innerRadius:1-c/o,start:0,angle:2*Math.PI,clockwise:!0}));const d=o-c;let _=d-e.tick.length,u=te,g=se/12;if(this._tickViews.forEach(((t,s)=>{t.setLine(r+S(u)*d,h+C(u)*d,r+S(u)*_,h+C(u)*_),t.internalSetStyleOrClass(e.tick._style),u+=g})),!a.isEmpty){let t=0;_=d-e.minorTick.length,u=te,g=se/60,a.forEach((s=>{t%5==0&&(u+=g,t++),s.setLine(r+S(u)*d,h+C(u)*d,r+S(u)*_,h+C(u)*_),s.internalSetStyleOrClass(e.minorTick._style),u+=g,t++}))}if(!n.isEmpty){const t=12/n.count,s=se/12*t;u=te,n.get(0).text="12",_=d-(e.tick.length+e.tickLabel.options.offset||0),_-=.5*n.get(0).getBBox().height,n.forEach(((i,a,n)=>{i.text=String(0===a?12:a*t),i.trans(r+S(u)*_,h+C(u)*_),i.internalSetStyleOrClass(e.tickLabel._style),u+=s}))}l.setVis(e.pin.visible)&&(l.setCircle(r,h,e.pin.raidus),l.setStyleOrClass(e.pin._style)),s.setVis(e.label.visible)&&(s.internalSetStyleOrClass(e.label._style),e.label.buildSvg(s,null,NaN,NaN,null,null),"bottom"===e.label.options.position?s.trans(r,h+_/2):s.trans(r,h-_/2))}$_getNow(){const e=this.model.options.timezone;let t=this.model.getTime()||new Date;if(!isNaN(e)){const s=t.getMinutes()+(t.getTimezoneOffset()+e);t.setMinutes(s)}return t}$_renderHands(e,t){const s=this.$_getNow(),i=s.getHours(),a=s.getMinutes(),n=s.getSeconds(),{cx:l,cy:r,rd:h}=t,o=new E;let c,d,_,u;c=e.hourHand,d=this._hourView,d.setVis(c.visible)&&(u=se*(i/12+a/60/12+n/60/60/12),_=c.getLength(h-this._rimThick),o.rect(-c.options.thickness/2,-_,c.options.thickness,_),d.internalSetStyleOrClass(c._style),d.setPath(o.close(!0)).trans(l,r).rotate(u*y)),c=e.minuteHand,d=this._minuteView,d.setVis(c.visible)&&(u=se*(a/60+n/60/60),_=c.getLength(h-this._rimThick),o.rect(-c.options.thickness/2,-_,c.options.thickness,_),d.internalSetStyleOrClass(c._style),d.setPath(o.close(!0)).trans(l,r).rotate(u*y)),c=e.secondHand,d=this._secondView,d.setVis(c.visible)&&(u=this._secRate<1?se*(this._aniSec+this._secRate)/60:se*n/60,_=c.getLength(h-this._rimThick),o.rect(-c.options.thickness/2,-_,c.options.thickness,_),d.internalSetStyleOrClass(c._style),d.setPath(o.close(!0)).trans(l,r).rotate(u*y),this._prevSec=n)}$_moveSecond(e){if(!isNaN(e)){this._aniSec=e;const t=new Je(this);t.duration=this.model.secondHand.options.duration||200,t.start()}}}function Qe(e){(function(e){return e.Series&&e.SeriesView})(e)&&(e.Gauge.register(He,ce,qe,fe),e.GaugeGroup.register(Ae,de,Re),e.GaugeView.register([ce,we],[fe,Te],[He,$e],[qe,Ke],[de,ye],[Re,Ne],[Ae,Me]))}export{He as BulletGauge,ce as CircleGauge,qe as ClockGauge,fe as LinearGauge,Qe as default,Qe as registerGauge};
7
+ import{extend as e,ChartItem as t,GaugeScale as s,CircleGaugeType as i,CircleGaugeGroupType as a,CircularGaugeGroup as n,GaugeItem as l,buildValueRanges as r,calcPercent as h,CircularGauge as o,GaugeRangeBand as c,maxv as d,SectorElement as _,TextElement as u,LayerElement as g,minv as p,pickNum as b,pixel as w,RAD_DEG as y,TextAnchor as V,GaugeGroupView as x,ElementPool as m,ValueGaugeView as v,ScaleView as f,ArcElement as k,cos as S,sin as C,fixnum as R,ChartElement as B,PathElement as L,PathBuilder as E,GaugeLabel as T,ValueGauge as D,LinearGaugeType as N,GaugeGroup as O,LinearGaugeGroupType as I,RectElement as G,isEmptyRect as H,LineElement as A,rectToSize as $,assignObj as M,createRect as P,pickProp as z,copyObj as W,BulletGaugeType as F,BulletGaugeGroupType as Y,ChartText as X,ClockGaugeType as U,Gauge as j,isString as q,parsePercentSize as J,GaugeView as K,CircleElement as Q,TextLayout as Z,absv as ee,ORG_ANGLE as te,PI_2 as se,RcAnimation as ie}from"./index.mjs";class ae extends l{getRange(e,t){const s=this.$_internalRanges(e);if(s)for(const e of s)if(t>=e.fromValue&&t<e.toValue)return e}_doApply(e){const t=this;var s;super._doApply(e),(s=e.ranges)!==t._ranges&&(t._ranges=s,t._runRanges=null)}$_internalRanges(e){return this._runRanges||(this._runRanges=r(this._ranges,e.minValue,e.maxValue,this._op.rangeInclusive)),this._runRanges}}ae.defaults=e(t.defaults,{rangeInclusive:!0});class ne extends ae{getSegmentThickness(e){return h(this._segmentThicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"segmentThickness")}}ne.defaults=e(ae.defaults,{segmentGap:0});class le extends ae{getThickness(e){return h(this._thicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"thickness")}}le.defaults=e(ae.defaults,{thickness:"100%",stroked:!1});(class extends l{}).defaults=e(t.defaults,{visible:!1});class re extends l{getExtents(e){return{radius:h(this._radiusDim,e,0),length:h(this._lengthDim,e,0),offset:h(this._offsetDim,e,0)}}_doApply(e){super._doApply(e),this._setDims(e,"radius","length","offset")}}re.defaults=e(t.defaults,{visible:!1,radius:3,length:"100%",offset:0});class he extends l{getRadius(e){return h(this._radiusDim,e,0)}_doApply(e){super._doApply(e),this._setDim(e,"radius")}}he.defaults=e(t.defaults,{visible:!1,radius:5});class oe extends s{_getStepMultiples(e){return[1,2,2.5,5,10]}}oe.defaults=e(s.defaults,{visible:!1,stepPixels:72});class ce extends o{_doInit(e){super._doInit(e),e.band=(this._band=new c(this)).init(),e.scale=(this._scale=new oe(this)).init(),e.rim=(this._rim=new ne(this)).init(),e.valueRim=(this._valueRim=new le(this)).init(),e.hand=(this._hand=new re(this)).init(),e.pin=(this._pin=new he(this)).init()}get band(){return this._band}get scale(){return this._scale}get rim(){return this._rim}get valueRim(){return this._valueRim}get hand(){return this._hand}get pin(){return this._pin}getExtents(e){const t=super.getExtents(e),s=this.scale,i=this.band;let a=t.radius;const n=a-t.inner;if(i.visible)switch(t.bandThick=i.getThickness(n),i.options.position){case"inside":t.band=a-(n-t.bandThick)/2;break;case"opposite":t.band=t.inner-i.options.gap,t.inner=t.band-t.bandThick;break;default:t.band=a+=t.bandThick+i.options.gap}if(t.scaleTick=d(1,s.tick.options.length||0),t.scaleLabel=16,"opposite"===s.options.position)t.scale=t.inner-s.options.gap,t.inner=t.scale-t.scaleTick-t.scaleLabel;else t.scale=a+s.options.gap;return t}}ce.type=i;class de extends n{_gaugesType(){return"circle"}}de.type=a,de.gaugeType=i,de.defaults=e(n.defaults,{innerRadius:"50%"});class _e extends v{}class ue extends f{setExtents(e,t){this._center=e,this._exts=t}_createLine(e,t){return new k(e,t)}_doMeasure(e,t,s,i,a){const n=t._steps.length-(360===t.gauge.options.sweepAngle?1:0);return this._line.setVis(t.line.visible)&&this._line.internalSetStyleOrClass(t.line._style),this._tickContainer.setVis(t.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(t.tick._style),this._ticks.prepare(n)),this._labelContainer.setVis(t.label.visible)&&(this._labelContainer.internalSetStyleOrClass(t.label._style),this._labels.prepare(n)),{width:s,height:i}}_doLayout(e){const t=this.model,s=t._steps,i=t.gauge,a=i.options,n="opposite"===t.options.position?-1:1,l=i._props,r=this._center.x,h=this._center.y,o=this._exts.scale,c=o+this.model.tick.options.length*n,d=l._sweepRad,_=l._startRad,u=a.maxValue-a.minValue,g=a.clockwise;let p,b,w,y;if(this._line.visible&&this._line.setArc(r,h,o,_,g?d:-d,g),this._tickContainer.visible&&this._ticks.forEach(((e,i,a)=>{const n=t.getRate(s[i])*(g?d:-d)+_;p=r+S(n)*o,b=h+C(n)*o,w=r+S(n)*c,y=h+C(n)*c,e.setLine(p,b,w,y)})),this._labelContainer.visible){this._labels.get(0).setText(String(a.maxValue));const e=c+.2*this._labels.get(0).getBBox().height*n;this._labels.forEach(((i,l)=>{const o=t.getRate(s[l])*(g?d:-d)+_;i.setText(String(R(a.minValue+t.getRate(s[l])*u))),i.setContrast(null).layout("center");const c=i.getBBox();w=r+S(o)*(e+c.width/2*n)-c.width/2,y=h+C(o)*(e+c.height/2*n)-c.height/2,i.trans(w,y)}))}}}let ge=class extends B{constructor(e){super(e,"rct-circle-gauge-band"),this._sectorViews=new m(this,_),this.add(this._labelContainer=new g(e,"rct-circle-gauge-band-tick-labels")),this._labels=new m(this._labelContainer,u)}setExtends(e,t){this._center=e,this._exts=t}_doLayout(e){const t=this.model,s=t.gauge,i=s.scale,a=s._props,n=this._center.x,l=this._center.y,r=this._exts.band,h=s.options.clockwise,o=1-this._exts.bandThick/r,c=t.getRanges(),d=a._sweepRad;s.options.maxValue,s.options.minValue;let _=a._startRad;this._sectorViews.prepare(c.length).forEach(((e,t)=>{const s=i.getRate(c[t].toValue-c[t].fromValue)*d;e.setSector({cx:n,cy:l,rx:r,ry:r,innerRadius:o,start:_,angle:s,clockwise:h}),e.internalClearStyleAndClass(),e.setFill(c[t].color),c[t].style&&e.addStyleOrClass(c[t].style),_+=h?s:-s}))}};class pe extends L{render(e,t){const s=e.getRadius(t);return s!==this._radius&&(this._radius=s,this.setPath((new E).circle(0,0,s).end())),this.internalSetStyleOrClass(e._style),this}}class be extends L{render(e,t){const s=e.getExtents(t);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const e=this._radius=s.radius,t=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new E;s.move(-e,t).line(0,-this._length+t).line(e,t),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(e._style),this}}class we extends _e{constructor(e){super(e,"rct-circle-gauge")}_doInitContents(e,t){t.add(this._rimView=new _(e,"rct-circle-gauge-rim")),t.add(this._valueView=new _(e,"rct-circle-gauge-value")),t.add(this._innerView=new _(e,"rct-circle-gauge-inner")),t.add(this._textView=new u(e,"rct-circle-gauge-label")),t.add(this._handContainer=new g(e,void 0)),t.add(this._scaleView=new ue(e)),t.add(this._bandView=new ge(e))}_backgroundView(){return this._rimView}_prepareGauge(e,t){this._rimView.setVis(t.rim.visible),this._scaleView.setVis(t.scale.visible),this._bandView.setVis(t.band.visible),this._valueView.setVis(t.valueRim.visible),t.hand.visible?(this._handView||this._handContainer.add(this._handView=new be(e,"rct-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),t.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new pe(e,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVis(t.labelVisible())&&this._textView.setStyleOrClass(t.label._style)}_renderGauge(e,t){const s=this.model,i=s.getCenter(e,t),a=s.getExtents(p(e,t));this.$_renderBackground(s,i,a),this._renderValue()}_renderValue(){const e=this.model,t=e.options,s=e.scale,i=e.getProps(),a=e.getValue(),n=s.getRate(b(a,0)),l=this._center,r=this._exts,h=e.valueRim.getThickness(r.radiusThick),o=this._textView;if(this._valueView.visible){const s=e.valueRim,o=s.options,c=s.getRange(t,a),d=r.value+(o.stroked?0:h/2),_=this._valueView;_.setStyleOrClass(s._style),c&&(_.setStyle(o.stroked?"stroke":"fill",c.color),c.style&&_.addStyleOrClass(c.style)),o.stroked&&(_.setFill("none"),_.setStyle("strokeWidth",w(h))),_.setBoolData("stroked",o.stroked),_.setSectorEx({cx:l.x,cy:l.y,rx:d,ry:d,innerRadius:(d-h)/d,start:i._startRad,angle:i._sweepRad*n,clockwise:t.clockwise},o.stroked)}if(this._handView){const t=(i._handRad+i._sweepRad*n)*y;this._handView.render(e.hand,r.radius).transp(l).rotate(e.options.clockwise?t:-t)}if(o.visible){const s=e.label;if(s.setText(e.getLabel(s,s.options.animatable?a:t.value)),o.text=s.options.text,o.setBoolData("grouped",!!e._group),s.buildSvg(o,null,NaN,NaN,e,s._domain),e._group)this.$_layoutGroupedLabel(e,o,r);else{const e=o.getBBox(),t=s.getOffset(this.width,this.height);o.trans(l.x+t.x,l.y-e.height/2+t.y)}}}$_renderBackground(e,t,s){const i=e.getProps(),a=i._startRad;this._center=t,this._exts=s,e.scale.buildSteps(s.scale*i._sweepRad,NaN),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(e.rim._style),this._rimView.setSector({cx:t.x,cy:t.y,rx:s.radius,ry:s.radius,innerRadius:1-s.radiusThick/s.radius,start:a,angle:i._sweepRad,clockwise:e.options.clockwise})),this._scaleView.visible&&(this._scaleView.setStyleOrClass(e.scale._style),this._scaleView.measure(this.doc,e.scale,this.width,this.height,0),this._scaleView.setExtents(t,s),this._scaleView.layout()),this._bandView.visible&&(this._bandView.setStyleOrClass(e.band._style),this._bandView.measure(this.doc,e.band,this.width,this.height,0),this._bandView.setExtends(t,s),this._bandView.layout()),this._innerView.setStyleOrClass(e.options.innerStyle);let n=s.inner;const l=getComputedStyle(this._innerView.dom),r=parseFloat(l.strokeWidth);r>1&&(n-=r/2),this._innerView.setSector({cx:t.x,cy:t.y,rx:n,ry:n,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(e.pin,n).trans(t.x,t.y)}$_layoutGroupedLabel(e,t,s){const i=t.getBBox(),a=this._rimView.getBBox(),n=+e._group.options.labelGap||0;t.anchor=V.END,t.trans(a.x+a.width/2-n,a.y+(s.radius-s.inner-i.height)/2)}}class ye extends x{constructor(e){super(e,"rct-circle-gauge-group")}_createPool(e){return new m(e,we)}_doRenderGauges(e,t,s,i){const a=this.doc,n=this.model,l=n.props.getCenter(s,i),r=n.props.getExtents(p(s,i));n.setChildExtents(r),s=i=2*r.radius,t.forEach(((e,t)=>{e.measure(a,n.getVisible(t),s,i,0),e.resize(s,i),e.layout()})),e.trans(l.x-r.radius,l.y-r.radius)}}class Ve extends s{}class xe extends T{getWidth(e){return h(this._widthDim,e)}getHeight(e){return h(this._heightDim,e)}getMaxWidth(e){return h(this._maxWidthDim,e)}getMaxHeight(e){return h(this._maxHeightDim,e)}getGap(e){return h(this._gapDim,e,0)}_doApply(e){super._doApply(e),this._setDims(e,"width","height","maxWidth","maxHeight","gap")}}xe.defaults=e(T.defaults,{maxWidth:"30%",maxHeight:"30%",gap:10});class me extends D{_doInit(e){super._doInit(e),e.label=(this._label=new xe(this.chart)).init(),e.scale=(this._scale=new Ve(this)).init()}get label(){return this._label}get scale(){return this._scale}isVertical(){return this._group?this._group.options.vertical:this._op.vertical}scaleVisible(){return!this._group&&this._scale.visible}calcedMinMax(){return this._scale.range()}_doPrepareRender(e){super._doPrepareRender(e),this._label._prepareRender()}}me.defaults=e(D.defaults,{reversed:!1});class ve extends l{constructor(){super(...arguments),this._args={gauge:null,value:NaN}}getStyle(e,t){if(this._op.styleCallback){this._args.gauge=e,this._args.value=t;return this._op.styleCallback(this._args)}}}class fe extends me{_doInit(e){super._doInit(e),e.valueBar=(this._valueBar=new ve(this)).init(),e.band=(this._band=new c(this)).init()}get valueBar(){return this._valueBar}get band(){return this._band}}fe.type=N;class ke extends t{}ke.defaults=e(t.defaults,{opposite:!1,gap:10});class Se extends xe{}Se.defaults=e(xe.defaults,{gap:10});class Ce extends O{_doInit(e){super._doInit(e),e.label=(this._label=new Se(this.chart)).init(),e.itemLabel=(this._itemLabel=new ke(this.chart)).init(),e.scale=(this._scale=new Ve(this)).init()}get label(){return this._label}get itemLabel(){return this._itemLabel}get scale(){return this._scale}calcedMinMax(){return this.scale.range()}}Ce.defaults=e(O.defaults,{vertical:!1,itemGap:10});class Re extends Ce{_doInit(e){super._doInit(e),e.band=(this._band=new c(this)).init()}get band(){return this._band}_gaugesType(){return"linear"}_doPrepareRender(e){super._doPrepareRender(e),this.band.visible&&this.band._prepareRender()}}Re.type=I,Re.gaugeType=N;class Be extends f{_createLine(e,t){return new A(e,t)}_doMeasure(e,t,s,i,a){const n=t.options,l=t._reversed,r=t._vertical,h=t.label,o=t.tick,c=t._steps,_=c.length;let u=r?n.gap:s,g=r?i:n.gap;if(this._tickContainer.setVis(o.visible)&&(this._tickContainer.setStyleOrClass(o._style),this._ticks.prepare(_)),r?u+=o.options.length:g+=o.options.length,this._labelContainer.setVis(h.visible)&&(this._labels.prepare(_,(t=>{t.setModel(e,h,null,null)})),_>0))if(r){let e=0;this._labels.forEach(((t,s)=>{t.setText(h.getText(c[l?s:_-1-s])),e=d(t.getBBox().width)})),u+=e}else{let e=0;this._labels.forEach(((t,s)=>{t.setText(h.getText(c[l?_-1-s:s])),e=d(t.getBBox().height)})),g+=e}return{width:u,height:g}}_doLayout(){const e=this.model;e._vertical?this.$_layoutVert(e,this.width,this.height):this.$_layoutHorz(e,this.width,this.height)}$_layoutHorz(e,t,s){const i=e.options,a=this._line,n=e.tick,l=e._steps;l.length;const r="opposite"===i.position,h=r?-n.options.length:n.options.length;let o,c=r?s-i.gap:i.gap;if(a.setVis(e.line.visible)&&(a.setStyleOrClass(e.line._style),a.setHLine(c,0,t)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((s,i)=>{o=e.getRate(l[i])*t,s.setVLine(o,c,c+h)})),this._labelContainer.visible){const s=this._labelContainer.textAlign()||"center";let i=Number.MIN_SAFE_INTEGER;c=r?0:c+h,this._labels.forEach(((a,n)=>{a.layout(s);const r=a.getBBox();o=e.getRate(l[n])*t,a.setVis(o-r.width/2>i)&&(a.trans(o-r.width/2,c),i=o+r.width/2)}))}}$_layoutVert(e,t,s){const i=e.options,a=this._line,n=e.tick,l=e._steps;this.height,l.length;const r="opposite"===i.position,h=r?n.options.length:-n.options.length;let o,c=r?i.gap:t-i.gap;if(a.setVis(e.line.visible)&&(a.setStyleOrClass(e.line._style),a.setVLine(c,0,s)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((t,i)=>{o=e.getRate(l[i])*s,t.setHLine(o,c,c+h)})),this._labelContainer.visible){const a=this._labelContainer.textAlign()||(r?"left":"right");c=r?c+h:t-i.gap+h,this._labels.forEach(((t,i)=>{t.layout(a);const n=t.getBBox(),h=r?c:c-n.width;o=e.getRate(l[i])*s,t.trans(h,o-n.height/2)}))}}}class Le extends v{_measureLabelSize(e,t,s){const i=e.label,a=this.labelView();return i.setText(e.getLabel(i,e.options.value)),a.text=i.options.text,i.buildSvg(a,null,t,s,e,i._domain),$(a.getBBox())}_renderGauge(e,t){const s=this.model,i=b(s._runValue,s.options.value);this._measureGauge(s,s.label,this.labelView(),i,s.isVertical(),e,t),this._renderValue()}_renderValue(){const e=this.model,t=e.label,s=e.scale,i=this.labelView(),a=b(e._runValue,e.options.value),n=M({},this._rBand);if(this._renderScale(n),this.background().setRect(n),n.height>0&&this._renderBand(e,n,a),"top"!==t._runPos&&"bottom"!==t._runPos||(this._rLabel.height=n.height),this._renderLabel(e,t,i,a),!this._vertical&&("left"===t._runPos||"right"===t._runPos)&&s.visible&&"opposite"===s.options.position){const e=i.getBBox();i.ty+e.height>this.height&&i.transY(d(0,this.height-e.height))}}_measureGauge(e,t,s,i,a,n,l){const r=this._rBand=P(0,0,n,l);if(this._vertical=e._group instanceof Ce?e._group.options.vertical:a,t.visible){const a=t._runPos=z(t.options.position,this._vertical?"top":"left"),h=t._runVert="top"===a||"bottom"===a,o=e._group?e._group.itemLabel.options.gap:t._runGap=t.getGap(h?l:n);let c=h?n:t.getWidth(n),_=h?t.getHeight(l):l;const u=h?n:t.getMaxWidth(n),g=h?t.getMaxHeight(l):l,p=this._rLabel=P(0,0,n,l);s.setStyleOrClass(t._style),t.setText(e.getLabel(t,t.options.animatable?i:e.options.value)),s.text=t.options.text,t.buildSvg(s,null,b(c,u),b(_,g),e,t._domain);const w=s.getBBox();switch(h?(p.height=b(_,w.height),r.height=d(0,r.height-(p.height+o))):(p.width=b(c,w.width),this._wLabel=e._group?e._group._labelWidth:p.width,r.width=d(0,r.width-(this._wLabel+o))),a){case"top":r.y=p.height+o;break;case"bottom":p.y=r.height+o;break;case"right":p.x=r.width+o;break;default:r.x=this._wLabel+o}}else this._rLabel=null}_renderLabel(e,t,s,i){if(s.visible){const e=this._rLabel,i=s.getBBox();let a=e.x,n=e.y;switch(t._runPos){case"top":case"bottom":a+=e.width/2;break;case"right":a=this.width-e.width,s.anchor=V.START,n+=d(0,(e.height-i.height)/2);break;default:s.anchor=V.END,a+=this._wLabel,n+=d(0,(e.height-i.height)/2)}s.trans(a,n)}}_renderScale(e){const t=this.model,s=t.label,i=t.scale,a=this.scaleView(),n=this._vertical?e.height:e.width;let l,r;if(i._vertical=this._vertical,i._reversed=t.options.reversed,isNaN(t._runValue)&&i.buildSteps(n,t.options.value),a.setVis(t.scaleVisible())){const t=a.measure(this.doc,i,e.width,e.height,1);this._vertical?(l=0,r=e.y,e.width=d(0,e.width-t.width),"opposite"===i.options.position?l=e.x+e.width:(s._runVert||(l=e.x),e.x+=t.width)):(l=e.x,e.height=d(0,e.height-t.height),"opposite"===i.options.position?s._runVert?(r=e.y,e.y+=t.height):(this._rLabel.y=e.y+=t.height,r=e.y-t.height):r=e.y+e.height),a.resizeByMeasured().layout().trans(l,r)}}}class Ee extends B{constructor(e){super(e,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._labelGap=3,this._barViews=new m(this,G),this.add(this._labelContainer=new g(e,"rct-linear-gauge-band-tick-labels")),this._labels=new m(this._labelContainer,u)}_doMeasure(e,t,s,i,a){const n=t.gauge,l=this._vertical=n instanceof fe?n.isVertical():n.options.vertical,r="inside"===t.options.position,h=this._thick=r?l?s:i:t.getThickness(l?s:i)+(this._gap=b(t.options.gap,0));let o=l?h:s,c=l?i:h;const _=this._ranges=t.getRanges();if(this._labelContainer.setVis(t.tickLabel.visible&&_.length>0)){const e=[_[0].fromValue].concat(_.map((e=>e.toValue)));if(this._labelContainer.setStyleOrClass(t.tickLabel._style),this._labels.prepare(_.length+1),l){let t=0;this._labels.forEach(((s,i)=>{s.text=String(e[i]),t=d(s.getBBox().width)})),o+=t+this._labelGap}else{let t=0;this._labels.forEach(((s,i)=>{s.text=String(e[i]),t=d(s.getBBox().height)})),c+=t}}return{width:o,height:c}}_doLayout(e){const t=this.model,s=t.gauge,i=s.scale,a=i._max-i._min;this._labelContainer.setVis(this.$_layoutBars(s,a,this._ranges)&&this._labelContainer.visible&&"inside"!==t.options.position)&&this.$_layoutLabels(s,a,this._ranges)}$_layoutBars(e,t,s){if(this._barViews.prepare(s.length),!this._barViews.isEmpty&&t>0){const e=this._vertical,i="inside"===this.model.options.position,a="opposite"===this.model.options.position,n=this.width,l=this.height,r=e?l:n,h=this._thick;let o=0;return this._barViews.prepare(s.length).forEach(((c,d)=>{const _=s[d],u=r*(_.toValue-_.fromValue)/t;if(e){const e=i||a?0:n-h;c.setBounds(e,l-o-u,h,u)}else{const e=a?l-h:0;c.setBounds(o,e,u,this._thick)}c.internalClearStyleAndClass(),c.setFill(_.color),_.style&&c.addStyleOrClass(_.style),o+=u})),!0}}$_layoutLabels(e,t,s){const i="opposite"===this.model.options.position;if(this._vertical){const e=this.height,a=i?V.START:V.END,n=i?this._thick+this._labelGap:this.width-this._thick-this._labelGap;let l=this._labels.get(0);l.anchor=a,l.trans(n,e-l.getBBox().height/2);for(let i=1;i<=s.length;i++){const r=e-e*s[i-1].toValue/t;l=this._labels.get(i),l.anchor=a,l.trans(n,r-l.getBBox().height/2)}}else{const e=this.width,a=i?0:this._thick;this._labels.get(0).trans(0,a);for(let i=1;i<=s.length;i++){const n=e*s[i-1].toValue/t;this._labels.get(i).trans(n,a)}}}}class Te extends Le{constructor(e){super(e,"rct-linear-gauge")}_doInitContents(e,t){t.add(this._background=new G(e,"rct-linear-gauge-background")),t.add(this._bandView=new Ee(e)),t.add(this._scaleView=new Be(e)),t.add(this._valueView=new G(e,"rct-linear-gauge-value")),t.add(this._labelView=new u(e))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(e,t){}_renderScale(e){const t=this.model.band,s=this._bandView;if(super._renderScale(e),s.setVis(t.visible)){const i=+t.options.gap||0,a=s.measure(this.doc,t,e.width,e.height,1);s.resizeByMeasured().layout(),this._vertical?"inside"===t.options.position?s.trans(e.x,e.y):"opposite"===t.options.position?(s.trans(e.x+e.width-a.width,e.y),e.width-=a.width+i):(s.trans(e.x,e.y),e.width-=a.width+i,e.x+=a.width+i):"inside"===t.options.position?s.trans(e.x,e.y):"opposite"===t.options.position?(s.trans(e.x,e.y),e.height-=a.height+i,e.y+=a.height+i):(s.trans(e.x,e.y+e.height-a.height),e.height-=a.height+i)}}_renderBand(e,t,s){const i=this._valueView,a=e.options.reversed,n=e.valueBar,l=e._group?e._group.scale:e.scale;if(i.setVis(!H(t)&&n.visible&&!l.isEmpty()&&!isNaN(e.options.value)))if(i.setStyleOrClass(n._style),i.internalSetStyleOrClass(n.getStyle(e,s)),this._vertical){const e=t.height*l.getRate(s),n=a?t.y:t.y+t.height-e;i.setBounds(t.x,n,t.width,e)}else{const e=t.width*l.getRate(s),n=a?t.x+t.width-e:t.x;i.setBounds(n,t.y,e,t.height)}}}class De extends x{constructor(e,t){super(e,t)}_doInitContents(e,t){super._doInitContents(e,t),t.insertFirst(this._scaleView=new Be(e)),t.insertFirst(this._textView=new u(e,"rct-linear-gauge-group-label"))}_prepareGauge(e,t){this._textView.setVis(t.label.visible)&&this._textView.setStyleOrClass(t.label._style),this._scaleView.setVis(t.scale.visible)&&this._scaleView.setStyleOrClass(t.scale._style),super._prepareGauge(e,t)}_doRenderGauges(e,t,s,i){const a=this.model,n=a.options,l=this._textView,r=P(0,0,s,i);if(l.visible){l.text=a.label.options.text,a.label.buildSvg(l,null,NaN,NaN,a,null);const e=this._textView.getBBox().height+a.label.getGap(i);r.y+=e,r.height-=e,l.trans(this.width/2,0)}a._labelWidth=a._labelHeight=0,this._gaugeViews.forEach(((e,t)=>{const n=e._measureLabelSize(a.get(t),s,i);a._labelWidth=d(a._labelWidth,n.width),a._labelHeight=d(a._labelHeight,n.height)}));const h=W(r),o=a.itemLabel.options.gap;n.vertical?(h.height-=a._labelHeight+o,a.itemLabel.options.opposite||(h.y+=a._labelHeight+o)):(h.width-=a._labelWidth+o,a.itemLabel.options.opposite||(h.x+=a._labelWidth+o)),this._renderScale(a,r,h),n.vertical?this.$_layoutVert(this.doc,a,t,r):this.$_layoutHorz(this.doc,a,t,r)}_renderScale(e,t,s){const i=this._scaleView,a=e.scale,n=e.options.vertical,l=n?t.height:t.width,r=[];let h,o;if(this._gaugeViews.forEach(((t,s)=>{r.push(e.get(s).getValue())})),a.buildGroupSteps(l,r),a._vertical=n,i.setVis(a.visible)){const e=i.measure(this.doc,a,s.width,s.height,1);if(n){const i=e.width;s.width-=i,t.width-=i,o=s.y,"opposite"===a.options.position?h=s.x+s.width:(h=s.x,s.x+=i,t.x+=i)}else{const i=e.height;s.height-=i,t.height-=i,h=s.x,"opposite"===a.options.position?(o=s.y,s.y+=i,t.y+=i):o=s.y+s.height}i.resizeByMeasured().layout().trans(h,o)}}$_layoutVert(e,t,s,i){const a=i.height,n=(i.width-t.options.itemGap*(s.count-1))/s.count,l=i.y;let r=i.x;s.forEach(((s,i)=>{s.measure(e,t.get(i),n,a,0),s.resize(n,a),s.layout(),s.trans(r,l),r+=n+t.options.itemGap}))}$_layoutHorz(e,t,s,i){const a=t.options.itemGap,n=i.width,l=(i.height-a*(s.count-1))/s.count,r=i.x;let h=i.y;s.forEach(((s,i)=>{s.measure(e,t.get(i),n,l,0),s.resize(n,l),s.layout(),s.trans(r,h),h+=l+a}))}}class Ne extends De{constructor(e){super(e,"rct-linear-gauge-group")}_doInitContents(e,t){super._doInitContents(e,t),t.insertChild(this._bandView=new Ee(e),this._scaleView)}_createPool(e){return new m(e,Te)}_renderScale(e,t,s){super._renderScale(e,t,s);const i=this._bandView,a=e.band;let n,l;if(i.setVis(a.visible)){const r=+a.options.gap||0,h=i.measure(this.doc,a,s.width,s.height,1);if(e.options.vertical){const e=h.width+r;s.width-=e,t.width-=e,l=s.y,"opposite"===a.options.position?n=s.x+s.width+r:(n=s.x,s.x+=e,t.x+=e)}else{const e=h.height+r;s.height-=e,t.height-=e,n=s.x,"opposite"===a.options.position?(l=s.y,s.y+=e,t.y+=e):l=s.y+s.height+r}i.resizeByMeasured().layout().trans(n,l)}}}class Oe extends t{constructor(e){super(e.chart),this.gauge=e}getRanges(){var e;return null===(e=this.$_internalRanges())||void 0===e?void 0:e.slice(0)}_doApply(e){const t=this;var s;super._doApply(e),(s=e.ranges)!==t._ranges&&(t._ranges=s,t._runRanges=null)}$_internalRanges(){if(!this._runRanges){const e=this.gauge.options;this._runRanges=r(this._ranges,e.minValue,e.maxValue,this._op.rangeInclusive)}return this._runRanges}}Oe.defaults=e(t.defaults,{vertical:!0,rangeInclusive:!0});class Ie extends l{}Ie.defaults=e(t.defaults,{visible:!0});class Ge extends ve{}class He extends me{_doInit(e){super._doInit(e),e.band=(this._band=new Oe(this)).init(),e.targetBar=(this._targetBar=new Ie(this)).init(),e.valueBar=(this._valueBar=new Ge(this)).init()}get band(){return this._band}get targetBar(){return this._targetBar}get valueBar(){return this._valueBar}getRanges(e,t,s){return r(this._op.ranges,e,t,z(s,this._op.rangeInclusive))}}He.type=F,He.defaults=e(me.defaults,{rangeInclusive:!0});class Ae extends Ce{getRanges(e,t,s){return r(this._op.ranges,e,t,z(s,this._op.rangeInclusive))}_gaugesType(){return"bullet"}}Ae.type=Y,Ae.gaugeType=F,Ae.defaults=e(Ce.defaults,{rangeInclusive:!0});class $e extends Le{constructor(e){super(e,"rct-bullet-gage")}_doInitContents(e,t){t.add(this._background=new G(e,"rct-bullet-gauge-background")),t.add(this._barContainer=new g(e,void 0)),this._barViews=new m(this._barContainer,G),t.add(this._valueView=new G(e,"rct-bullet-gauge-value")),t.add(this._targetView=new G(e,"rct-bullet-gauge-target")),t.add(this._scaleView=new Be(e)),t.add(this._labelView=new u(e))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(e,t){}_renderBand(e,t,s){const i=e.options,a=e._group,n=e.options.reversed,l=this._vertical,r=a?a.scale:e.scale,h=this._valueView,o=this._targetView;if(this._barContainer.setVis(!H(t)&&!r.isEmpty())){const s=e.getRanges(r._min,r._max,!1)||(null==a?void 0:a.getRanges(r._min,r._max,!1));s&&(this._barContainer.setRect(t),this._barViews.prepare(s.length),l?this._barViews.forEach(((e,i)=>{const a=s[i],l=t.height*r.getRate(a.toValue-a.fromValue),h=t.height*r.getRate(a.fromValue);e.setBounds(0,n?h:t.height-h-l,t.width,l),e.internalClearStyleAndClass(),e.setFill(a.color),a.style&&e.addStyleOrClass(a.style)})):this._barViews.forEach(((e,i)=>{const a=s[i],l=t.width*r.getRate(a.toValue-a.fromValue),h=t.width*r.getRate(a.fromValue);e.setBounds(n?t.width-l-h:h,0,l,t.height),e.internalClearStyleAndClass(),e.setFill(a.color),a.style&&e.addStyleOrClass(a.style)})))}if(h.setVis(e.valueBar.visible&&!r.isEmpty()&&!isNaN(s)))if(h.setStyleOrClass(e.valueBar._style),s<i.targetValue&&e.valueBar.options.belowStyle&&h.internalSetStyleOrClass(e.valueBar.options.belowStyle),h.internalSetStyleOrClass(e.valueBar.getStyle(e,s)),l){const e=t.height*r.getRate(s),i=n?t.y:t.y+t.height-e;h.setBounds(t.x+t.width/3,i,t.width/3,e)}else{const e=t.width*r.getRate(s),i=n?t.x+t.width-e:t.x;h.setBounds(i,t.y+t.height/3,e,t.height/3)}if(o.setVis(e.targetBar.visible&&!r.isEmpty()&&!isNaN(i.targetValue)))if(o.setStyleOrClass(e.targetBar._style),l&&t.width>10){let e=t.height*r.getRate(i.targetValue);e=n?t.y+e:t.y+t.height-e,o.setBounds(t.x+5,e-1,t.width-10,3)}else if(!l&&t.height>10){let e=t.width*r.getRate(i.targetValue);e=n?t.x+t.width-e:t.x+e,o.setBounds(e-1,t.y+5,3,t.height-10)}}}class Me extends De{constructor(e){super(e,"rct-bullet-gauge-group")}_createPool(e){return new m(e,$e)}}class Pe extends l{getThickness(e){return h(this._thicknessDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"thickness")}}Pe.defaults=e(t.defaults,{thickness:7});class ze extends l{getLength(e){return h(this._lengthDim,e,e)}_doApply(e){super._doApply(e),this._setDim(e,"length")}}ze.defaults=e(t.defaults,{thickness:7,length:"60%"});class We extends ze{}We.defaults=e(ze.defaults,{thickness:5,length:"85%"});class Fe extends ze{}Fe.defaults=e(ze.defaults,{thickness:2,length:"95%",animatable:!1,duration:200});class Ye extends l{constructor(e,t){super(e),this.length=t}}class Xe extends l{}Xe.defaults=e(t.defaults,{step:1,offset:1});class Ue extends l{constructor(e,t){super(e),this.raidus=t}}class je extends X{constructor(e){super(e.chart)}}je.defaults=e(X.defaults,{text:"RealChart Clock<br>ver1.0",position:"top"});class qe extends j{_doInit(e){super._doInit(e),e.rim=(this.rim=new Pe(this)).init(),e.hourHand=(this.hourHand=new ze(this)).init(),e.minuteHand=(this.minuteHand=new We(this)).init(),e.secondHand=(this.secondHand=new Fe(this)).init(),e.tick=(this.tick=new Ye(this,10)).init(),e.minorTick=(this.minorTick=new Ye(this,5)).init(),e.tickLabel=(this.tickLabel=new Xe(this)).init(),e.pin=(this.pin=new Ue(this,5)).init(),e.label=(this.label=new je(this)).init()}getTime(){const e=this._op;return e.time instanceof Date?e.time:q(e.time)?new Date(e.time):isNaN(e.time)?void 0:new Date(e.time)}getExtents(e,t){const s=p(e,t);return{cx:h(this._centerXDim,e,e/2),cy:h(this._centerYDim,t,t/3),rd:h(this._radiusDim,s,s/2)}}_doApply(e){const t=this;var s,i,a;super._doApply(e),s=e.centerX,i=e.centerY,a=e.radius,(t._centerXDim||s!==t._centerX)&&(t._centerXDim=J(z(t._centerX=s,o.DEF_CENTER),!0)),t._centerYDim&&i===t._centerY||(t._centerYDim=J(z(t._centerY=i,o.DEF_CENTER),!0)),t._radiusDim&&a===t._radius||(t._radiusDim=J(z(t._radius=a,o.DEF_RADIUS),!0))}}qe.type=U,qe.defaults=e(j.defaults,{centerX:"50%",centerY:"50%",radius:"40%",active:!0});class Je extends ie{constructor(e){super(),this.view=e}_doUpdate(e){return this.view._secRate=e,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class Ke extends K{constructor(e){super(e,"rct-clock-gauge"),this._rimThick=0,this._secRate=1}_doInitContents(e,t){t.add(this._faceView=new Q(e,"rct-clock-gauge-face")),t.add(this._rimView=new _(e,"rct-clock-gauge-rim")),t.add(this._labelView=new u(e,"rct-clock-gauge-label")),this._labelView.layout=Z.MIDDLE,t.add(this._tickContainer=new g(e,"rct-clock-gauge-ticks")),t.add(this._tickLabelContainer=new g(e,"rct-clock-gauge-tick-labels")),t.add(this._hourView=new L(e,"rct-clock-gauge-hour")),t.add(this._minuteView=new L(e,"rct-clock-gauge-minute")),t.add(this._secondView=new L(e,"rct-clock-gauge-second")),t.add(this._pinView=new Q(e,"rct-clock-gauge-pin")),this._tickViews=new m(this._tickContainer,A,"rct-clock-gauge-tick"),this._minorTickViews=new m(this._tickContainer,A,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new m(this._tickLabelContainer,u,"rct-clock-gauge-tick-label")}_prepareGauge(e,t){this._tickViews.prepare(t.tick.visible?12:0),this._minorTickViews.prepare(t.minorTick.visible?48:0);const s=Math.round(12/d(1,Math.floor(t.tickLabel.options.step)||1));this._tickLabelViews.prepare(t.tickLabel.visible?s:0,(e=>{e.layout=Z.MIDDLE}))}_renderGauge(e,t){const s=this.model,i=this._exts=s.getExtents(e,t);this._secRate=1,this.$_renderFace(s,i),this.$_renderHands(s,i),s.options.active&&!s.getTime()?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(this.model,this._exts),ee(e-this._prevSec)>=1&&this._secondView.visible&&s.chart.animatable()&&s.secondHand.options.animatable&&this.$_moveSecond(e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(e,t){const s=this._labelView,i=this._rimView,a=this._minorTickViews,n=this._tickLabelViews,l=this._pinView,{cx:r,cy:h,rd:o}=t,c=this._rimThick=i.visible?e.rim.getThickness(o):0;this._faceView.setCircle(r,h,o),i.setVis(e.rim.visible)&&(i.internalSetStyleOrClass(e.rim._style),i.setSector({cx:r,cy:h,rx:o,ry:o,innerRadius:1-c/o,start:0,angle:2*Math.PI,clockwise:!0}));const d=o-c;let _=d-e.tick.length,u=te,g=se/12;if(this._tickViews.forEach(((t,s)=>{t.setLine(r+S(u)*d,h+C(u)*d,r+S(u)*_,h+C(u)*_),t.internalSetStyleOrClass(e.tick._style),u+=g})),!a.isEmpty){let t=0;_=d-e.minorTick.length,u=te,g=se/60,a.forEach((s=>{t%5==0&&(u+=g,t++),s.setLine(r+S(u)*d,h+C(u)*d,r+S(u)*_,h+C(u)*_),s.internalSetStyleOrClass(e.minorTick._style),u+=g,t++}))}if(!n.isEmpty){const t=12/n.count,s=se/12*t;u=te,n.get(0).text="12",_=d-(e.tick.length+e.tickLabel.options.offset||0),_-=.5*n.get(0).getBBox().height,n.forEach(((i,a,n)=>{i.text=String(0===a?12:a*t),i.trans(r+S(u)*_,h+C(u)*_),i.internalSetStyleOrClass(e.tickLabel._style),u+=s}))}l.setVis(e.pin.visible)&&(l.setCircle(r,h,e.pin.raidus),l.setStyleOrClass(e.pin._style)),s.setVis(e.label.visible)&&(s.internalSetStyleOrClass(e.label._style),e.label.buildSvg(s,null,NaN,NaN,null,null),"bottom"===e.label.options.position?s.trans(r,h+_/2):s.trans(r,h-_/2))}$_getNow(){const e=this.model.options.timezone;let t=this.model.getTime()||new Date;if(!isNaN(e)){const s=t.getMinutes()+(t.getTimezoneOffset()+e);t.setMinutes(s)}return t}$_renderHands(e,t){const s=this.$_getNow(),i=s.getHours(),a=s.getMinutes(),n=s.getSeconds(),{cx:l,cy:r,rd:h}=t,o=new E;let c,d,_,u;c=e.hourHand,d=this._hourView,d.setVis(c.visible)&&(u=se*(i/12+a/60/12+n/60/60/12),_=c.getLength(h-this._rimThick),o.rect(-c.options.thickness/2,-_,c.options.thickness,_),d.internalSetStyleOrClass(c._style),d.setPath(o.close(!0)).trans(l,r).rotate(u*y)),c=e.minuteHand,d=this._minuteView,d.setVis(c.visible)&&(u=se*(a/60+n/60/60),_=c.getLength(h-this._rimThick),o.rect(-c.options.thickness/2,-_,c.options.thickness,_),d.internalSetStyleOrClass(c._style),d.setPath(o.close(!0)).trans(l,r).rotate(u*y)),c=e.secondHand,d=this._secondView,d.setVis(c.visible)&&(u=this._secRate<1?se*(this._aniSec+this._secRate)/60:se*n/60,_=c.getLength(h-this._rimThick),o.rect(-c.options.thickness/2,-_,c.options.thickness,_),d.internalSetStyleOrClass(c._style),d.setPath(o.close(!0)).trans(l,r).rotate(u*y),this._prevSec=n)}$_moveSecond(e){if(!isNaN(e)){this._aniSec=e;const t=new Je(this);t.duration=this.model.secondHand.options.duration||200,t.start()}}}function Qe(e){(function(e){return e.Series&&e.SeriesView})(e)&&(e.Gauge.register(He,ce,qe,fe),e.GaugeGroup.register(Ae,de,Re),e.GaugeView.register([ce,we],[fe,Te],[He,$e],[qe,Ke],[de,ye],[Re,Ne],[Ae,Me]))}export{He as BulletGauge,ce as CircleGauge,qe as ClockGauge,fe as LinearGauge,Qe as default,Qe as registerGauge};
package/heatmap.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * RealChart Heatmap v1.4.6
3
+ * RealChart Heatmap v1.4.7
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
package/heatmap.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * RealChart Heatmap v1.4.6
3
+ * RealChart Heatmap v1.4.7
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
package/ie/gauge.ie.js ADDED
@@ -0,0 +1,7 @@
1
+
2
+ /**
3
+ * RealChart Gauge v1.4.7
4
+ * Copyright (C) 2023-2025 WooriTech Inc.
5
+ * All Rights Reserved.
6
+ */
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("realchart")):"function"==typeof define&&define.amd?define(["exports","realchart"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChartGauge={},t.RealChart)}(this,(function(t,e){"use strict";function i(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var n,r=i(e),s=(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),o=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),i.prototype.getRange=function(t,e){var i=this.$_internalRanges(t);if(i)for(var n=0,r=i;n<r.length;n++){var s=r[n];if(e>=s.fromValue&&e<s.toValue)return s}},i.prototype._doApply=function(e){var i,n=this;t.prototype._doApply.call(this,e),(i=e.ranges)!==n._ranges&&(n._ranges=i,n._runRanges=null)},i.prototype.$_internalRanges=function(t){return this._runRanges||(this._runRanges=e.buildValueRanges(this._ranges,t.minValue,t.maxValue,this._op.rangeInclusive)),this._runRanges},i.defaults=e.extend(e.ChartItem.defaults,{rangeInclusive:!0}),i}(e.GaugeItem),a=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),i.prototype.getSegmentThickness=function(t){return e.calcPercent(this._segmentThicknessDim,t,t)},i.prototype._doApply=function(e){t.prototype._doApply.call(this,e),this._setDim(e,"segmentThickness")},i.defaults=e.extend(o.defaults,{segmentGap:0}),i}(o),l=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),i.prototype.getThickness=function(t){return e.calcPercent(this._thicknessDim,t,t)},i.prototype._doApply=function(e){t.prototype._doApply.call(this,e),this._setDim(e,"thickness")},i.defaults=e.extend(o.defaults,{thickness:"100%",stroked:!1}),i}(o);!function(t){function i(){return null!==t&&t.apply(this,arguments)||this}s(i,t),i.defaults=e.extend(e.ChartItem.defaults,{visible:!1})}(e.GaugeItem);var u=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),i.prototype.getExtents=function(t){return{radius:e.calcPercent(this._radiusDim,t,0),length:e.calcPercent(this._lengthDim,t,0),offset:e.calcPercent(this._offsetDim,t,0)}},i.prototype._doApply=function(e){t.prototype._doApply.call(this,e),this._setDims(e,"radius","length","offset")},i.defaults=e.extend(e.ChartItem.defaults,{visible:!1,radius:3,length:"100%",offset:0}),i}(e.GaugeItem),c=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),i.prototype.getRadius=function(t){return e.calcPercent(this._radiusDim,t,0)},i.prototype._doApply=function(e){t.prototype._doApply.call(this,e),this._setDim(e,"radius")},i.defaults=e.extend(e.ChartItem.defaults,{visible:!1,radius:5}),i}(e.GaugeItem),h=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),i.prototype._getStepMultiples=function(t){return[1,2,2.5,5,10]},i.defaults=e.extend(e.GaugeScale.defaults,{visible:!1,stepPixels:72}),i}(e.GaugeScale),p=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),i.prototype._doInit=function(i){t.prototype._doInit.call(this,i),i.band=(this._band=new e.GaugeRangeBand(this)).init(),i.scale=(this._scale=new h(this)).init(),i.rim=(this._rim=new a(this)).init(),i.valueRim=(this._valueRim=new l(this)).init(),i.hand=(this._hand=new u(this)).init(),i.pin=(this._pin=new c(this)).init()},Object.defineProperty(i.prototype,"band",{get:function(){return this._band},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this._scale},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"rim",{get:function(){return this._rim},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"valueRim",{get:function(){return this._valueRim},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"hand",{get:function(){return this._hand},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"pin",{get:function(){return this._pin},enumerable:!1,configurable:!0}),i.prototype.getExtents=function(i){var n=t.prototype.getExtents.call(this,i),r=this.scale,s=this.band,o=n.radius,a=o-n.inner;if(s.visible)switch(n.bandThick=s.getThickness(a),s.options.position){case"inside":n.band=o-(a-n.bandThick)/2;break;case"opposite":n.band=n.inner-s.options.gap,n.inner=n.band-n.bandThick;break;default:n.band=o+=n.bandThick+s.options.gap}if(n.scaleTick=e.maxv(1,r.tick.options.length||0),n.scaleLabel=16,"opposite"===r.options.position)n.scale=n.inner-r.options.gap,n.inner=n.scale-n.scaleTick-n.scaleLabel;else n.scale=o+r.options.gap;return n},i.type=e.CircleGaugeType,i}(e.CircularGauge),_=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),i.prototype._gaugesType=function(){return"circle"},i.type=e.CircleGaugeGroupType,i.gaugeType=e.CircleGaugeType,i.defaults=e.extend(e.CircularGaugeGroup.defaults,{innerRadius:"50%"}),i}(e.CircularGaugeGroup),d=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e}(e.ValueGaugeView),f=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return d(i,t),i.prototype.setExtents=function(t,e){this._center=t,this._exts=e},i.prototype._createLine=function(t,i){return new e.ArcElement(t,i)},i.prototype._doMeasure=function(t,e,i,n,r){var s=e._steps.length-(360===e.gauge.options.sweepAngle?1:0);return this._line.setVis(e.line.visible)&&this._line.internalSetStyleOrClass(e.line._style),this._tickContainer.setVis(e.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(e.tick._style),this._ticks.prepare(s)),this._labelContainer.setVis(e.label.visible)&&(this._labelContainer.internalSetStyleOrClass(e.label._style),this._labels.prepare(s)),{width:i,height:n}},i.prototype._doLayout=function(t){var i,n,r,s,o=this.model,a=o._steps,l=o.gauge,u=l.options,c="opposite"===o.options.position?-1:1,h=l._props,p=this._center.x,_=this._center.y,d=this._exts.scale,g=d+this.model.tick.options.length*c,f=h._sweepRad,y=h._startRad,b=u.maxValue-u.minValue,w=u.clockwise;if(this._line.visible&&this._line.setArc(p,_,d,y,w?f:-f,w),this._tickContainer.visible&&this._ticks.forEach((function(t,l,u){var c=o.getRate(a[l])*(w?f:-f)+y;i=p+e.cos(c)*d,n=_+e.sin(c)*d,r=p+e.cos(c)*g,s=_+e.sin(c)*g,t.setLine(i,n,r,s)})),this._labelContainer.visible){this._labels.get(0).setText(String(u.maxValue));var v=g+.2*this._labels.get(0).getBBox().height*c;this._labels.forEach((function(t,i){var n=o.getRate(a[i])*(w?f:-f)+y;t.setText(String(e.fixnum(u.minValue+o.getRate(a[i])*b))),t.setContrast(null).layout("center");var l=t.getBBox();r=p+e.cos(n)*(v+l.width/2*c)-l.width/2,s=_+e.sin(n)*(v+l.height/2*c)-l.height/2,t.trans(r,s)}))}},i}(e.ScaleView),y=function(t){function i(i){var n=t.call(this,i,"rct-circle-gauge-band")||this;return n._sectorViews=new e.ElementPool(n,e.SectorElement),n.add(n._labelContainer=new e.LayerElement(i,"rct-circle-gauge-band-tick-labels")),n._labels=new e.ElementPool(n._labelContainer,e.TextElement),n}return d(i,t),i.prototype.setExtends=function(t,e){this._center=t,this._exts=e},i.prototype._doLayout=function(t){var e=this.model,i=e.gauge,n=i.scale,r=i._props,s=this._center.x,o=this._center.y,a=this._exts.band,l=i.options.clockwise,u=1-this._exts.bandThick/a,c=e.getRanges(),h=r._sweepRad;i.options.maxValue,i.options.minValue;var p=r._startRad;this._sectorViews.prepare(c.length).forEach((function(t,e){var i=n.getRate(c[e].toValue-c[e].fromValue)*h;t.setSector({cx:s,cy:o,rx:a,ry:a,innerRadius:u,start:p,angle:i,clockwise:l}),t.internalClearStyleAndClass(),t.setFill(c[e].color),c[e].style&&t.addStyleOrClass(c[e].style),p+=l?i:-i}))},i}(e.ChartElement),b=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return d(i,t),i.prototype.render=function(t,i){var n=t.getRadius(i);return n!==this._radius&&(this._radius=n,this.setPath((new e.PathBuilder).circle(0,0,n).end())),this.internalSetStyleOrClass(t._style),this},i}(e.PathElement),w=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return d(i,t),i.prototype.render=function(t,i){var n=t.getExtents(i);if(n.radius!==this._radius||n.length!==this._length||n.offset!==this._offset){var r=this._radius=n.radius,s=this._offset=n.offset;if(this._length=n.length,this._radius>0&&this._length>0){var o=new e.PathBuilder;o.move(-r,s).line(0,-this._length+s).line(r,s),this.setPath(o.end())}else this.setPath("")}return this.internalSetStyleOrClass(t._style),this},i}(e.PathElement),v=function(t){function i(e){return t.call(this,e,"rct-circle-gauge")||this}return d(i,t),i.prototype._doInitContents=function(t,i){i.add(this._rimView=new e.SectorElement(t,"rct-circle-gauge-rim")),i.add(this._valueView=new e.SectorElement(t,"rct-circle-gauge-value")),i.add(this._innerView=new e.SectorElement(t,"rct-circle-gauge-inner")),i.add(this._textView=new e.TextElement(t,"rct-circle-gauge-label")),i.add(this._handContainer=new e.LayerElement(t,void 0)),i.add(this._scaleView=new f(t)),i.add(this._bandView=new y(t))},i.prototype._backgroundView=function(){return this._rimView},i.prototype._prepareGauge=function(t,e){this._rimView.setVis(e.rim.visible),this._scaleView.setVis(e.scale.visible),this._bandView.setVis(e.band.visible),this._valueView.setVis(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new w(t,"rct-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),e.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new b(t,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVis(e.labelVisible())&&this._textView.setStyleOrClass(e.label._style)},i.prototype._renderGauge=function(t,i){var n=this.model,r=n.getCenter(t,i),s=n.getExtents(e.minv(t,i));this.$_renderBackground(n,r,s),this._renderValue()},i.prototype._renderValue=function(){var t=this.model,i=t.options,n=t.scale,r=t.getProps(),s=t.getValue(),o=n.getRate(e.pickNum(s,0)),a=this._center,l=this._exts,u=t.valueRim.getThickness(l.radiusThick),c=this._textView;if(this._valueView.visible){var h=t.valueRim,p=h.options,_=h.getRange(i,s),d=l.value+(p.stroked?0:u/2),g=this._valueView;g.setStyleOrClass(h._style),_&&(g.setStyle(p.stroked?"stroke":"fill",_.color),_.style&&g.addStyleOrClass(_.style)),p.stroked&&(g.setFill("none"),g.setStyle("strokeWidth",e.pixel(u))),g.setBoolData("stroked",p.stroked),g.setSectorEx({cx:a.x,cy:a.y,rx:d,ry:d,innerRadius:(d-u)/d,start:r._startRad,angle:r._sweepRad*o,clockwise:i.clockwise},p.stroked)}if(this._handView){var f=(r._handRad+r._sweepRad*o)*e.RAD_DEG;this._handView.render(t.hand,l.radius).transp(a).rotate(t.options.clockwise?f:-f)}if(c.visible){var y=t.label;if(y.setText(t.getLabel(y,y.options.animatable?s:i.value)),c.text=y.options.text,c.setBoolData("grouped",!!t._group),y.buildSvg(c,null,NaN,NaN,t,y._domain),t._group)this.$_layoutGroupedLabel(t,c,l);else{var b=c.getBBox(),w=y.getOffset(this.width,this.height);c.trans(a.x+w.x,a.y-b.height/2+w.y)}}},i.prototype.$_renderBackground=function(t,e,i){var n=t.getProps(),r=n._startRad;this._center=e,this._exts=i,t.scale.buildSteps(i.scale*n._sweepRad,NaN),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(t.rim._style),this._rimView.setSector({cx:e.x,cy:e.y,rx:i.radius,ry:i.radius,innerRadius:1-i.radiusThick/i.radius,start:r,angle:n._sweepRad,clockwise:t.options.clockwise})),this._scaleView.visible&&(this._scaleView.setStyleOrClass(t.scale._style),this._scaleView.measure(this.doc,t.scale,this.width,this.height,0),this._scaleView.setExtents(e,i),this._scaleView.layout()),this._bandView.visible&&(this._bandView.setStyleOrClass(t.band._style),this._bandView.measure(this.doc,t.band,this.width,this.height,0),this._bandView.setExtends(e,i),this._bandView.layout()),this._innerView.setStyleOrClass(t.options.innerStyle);var s=i.inner,o=getComputedStyle(this._innerView.dom),a=parseFloat(o.strokeWidth);a>1&&(s-=a/2),this._innerView.setSector({cx:e.x,cy:e.y,rx:s,ry:s,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(t.pin,s).trans(e.x,e.y)},i.prototype.$_layoutGroupedLabel=function(t,i,n){var r=i.getBBox(),s=this._rimView.getBBox(),o=+t._group.options.labelGap||0;i.anchor=e.TextAnchor.END,i.trans(s.x+s.width/2-o,s.y+(n.radius-n.inner-r.height)/2)},i}(g),m=function(t){function i(e){return t.call(this,e,"rct-circle-gauge-group")||this}return d(i,t),i.prototype._createPool=function(t){return new e.ElementPool(t,v)},i.prototype._doRenderGauges=function(t,i,n,r){var s=this.doc,o=this.model,a=o.props.getCenter(n,r),l=o.props.getExtents(e.minv(n,r));o.setChildExtents(l),n=r=2*l.radius,i.forEach((function(t,e){t.measure(s,o.getVisible(e),n,r,0),t.resize(n,r),t.layout()})),t.trans(a.x-l.radius,a.y-l.radius)},i}(e.GaugeGroupView),V=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e}(e.GaugeScale),k=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return V(i,t),i.prototype.getWidth=function(t){return e.calcPercent(this._widthDim,t)},i.prototype.getHeight=function(t){return e.calcPercent(this._heightDim,t)},i.prototype.getMaxWidth=function(t){return e.calcPercent(this._maxWidthDim,t)},i.prototype.getMaxHeight=function(t){return e.calcPercent(this._maxHeightDim,t)},i.prototype.getGap=function(t){return e.calcPercent(this._gapDim,t,0)},i.prototype._doApply=function(e){t.prototype._doApply.call(this,e),this._setDims(e,"width","height","maxWidth","maxHeight","gap")},i.defaults=e.extend(e.GaugeLabel.defaults,{maxWidth:"30%",maxHeight:"30%",gap:10}),i}(e.GaugeLabel),C=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return V(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),e.label=(this._label=new k(this.chart)).init(),e.scale=(this._scale=new x(this)).init()},Object.defineProperty(i.prototype,"label",{get:function(){return this._label},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this._scale},enumerable:!1,configurable:!0}),i.prototype.isVertical=function(){return this._group?this._group.options.vertical:this._op.vertical},i.prototype.scaleVisible=function(){return!this._group&&this._scale.visible},i.prototype.calcedMinMax=function(){return this._scale.range()},i.prototype._doPrepareRender=function(e){t.prototype._doPrepareRender.call(this,e),this._label._prepareRender()},i.defaults=e.extend(e.ValueGauge.defaults,{reversed:!1}),i}(e.ValueGauge),S=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._args={gauge:null,value:NaN},e}return V(e,t),e.prototype.getStyle=function(t,e){if(this._op.styleCallback)return this._args.gauge=t,this._args.value=e,this._op.styleCallback(this._args)},e}(e.GaugeItem),E=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return V(i,t),i.prototype._doInit=function(i){t.prototype._doInit.call(this,i),i.valueBar=(this._valueBar=new S(this)).init(),i.band=(this._band=new e.GaugeRangeBand(this)).init()},Object.defineProperty(i.prototype,"valueBar",{get:function(){return this._valueBar},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"band",{get:function(){return this._band},enumerable:!1,configurable:!0}),i.type=e.LinearGaugeType,i}(C),R=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return V(i,t),i.defaults=e.extend(e.ChartItem.defaults,{opposite:!1,gap:10}),i}(e.ChartItem),P=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return V(i,t),i.defaults=e.extend(k.defaults,{gap:10}),i}(k),O=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return V(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),e.label=(this._label=new P(this.chart)).init(),e.itemLabel=(this._itemLabel=new R(this.chart)).init(),e.scale=(this._scale=new x(this)).init()},Object.defineProperty(i.prototype,"label",{get:function(){return this._label},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"itemLabel",{get:function(){return this._itemLabel},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this._scale},enumerable:!1,configurable:!0}),i.prototype.calcedMinMax=function(){return this.scale.range()},i.defaults=e.extend(e.GaugeGroup.defaults,{vertical:!1,itemGap:10}),i}(e.GaugeGroup),G=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return V(i,t),i.prototype._doInit=function(i){t.prototype._doInit.call(this,i),i.band=(this._band=new e.GaugeRangeBand(this)).init()},Object.defineProperty(i.prototype,"band",{get:function(){return this._band},enumerable:!1,configurable:!0}),i.prototype._gaugesType=function(){return"linear"},i.prototype._doPrepareRender=function(e){t.prototype._doPrepareRender.call(this,e),this.band.visible&&this.band._prepareRender()},i.type=e.LinearGaugeGroupType,i.gaugeType=e.LinearGaugeType,i}(O),T=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),B=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return T(i,t),i.prototype._createLine=function(t,i){return new e.LineElement(t,i)},i.prototype._doMeasure=function(t,i,n,r,s){var o=i.options,a=i._reversed,l=i._vertical,u=i.label,c=i.tick,h=i._steps,p=h.length,_=l?o.gap:n,d=l?r:o.gap;if(this._tickContainer.setVis(c.visible)&&(this._tickContainer.setStyleOrClass(c._style),this._ticks.prepare(p)),l?_+=c.options.length:d+=c.options.length,this._labelContainer.setVis(u.visible)&&(this._labels.prepare(p,(function(e){e.setModel(t,u,null,null)})),p>0))if(l){var g=0;this._labels.forEach((function(t,i){t.setText(u.getText(h[a?i:p-1-i])),g=e.maxv(t.getBBox().width)})),_+=g}else{var f=0;this._labels.forEach((function(t,i){t.setText(u.getText(h[a?p-1-i:i])),f=e.maxv(t.getBBox().height)})),d+=f}return{width:_,height:d}},i.prototype._doLayout=function(){var t=this.model;t._vertical?this.$_layoutVert(t,this.width,this.height):this.$_layoutHorz(t,this.width,this.height)},i.prototype.$_layoutHorz=function(t,e,i){var n=t.options,r=this._line,s=t.tick,o=t._steps;o.length;var a,l="opposite"===n.position,u=l?-s.options.length:s.options.length,c=l?i-n.gap:n.gap;if(r.setVis(t.line.visible)&&(r.setStyleOrClass(t.line._style),r.setHLine(c,0,e)),this._tickContainer.setVis(s.visible)&&this._ticks.forEach((function(i,n){a=t.getRate(o[n])*e,i.setVLine(a,c,c+u)})),this._labelContainer.visible){var h=this._labelContainer.textAlign()||"center",p=Number.MIN_SAFE_INTEGER;c=l?0:c+u,this._labels.forEach((function(i,n){i.layout(h);var r=i.getBBox();a=t.getRate(o[n])*e,i.setVis(a-r.width/2>p)&&(i.trans(a-r.width/2,c),p=a+r.width/2)}))}},i.prototype.$_layoutVert=function(t,e,i){var n=t.options,r=this._line,s=t.tick,o=t._steps;this.height,o.length;var a,l="opposite"===n.position,u=l?s.options.length:-s.options.length,c=l?n.gap:e-n.gap;if(r.setVis(t.line.visible)&&(r.setStyleOrClass(t.line._style),r.setVLine(c,0,i)),this._tickContainer.setVis(s.visible)&&this._ticks.forEach((function(e,n){a=t.getRate(o[n])*i,e.setHLine(a,c,c+u)})),this._labelContainer.visible){var h=this._labelContainer.textAlign()||(l?"left":"right");c=l?c+u:e-n.gap+u,this._labels.forEach((function(e,n){e.layout(h);var r=e.getBBox(),s=l?c:c-r.width;a=t.getRate(o[n])*i,e.trans(s,a-r.height/2)}))}},i}(e.ScaleView);!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}T(e,t)}(e.GaugeScale);var L=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return T(i,t),i.prototype._measureLabelSize=function(t,i,n){var r=t.label,s=this.labelView();return r.setText(t.getLabel(r,t.options.value)),s.text=r.options.text,r.buildSvg(s,null,i,n,t,r._domain),e.rectToSize(s.getBBox())},i.prototype._renderGauge=function(t,i){var n=this.model,r=e.pickNum(n._runValue,n.options.value);this._measureGauge(n,n.label,this.labelView(),r,n.isVertical(),t,i),this._renderValue()},i.prototype._renderValue=function(){var t=this.model,i=t.label,n=t.scale,r=this.labelView(),s=e.pickNum(t._runValue,t.options.value),o=e.assignObj({},this._rBand);if(this._renderScale(o),this.background().setRect(o),o.height>0&&this._renderBand(t,o,s),"top"!==i._runPos&&"bottom"!==i._runPos||(this._rLabel.height=o.height),this._renderLabel(t,i,r,s),!this._vertical&&("left"===i._runPos||"right"===i._runPos)&&n.visible&&"opposite"===n.options.position){var a=r.getBBox();r.ty+a.height>this.height&&r.transY(e.maxv(0,this.height-a.height))}},i.prototype._measureGauge=function(t,i,n,r,s,o,a){var l=this._rBand=e.createRect(0,0,o,a);if(this._vertical=t._group instanceof O?t._group.options.vertical:s,i.visible){var u=i._runPos=e.pickProp(i.options.position,this._vertical?"top":"left"),c=i._runVert="top"===u||"bottom"===u,h=t._group?t._group.itemLabel.options.gap:i._runGap=i.getGap(c?a:o),p=c?o:i.getWidth(o),_=c?i.getHeight(a):a,d=c?o:i.getMaxWidth(o),g=c?i.getMaxHeight(a):a,f=this._rLabel=e.createRect(0,0,o,a);n.setStyleOrClass(i._style),i.setText(t.getLabel(i,i.options.animatable?r:t.options.value)),n.text=i.options.text,i.buildSvg(n,null,e.pickNum(p,d),e.pickNum(_,g),t,i._domain);var y=n.getBBox();switch(c?(f.height=e.pickNum(_,y.height),l.height=e.maxv(0,l.height-(f.height+h))):(f.width=e.pickNum(p,y.width),this._wLabel=t._group?t._group._labelWidth:f.width,l.width=e.maxv(0,l.width-(this._wLabel+h))),u){case"top":l.y=f.height+h;break;case"bottom":f.y=l.height+h;break;case"right":f.x=l.width+h;break;default:l.x=this._wLabel+h}}else this._rLabel=null},i.prototype._renderLabel=function(t,i,n,r){if(n.visible){var s=this._rLabel,o=n.getBBox(),a=s.x,l=s.y;switch(i._runPos){case"top":case"bottom":a+=s.width/2;break;case"right":a=this.width-s.width,n.anchor=e.TextAnchor.START,l+=e.maxv(0,(s.height-o.height)/2);break;default:n.anchor=e.TextAnchor.END,a+=this._wLabel,l+=e.maxv(0,(s.height-o.height)/2)}n.trans(a,l)}},i.prototype._renderScale=function(t){var i,n,r=this.model,s=r.label,o=r.scale,a=this.scaleView(),l=this._vertical?t.height:t.width;if(o._vertical=this._vertical,o._reversed=r.options.reversed,isNaN(r._runValue)&&o.buildSteps(l,r.options.value),a.setVis(r.scaleVisible())){var u=a.measure(this.doc,o,t.width,t.height,1);this._vertical?(i=0,n=t.y,t.width=e.maxv(0,t.width-u.width),"opposite"===o.options.position?i=t.x+t.width:(s._runVert||(i=t.x),t.x+=u.width)):(i=t.x,t.height=e.maxv(0,t.height-u.height),"opposite"===o.options.position?s._runVert?(n=t.y,t.y+=u.height):(this._rLabel.y=t.y+=u.height,n=t.y-u.height):n=t.y+t.height),a.resizeByMeasured().layout().trans(i,n)}},i}(e.ValueGaugeView),I=function(t){function i(i){var n=t.call(this,i,"rct-linear-gauge-band")||this;return n._thick=0,n._gap=0,n._labelGap=3,n._barViews=new e.ElementPool(n,e.RectElement),n.add(n._labelContainer=new e.LayerElement(i,"rct-linear-gauge-band-tick-labels")),n._labels=new e.ElementPool(n._labelContainer,e.TextElement),n}return T(i,t),i.prototype._doMeasure=function(t,i,n,r,s){var o=i.gauge,a=this._vertical=o instanceof E?o.isVertical():o.options.vertical,l="inside"===i.options.position,u=this._thick=l?a?n:r:i.getThickness(a?n:r)+(this._gap=e.pickNum(i.options.gap,0)),c=a?u:n,h=a?r:u,p=this._ranges=i.getRanges();if(this._labelContainer.setVis(i.tickLabel.visible&&p.length>0)){var _=[p[0].fromValue].concat(p.map((function(t){return t.toValue})));if(this._labelContainer.setStyleOrClass(i.tickLabel._style),this._labels.prepare(p.length+1),a){var d=0;this._labels.forEach((function(t,i){t.text=String(_[i]),d=e.maxv(t.getBBox().width)})),c+=d+this._labelGap}else{var g=0;this._labels.forEach((function(t,i){t.text=String(_[i]),g=e.maxv(t.getBBox().height)})),h+=g}}return{width:c,height:h}},i.prototype._doLayout=function(t){var e=this.model,i=e.gauge,n=i.scale,r=n._max-n._min;this._labelContainer.setVis(this.$_layoutBars(i,r,this._ranges)&&this._labelContainer.visible&&"inside"!==e.options.position)&&this.$_layoutLabels(i,r,this._ranges)},i.prototype.$_layoutBars=function(t,e,i){var n=this;if(this._barViews.prepare(i.length),!this._barViews.isEmpty&&e>0){var r=this._vertical,s="inside"===this.model.options.position,o="opposite"===this.model.options.position,a=this.width,l=this.height,u=r?l:a,c=this._thick,h=0;return this._barViews.prepare(i.length).forEach((function(t,p){var _=i[p],d=u*(_.toValue-_.fromValue)/e;if(r){var g=s||o?0:a-c;t.setBounds(g,l-h-d,c,d)}else{var f=o?l-c:0;t.setBounds(h,f,d,n._thick)}t.internalClearStyleAndClass(),t.setFill(_.color),_.style&&t.addStyleOrClass(_.style),h+=d})),!0}},i.prototype.$_layoutLabels=function(t,i,n){var r="opposite"===this.model.options.position;if(this._vertical){var s=this.height,o=r?e.TextAnchor.START:e.TextAnchor.END,a=r?this._thick+this._labelGap:this.width-this._thick-this._labelGap;(c=this._labels.get(0)).anchor=o,c.trans(a,s-c.getBBox().height/2);for(var l=1;l<=n.length;l++){var u=s-s*n[l-1].toValue/i;(c=this._labels.get(l)).anchor=o,c.trans(a,u-c.getBBox().height/2)}}else{var c;s=this.width,a=r?0:this._thick;(c=this._labels.get(0)).trans(0,a);for(l=1;l<=n.length;l++){var h=s*n[l-1].toValue/i;this._labels.get(l).trans(h,a)}}},i}(e.ChartElement),D=function(t){function i(e){return t.call(this,e,"rct-linear-gauge")||this}return T(i,t),i.prototype._doInitContents=function(t,i){i.add(this._background=new e.RectElement(t,"rct-linear-gauge-background")),i.add(this._bandView=new I(t)),i.add(this._scaleView=new B(t)),i.add(this._valueView=new e.RectElement(t,"rct-linear-gauge-value")),i.add(this._labelView=new e.TextElement(t))},i.prototype._backgroundView=function(){return this._background},i.prototype.labelView=function(){return this._labelView},i.prototype.scaleView=function(){return this._scaleView},i.prototype.background=function(){return this._background},i.prototype._prepareGauge=function(t,e){},i.prototype._renderScale=function(e){var i=this.model.band,n=this._bandView;if(t.prototype._renderScale.call(this,e),n.setVis(i.visible)){var r=+i.options.gap||0,s=n.measure(this.doc,i,e.width,e.height,1);n.resizeByMeasured().layout(),this._vertical?"inside"===i.options.position?n.trans(e.x,e.y):"opposite"===i.options.position?(n.trans(e.x+e.width-s.width,e.y),e.width-=s.width+r):(n.trans(e.x,e.y),e.width-=s.width+r,e.x+=s.width+r):"inside"===i.options.position?n.trans(e.x,e.y):"opposite"===i.options.position?(n.trans(e.x,e.y),e.height-=s.height+r,e.y+=s.height+r):(n.trans(e.x,e.y+e.height-s.height),e.height-=s.height+r)}},i.prototype._renderBand=function(t,i,n){var r=this._valueView,s=t.options.reversed,o=t.valueBar,a=t._group?t._group.scale:t.scale;if(r.setVis(!e.isEmptyRect(i)&&o.visible&&!a.isEmpty()&&!isNaN(t.options.value)))if(r.setStyleOrClass(o._style),r.internalSetStyleOrClass(o.getStyle(t,n)),this._vertical){var l=i.height*a.getRate(n),u=s?i.y:i.y+i.height-l;r.setBounds(i.x,u,i.width,l)}else{var c=i.width*a.getRate(n),h=s?i.x+i.width-c:i.x;r.setBounds(h,i.y,c,i.height)}},i}(L),A=function(t){function i(e,i){return t.call(this,e,i)||this}return T(i,t),i.prototype._doInitContents=function(i,n){t.prototype._doInitContents.call(this,i,n),n.insertFirst(this._scaleView=new B(i)),n.insertFirst(this._textView=new e.TextElement(i,"rct-linear-gauge-group-label"))},i.prototype._prepareGauge=function(e,i){this._textView.setVis(i.label.visible)&&this._textView.setStyleOrClass(i.label._style),this._scaleView.setVis(i.scale.visible)&&this._scaleView.setStyleOrClass(i.scale._style),t.prototype._prepareGauge.call(this,e,i)},i.prototype._doRenderGauges=function(t,i,n,r){var s=this.model,o=s.options,a=this._textView,l=e.createRect(0,0,n,r);if(a.visible){a.text=s.label.options.text,s.label.buildSvg(a,null,NaN,NaN,s,null);var u=this._textView.getBBox().height+s.label.getGap(r);l.y+=u,l.height-=u,a.trans(this.width/2,0)}s._labelWidth=s._labelHeight=0,this._gaugeViews.forEach((function(t,i){var o=t._measureLabelSize(s.get(i),n,r);s._labelWidth=e.maxv(s._labelWidth,o.width),s._labelHeight=e.maxv(s._labelHeight,o.height)}));var c=e.copyObj(l),h=s.itemLabel.options.gap;o.vertical?(c.height-=s._labelHeight+h,s.itemLabel.options.opposite||(c.y+=s._labelHeight+h)):(c.width-=s._labelWidth+h,s.itemLabel.options.opposite||(c.x+=s._labelWidth+h)),this._renderScale(s,l,c),o.vertical?this.$_layoutVert(this.doc,s,i,l):this.$_layoutHorz(this.doc,s,i,l)},i.prototype._renderScale=function(t,e,i){var n,r,s=this._scaleView,o=t.scale,a=t.options.vertical,l=a?e.height:e.width,u=[];if(this._gaugeViews.forEach((function(e,i){u.push(t.get(i).getValue())})),o.buildGroupSteps(l,u),o._vertical=a,s.setVis(o.visible)){var c=s.measure(this.doc,o,i.width,i.height,1);if(a){var h=c.width;i.width-=h,e.width-=h,r=i.y,"opposite"===o.options.position?n=i.x+i.width:(n=i.x,i.x+=h,e.x+=h)}else{var p=c.height;i.height-=p,e.height-=p,n=i.x,"opposite"===o.options.position?(r=i.y,i.y+=p,e.y+=p):r=i.y+i.height}s.resizeByMeasured().layout().trans(n,r)}},i.prototype.$_layoutVert=function(t,e,i,n){var r=n.height,s=(n.width-e.options.itemGap*(i.count-1))/i.count,o=n.y,a=n.x;i.forEach((function(i,n){i.measure(t,e.get(n),s,r,0),i.resize(s,r),i.layout(),i.trans(a,o),a+=s+e.options.itemGap}))},i.prototype.$_layoutHorz=function(t,e,i,n){var r=e.options.itemGap,s=n.width,o=(n.height-r*(i.count-1))/i.count,a=n.x,l=n.y;i.forEach((function(i,n){i.measure(t,e.get(n),s,o,0),i.resize(s,o),i.layout(),i.trans(a,l),l+=o+r}))},i}(e.GaugeGroupView),N=function(t){function i(e){return t.call(this,e,"rct-linear-gauge-group")||this}return T(i,t),i.prototype._doInitContents=function(e,i){t.prototype._doInitContents.call(this,e,i),i.insertChild(this._bandView=new I(e),this._scaleView)},i.prototype._createPool=function(t){return new e.ElementPool(t,D)},i.prototype._renderScale=function(e,i,n){t.prototype._renderScale.call(this,e,i,n);var r,s,o=this._bandView,a=e.band;if(o.setVis(a.visible)){var l=+a.options.gap||0,u=o.measure(this.doc,a,n.width,n.height,1);if(e.options.vertical){var c=u.width+l;n.width-=c,i.width-=c,s=n.y,"opposite"===a.options.position?r=n.x+n.width+l:(r=n.x,n.x+=c,i.x+=c)}else{var h=u.height+l;n.height-=h,i.height-=h,r=n.x,"opposite"===a.options.position?(s=n.y,n.y+=h,i.y+=h):s=n.y+n.height+l}o.resizeByMeasured().layout().trans(r,s)}},i}(A),j=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),H=function(t){function i(e){var i=t.call(this,e.chart)||this;return i.gauge=e,i}return j(i,t),i.prototype.getRanges=function(){var t;return null===(t=this.$_internalRanges())||void 0===t?void 0:t.slice(0)},i.prototype._doApply=function(e){var i,n=this;t.prototype._doApply.call(this,e),(i=e.ranges)!==n._ranges&&(n._ranges=i,n._runRanges=null)},i.prototype.$_internalRanges=function(){if(!this._runRanges){var t=this.gauge.options;this._runRanges=e.buildValueRanges(this._ranges,t.minValue,t.maxValue,this._op.rangeInclusive)}return this._runRanges},i.defaults=e.extend(e.ChartItem.defaults,{vertical:!0,rangeInclusive:!0}),i}(e.ChartItem),$=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return j(i,t),i.defaults=e.extend(e.ChartItem.defaults,{visible:!0}),i}(e.GaugeItem),M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e}(S),z=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return j(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),e.band=(this._band=new H(this)).init(),e.targetBar=(this._targetBar=new $(this)).init(),e.valueBar=(this._valueBar=new M(this)).init()},Object.defineProperty(i.prototype,"band",{get:function(){return this._band},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"targetBar",{get:function(){return this._targetBar},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"valueBar",{get:function(){return this._valueBar},enumerable:!1,configurable:!0}),i.prototype.getRanges=function(t,i,n){return e.buildValueRanges(this._op.ranges,t,i,e.pickProp(n,this._op.rangeInclusive))},i.type=e.BulletGaugeType,i.defaults=e.extend(C.defaults,{rangeInclusive:!0}),i}(C),W=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return j(i,t),i.prototype.getRanges=function(t,i,n){return e.buildValueRanges(this._op.ranges,t,i,e.pickProp(n,this._op.rangeInclusive))},i.prototype._gaugesType=function(){return"bullet"},i.type=e.BulletGaugeGroupType,i.gaugeType=e.BulletGaugeType,i.defaults=e.extend(O.defaults,{rangeInclusive:!0}),i}(O),F=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Y=function(t){function i(e){return t.call(this,e,"rct-bullet-gage")||this}return F(i,t),i.prototype._doInitContents=function(t,i){i.add(this._background=new e.RectElement(t,"rct-bullet-gauge-background")),i.add(this._barContainer=new e.LayerElement(t,void 0)),this._barViews=new e.ElementPool(this._barContainer,e.RectElement),i.add(this._valueView=new e.RectElement(t,"rct-bullet-gauge-value")),i.add(this._targetView=new e.RectElement(t,"rct-bullet-gauge-target")),i.add(this._scaleView=new B(t)),i.add(this._labelView=new e.TextElement(t))},i.prototype._backgroundView=function(){return this._background},i.prototype.labelView=function(){return this._labelView},i.prototype.scaleView=function(){return this._scaleView},i.prototype.background=function(){return this._background},i.prototype._prepareGauge=function(t,e){},i.prototype._renderBand=function(t,i,n){var r=t.options,s=t._group,o=t.options.reversed,a=this._vertical,l=s?s.scale:t.scale,u=this._valueView,c=this._targetView;if(this._barContainer.setVis(!e.isEmptyRect(i)&&!l.isEmpty())){var h=t.getRanges(l._min,l._max,!1)||(null==s?void 0:s.getRanges(l._min,l._max,!1));h&&(this._barContainer.setRect(i),this._barViews.prepare(h.length),a?this._barViews.forEach((function(t,e){var n=h[e],r=i.height*l.getRate(n.toValue-n.fromValue),s=i.height*l.getRate(n.fromValue);t.setBounds(0,o?s:i.height-s-r,i.width,r),t.internalClearStyleAndClass(),t.setFill(n.color),n.style&&t.addStyleOrClass(n.style)})):this._barViews.forEach((function(t,e){var n=h[e],r=i.width*l.getRate(n.toValue-n.fromValue),s=i.width*l.getRate(n.fromValue);t.setBounds(o?i.width-r-s:s,0,r,i.height),t.internalClearStyleAndClass(),t.setFill(n.color),n.style&&t.addStyleOrClass(n.style)})))}if(u.setVis(t.valueBar.visible&&!l.isEmpty()&&!isNaN(n)))if(u.setStyleOrClass(t.valueBar._style),n<r.targetValue&&t.valueBar.options.belowStyle&&u.internalSetStyleOrClass(t.valueBar.options.belowStyle),u.internalSetStyleOrClass(t.valueBar.getStyle(t,n)),a){var p=i.height*l.getRate(n),_=o?i.y:i.y+i.height-p;u.setBounds(i.x+i.width/3,_,i.width/3,p)}else{var d=i.width*l.getRate(n),g=o?i.x+i.width-d:i.x;u.setBounds(g,i.y+i.height/3,d,i.height/3)}if(c.setVis(t.targetBar.visible&&!l.isEmpty()&&!isNaN(r.targetValue)))if(c.setStyleOrClass(t.targetBar._style),a&&i.width>10){_=i.height*l.getRate(r.targetValue);_=o?i.y+_:i.y+i.height-_,c.setBounds(i.x+5,_-1,i.width-10,3)}else if(!a&&i.height>10){g=i.width*l.getRate(r.targetValue);g=o?i.x+i.width-g:i.x+g,c.setBounds(g-1,i.y+5,3,i.height-10)}},i}(L),X=function(t){function i(e){return t.call(this,e,"rct-bullet-gauge-group")||this}return F(i,t),i.prototype._createPool=function(t){return new e.ElementPool(t,Y)},i}(A),U=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),q=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return U(i,t),i.prototype.getThickness=function(t){return e.calcPercent(this._thicknessDim,t,t)},i.prototype._doApply=function(e){t.prototype._doApply.call(this,e),this._setDim(e,"thickness")},i.defaults=e.extend(e.ChartItem.defaults,{thickness:7}),i}(e.GaugeItem),J=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return U(i,t),i.prototype.getLength=function(t){return e.calcPercent(this._lengthDim,t,t)},i.prototype._doApply=function(e){t.prototype._doApply.call(this,e),this._setDim(e,"length")},i.defaults=e.extend(e.ChartItem.defaults,{thickness:7,length:"60%"}),i}(e.GaugeItem),K=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return U(i,t),i.defaults=e.extend(J.defaults,{thickness:5,length:"85%"}),i}(J),Q=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return U(i,t),i.defaults=e.extend(J.defaults,{thickness:2,length:"95%",animatable:!1,duration:200}),i}(J),Z=function(t){function e(e,i){var n=t.call(this,e)||this;return n.length=i,n}return U(e,t),e}(e.GaugeItem),tt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return U(i,t),i.defaults=e.extend(e.ChartItem.defaults,{step:1,offset:1}),i}(e.GaugeItem),et=function(t){function e(e,i){var n=t.call(this,e)||this;return n.raidus=i,n}return U(e,t),e}(e.GaugeItem),it=function(t){function i(e){return t.call(this,e.chart)||this}return U(i,t),i.defaults=e.extend(e.ChartText.defaults,{text:"RealChart Clock<br>ver1.0",position:"top"}),i}(e.ChartText),nt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return U(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),e.rim=(this.rim=new q(this)).init(),e.hourHand=(this.hourHand=new J(this)).init(),e.minuteHand=(this.minuteHand=new K(this)).init(),e.secondHand=(this.secondHand=new Q(this)).init(),e.tick=(this.tick=new Z(this,10)).init(),e.minorTick=(this.minorTick=new Z(this,5)).init(),e.tickLabel=(this.tickLabel=new tt(this)).init(),e.pin=(this.pin=new et(this,5)).init(),e.label=(this.label=new it(this)).init()},i.prototype.getTime=function(){var t=this._op;return t.time instanceof Date?t.time:e.isString(t.time)?new Date(t.time):isNaN(t.time)?void 0:new Date(t.time)},i.prototype.getExtents=function(t,i){var n=e.minv(t,i);return{cx:e.calcPercent(this._centerXDim,t,t/2),cy:e.calcPercent(this._centerYDim,i,i/3),rd:e.calcPercent(this._radiusDim,n,n/2)}},i.prototype._doApply=function(i){var n,r,s,o=this;t.prototype._doApply.call(this,i),n=i.centerX,r=i.centerY,s=i.radius,(o._centerXDim||n!==o._centerX)&&(o._centerXDim=e.parsePercentSize(e.pickProp(o._centerX=n,e.CircularGauge.DEF_CENTER),!0)),o._centerYDim&&r===o._centerY||(o._centerYDim=e.parsePercentSize(e.pickProp(o._centerY=r,e.CircularGauge.DEF_CENTER),!0)),o._radiusDim&&s===o._radius||(o._radiusDim=e.parsePercentSize(e.pickProp(o._radius=s,e.CircularGauge.DEF_RADIUS),!0))},i.type=e.ClockGaugeType,i.defaults=e.extend(e.Gauge.defaults,{centerX:"50%",centerY:"50%",radius:"40%",active:!0}),i}(e.Gauge),rt=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),st=function(t){function e(e){var i=t.call(this)||this;return i.view=e,i}return rt(e,t),e.prototype._doUpdate=function(t){return this.view._secRate=t,this.view.$_renderHands(this.view.model,this.view._exts),!0},e}(e.RcAnimation),ot=function(t){function i(e){var i=t.call(this,e,"rct-clock-gauge")||this;return i._rimThick=0,i._secRate=1,i}return rt(i,t),i.prototype._doInitContents=function(t,i){i.add(this._faceView=new e.CircleElement(t,"rct-clock-gauge-face")),i.add(this._rimView=new e.SectorElement(t,"rct-clock-gauge-rim")),i.add(this._labelView=new e.TextElement(t,"rct-clock-gauge-label")),this._labelView.layout=e.TextLayout.MIDDLE,i.add(this._tickContainer=new e.LayerElement(t,"rct-clock-gauge-ticks")),i.add(this._tickLabelContainer=new e.LayerElement(t,"rct-clock-gauge-tick-labels")),i.add(this._hourView=new e.PathElement(t,"rct-clock-gauge-hour")),i.add(this._minuteView=new e.PathElement(t,"rct-clock-gauge-minute")),i.add(this._secondView=new e.PathElement(t,"rct-clock-gauge-second")),i.add(this._pinView=new e.CircleElement(t,"rct-clock-gauge-pin")),this._tickViews=new e.ElementPool(this._tickContainer,e.LineElement,"rct-clock-gauge-tick"),this._minorTickViews=new e.ElementPool(this._tickContainer,e.LineElement,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new e.ElementPool(this._tickLabelContainer,e.TextElement,"rct-clock-gauge-tick-label")},i.prototype._prepareGauge=function(t,i){this._tickViews.prepare(i.tick.visible?12:0),this._minorTickViews.prepare(i.minorTick.visible?48:0);var n=Math.round(12/e.maxv(1,Math.floor(i.tickLabel.options.step)||1));this._tickLabelViews.prepare(i.tickLabel.visible?n:0,(function(t){t.layout=e.TextLayout.MIDDLE}))},i.prototype._renderGauge=function(t,i){var n=this,r=this.model,s=this._exts=r.getExtents(t,i);this._secRate=1,this.$_renderFace(r,s),this.$_renderHands(r,s),r.options.active&&!r.getTime()?this._runner||(this._runner=setInterval((function(){var t=n._prevSec;n.$_renderHands(n.model,n._exts),e.absv(t-n._prevSec)>=1&&n._secondView.visible&&r.chart.animatable()&&r.secondHand.options.animatable&&n.$_moveSecond(t)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)},i.prototype.$_renderFace=function(t,i){var n=this._labelView,r=this._rimView,s=this._minorTickViews,o=this._tickLabelViews,a=this._pinView,l=i.cx,u=i.cy,c=i.rd,h=this._rimThick=r.visible?t.rim.getThickness(c):0;this._faceView.setCircle(l,u,c),r.setVis(t.rim.visible)&&(r.internalSetStyleOrClass(t.rim._style),r.setSector({cx:l,cy:u,rx:c,ry:c,innerRadius:1-h/c,start:0,angle:2*Math.PI,clockwise:!0}));var p=c-h,_=p-t.tick.length,d=e.ORG_ANGLE,g=e.PI_2/12;if(this._tickViews.forEach((function(i,n){i.setLine(l+e.cos(d)*p,u+e.sin(d)*p,l+e.cos(d)*_,u+e.sin(d)*_),i.internalSetStyleOrClass(t.tick._style),d+=g})),!s.isEmpty){var f=0;_=p-t.minorTick.length,d=e.ORG_ANGLE,g=e.PI_2/60,s.forEach((function(i){f%5==0&&(d+=g,f++),i.setLine(l+e.cos(d)*p,u+e.sin(d)*p,l+e.cos(d)*_,u+e.sin(d)*_),i.internalSetStyleOrClass(t.minorTick._style),d+=g,f++}))}if(!o.isEmpty){var y=12/o.count,b=e.PI_2/12*y;d=e.ORG_ANGLE,o.get(0).text="12",_=p-(t.tick.length+t.tickLabel.options.offset||0),_-=.5*o.get(0).getBBox().height,o.forEach((function(i,n,r){i.text=String(0===n?12:n*y),i.trans(l+e.cos(d)*_,u+e.sin(d)*_),i.internalSetStyleOrClass(t.tickLabel._style),d+=b}))}a.setVis(t.pin.visible)&&(a.setCircle(l,u,t.pin.raidus),a.setStyleOrClass(t.pin._style)),n.setVis(t.label.visible)&&(n.internalSetStyleOrClass(t.label._style),t.label.buildSvg(n,null,NaN,NaN,null,null),"bottom"===t.label.options.position?n.trans(l,u+_/2):n.trans(l,u-_/2))},i.prototype.$_getNow=function(){var t=this.model.options.timezone,e=this.model.getTime()||new Date;if(!isNaN(t)){var i=e.getMinutes()+(e.getTimezoneOffset()+t);e.setMinutes(i)}return e},i.prototype.$_renderHands=function(t,i){var n,r,s,o,a=this.$_getNow(),l=a.getHours(),u=a.getMinutes(),c=a.getSeconds(),h=i.cx,p=i.cy,_=i.rd,d=new e.PathBuilder;n=t.hourHand,(r=this._hourView).setVis(n.visible)&&(o=e.PI_2*(l/12+u/60/12+c/60/60/12),s=n.getLength(_-this._rimThick),d.rect(-n.options.thickness/2,-s,n.options.thickness,s),r.internalSetStyleOrClass(n._style),r.setPath(d.close(!0)).trans(h,p).rotate(o*e.RAD_DEG)),n=t.minuteHand,(r=this._minuteView).setVis(n.visible)&&(o=e.PI_2*(u/60+c/60/60),s=n.getLength(_-this._rimThick),d.rect(-n.options.thickness/2,-s,n.options.thickness,s),r.internalSetStyleOrClass(n._style),r.setPath(d.close(!0)).trans(h,p).rotate(o*e.RAD_DEG)),n=t.secondHand,(r=this._secondView).setVis(n.visible)&&(o=this._secRate<1?e.PI_2*(this._aniSec+this._secRate)/60:e.PI_2*c/60,s=n.getLength(_-this._rimThick),d.rect(-n.options.thickness/2,-s,n.options.thickness,s),r.internalSetStyleOrClass(n._style),r.setPath(d.close(!0)).trans(h,p).rotate(o*e.RAD_DEG),this._prevSec=c)},i.prototype.$_moveSecond=function(t){if(!isNaN(t)){this._aniSec=t;var e=new st(this);e.duration=this.model.secondHand.options.duration||200,e.start()}},i}(e.GaugeView);function at(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.Gauge.register(z,p,nt,E),t.GaugeGroup.register(W,_,G),t.GaugeView.register([p,v],[E,D],[z,Y],[nt,ot],[_,m],[G,N],[W,X]))}at(r),t.BulletGauge=z,t.CircleGauge=p,t.ClockGauge=nt,t.LinearGauge=E,t.default=at,Object.defineProperty(t,"__esModule",{value:!0})}));
@@ -0,0 +1,7 @@
1
+
2
+ /**
3
+ * RealChart Heatmap v1.4.7
4
+ * Copyright (C) 2023-2025 WooriTech Inc.
5
+ * All Rights Reserved.
6
+ */
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("realchart")):"function"==typeof define&&define.amd?define(["exports","realchart"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChartheatmap={},t.RealChart)}(this,(function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var o,r=n(e),i=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(e.ZValuePoint),u=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return i(n,t),n.prototype.getColor=function(t){},n.prototype.canMixWith=function(t){return!1},n.prototype.canCategorized=function(){return!0},n.prototype.hasZ=function(){return!0},n.prototype.defYAxisType=function(){return"category"},n.prototype._createPoint=function(t){return new a(t)},n.prototype._doPrepareRender=function(){t.prototype._doPrepareRender.call(this);var n=Number.MAX_VALUE,o=Number.MIN_VALUE;this._runPoints.forEach((function(t){isNaN(t.zValue)||(n=e.minv(n,t.zValue),o=e.maxv(o,t.zValue))})),this._heatMin=n,this._heatMax=o},n.type=e.HeatmapSeriesType,n.defaults=e.extend(e.Series.defaults,{tooltipText:"x: <b>${x}</b><br>y: <b>${y}</b><br>heat: <b>${z}</b>"}),n}(e.ConnectableSeries),s=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),l=function(t){function n(n){return t.call(this,n,e.SeriesView.POINT_CLASS)||this}return s(n,t),n}(e.RectElement),c=function(t){function n(n){var o=t.call(this,n,"rct-heatmap-series")||this;return o._cells=new e.ElementPool(o._pointContainer,l),o}return s(n,t),n.prototype._getPointPool=function(){return this._cells},n.prototype._prepareSeries=function(t,e){this.$_parepareCells(e,this._visPoints)},n.prototype._renderSeries=function(t,e){this._pointContainer.invert(this._inverted,e),this.$_layoutCells(t,e)},n.prototype._runShowEffect=function(t){t&&e.SeriesAnimation.grow(this)},n.prototype._doViewRateChanged=function(t){this.$_layoutCells(this.width,this.height)},n.prototype.$_parepareCells=function(t,n){var o=this,r=new e.Color(t._calcedColor),i=[{fill:void 0}],a=t._heatMin,u=t._heatMax-a;this._cells.prepare(n.length,(function(e,s){var l=e.point=n[s];i[0].fill=r.brighten(1-(l.zValue-a)/u).toString(),o._setPointStyle(e,t,l,i)}))},n.prototype.$_layoutCells=function(t,e){var n=this.model,o=this._inverted,r=this._getGrowRate();n.pointLabel;var i=this._labelViews(),a=this._labelContainer._textAlign,u=n._xAxisObj,s=n._yAxisObj,l=o?t:e,c=o?e:t,p=o?0:e;this._cells.forEach((function(t){var e=t.point;if(t.setVis(!e.isNull)){var n=u.getUnitLen(c,e.xValue)*r,f=s.getUnitLen(l,e.yValue)*r,h=u.getPos(c,e.xValue)-n/2,y=p-s.getPos(l,e.yValue)-f/2,_=void 0;if(e.xPos=o?p+s.getPos(l,e.yValue):h+n/2,e.yPos=o?c-u.getPos(c,e.xValue)+n/2:y+f/2,t.setBounds(h,y,n,f),i&&(_=i.get(e,0))){_.layout(a);var d=_.getBBox();o?(y=c-u.getPos(c,e.xValue)-d.height/2,h=p+s.getPos(l,e.yValue)):(h+=n/2,y+=(f-d.height)/2),h-=d.width/2,_.trans(h,y)}}}))},n}(e.SeriesView);function p(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.Series.register(u),t.SeriesView.register([u,c]))}p(r),t.HeatmapSeries=u,t.default=p,Object.defineProperty(t,"__esModule",{value:!0})}));