realchart 1.4.33 → 1.5.0
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 +2 -2
- package/gauge.mjs +2 -2
- package/heatmap.js +2 -2
- package/heatmap.mjs +2 -2
- package/ie/gauge.ie.js +2 -2
- package/ie/heatmap.ie.js +2 -2
- package/ie/index.ie.js +2 -2
- package/ie/pictogram.ie.js +2 -2
- package/ie/split.ie.js +2 -2
- package/ie/treemap.ie.js +2 -2
- package/ie/vector.ie.js +2 -2
- package/ie/wordcloud.ie.js +2 -2
- package/index.d.ts +350 -88
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +27 -8
- package/pictogram.d.ts +1 -1
- package/pictogram.js +2 -2
- package/pictogram.mjs +2 -2
- package/split.d.ts +2 -0
- package/split.js +2 -2
- package/split.mjs +2 -2
- package/treemap.js +2 -2
- package/treemap.mjs +2 -2
- package/vector.d.ts +1 -1
- package/vector.js +2 -2
- package/vector.mjs +2 -2
- package/wordcloud.js +2 -2
- package/wordcloud.mjs +2 -2
package/ie/gauge.ie.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart Gauge v1.
|
|
3
|
+
* RealChart Gauge v1.5.0
|
|
4
4
|
* Copyright (C) 2023-2026 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
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),a=(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)}),s=function(t){function i(e){var i=t.call(this,e)||this;return i.gauge=e,i}return a(i,t),i.prototype.getRanges=function(t){if(!t){var i=this.gauge.calcedMinMax();t={minValue:i.min,maxValue:i.max}}var n=t.minValue,r=t.maxValue;if(!(r>n)&&(r=e.maxv(n,e.pickNum(this.gauge.prop("value"),n)),this._ranges))for(var a=0;a<this._ranges.length;a++){var s=e.pickNum(this._ranges[a].toValue,NaN);isNaN(s)||(r=e.maxv(r,s))}return e.buildValueRanges(this._ranges,n,r,!1,!0)||[]},i.prototype.getRange=function(t,e){var i=this.$_internalRanges(t);if(i)for(var n=0,r=i.length;n<r;n++){var a=i[n];if(e>=a.fromValue&&(e<a.toValue||n===r-1&&e<=a.toValue))return a}},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.prop("rangeInclusive"))||[]),this._runRanges},i.defaults=e.extend(e.ChartItem.defaults,{rangeInclusive:!0}),i}(e.GaugeItem),o=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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(s.defaults,{segmentGap:0}),i}(s),l=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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(s.defaults,{thickness:"100%",stroked:!1}),i}(s);!function(t){function i(){return null!==t&&t.apply(this,arguments)||this}a(i,t),i.defaults=e.extend(e.ChartItem.defaults,{visible:!1})}(e.GaugeItem);var h=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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),u=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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),c=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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 a(i,t),i.prototype._doInit=function(i){t.prototype._doInit.call(this,i),this._band=this._addChild("band",new e.GaugeRangeBand(this)),this._scale=this._addChild("scale",new c(this)),this._rim=this._addChild("rim",new o(this)),this._valueRim=this._addChild("valueRim",new l(this)),this._hand=this._addChild("hand",new h(this)),this._pin=this._addChild("pin",new u(this))},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,a=this.band,s=n.radius,o=s-n.inner;if(a.visible)switch(n.bandThick=a.getThickness(o),a.prop("position")){case"inside":n.band=s-(o-n.bandThick)/2;break;case"opposite":n.band=n.inner-a.prop("gap"),n.inner=n.band-n.bandThick;break;default:n.band=s+=n.bandThick+a.prop("gap")}if(n.scaleTick=e.maxv(1,r.tick.num("length")),n.scaleLabel=16,"opposite"===r.prop("position"))n.scale=e.maxv(n.inner-r.prop("gap"),0),n.inner=n.scale-n.scaleTick-n.scaleLabel;else n.scale=s+r.prop("gap");return n},i.type=e.CircleGaugeType,i}(e.CircularGauge),d=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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),_=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 _(e,t),e}(e.ValueGaugeView),f=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return _(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 a=e._steps.length-(360===e.gauge.prop("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(a)),this._labelContainer.setVis(e.label.visible)&&(this._labelContainer.internalSetStyleOrClass(e.label._style),this._labels.prepare(a)),{width:i,height:n}},i.prototype._doLayout=function(t){var i,n,r,a,s=this.model,o=s._steps,l=s.gauge,h="opposite"===s.prop("position")?-1:1,u=l.getProps(),c=this._center.x,p=this._center.y,d=this._exts.scale,_=d+this.model.tick.prop("length")*h,g=u._sweepRad,f=u._startRad,y=l.prop("maxValue")-l.prop("minValue"),b=l.prop("clockwise");if(this._line.visible&&this._line.setArc(c,p,d,f,b?g:-g,b),this._tickContainer.visible&&this._ticks.forEach(function(t,l,h){var u=s.getRate(o[l])*(b?g:-g)+f;i=c+e.cos(u)*d,n=p+e.sin(u)*d,r=c+e.cos(u)*_,a=p+e.sin(u)*_,t.setLine(i,n,r,a)}),this._labelContainer.visible){this._labels.get(0).setText(String(l.prop("maxValue")));var w=_+.2*this._labels.get(0).getBBox().height*h;this._labels.forEach(function(t,i){var n=s.getRate(o[i])*(b?g:-g)+f;t.setText(String(e.fixnum(l.prop("minValue")+s.getRate(o[i])*y))),t.setContrast(null).layout("center");var u=t.getBBox();r=c+e.cos(n)*(w+u.width/2*h)-u.width/2,a=p+e.sin(n)*(w+u.height/2*h)-u.height/2,t.trans(r,a)})}},i}(e.ScaleView),y=function(t){function i(i){var n=t.call(this,i,"rct-circle-gauge-rim")||this;return n._sectorViews=new e.ElementPool(n,e.SectorElement,"rct-circle-gauge-rim"),n}return _(i,t),i.prototype.setExtents=function(t,e){this._center=t,this._exts=e},i.prototype._doLayout=function(t){var i=this.model,n=i.gauge,r=n.getProps(),a=i.getRanges(),s=this._center.x,o=this._center.y,l=this._exts.radius,h=1-i.getSegmentThickness(this._exts.radiusThick)/l,u=n.prop("clockwise"),c=r._sweepRad,p=r._startRad;if(0===a.length){var d=this._sectorViews.prepare(1).get(0);return d.internalSetStyleOrClass(i._style),void d.setSector({cx:s,cy:o,rx:l,ry:l,innerRadius:h,start:p,angle:c,clockwise:u})}var _=e.pickNum(i.prop("segmentGap"),0),g=_>0?_/l:0,f=g*(a.length-1),y=e.maxv(0,c-f),b=a.reduce(function(t,e){return t+(e.toValue-e.fromValue)},0);this._sectorViews.prepare(a.length).forEach(function(t,e){var i=b>0?(a[e].toValue-a[e].fromValue)/b*y:0;t.setSector({cx:s,cy:o,rx:l,ry:l,innerRadius:h,start:p,angle:i,clockwise:u}),t.internalClearStyleAndClass(),t.setFill(a[e].color),a[e].style&&t.addStyleOrClass(a[e].style),p+=u?i+g:-(i+g)})},i}(e.ChartElement),b=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 _(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.getProps(),r=this._center.x,a=this._center.y,s=this._exts.band,o=i.prop("clockwise"),l=1-this._exts.bandThick/s,h=e.getRanges(),u=n._sweepRad,c=n._startRad,p=h.reduce(function(t,e){return t+(e.toValue-e.fromValue)},0);this._sectorViews.prepare(h.length).forEach(function(t,e){var i=p>0?(h[e].toValue-h[e].fromValue)/p*u:0;t.setSector({cx:r,cy:a,rx:s,ry:s,innerRadius:l,start:c,angle:i,clockwise:o}),t.internalClearStyleAndClass(),t.setFill(h[e].color),h[e].style&&t.addStyleOrClass(h[e].style),c+=o?i:-i})},i}(e.ChartElement),w=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return _(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),v=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return _(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,a=this._offset=n.offset;if(this._length=n.length,this._radius>0&&this._length>0){var s=new e.PathBuilder;s.move(-r,a).line(0,-this._length+a).line(r,a),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(t._style),this},i}(e.PathElement),m=function(t){function i(e){return t.call(this,e,"rct-circle-gauge")||this}return _(i,t),i.prototype._doInitContents=function(t,i){i.add(this._rimView=new y(t)),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 b(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 v(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 w(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),a=n.getExtents(e.minv(t,i));this.$_renderBackground(n,r,a),this._renderValue()},i.prototype._renderValue=function(){var t=this.model,i=t.scale,n=t.getProps(),r=t.getValue(),a=i.getRate(e.pickNum(r,0)),s=this._center,o=this._exts,l=t.valueRim.getThickness(o.radiusThick),h=this._textView;if(this._valueView.visible){var u=t.valueRim,c=t.calcedMinMax(),p=u.getRange({minValue:c.min,maxValue:c.max},r),d=o.value+(u.prop("stroked")?0:l/2),_=this._valueView;_.setStyleOrClass(u._style),p&&(_.setStyle(u.prop("stroked")?"stroke":"fill",p.color),p.style&&_.addStyleOrClass(p.style)),u.prop("stroked")&&(_.setFill("none"),_.setStyle("strokeWidth",e.pixel(l))),_.setBoolData("stroked",u.prop("stroked")),_.setSectorEx({cx:s.x,cy:s.y,rx:d,ry:d,innerRadius:(d-l)/d,start:n._startRad,angle:n._sweepRad*a,clockwise:t.prop("clockwise")},u.prop("stroked"))}if(this._handView){var g=(n._handRad+n._sweepRad*a)*e.RAD_DEG;this._handView.render(t.hand,o.radius).transp(s).rotate(t.prop("clockwise")?g:-g)}if(h.visible){var f=t.label;if(f.setText(t.getLabel(f,f.prop("animatable")?r:t.prop("value"))),h.text=f.prop("text"),h.setBoolData("grouped",!!t._group),f.buildSvg(h,null,NaN,NaN,t,f._domain),t._group)this.$_layoutGroupedLabel(t,h,o);else{var y=h.getBBox(),b=f.getOffset(this.width,this.height);h.trans(s.x+b.x,s.y-y.height/2+b.y)}}},i.prototype.$_renderBackground=function(t,e,i){var n=t.getProps();this._center=e,this._exts=i,t.scale.buildSteps(i.scale*n._sweepRad,NaN),this._rimView.visible&&(this._rimView.measure(this.doc,t.rim,this.width,this.height,0),this._rimView.setExtents(e,i),this._rimView.layout()),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.prop("innerStyle"));var r=i.inner,a=getComputedStyle(this._innerView.dom),s=parseFloat(a.strokeWidth);s>1&&(r-=s/2),this._innerView.setSector({cx:e.x,cy:e.y,rx:r,ry:r,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(t.pin,r).trans(e.x,e.y)},i.prototype.$_layoutGroupedLabel=function(t,i,n){var r=i.getBBox(),a=this._center,s=+t._group.num("labelGap");i.anchor=e.TextAnchor.END,i.trans(a.x-s,a.y-n.radius+(n.radius-n.inner-r.height)/2)},i}(g),V=function(t){function i(e){return t.call(this,e,"rct-circle-gauge-group")||this}return _(i,t),i.prototype._createPool=function(t){return new e.ElementPool(t,m)},i.prototype._doRenderGauges=function(t,i,n,r){var a=this.doc,s=this.model,o=s.getProps().getCenter(n,r),l=s.getProps().getExtents(e.minv(n,r));s.setChildExtents(l),n=r=2*l.radius,i.forEach(function(t,e){t.measure(a,s.getVisible(e),n,r,0),t.resize(n,r),t.layout()}),t.trans(o.x-l.radius,o.y-l.radius)},i}(e.GaugeGroupView),x=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)}}(),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x(e,t),e}(e.GaugeScale),C=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(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),S=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._scale=this._addChild("scale",new k(this))},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._createLabel=function(){return new C(this.chart)},i.prototype.isVertical=function(){return this._group?this._group.prop("vertical"):this.prop("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),E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._args={gauge:null,value:NaN},e}return x(e,t),e.prototype.getStyle=function(t,e){var i=this.prop("styleCallback");if(i)return this._args.gauge=t,this._args.value=e,i(this._args)},e}(e.GaugeItem),R=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(i,t),i.prototype._doInit=function(i){t.prototype._doInit.call(this,i),this._valueBar=this._addChild("valueBar",new E(this)),this._band=this._addChild("band",new e.GaugeRangeBand(this))},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}(S),P=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(i,t),i.defaults=e.extend(e.ChartItem.defaults,{opposite:!1,gap:10}),i}(e.ChartItem),L=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(i,t),i.defaults=e.extend(C.defaults,{gap:10}),i}(C),O=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._label=this._addChild("label",new L(this.chart)),this._itemLabel=this._addChild("itemLabel",new P(this.chart)),this._scale=this._addChild("scale",new k(this))},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 x(i,t),i.prototype._doInit=function(i){t.prototype._doInit.call(this,i),this._band=this._addChild("band",new e.GaugeRangeBand(this))},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,a){var s=i.prop("gap"),o=i._reversed,l=i._vertical,h=i.label,u=i.tick,c=i._steps,p=c.length,d=l?s:n,_=l?r:s;if(this._tickContainer.setVis(u.visible)&&(this._tickContainer.setStyleOrClass(u._style),this._ticks.prepare(p)),l?d+=u.prop("length"):_+=u.prop("length"),this._labelContainer.setVis(h.visible)&&(this._labels.prepare(p,function(e){e.setModel(t,h,null,null)}),p>0))if(l){var g=0;this._labels.forEach(function(t,i){t.setText(h.getText(c[o?i:p-1-i])),g=e.maxv(t.getBBox().width)}),d+=g}else{var f=0;this._labels.forEach(function(t,i){t.setText(h.getText(c[o?p-1-i:i])),f=e.maxv(t.getBBox().height)}),_+=f}return{width:d,height:_}},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.prop("gap"),r=this._line,a=t.tick,s=t._steps;s.length;var o,l="opposite"===t.prop("position"),h=l?-a.prop("length"):a.prop("length"),u=l?i-n:n;if(r.setVis(t.line.visible)&&(r.setStyleOrClass(t.line._style),r.setHLine(u,0,e)),this._tickContainer.setVis(a.visible)&&this._ticks.forEach(function(i,n){o=t.getRate(s[n])*e,i.setVLine(o,u,u+h)}),this._labelContainer.visible){var c=this._labelContainer.textAlign()||"center",p=Number.MIN_SAFE_INTEGER;u=l?0:u+h,this._labels.forEach(function(i,n){i.layout(c);var r=i.getBBox();o=t.getRate(s[n])*e,i.setVis(o-r.width/2>p)&&(i.trans(o-r.width/2,u),p=o+r.width/2)})}},i.prototype.$_layoutVert=function(t,e,i){var n=t.prop("gap"),r=this._line,a=t.tick,s=t._steps;this.height,s.length;var o,l="opposite"===t.prop("position"),h=l?a.prop("length"):-a.prop("length"),u=l?n:e-n;if(r.setVis(t.line.visible)&&(r.setStyleOrClass(t.line._style),r.setVLine(u,0,i)),this._tickContainer.setVis(a.visible)&&this._ticks.forEach(function(e,n){o=t.getRate(s[n])*i,e.setHLine(o,u,u+h)}),this._labelContainer.visible){var c=this._labelContainer.textAlign()||(l?"left":"right");u=l?u+h:e-n+h,this._labels.forEach(function(e,n){e.layout(c);var r=e.getBBox(),a=l?u:u-r.width;o=t.getRate(s[n])*i,e.trans(a,o-r.height/2)})}},i}(e.ScaleView);!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}T(e,t)}(e.GaugeScale);var I=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,a=this.labelView();return r.setText(t.getLabel(r,t.prop("value"))),a.text=r.prop("text"),r.buildSvg(a,null,i,n,t,r._domain),e.rectToSize(a.getBBox())},i.prototype._renderGauge=function(t,i){var n=this.model,r=e.pickNum(n._runValue,n.prop("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(),a=e.pickNum(t._runValue,t.prop("value")),s=e.assignObj({},this._rBand);if(this._renderScale(s),this.background().setRect(s),s.height>0&&this._renderBand(t,s,a),"top"!==i._runPos&&"bottom"!==i._runPos||(this._rLabel.height=s.height),this._renderLabel(t,i,r,a),!this._vertical&&("left"===i._runPos||"right"===i._runPos)&&n.visible&&"opposite"===n.prop("position")){var o=r.getBBox();r.ty+o.height>this.height&&r.transY(e.maxv(0,this.height-o.height))}},i.prototype._measureGauge=function(t,i,n,r,a,s,o){var l=this._rBand=e.createRect(0,0,s,o);if(this._vertical=t._group instanceof O?t._group.prop("vertical"):a,i.visible){var h=i._runPos=e.pickProp(i.prop("position"),this._vertical?"top":"left"),u=i._runVert="top"===h||"bottom"===h,c=t._group?t._group.itemLabel.prop("gap"):i._runGap=i.getGap(u?o:s),p=u?s:i.getWidth(s),d=u?i.getHeight(o):o,_=u?s:i.getMaxWidth(s),g=u?i.getMaxHeight(o):o,f=this._rLabel=e.createRect(0,0,s,o);n.setStyleOrClass(i._style),i.setText(t.getLabel(i,i.prop("animatable")?r:t.prop("value"))),n.text=i.prop("text"),i.buildSvg(n,null,e.pickNum(p,_),e.pickNum(d,g),t,i._domain);var y=n.getBBox();switch(u?(f.height=e.pickNum(d,y.height),l.height=e.maxv(0,l.height-(f.height+c))):(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+c))),h){case"top":l.y=f.height+c;break;case"bottom":f.y=l.height+c;break;case"right":f.x=l.width+c;break;default:l.x=this._wLabel+c}}else this._rLabel=null},i.prototype._renderLabel=function(t,i,n,r){if(n.visible){var a=this._rLabel,s=n.getBBox(),o=a.x,l=a.y;switch(i._runPos){case"top":case"bottom":o+=a.width/2;break;case"right":o=this.width-a.width,n.anchor=e.TextAnchor.START,l+=e.maxv(0,(a.height-s.height)/2);break;default:n.anchor=e.TextAnchor.END,o+=this._wLabel,l+=e.maxv(0,(a.height-s.height)/2)}n.trans(o,l)}},i.prototype._renderScale=function(t){var i,n,r=this.model,a=r.label,s=r.scale,o=this.scaleView(),l=this._vertical?t.height:t.width;if(s._vertical=this._vertical,s._reversed=r.prop("reversed"),isNaN(r._runValue)&&s.buildSteps(l,r.prop("value")),o.setVis(r.scaleVisible())){var h=o.measure(this.doc,s,t.width,t.height,1);this._vertical?(i=0,n=t.y,t.width=e.maxv(0,t.width-h.width),"opposite"===s.prop("position")?i=t.x+t.width:(a._runVert||(i=t.x),t.x+=h.width)):(i=t.x,t.height=e.maxv(0,t.height-h.height),"opposite"===s.prop("position")?a._runVert?(n=t.y,t.y+=h.height):(this._rLabel.y=t.y+=h.height,n=t.y-h.height):n=t.y+t.height),o.resizeByMeasured().layout().trans(i,n)}},i}(e.ValueGaugeView),N=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,a){var s=i.gauge,o=this._vertical=s instanceof R?s.isVertical():s.prop("vertical"),l="inside"===i.prop("position"),h=this._thick=l?o?n:r:i.getThickness(o?n:r)+(this._gap=i.num("gap")),u=o?h:n,c=o?r:h,p=this._ranges=i.getRanges();if(this._labelContainer.setVis(i.tickLabel.visible&&p.length>0)){var d=[p[0].fromValue].concat(p.map(function(t){return t.toValue}));if(this._labelContainer.setStyleOrClass(i.tickLabel._style),this._labels.prepare(p.length+1),o){var _=0;this._labels.forEach(function(t,i){t.text=String(d[i]),_=e.maxv(t.getBBox().width)}),u+=_+this._labelGap}else{var g=0;this._labels.forEach(function(t,i){t.text=String(d[i]),g=e.maxv(t.getBBox().height)}),c+=g}}return{width:u,height:c}},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.prop("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,a="inside"===this.model.prop("position"),s="opposite"===this.model.prop("position"),o=this.width,l=this.height,h=r?l:o,u=this._thick,c=0;return this._barViews.prepare(i.length).forEach(function(t,p){var d=i[p],_=h*(d.toValue-d.fromValue)/e;if(r){var g=a||s?0:o-u;t.setBounds(g,l-c-_,u,_)}else{var f=s?l-u:0;t.setBounds(c,f,_,n._thick)}t.internalClearStyleAndClass(),t.setFill(d.color),d.style&&t.addStyleOrClass(d.style),c+=_}),!0}},i.prototype.$_layoutLabels=function(t,i,n){var r="opposite"===this.model.prop("position");if(this._vertical){var a=this.height,s=r?e.TextAnchor.START:e.TextAnchor.END,o=r?this._thick+this._labelGap:this.width-this._thick-this._labelGap;(u=this._labels.get(0)).anchor=s,u.trans(o,a-u.getBBox().height/2);for(var l=1;l<=n.length;l++){var h=a-a*n[l-1].toValue/i;(u=this._labels.get(l)).anchor=s,u.trans(o,h-u.getBBox().height/2)}}else{var u;a=this.width,o=r?0:this._thick;(u=this._labels.get(0)).trans(0,o);for(l=1;l<=n.length;l++){var c=a*n[l-1].toValue/i;this._labels.get(l).trans(c,o)}}},i}(e.ChartElement),A=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 N(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.num("gap"),a=n.measure(this.doc,i,e.width,e.height,1);n.resizeByMeasured().layout(),this._vertical?"inside"===i.prop("position")?n.trans(e.x,e.y):"opposite"===i.prop("position")?(n.trans(e.x+e.width-a.width,e.y),e.width-=a.width+r):(n.trans(e.x,e.y),e.width-=a.width+r,e.x+=a.width+r):"inside"===i.prop("position")?n.trans(e.x,e.y):"opposite"===i.prop("position")?(n.trans(e.x,e.y),e.height-=a.height+r,e.y+=a.height+r):(n.trans(e.x,e.y+e.height-a.height),e.height-=a.height+r)}},i.prototype._renderBand=function(t,i,n){var r=this._valueView,a=t.prop("reversed"),s=t.valueBar,o=t._group?t._group.scale:t.scale;if(r.setVis(!e.isEmptyRect(i)&&s.visible&&!o.isEmpty()&&!isNaN(t.prop("value"))))if(r.setStyleOrClass(s._style),r.internalSetStyleOrClass(s.getStyle(t,n)),this._vertical){var l=i.height*o.getRate(n),h=a?i.y:i.y+i.height-l;r.setBounds(i.x,h,i.width,l)}else{var u=i.width*o.getRate(n),c=a?i.x+i.width-u:i.x;r.setBounds(c,i.y,u,i.height)}},i}(I),D=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 a=this.model,s=this._textView,o=e.createRect(0,0,n,r);if(s.visible){s.text=a.label.prop("text"),a.label.buildSvg(s,null,NaN,NaN,a,null);var l=this._textView.getBBox().height+a.label.getGap(r);o.y+=l,o.height-=l,s.trans(this.width/2,0)}a._labelWidth=a._labelHeight=0,this._gaugeViews.forEach(function(t,i){var s=t._measureLabelSize(a.get(i),n,r);a._labelWidth=e.maxv(a._labelWidth,s.width),a._labelHeight=e.maxv(a._labelHeight,s.height)});var h=e.copyObj(o),u=a.itemLabel.prop("gap");a.prop("vertical")?(h.height-=a._labelHeight+u,a.itemLabel.prop("opposite")||(h.y+=a._labelHeight+u)):(h.width-=a._labelWidth+u,a.itemLabel.prop("opposite")||(h.x+=a._labelWidth+u)),this._renderScale(a,o,h),a.prop("vertical")?this.$_layoutVert(this.doc,a,i,o):this.$_layoutHorz(this.doc,a,i,o)},i.prototype._renderScale=function(t,e,i){var n,r,a=this._scaleView,s=t.scale,o=t.prop("vertical"),l=o?e.height:e.width,h=[];if(this._gaugeViews.forEach(function(e,i){h.push(t.get(i).getValue())}),s.buildGroupSteps(l,h),s._vertical=o,a.setVis(s.visible)){var u=a.measure(this.doc,s,i.width,i.height,1);if(o){var c=u.width;i.width-=c,e.width-=c,r=i.y,"opposite"===s.prop("position")?n=i.x+i.width:(n=i.x,i.x+=c,e.x+=c)}else{var p=u.height;i.height-=p,e.height-=p,n=i.x,"opposite"===s.prop("position")?(r=i.y,i.y+=p,e.y+=p):r=i.y+i.height}a.resizeByMeasured().layout().trans(n,r)}},i.prototype.$_layoutVert=function(t,e,i,n){var r=n.height,a=(n.width-e.prop("itemGap")*(i.count-1))/i.count,s=n.y,o=n.x;i.forEach(function(i,n){i.measure(t,e.get(n),a,r,0),i.resize(a,r),i.layout(),i.trans(o,s),o+=a+e.prop("itemGap")})},i.prototype.$_layoutHorz=function(t,e,i,n){var r=e.prop("itemGap"),a=n.width,s=(n.height-r*(i.count-1))/i.count,o=n.x,l=n.y;i.forEach(function(i,n){i.measure(t,e.get(n),a,s,0),i.resize(a,s),i.layout(),i.trans(o,l),l+=s+r})},i}(e.GaugeGroupView),j=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 N(e),this._scaleView)},i.prototype._createPool=function(t){return new e.ElementPool(t,A)},i.prototype._renderScale=function(e,i,n){t.prototype._renderScale.call(this,e,i,n);var r,a,s=this._bandView,o=e.band;if(s.setVis(o.visible)){var l=o.num("gap"),h=s.measure(this.doc,o,n.width,n.height,1);if(e.prop("vertical")){var u=h.width+l;n.width-=u,i.width-=u,a=n.y,"opposite"===o.prop("position")?r=n.x+n.width+l:(r=n.x,n.x+=u,i.x+=u)}else{var c=h.height+l;n.height-=c,i.height-=c,r=n.x,"opposite"===o.prop("position")?(a=n.y,n.y+=c,i.y+=c):a=n.y+n.height+l}s.resizeByMeasured().layout().trans(r,a)}},i}(D),H=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)}}(),M=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return H(i,t),i.prototype.getText=function(t){return this._getText(null,t,e.absv(t)>1e3,!0)},i.defaults=e.extend(e.GaugeLabel.defaults,{visible:!1,position:"outside",offset:4}),i}(e.GaugeLabel),$=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return H(i,t),i.prototype.getText=function(t){return this._getText(null,t,e.absv(t)>1e3,!0)},i.defaults=e.extend(e.GaugeLabel.defaults,{visible:!1,offset:4}),i}(e.GaugeLabel),z=function(t){function i(e){var i=t.call(this,e.chart)||this;return i.gauge=e,i}return H(i,t),Object.defineProperty(i.prototype,"toValueLabel",{get:function(){return this._toValueLabel},enumerable:!1,configurable:!0}),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._toValueLabel=this._addChild("toValueLabel",new $(this.chart))},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;this._runRanges=e.buildValueRanges(this._ranges,t.prop("minValue"),t.prop("maxValue"),this.prop("rangeInclusive"))}return this._runRanges},i.defaults=e.extend(e.ChartItem.defaults,{vertical:!0,rangeInclusive:!0}),i}(e.ChartItem),F=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return H(i,t),Object.defineProperty(i.prototype,"label",{get:function(){return this._label},enumerable:!1,configurable:!0}),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._label=this._addChild("label",new M(this.chart))},i.defaults=e.extend(e.ChartItem.defaults,{visible:!0}),i}(e.GaugeItem),W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return H(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return this._label},enumerable:!1,configurable:!0}),e.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._label=this._addChild("label",new M(this.chart))},e}(E),Y=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return H(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._band=this._addChild("band",new z(this)),this._targetBar=this._addChild("targetBar",new F(this)),this._valueBar=this._addChild("valueBar",new W(this))},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.prop("ranges"),t,i,e.pickProp(n,this.prop("rangeInclusive")))},i.prototype.getParam=function(e){return"targetValue"===e?this.prop("targetValue"):t.prototype.getParam.call(this,e)},i.type=e.BulletGaugeType,i.defaults=e.extend(S.defaults,{rangeInclusive:!0}),i}(S),X=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return H(i,t),i.prototype.getRanges=function(t,i,n){return e.buildValueRanges(this.prop("ranges"),t,i,e.pickProp(n,this.prop("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),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(e){return t.call(this,e,"rct-bullet-gauge")||this}return U(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.add(this._valueLabelView=new e.TextElement(t,"rct-bullet-gauge-value-label")),i.add(this._targetLabelView=new e.TextElement(t,"rct-bullet-gauge-target-label")),this._bandLabelViews=new e.ElementPool(i,e.TextElement)},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.prop("targetValue"),a=t._group,s=t.prop("reversed"),o=this._vertical,l=a?a.scale:t.scale,h=this._valueView,u=this._targetView;if(this._barContainer.setVis(!e.isEmptyRect(i)&&!l.isEmpty())){var c=t.getRanges(l._min,l._max,!1)||(null==a?void 0:a.getRanges(l._min,l._max,!1));if(c){this._barContainer.setRect(i),this._barViews.prepare(c.length),o?this._barViews.forEach(function(t,e){var n=c[e],r=i.height*l.getRate(n.toValue-n.fromValue),a=i.height*l.getRate(n.fromValue);t.setBounds(0,s?a:i.height-a-r,i.width,r),t.internalClearStyleAndClass(),t.setFill(n.color),n.style&&t.addStyleOrClass(n.style)}):this._barViews.forEach(function(t,e){var n=c[e],r=i.width*l.getRate(n.toValue-n.fromValue),a=i.width*l.getRate(n.fromValue);t.setBounds(s?i.width-r-a:a,0,r,i.height),t.internalClearStyleAndClass(),t.setFill(n.color),n.style&&t.addStyleOrClass(n.style)});var p=t.band.toValueLabel;if(p.visible){var d=p.num("offset");this._bandLabelViews.prepare(c.length,function(t){t.internalClearStyleAndClass(),t.setStyleOrClass(p._style)}),this._bandLabelViews.forEach(function(t,e){var n=c[e].toValue;t.text=p.getText(n);var r=t.getBBox();if(o){var a=s?i.y+i.height*l.getRate(n):i.y+i.height*(1-l.getRate(n)),h=r.width/2;t.trans(i.x+i.width+d+h,a-r.height/2)}else{var u=s?i.x+i.width*(1-l.getRate(n)):i.x+i.width*l.getRate(n);t.trans(u-r.width/2,i.y-d-r.height)}})}else this._bandLabelViews.prepare(0)}}if(h.setVis(t.valueBar.visible&&!l.isEmpty()&&!isNaN(n)))if(h.setStyleOrClass(t.valueBar._style),n<r&&t.valueBar.prop("belowStyle")&&h.internalSetStyleOrClass(t.valueBar.prop("belowStyle")),h.internalSetStyleOrClass(t.valueBar.getStyle(t,n)),o){var _=i.height*l.getRate(n),g=s?i.y:i.y+i.height-_;h.setBounds(i.x+i.width/3,g,i.width/3,_)}else{var f=i.width*l.getRate(n),y=s?i.x+i.width-f:i.x;h.setBounds(y,i.y+i.height/3,f,i.height/3)}var b=t.valueBar.label;if(this._valueLabelView.setVis(b.visible&&h.visible)){var w=b.prop("position")||"outside",v=b.num("offset");this._valueLabelView.setStyleOrClass(b._style),this._valueLabelView.text=b.getText(n);var m=this._valueLabelView.getBBox();if(o){_=i.height*l.getRate(n);var V=s?i.y:i.y+i.height-_,x=s?V+_:V;if("inside"===w){var k=s?x-m.height-v:x+v;this._valueLabelView.trans(i.x+i.width/2,k)}else{k=s?x+v:x-v-m.height;this._valueLabelView.trans(i.x+i.width/2,k)}}else{f=i.width*l.getRate(n);var C=s?i.x+i.width-f:i.x,S=s?C:C+f,E=i.y+i.height/2,R=m.width/2;if("inside"===w){var P=s?S+v+R:S-v-R;this._valueLabelView.trans(P,E-m.height/2)}else{P=s?S-v-R:S+v+R;this._valueLabelView.trans(P,E-m.height/2)}}}if(u.setVis(t.targetBar.visible&&!l.isEmpty()&&!isNaN(r)))if(u.setStyleOrClass(t.targetBar._style),o&&i.width>10){g=i.height*l.getRate(r);g=s?i.y+g:i.y+i.height-g,u.setBounds(i.x+5,g-1,i.width-10,3)}else if(!o&&i.height>10){y=i.width*l.getRate(r);y=s?i.x+i.width-y:i.x+y,u.setBounds(y-1,i.y+5,3,i.height-10)}var L=t.targetBar.label;if(this._targetLabelView.setVis(L.visible&&u.visible)){w=L.prop("position")||"outside",v=L.num("offset");this._targetLabelView.setStyleOrClass(L._style),this._targetLabelView.text=L.getText(r);m=this._targetLabelView.getBBox();if(o){var O=l.getRate(r),G=s?i.y+i.height*O:i.y+i.height*(1-O);k=G-m.height/2,R=m.width/2;if("inside"===w){var T=i.x+i.width/2;s?this._targetLabelView.trans(T,G-v-m.height):this._targetLabelView.trans(T,G+v)}else this._targetLabelView.trans(i.x+i.width+v+R,k)}else{O=l.getRate(r);var B=s?i.x+i.width*(1-O):i.x+i.width*O;if("inside"===w){R=m.width/2,E=i.y+i.height/2,P=s?B+v+R:B-v-R;this._targetLabelView.trans(P,E-m.height/2)}else this._targetLabelView.trans(B,i.y-v-m.height)}}},i}(I),J=function(t){function i(e){return t.call(this,e,"rct-bullet-gauge-group")||this}return U(i,t),i.prototype._createPool=function(t){return new e.ElementPool(t,q)},i}(D),K=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 K(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),Z=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return K(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),tt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return K(i,t),i.defaults=e.extend(Z.defaults,{thickness:5,length:"85%"}),i}(Z),et=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return K(i,t),i.defaults=e.extend(Z.defaults,{thickness:2,length:"95%",animatable:!1,duration:200}),i}(Z),it=function(t){function e(e,i){var n=t.call(this,e)||this;return n.length=i,n}return K(e,t),e}(e.GaugeItem),nt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return K(i,t),i.defaults=e.extend(e.ChartItem.defaults,{step:1,offset:1}),i}(e.GaugeItem),rt=function(t){function e(e,i){var n=t.call(this,e)||this;return n.raidus=i,n}return K(e,t),e}(e.GaugeItem),at=function(t){function i(e){return t.call(this,e.chart)||this}return K(i,t),i.defaults=e.extend(e.ChartText.defaults,{text:"RealChart Clock<br>ver1.0",position:"top"}),i}(e.ChartText),st=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return K(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this.rim=this._addChild("rim",new Q(this)),this.hourHand=this._addChild("hourHand",new Z(this)),this.minuteHand=this._addChild("minuteHand",new tt(this)),this.secondHand=this._addChild("secondHand",new et(this)),this.tick=this._addChild("tick",new it(this,10)),this.minorTick=this._addChild("minorTick",new it(this,5)),this.tickLabel=this._addChild("tickLabel",new nt(this)),this.pin=this._addChild("pin",new rt(this,5)),this.label=this._addChild("label",new at(this))},i.prototype.getTime=function(){var t=this._op;return t.time instanceof this.chart.win.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,a,s=this;t.prototype._doApply.call(this,i),n=i.centerX,r=i.centerY,a=i.radius,(s._centerXDim||n!==s._centerX)&&(s._centerXDim=e.parsePercentSize(e.pickProp(s._centerX=n,e.CircularGauge.DEF_CENTER),!0)),s._centerYDim&&r===s._centerY||(s._centerYDim=e.parsePercentSize(e.pickProp(s._centerY=r,e.CircularGauge.DEF_CENTER),!0)),s._radiusDim&&a===s._radius||(s._radiusDim=e.parsePercentSize(e.pickProp(s._radius=a,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),ot=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)}}(),lt=function(t){function e(e){var i=t.call(this)||this;return i.view=e,i}return ot(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),ht=function(t){function i(e){var i=t.call(this,e,"rct-clock-gauge")||this;return i._rimThick=0,i._secRate=1,i}return ot(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.prop("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,a=this._exts=r.getExtents(t,i);this._secRate=1,this.$_renderFace(r,a),this.$_renderHands(r,a),r.prop("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.prop("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,a=this._minorTickViews,s=this._tickLabelViews,o=this._pinView,l=i.cx,h=i.cy,u=i.rd,c=this._rimThick=t.rim.getThickness(u);this._faceView.setCircle(l,h,u),r.setVis(t.rim.visible)&&(r.internalSetStyleOrClass(t.rim._style),r.setSector({cx:l,cy:h,rx:u,ry:u,innerRadius:1-c/u,start:0,angle:2*Math.PI,clockwise:!0}));var p=u-(r.visible?c:0),d=p-t.tick.length,_=e.ORG_ANGLE,g=e.PI_2/12;if(this._tickViews.forEach(function(i,n){i.setLine(l+e.cos(_)*p,h+e.sin(_)*p,l+e.cos(_)*d,h+e.sin(_)*d),i.internalSetStyleOrClass(t.tick._style),_+=g}),!a.isEmpty){var f=0;d=p-t.minorTick.length,_=e.ORG_ANGLE,g=e.PI_2/60,a.forEach(function(i){f%5==0&&(_+=g,f++),i.setLine(l+e.cos(_)*p,h+e.sin(_)*p,l+e.cos(_)*d,h+e.sin(_)*d),i.internalSetStyleOrClass(t.minorTick._style),_+=g,f++})}if(!s.isEmpty){var y=12/s.count,b=e.PI_2/12*y;_=e.ORG_ANGLE,s.get(0).text="12",d=p-(t.tick.length+t.tickLabel.prop("offset")||0),d-=.5*s.get(0).getBBox().height,s.forEach(function(i,n,r){i.text=String(0===n?12:n*y),i.trans(l+e.cos(_)*d,h+e.sin(_)*d),i.internalSetStyleOrClass(t.tickLabel._style),_+=b})}o.setVis(t.pin.visible)&&(o.setCircle(l,h,t.pin.raidus),o.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.prop("position")?n.trans(l,h+d/2):n.trans(l,h-d/2))},i.prototype.$_getNow=function(){var t=this.model.prop("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,a,s,o=this.$_getNow(),l=o.getHours(),h=o.getMinutes(),u=o.getSeconds(),c=i.cx,p=i.cy,d=i.rd,_=new e.PathBuilder;n=t.hourHand,(r=this._hourView).setVis(n.visible)&&(s=e.PI_2*(l/12+h/60/12+u/60/60/12),a=n.getLength(d-this._rimThick),_.rect(-n.prop("thickness")/2,-a,n.prop("thickness"),a),r.internalSetStyleOrClass(n._style),r.setPath(_.close(!0)).trans(c,p).rotate(s*e.RAD_DEG)),n=t.minuteHand,(r=this._minuteView).setVis(n.visible)&&(s=e.PI_2*(h/60+u/60/60),a=n.getLength(d-this._rimThick),_.rect(-n.prop("thickness")/2,-a,n.prop("thickness"),a),r.internalSetStyleOrClass(n._style),r.setPath(_.close(!0)).trans(c,p).rotate(s*e.RAD_DEG)),n=t.secondHand,(r=this._secondView).setVis(n.visible)&&(s=this._secRate<1?e.PI_2*(this._aniSec+this._secRate)/60:e.PI_2*u/60,a=n.getLength(d-this._rimThick),_.rect(-n.prop("thickness")/2,-a,n.prop("thickness"),a),r.internalSetStyleOrClass(n._style),r.setPath(_.close(!0)).trans(c,p).rotate(s*e.RAD_DEG),this._prevSec=u)},i.prototype.$_moveSecond=function(t){if(!isNaN(t)){this._aniSec=t;var e=new lt(this);e.duration=this.model.secondHand.prop("duration")||200,e.start()}},i}(e.GaugeView);function ut(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.Gauge.register(Y,p,st,R),t.GaugeGroup.register(X,d,G),t.GaugeView.register([p,m],[R,A],[Y,q],[st,ht],[d,V],[G,j],[X,J]))}ut(r),t.BulletGauge=Y,t.CircleGauge=p,t.ClockGauge=st,t.LinearGauge=R,t.default=ut,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
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),a=(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)}),s=function(t){function i(e){var i=t.call(this,e)||this;return i.gauge=e,i}return a(i,t),i.prototype.getRanges=function(t){if(!t){var i=this.gauge.calcedMinMax();t={minValue:i.min,maxValue:i.max}}var n=t.minValue,r=t.maxValue;if(!(r>n)&&(r=e.maxv(n,e.pickNum(this.gauge.prop("value"),n)),this._ranges))for(var a=0;a<this._ranges.length;a++){var s=e.pickNum(this._ranges[a].toValue,NaN);isNaN(s)||(r=e.maxv(r,s))}return e.buildValueRanges(this._ranges,n,r,!1,!0)||[]},i.prototype.getRange=function(t,e){var i=this.$_internalRanges(t);if(i)for(var n=0,r=i.length;n<r;n++){var a=i[n];if(e>=a.fromValue&&(e<a.toValue||n===r-1&&e<=a.toValue))return a}},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.prop("rangeInclusive"))||[]),this._runRanges},i.defaults=e.extend(e.ChartItem.defaults,{rangeInclusive:!0}),i}(e.GaugeItem),o=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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(s.defaults,{segmentGap:0}),i}(s),l=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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(s.defaults,{thickness:"100%",stroked:!1}),i}(s);!function(t){function i(){return null!==t&&t.apply(this,arguments)||this}a(i,t),i.defaults=e.extend(e.ChartItem.defaults,{visible:!1})}(e.GaugeItem);var h=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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),u=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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),c=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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 a(i,t),i.prototype._doInit=function(i){t.prototype._doInit.call(this,i),this._band=this._addChild("band",new e.GaugeRangeBand(this)),this._scale=this._addChild("scale",new c(this)),this._rim=this._addChild("rim",new o(this)),this._valueRim=this._addChild("valueRim",new l(this)),this._hand=this._addChild("hand",new h(this)),this._pin=this._addChild("pin",new u(this))},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,a=this.band,s=n.radius,o=s-n.inner;if(a.visible)switch(n.bandThick=a.getThickness(o),a.prop("position")){case"inside":n.band=s-(o-n.bandThick)/2;break;case"opposite":n.band=n.inner-a.prop("gap"),n.inner=n.band-n.bandThick;break;default:n.band=s+=n.bandThick+a.prop("gap")}if(n.scaleTick=e.maxv(1,r.tick.num("length")),n.scaleLabel=16,"opposite"===r.prop("position"))n.scale=e.maxv(n.inner-r.prop("gap"),0),n.inner=n.scale-n.scaleTick-n.scaleLabel;else n.scale=s+r.prop("gap");return n},i.type=e.CircleGaugeType,i}(e.CircularGauge),d=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return a(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),_=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 _(e,t),e}(e.ValueGaugeView),f=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return _(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 a=e._steps.length-(360===e.gauge.prop("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(a)),this._labelContainer.setVis(e.label.visible)&&(this._labelContainer.internalSetStyleOrClass(e.label._style),this._labels.prepare(a)),{width:i,height:n}},i.prototype._doLayout=function(t){var i,n,r,a,s=this.model,o=s._steps,l=s.gauge,h="opposite"===s.prop("position")?-1:1,u=l.getProps(),c=this._center.x,p=this._center.y,d=this._exts.scale,_=d+this.model.tick.prop("length")*h,g=u._sweepRad,f=u._startRad,y=l.prop("maxValue")-l.prop("minValue"),b=l.prop("clockwise");if(this._line.visible&&this._line.setArc(c,p,d,f,b?g:-g,b),this._tickContainer.visible&&this._ticks.forEach(function(t,l,h){var u=s.getRate(o[l])*(b?g:-g)+f;i=c+e.cos(u)*d,n=p+e.sin(u)*d,r=c+e.cos(u)*_,a=p+e.sin(u)*_,t.setLine(i,n,r,a)}),this._labelContainer.visible){this._labels.get(0).setText(String(l.prop("maxValue")));var w=_+.2*this._labels.get(0).getBBox().height*h;this._labels.forEach(function(t,i){var n=s.getRate(o[i])*(b?g:-g)+f;t.setText(String(e.fixnum(l.prop("minValue")+s.getRate(o[i])*y))),t.setContrast(null).layout("center");var u=t.getBBox();r=c+e.cos(n)*(w+u.width/2*h)-u.width/2,a=p+e.sin(n)*(w+u.height/2*h)-u.height/2,t.trans(r,a)})}},i}(e.ScaleView),y=function(t){function i(i){var n=t.call(this,i,"rct-circle-gauge-rim")||this;return n._sectorViews=new e.ElementPool(n,e.SectorElement,"rct-circle-gauge-rim"),n}return _(i,t),i.prototype.setExtents=function(t,e){this._center=t,this._exts=e},i.prototype._doLayout=function(t){var i=this.model,n=i.gauge,r=n.getProps(),a=i.getRanges(),s=this._center.x,o=this._center.y,l=this._exts.radius,h=1-i.getSegmentThickness(this._exts.radiusThick)/l,u=n.prop("clockwise"),c=r._sweepRad,p=r._startRad;if(0===a.length){var d=this._sectorViews.prepare(1).get(0);return d.internalSetStyleOrClass(i._style),void d.setSector({cx:s,cy:o,rx:l,ry:l,innerRadius:h,start:p,angle:c,clockwise:u})}var _=e.pickNum(i.prop("segmentGap"),0),g=_>0?_/l:0,f=g*(a.length-1),y=e.maxv(0,c-f),b=a.reduce(function(t,e){return t+(e.toValue-e.fromValue)},0);this._sectorViews.prepare(a.length).forEach(function(t,e){var i=b>0?(a[e].toValue-a[e].fromValue)/b*y:0;t.setSector({cx:s,cy:o,rx:l,ry:l,innerRadius:h,start:p,angle:i,clockwise:u}),t.internalClearStyleAndClass(),t.setFill(a[e].color),a[e].style&&t.addStyleOrClass(a[e].style),p+=u?i+g:-(i+g)})},i}(e.ChartElement),b=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 _(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.getProps(),r=this._center.x,a=this._center.y,s=this._exts.band,o=i.prop("clockwise"),l=1-this._exts.bandThick/s,h=e.getRanges(),u=n._sweepRad,c=n._startRad,p=h.reduce(function(t,e){return t+(e.toValue-e.fromValue)},0);this._sectorViews.prepare(h.length).forEach(function(t,e){var i=p>0?(h[e].toValue-h[e].fromValue)/p*u:0;t.setSector({cx:r,cy:a,rx:s,ry:s,innerRadius:l,start:c,angle:i,clockwise:o}),t.internalClearStyleAndClass(),t.setFill(h[e].color),h[e].style&&t.addStyleOrClass(h[e].style),c+=o?i:-i})},i}(e.ChartElement),w=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return _(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),v=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return _(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,a=this._offset=n.offset;if(this._length=n.length,this._radius>0&&this._length>0){var s=new e.PathBuilder;s.move(-r,a).line(0,-this._length+a).line(r,a),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(t._style),this},i}(e.PathElement),m=function(t){function i(e){return t.call(this,e,"rct-circle-gauge")||this}return _(i,t),i.prototype._doInitContents=function(t,i){i.add(this._rimView=new y(t)),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 b(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 v(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 w(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),a=n.getExtents(e.minv(t,i));this.$_renderBackground(n,r,a),this._renderValue()},i.prototype._renderValue=function(){var t=this.model,i=t.scale,n=t.getProps(),r=t.getValue(),a=i.getRate(e.pickNum(r,0)),s=this._center,o=this._exts,l=t.valueRim.getThickness(o.radiusThick),h=this._textView;if(this._valueView.visible){var u=t.valueRim,c=t.calcedMinMax(),p=u.getRange({minValue:c.min,maxValue:c.max},r),d=o.value+(u.prop("stroked")?0:l/2),_=this._valueView;_.setStyleOrClass(u._style),p&&(_.setStyle(u.prop("stroked")?"stroke":"fill",p.color),p.style&&_.addStyleOrClass(p.style)),u.prop("stroked")&&(_.setFill("none"),_.setStyle("strokeWidth",e.pixel(l))),_.setBoolData("stroked",u.prop("stroked")),_.setSectorEx({cx:s.x,cy:s.y,rx:d,ry:d,innerRadius:(d-l)/d,start:n._startRad,angle:n._sweepRad*a,clockwise:t.prop("clockwise")},u.prop("stroked"))}if(this._handView){var g=(n._handRad+n._sweepRad*a)*e.RAD_DEG;this._handView.render(t.hand,o.radius).transp(s).rotate(t.prop("clockwise")?g:-g)}if(h.visible){var f=t.label;if(f.setText(t.getLabel(f,f.prop("animatable")?r:t.prop("value"))),h.text=f.prop("text"),h.setBoolData("grouped",!!t._group),f.buildSvg(h,null,NaN,NaN,t,f._domain),t._group)this.$_layoutGroupedLabel(t,h,o);else{var y=h.getBBox(),b=f.getOffset(this.width,this.height);h.trans(s.x+b.x,s.y-y.height/2+b.y)}}},i.prototype.$_renderBackground=function(t,e,i){var n=t.getProps();this._center=e,this._exts=i,t.scale.buildSteps(i.scale*n._sweepRad,NaN),this._rimView.visible&&(this._rimView.measure(this.doc,t.rim,this.width,this.height,0),this._rimView.setExtents(e,i),this._rimView.layout()),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.prop("innerStyle"));var r=i.inner,a=getComputedStyle(this._innerView.dom),s=parseFloat(a.strokeWidth);s>1&&(r-=s/2),this._innerView.setSector({cx:e.x,cy:e.y,rx:r,ry:r,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(t.pin,r).trans(e.x,e.y)},i.prototype.$_layoutGroupedLabel=function(t,i,n){var r=i.getBBox(),a=this._center,s=+t._group.num("labelGap");i.anchor=e.TextAnchor.END,i.trans(a.x-s,a.y-n.radius+(n.radius-n.inner-r.height)/2)},i}(g),V=function(t){function i(e){return t.call(this,e,"rct-circle-gauge-group")||this}return _(i,t),i.prototype._createPool=function(t){return new e.ElementPool(t,m)},i.prototype._doRenderGauges=function(t,i,n,r){var a=this.doc,s=this.model,o=s.getProps().getCenter(n,r),l=s.getProps().getExtents(e.minv(n,r));s.setChildExtents(l),n=r=2*l.radius,i.forEach(function(t,e){t.measure(a,s.getVisible(e),n,r,0),t.resize(n,r),t.layout()}),t.trans(o.x-l.radius,o.y-l.radius)},i}(e.GaugeGroupView),x=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)}}(),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x(e,t),e}(e.GaugeScale),C=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(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),S=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._scale=this._addChild("scale",new k(this))},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._createLabel=function(){return new C(this.chart)},i.prototype.isVertical=function(){return this._group?this._group.prop("vertical"):this.prop("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),E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._args={gauge:null,value:NaN},e}return x(e,t),e.prototype.getStyle=function(t,e){var i=this.prop("styleCallback");if(i)return this._args.gauge=t,this._args.value=e,i(this._args)},e}(e.GaugeItem),R=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(i,t),i.prototype._doInit=function(i){t.prototype._doInit.call(this,i),this._valueBar=this._addChild("valueBar",new E(this)),this._band=this._addChild("band",new e.GaugeRangeBand(this))},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}(S),P=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(i,t),i.defaults=e.extend(e.ChartItem.defaults,{opposite:!1,gap:10}),i}(e.ChartItem),L=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(i,t),i.defaults=e.extend(C.defaults,{gap:10}),i}(C),O=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return x(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._label=this._addChild("label",new L(this.chart)),this._itemLabel=this._addChild("itemLabel",new P(this.chart)),this._scale=this._addChild("scale",new k(this))},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 x(i,t),i.prototype._doInit=function(i){t.prototype._doInit.call(this,i),this._band=this._addChild("band",new e.GaugeRangeBand(this))},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,a){var s=i.prop("gap"),o=i._reversed,l=i._vertical,h=i.label,u=i.tick,c=i._steps,p=c.length,d=l?s:n,_=l?r:s;if(this._tickContainer.setVis(u.visible)&&(this._tickContainer.setStyleOrClass(u._style),this._ticks.prepare(p)),l?d+=u.prop("length"):_+=u.prop("length"),this._labelContainer.setVis(h.visible)&&(this._labels.prepare(p,function(e){e.setModel(t,h,null,null)}),p>0))if(l){var g=0;this._labels.forEach(function(t,i){t.setText(h.getText(c[o?i:p-1-i])),g=e.maxv(t.getBBox().width)}),d+=g}else{var f=0;this._labels.forEach(function(t,i){t.setText(h.getText(c[o?p-1-i:i])),f=e.maxv(t.getBBox().height)}),_+=f}return{width:d,height:_}},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.prop("gap"),r=this._line,a=t.tick,s=t._steps;s.length;var o,l="opposite"===t.prop("position"),h=l?-a.prop("length"):a.prop("length"),u=l?i-n:n;if(r.setVis(t.line.visible)&&(r.setStyleOrClass(t.line._style),r.setHLine(u,0,e)),this._tickContainer.setVis(a.visible)&&this._ticks.forEach(function(i,n){o=t.getRate(s[n])*e,i.setVLine(o,u,u+h)}),this._labelContainer.visible){var c=this._labelContainer.textAlign()||"center",p=Number.MIN_SAFE_INTEGER;u=l?0:u+h,this._labels.forEach(function(i,n){i.layout(c);var r=i.getBBox();o=t.getRate(s[n])*e,i.setVis(o-r.width/2>p)&&(i.trans(o-r.width/2,u),p=o+r.width/2)})}},i.prototype.$_layoutVert=function(t,e,i){var n=t.prop("gap"),r=this._line,a=t.tick,s=t._steps;this.height,s.length;var o,l="opposite"===t.prop("position"),h=l?a.prop("length"):-a.prop("length"),u=l?n:e-n;if(r.setVis(t.line.visible)&&(r.setStyleOrClass(t.line._style),r.setVLine(u,0,i)),this._tickContainer.setVis(a.visible)&&this._ticks.forEach(function(e,n){o=t.getRate(s[n])*i,e.setHLine(o,u,u+h)}),this._labelContainer.visible){var c=this._labelContainer.textAlign()||(l?"left":"right");u=l?u+h:e-n+h,this._labels.forEach(function(e,n){e.layout(c);var r=e.getBBox(),a=l?u:u-r.width;o=t.getRate(s[n])*i,e.trans(a,o-r.height/2)})}},i}(e.ScaleView);!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}T(e,t)}(e.GaugeScale);var I=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,a=this.labelView();return r.setText(t.getLabel(r,t.prop("value"))),a.text=r.prop("text"),r.buildSvg(a,null,i,n,t,r._domain),e.rectToSize(a.getBBox())},i.prototype._renderGauge=function(t,i){var n=this.model,r=e.pickNum(n._runValue,n.prop("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(),a=e.pickNum(t._runValue,t.prop("value")),s=e.assignObj({},this._rBand);if(this._renderScale(s),this.background().setRect(s),s.height>0&&this._renderBand(t,s,a),"top"!==i._runPos&&"bottom"!==i._runPos||(this._rLabel.height=s.height),this._renderLabel(t,i,r,a),!this._vertical&&("left"===i._runPos||"right"===i._runPos)&&n.visible&&"opposite"===n.prop("position")){var o=r.getBBox();r.ty+o.height>this.height&&r.transY(e.maxv(0,this.height-o.height))}},i.prototype._measureGauge=function(t,i,n,r,a,s,o){var l=this._rBand=e.createRect(0,0,s,o);if(this._vertical=t._group instanceof O?t._group.prop("vertical"):a,i.visible){var h=i._runPos=e.pickProp(i.prop("position"),this._vertical?"top":"left"),u=i._runVert="top"===h||"bottom"===h,c=t._group?t._group.itemLabel.prop("gap"):i._runGap=i.getGap(u?o:s),p=u?s:i.getWidth(s),d=u?i.getHeight(o):o,_=u?s:i.getMaxWidth(s),g=u?i.getMaxHeight(o):o,f=this._rLabel=e.createRect(0,0,s,o);n.setStyleOrClass(i._style),i.setText(t.getLabel(i,i.prop("animatable")?r:t.prop("value"))),n.text=i.prop("text"),i.buildSvg(n,null,e.pickNum(p,_),e.pickNum(d,g),t,i._domain);var y=n.getBBox();switch(u?(f.height=e.pickNum(d,y.height),l.height=e.maxv(0,l.height-(f.height+c))):(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+c))),h){case"top":l.y=f.height+c;break;case"bottom":f.y=l.height+c;break;case"right":f.x=l.width+c;break;default:l.x=this._wLabel+c}}else this._rLabel=null},i.prototype._renderLabel=function(t,i,n,r){if(n.visible){var a=this._rLabel,s=n.getBBox(),o=a.x,l=a.y;switch(i._runPos){case"top":case"bottom":o+=a.width/2;break;case"right":o=this.width-a.width,n.anchor=e.TextAnchor.START,l+=e.maxv(0,(a.height-s.height)/2);break;default:n.anchor=e.TextAnchor.END,o+=this._wLabel,l+=e.maxv(0,(a.height-s.height)/2)}n.trans(o,l)}},i.prototype._renderScale=function(t){var i,n,r=this.model,a=r.label,s=r.scale,o=this.scaleView(),l=this._vertical?t.height:t.width;if(s._vertical=this._vertical,s._reversed=r.prop("reversed"),isNaN(r._runValue)&&s.buildSteps(l,r.prop("value")),o.setVis(r.scaleVisible())){var h=o.measure(this.doc,s,t.width,t.height,1);this._vertical?(i=0,n=t.y,t.width=e.maxv(0,t.width-h.width),"opposite"===s.prop("position")?i=t.x+t.width:(a._runVert||(i=t.x),t.x+=h.width)):(i=t.x,t.height=e.maxv(0,t.height-h.height),"opposite"===s.prop("position")?a._runVert?(n=t.y,t.y+=h.height):(this._rLabel.y=t.y+=h.height,n=t.y-h.height):n=t.y+t.height),o.resizeByMeasured().layout().trans(i,n)}},i}(e.ValueGaugeView),N=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,a){var s=i.gauge,o=this._vertical=s instanceof R?s.isVertical():s.prop("vertical"),l="inside"===i.prop("position"),h=this._thick=l?o?n:r:i.getThickness(o?n:r)+(this._gap=i.num("gap")),u=o?h:n,c=o?r:h,p=this._ranges=i.getRanges();if(this._labelContainer.setVis(i.tickLabel.visible&&p.length>0)){var d=[p[0].fromValue].concat(p.map(function(t){return t.toValue}));if(this._labelContainer.setStyleOrClass(i.tickLabel._style),this._labels.prepare(p.length+1),o){var _=0;this._labels.forEach(function(t,i){t.text=String(d[i]),_=e.maxv(t.getBBox().width)}),u+=_+this._labelGap}else{var g=0;this._labels.forEach(function(t,i){t.text=String(d[i]),g=e.maxv(t.getBBox().height)}),c+=g}}return{width:u,height:c}},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.prop("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,a="inside"===this.model.prop("position"),s="opposite"===this.model.prop("position"),o=this.width,l=this.height,h=r?l:o,u=this._thick,c=0;return this._barViews.prepare(i.length).forEach(function(t,p){var d=i[p],_=h*(d.toValue-d.fromValue)/e;if(r){var g=a||s?0:o-u;t.setBounds(g,l-c-_,u,_)}else{var f=s?l-u:0;t.setBounds(c,f,_,n._thick)}t.internalClearStyleAndClass(),t.setFill(d.color),d.style&&t.addStyleOrClass(d.style),c+=_}),!0}},i.prototype.$_layoutLabels=function(t,i,n){var r="opposite"===this.model.prop("position");if(this._vertical){var a=this.height,s=r?e.TextAnchor.START:e.TextAnchor.END,o=r?this._thick+this._labelGap:this.width-this._thick-this._labelGap;(u=this._labels.get(0)).anchor=s,u.trans(o,a-u.getBBox().height/2);for(var l=1;l<=n.length;l++){var h=a-a*n[l-1].toValue/i;(u=this._labels.get(l)).anchor=s,u.trans(o,h-u.getBBox().height/2)}}else{var u;a=this.width,o=r?0:this._thick;(u=this._labels.get(0)).trans(0,o);for(l=1;l<=n.length;l++){var c=a*n[l-1].toValue/i;this._labels.get(l).trans(c,o)}}},i}(e.ChartElement),A=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 N(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.num("gap"),a=n.measure(this.doc,i,e.width,e.height,1);n.resizeByMeasured().layout(),this._vertical?"inside"===i.prop("position")?n.trans(e.x,e.y):"opposite"===i.prop("position")?(n.trans(e.x+e.width-a.width,e.y),e.width-=a.width+r):(n.trans(e.x,e.y),e.width-=a.width+r,e.x+=a.width+r):"inside"===i.prop("position")?n.trans(e.x,e.y):"opposite"===i.prop("position")?(n.trans(e.x,e.y),e.height-=a.height+r,e.y+=a.height+r):(n.trans(e.x,e.y+e.height-a.height),e.height-=a.height+r)}},i.prototype._renderBand=function(t,i,n){var r=this._valueView,a=t.prop("reversed"),s=t.valueBar,o=t._group?t._group.scale:t.scale;if(r.setVis(!e.isEmptyRect(i)&&s.visible&&!o.isEmpty()&&!isNaN(t.prop("value"))))if(r.setStyleOrClass(s._style),r.internalSetStyleOrClass(s.getStyle(t,n)),this._vertical){var l=i.height*o.getRate(n),h=a?i.y:i.y+i.height-l;r.setBounds(i.x,h,i.width,l)}else{var u=i.width*o.getRate(n),c=a?i.x+i.width-u:i.x;r.setBounds(c,i.y,u,i.height)}},i}(I),D=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 a=this.model,s=this._textView,o=e.createRect(0,0,n,r);if(s.visible){s.text=a.label.prop("text"),a.label.buildSvg(s,null,NaN,NaN,a,null);var l=this._textView.getBBox().height+a.label.getGap(r);o.y+=l,o.height-=l,s.trans(this.width/2,0)}a._labelWidth=a._labelHeight=0,this._gaugeViews.forEach(function(t,i){var s=t._measureLabelSize(a.get(i),n,r);a._labelWidth=e.maxv(a._labelWidth,s.width),a._labelHeight=e.maxv(a._labelHeight,s.height)});var h=e.copyObj(o),u=a.itemLabel.prop("gap");a.prop("vertical")?(h.height-=a._labelHeight+u,a.itemLabel.prop("opposite")||(h.y+=a._labelHeight+u)):(h.width-=a._labelWidth+u,a.itemLabel.prop("opposite")||(h.x+=a._labelWidth+u)),this._renderScale(a,o,h),a.prop("vertical")?this.$_layoutVert(this.doc,a,i,o):this.$_layoutHorz(this.doc,a,i,o)},i.prototype._renderScale=function(t,e,i){var n,r,a=this._scaleView,s=t.scale,o=t.prop("vertical"),l=o?e.height:e.width,h=[];if(this._gaugeViews.forEach(function(e,i){h.push(t.get(i).getValue())}),s.buildGroupSteps(l,h),s._vertical=o,a.setVis(s.visible)){var u=a.measure(this.doc,s,i.width,i.height,1);if(o){var c=u.width;i.width-=c,e.width-=c,r=i.y,"opposite"===s.prop("position")?n=i.x+i.width:(n=i.x,i.x+=c,e.x+=c)}else{var p=u.height;i.height-=p,e.height-=p,n=i.x,"opposite"===s.prop("position")?(r=i.y,i.y+=p,e.y+=p):r=i.y+i.height}a.resizeByMeasured().layout().trans(n,r)}},i.prototype.$_layoutVert=function(t,e,i,n){var r=n.height,a=(n.width-e.prop("itemGap")*(i.count-1))/i.count,s=n.y,o=n.x;i.forEach(function(i,n){i.measure(t,e.get(n),a,r,0),i.resize(a,r),i.layout(),i.trans(o,s),o+=a+e.prop("itemGap")})},i.prototype.$_layoutHorz=function(t,e,i,n){var r=e.prop("itemGap"),a=n.width,s=(n.height-r*(i.count-1))/i.count,o=n.x,l=n.y;i.forEach(function(i,n){i.measure(t,e.get(n),a,s,0),i.resize(a,s),i.layout(),i.trans(o,l),l+=s+r})},i}(e.GaugeGroupView),j=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 N(e),this._scaleView)},i.prototype._createPool=function(t){return new e.ElementPool(t,A)},i.prototype._renderScale=function(e,i,n){t.prototype._renderScale.call(this,e,i,n);var r,a,s=this._bandView,o=e.band;if(s.setVis(o.visible)){var l=o.num("gap"),h=s.measure(this.doc,o,n.width,n.height,1);if(e.prop("vertical")){var u=h.width+l;n.width-=u,i.width-=u,a=n.y,"opposite"===o.prop("position")?r=n.x+n.width+l:(r=n.x,n.x+=u,i.x+=u)}else{var c=h.height+l;n.height-=c,i.height-=c,r=n.x,"opposite"===o.prop("position")?(a=n.y,n.y+=c,i.y+=c):a=n.y+n.height+l}s.resizeByMeasured().layout().trans(r,a)}},i}(D),H=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)}}(),M=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return H(i,t),i.prototype.getText=function(t){return this._getText(null,t,e.absv(t)>1e3,!0)},i.defaults=e.extend(e.GaugeLabel.defaults,{visible:!1,position:"outside",offset:4}),i}(e.GaugeLabel),$=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return H(i,t),i.prototype.getText=function(t){return this._getText(null,t,e.absv(t)>1e3,!0)},i.defaults=e.extend(e.GaugeLabel.defaults,{visible:!1,offset:4}),i}(e.GaugeLabel),z=function(t){function i(e){var i=t.call(this,e.chart)||this;return i.gauge=e,i}return H(i,t),Object.defineProperty(i.prototype,"toValueLabel",{get:function(){return this._toValueLabel},enumerable:!1,configurable:!0}),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._toValueLabel=this._addChild("toValueLabel",new $(this.chart))},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;this._runRanges=e.buildValueRanges(this._ranges,t.prop("minValue"),t.prop("maxValue"),this.prop("rangeInclusive"))}return this._runRanges},i.defaults=e.extend(e.ChartItem.defaults,{vertical:!0,rangeInclusive:!0}),i}(e.ChartItem),F=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return H(i,t),Object.defineProperty(i.prototype,"label",{get:function(){return this._label},enumerable:!1,configurable:!0}),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._label=this._addChild("label",new M(this.chart))},i.defaults=e.extend(e.ChartItem.defaults,{visible:!0}),i}(e.GaugeItem),W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return H(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return this._label},enumerable:!1,configurable:!0}),e.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._label=this._addChild("label",new M(this.chart))},e}(E),Y=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return H(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this._band=this._addChild("band",new z(this)),this._targetBar=this._addChild("targetBar",new F(this)),this._valueBar=this._addChild("valueBar",new W(this))},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.prop("ranges"),t,i,e.pickProp(n,this.prop("rangeInclusive")))},i.prototype.getParam=function(e){return"targetValue"===e?this.prop("targetValue"):t.prototype.getParam.call(this,e)},i.type=e.BulletGaugeType,i.defaults=e.extend(S.defaults,{rangeInclusive:!0}),i}(S),X=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return H(i,t),i.prototype.getRanges=function(t,i,n){return e.buildValueRanges(this.prop("ranges"),t,i,e.pickProp(n,this.prop("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),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(e){return t.call(this,e,"rct-bullet-gauge")||this}return U(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.add(this._valueLabelView=new e.TextElement(t,"rct-bullet-gauge-value-label")),i.add(this._targetLabelView=new e.TextElement(t,"rct-bullet-gauge-target-label")),this._bandLabelViews=new e.ElementPool(i,e.TextElement)},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.prop("targetValue"),a=t._group,s=t.prop("reversed"),o=this._vertical,l=a?a.scale:t.scale,h=this._valueView,u=this._targetView;if(this._barContainer.setVis(!e.isEmptyRect(i)&&!l.isEmpty())){var c=t.getRanges(l._min,l._max,!1)||(null==a?void 0:a.getRanges(l._min,l._max,!1));if(c){this._barContainer.setRect(i),this._barViews.prepare(c.length),o?this._barViews.forEach(function(t,e){var n=c[e],r=i.height*l.getRate(n.toValue-n.fromValue),a=i.height*l.getRate(n.fromValue);t.setBounds(0,s?a:i.height-a-r,i.width,r),t.internalClearStyleAndClass(),t.setFill(n.color),n.style&&t.addStyleOrClass(n.style)}):this._barViews.forEach(function(t,e){var n=c[e],r=i.width*l.getRate(n.toValue-n.fromValue),a=i.width*l.getRate(n.fromValue);t.setBounds(s?i.width-r-a:a,0,r,i.height),t.internalClearStyleAndClass(),t.setFill(n.color),n.style&&t.addStyleOrClass(n.style)});var p=t.band.toValueLabel;if(p.visible){var d=p.num("offset");this._bandLabelViews.prepare(c.length,function(t){t.internalClearStyleAndClass(),t.setStyleOrClass(p._style)}),this._bandLabelViews.forEach(function(t,e){var n=c[e].toValue;t.text=p.getText(n);var r=t.getBBox();if(o){var a=s?i.y+i.height*l.getRate(n):i.y+i.height*(1-l.getRate(n)),h=r.width/2;t.trans(i.x+i.width+d+h,a-r.height/2)}else{var u=s?i.x+i.width*(1-l.getRate(n)):i.x+i.width*l.getRate(n);t.trans(u-r.width/2,i.y-d-r.height)}})}else this._bandLabelViews.prepare(0)}}if(h.setVis(t.valueBar.visible&&!l.isEmpty()&&!isNaN(n)))if(h.setStyleOrClass(t.valueBar._style),n<r&&t.valueBar.prop("belowStyle")&&h.internalSetStyleOrClass(t.valueBar.prop("belowStyle")),h.internalSetStyleOrClass(t.valueBar.getStyle(t,n)),o){var _=i.height*l.getRate(n),g=s?i.y:i.y+i.height-_;h.setBounds(i.x+i.width/3,g,i.width/3,_)}else{var f=i.width*l.getRate(n),y=s?i.x+i.width-f:i.x;h.setBounds(y,i.y+i.height/3,f,i.height/3)}var b=t.valueBar.label;if(this._valueLabelView.setVis(b.visible&&h.visible)){var w=b.prop("position")||"outside",v=b.num("offset");this._valueLabelView.setStyleOrClass(b._style),this._valueLabelView.text=b.getText(n);var m=this._valueLabelView.getBBox();if(o){_=i.height*l.getRate(n);var V=s?i.y:i.y+i.height-_,x=s?V+_:V;if("inside"===w){var k=s?x-m.height-v:x+v;this._valueLabelView.trans(i.x+i.width/2,k)}else{k=s?x+v:x-v-m.height;this._valueLabelView.trans(i.x+i.width/2,k)}}else{f=i.width*l.getRate(n);var C=s?i.x+i.width-f:i.x,S=s?C:C+f,E=i.y+i.height/2,R=m.width/2;if("inside"===w){var P=s?S+v+R:S-v-R;this._valueLabelView.trans(P,E-m.height/2)}else{P=s?S-v-R:S+v+R;this._valueLabelView.trans(P,E-m.height/2)}}}if(u.setVis(t.targetBar.visible&&!l.isEmpty()&&!isNaN(r)))if(u.setStyleOrClass(t.targetBar._style),o&&i.width>10){g=i.height*l.getRate(r);g=s?i.y+g:i.y+i.height-g,u.setBounds(i.x+5,g-1,i.width-10,3)}else if(!o&&i.height>10){y=i.width*l.getRate(r);y=s?i.x+i.width-y:i.x+y,u.setBounds(y-1,i.y+5,3,i.height-10)}var L=t.targetBar.label;if(this._targetLabelView.setVis(L.visible&&u.visible)){w=L.prop("position")||"outside",v=L.num("offset");this._targetLabelView.setStyleOrClass(L._style),this._targetLabelView.text=L.getText(r);m=this._targetLabelView.getBBox();if(o){var O=l.getRate(r),G=s?i.y+i.height*O:i.y+i.height*(1-O);k=G-m.height/2,R=m.width/2;if("inside"===w){var T=i.x+i.width/2;s?this._targetLabelView.trans(T,G-v-m.height):this._targetLabelView.trans(T,G+v)}else this._targetLabelView.trans(i.x+i.width+v+R,k)}else{O=l.getRate(r);var B=s?i.x+i.width*(1-O):i.x+i.width*O;if("inside"===w){R=m.width/2,E=i.y+i.height/2,P=s?B+v+R:B-v-R;this._targetLabelView.trans(P,E-m.height/2)}else this._targetLabelView.trans(B,i.y-v-m.height)}}},i}(I),J=function(t){function i(e){return t.call(this,e,"rct-bullet-gauge-group")||this}return U(i,t),i.prototype._createPool=function(t){return new e.ElementPool(t,q)},i}(D),K=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 K(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),Z=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return K(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),tt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return K(i,t),i.defaults=e.extend(Z.defaults,{thickness:5,length:"85%"}),i}(Z),et=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return K(i,t),i.defaults=e.extend(Z.defaults,{thickness:2,length:"95%",animatable:!1,duration:200}),i}(Z),it=function(t){function e(e,i){var n=t.call(this,e)||this;return n.length=i,n}return K(e,t),e}(e.GaugeItem),nt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return K(i,t),i.defaults=e.extend(e.ChartItem.defaults,{step:1,offset:1}),i}(e.GaugeItem),rt=function(t){function e(e,i){var n=t.call(this,e)||this;return n.raidus=i,n}return K(e,t),e}(e.GaugeItem),at=function(t){function i(e){return t.call(this,e.chart)||this}return K(i,t),i.defaults=e.extend(e.ChartText.defaults,{text:"RealChart Clock<br>ver1.0",position:"top"}),i}(e.ChartText),st=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return K(i,t),i.prototype._doInit=function(e){t.prototype._doInit.call(this,e),this.rim=this._addChild("rim",new Q(this)),this.hourHand=this._addChild("hourHand",new Z(this)),this.minuteHand=this._addChild("minuteHand",new tt(this)),this.secondHand=this._addChild("secondHand",new et(this)),this.tick=this._addChild("tick",new it(this,10)),this.minorTick=this._addChild("minorTick",new it(this,5)),this.tickLabel=this._addChild("tickLabel",new nt(this)),this.pin=this._addChild("pin",new rt(this,5)),this.label=this._addChild("label",new at(this))},i.prototype.getTime=function(){var t=this._op;return t.time instanceof this.chart.win.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,a,s=this;t.prototype._doApply.call(this,i),n=i.centerX,r=i.centerY,a=i.radius,(s._centerXDim||n!==s._centerX)&&(s._centerXDim=e.parsePercentSize(e.pickProp(s._centerX=n,e.CircularGauge.DEF_CENTER),!0)),s._centerYDim&&r===s._centerY||(s._centerYDim=e.parsePercentSize(e.pickProp(s._centerY=r,e.CircularGauge.DEF_CENTER),!0)),s._radiusDim&&a===s._radius||(s._radiusDim=e.parsePercentSize(e.pickProp(s._radius=a,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),ot=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)}}(),lt=function(t){function e(e){var i=t.call(this)||this;return i.view=e,i}return ot(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),ht=function(t){function i(e){var i=t.call(this,e,"rct-clock-gauge")||this;return i._rimThick=0,i._secRate=1,i}return ot(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.prop("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,a=this._exts=r.getExtents(t,i);this._secRate=1,this.$_renderFace(r,a),this.$_renderHands(r,a),r.prop("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.prop("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,a=this._minorTickViews,s=this._tickLabelViews,o=this._pinView,l=i.cx,h=i.cy,u=i.rd,c=this._rimThick=t.rim.getThickness(u);this._faceView.setCircle(l,h,u),r.setVis(t.rim.visible)&&(r.internalSetStyleOrClass(t.rim._style),r.setSector({cx:l,cy:h,rx:u,ry:u,innerRadius:1-c/u,start:0,angle:2*Math.PI,clockwise:!0}));var p=u-(r.visible?c:0),d=p-t.tick.length,_=e.ORG_ANGLE,g=e.PI_2/12;if(this._tickViews.forEach(function(i,n){i.setLine(l+e.cos(_)*p,h+e.sin(_)*p,l+e.cos(_)*d,h+e.sin(_)*d),i.internalSetStyleOrClass(t.tick._style),_+=g}),!a.isEmpty){var f=0;d=p-t.minorTick.length,_=e.ORG_ANGLE,g=e.PI_2/60,a.forEach(function(i){f%5==0&&(_+=g,f++),i.setLine(l+e.cos(_)*p,h+e.sin(_)*p,l+e.cos(_)*d,h+e.sin(_)*d),i.internalSetStyleOrClass(t.minorTick._style),_+=g,f++})}if(!s.isEmpty){var y=12/s.count,b=e.PI_2/12*y;_=e.ORG_ANGLE,s.get(0).text="12",d=p-(t.tick.length+t.tickLabel.prop("offset")||0),d-=.5*s.get(0).getBBox().height,s.forEach(function(i,n,r){i.text=String(0===n?12:n*y),i.trans(l+e.cos(_)*d,h+e.sin(_)*d),i.internalSetStyleOrClass(t.tickLabel._style),_+=b})}o.setVis(t.pin.visible)&&(o.setCircle(l,h,t.pin.raidus),o.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.prop("position")?n.trans(l,h+d/2):n.trans(l,h-d/2))},i.prototype.$_getNow=function(){var t=this.model.prop("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,a,s,o=this.$_getNow(),l=o.getHours(),h=o.getMinutes(),u=o.getSeconds(),c=i.cx,p=i.cy,d=i.rd,_=new e.PathBuilder;n=t.hourHand,(r=this._hourView).setVis(n.visible)&&(s=e.PI_2*(l/12+h/60/12+u/60/60/12),a=n.getLength(d-this._rimThick),_.rect(-n.prop("thickness")/2,-a,n.prop("thickness"),a),r.internalSetStyleOrClass(n._style),r.setPath(_.close(!0)).trans(c,p).rotate(s*e.RAD_DEG)),n=t.minuteHand,(r=this._minuteView).setVis(n.visible)&&(s=e.PI_2*(h/60+u/60/60),a=n.getLength(d-this._rimThick),_.rect(-n.prop("thickness")/2,-a,n.prop("thickness"),a),r.internalSetStyleOrClass(n._style),r.setPath(_.close(!0)).trans(c,p).rotate(s*e.RAD_DEG)),n=t.secondHand,(r=this._secondView).setVis(n.visible)&&(s=this._secRate<1?e.PI_2*(this._aniSec+this._secRate)/60:e.PI_2*u/60,a=n.getLength(d-this._rimThick),_.rect(-n.prop("thickness")/2,-a,n.prop("thickness"),a),r.internalSetStyleOrClass(n._style),r.setPath(_.close(!0)).trans(c,p).rotate(s*e.RAD_DEG),this._prevSec=u)},i.prototype.$_moveSecond=function(t){if(!isNaN(t)){this._aniSec=t;var e=new lt(this);e.duration=this.model.secondHand.prop("duration")||200,e.start()}},i}(e.GaugeView);function ut(t){(function(t){return!!(t&&t.Gauge&&t.GaugeView)})(t)&&(t.Gauge.register(Y,p,st,R),t.GaugeGroup.register(X,d,G),t.GaugeView.register([p,m],[R,A],[Y,q],[st,ht],[d,V],[G,j],[X,J]))}ut(r),t.BulletGauge=Y,t.CircleGauge=p,t.ClockGauge=st,t.LinearGauge=R,t.default=ut,Object.defineProperty(t,"__esModule",{value:!0})});
|
package/ie/heatmap.ie.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart Heatmap v1.
|
|
3
|
+
* RealChart Heatmap v1.5.0
|
|
4
4
|
* Copyright (C) 2023-2026 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
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:"${detail}",tooltipDetail:"x: <b>${x}</b><br>y: <b>${y}</b><br>heat: <b>${z}</b>"}),n}(e.ConnectableSeries),
|
|
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:"${detail}",tooltipDetail:"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.PointViewPool(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),_.setContrast(t.dom);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&&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})});
|