@syncfusion/ej2-circulargauge
Advanced tools
Comparing version 1.0.15 to 15.4.17
/*! | ||
* filename: ej2-circulargauge.umd.min.js | ||
* version : 1.0.14 | ||
* version : 15.4.17 | ||
* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. | ||
@@ -11,2 +11,4 @@ * Use of this code is subject to the terms of our license. | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"));else if("function"==typeof define&&define.amd)define(["@syncfusion/ej2-base","@syncfusion/ej2-popups"],t);else{var i="object"==typeof exports?t(require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups")):t(e["@syncfusion/ej2-base"],e["@syncfusion/ej2-popups"]);for(var o in i)("object"==typeof exports?exports:e)[o]=i[o]}}(this,function(e,t){return function(e){function t(o){if(i[o])return i[o].exports;var r=i[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){var o,r;o=[i,t,i(1)],void 0!==(r=function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}(i)}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t,i(2),i(8),i(6),i(3),i(10),i(5)],void 0!==(r=function(e,t,i,o,r,n,a,l){"use strict";function s(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}Object.defineProperty(t,"__esModule",{value:!0}),s(i),s(o),s(r),s(n),s(a),s(l)}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r,n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),a=this&&this.__decorate||function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};o=[i,t,i(4),i(4),i(4),i(5),i(5),i(5),i(3),i(6),i(8),i(10),i(9),i(9),i(12)],void 0!==(r=function(e,t,i,o,r,l,s,p,u,d,c,h,g,m,y){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var v=function(e){function t(t,i){return e.call(this,t,i)||this}return n(t,e),t.prototype.preRender=function(){this.unWireEvents(),this.trigger(g.load,{gauge:this}),this.initPrivateVariable(),this.setCulture(),this.createSvg(),this.wireEvents()},t.prototype.initPrivateVariable=function(){this.renderer=new o.SvgRenderer(this.element.id),this.gaugeAxisLayoutPanel=new y.AxisLayoutPanel(this),this.animatePointer=!0},t.prototype.createSvg=function(){this.removeSvg(),this.calculateSvgSize(),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},t.prototype.setCulture=function(){this.intl=new o.Internationalization},t.prototype.calculateSvgSize=function(){var e=this.element.offsetWidth,t=this.element.offsetHeight,i=s.stringToNumber(this.width,e)||e||600,o=s.stringToNumber(this.height,t)||t||450;this.availableSize=new s.Size(i,o)},t.prototype.render=function(){this.calculateBounds(),this.renderElements()},t.prototype.renderElements=function(){this.renderBorder(),this.renderTitle(),this.gaugeAxisLayoutPanel.renderAxes(),this.element.appendChild(this.svgObject),this.trigger(g.loaded,{gauge:this})},t.prototype.renderTitle=function(){if(this.title){var e=s.measureText(this.title,this.titleStyle),t=new l.TextOption(this.element.id+"_CircularGaugeTitle",this.availableSize.width/2,this.margin.top+e.height/4*3,"middle",this.title),i=l.textElement(t,this.titleStyle,this.titleStyle.color,this.svgObject,"");i.setAttribute("aria-label",this.description||this.title),i.setAttribute("tabindex",this.tabIndex.toString())}},t.prototype.renderBorder=function(){var e=this.border.width;(e>0||null!==this.background&&"transparent"!==this.background)&&this.svgObject.appendChild(this.renderer.drawRectangle(new l.RectOption(this.element.id+"_CircularGaugeBorder",this.background,this.border,null,new s.Rect(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e))))},t.prototype.setPointerValue=function(e,t,i){var o=this,r=this.axes[e],n=r.pointers[t],a=n.currentRadius,l=n.animation.enable;i=i<r.visibleRange.min?r.visibleRange.min:i,i=i>r.visibleRange.max?r.visibleRange.max:i,n.pathElement.map(function(e){"RangeBar"===n.type?(s.setStyles(e,n.color,n.border),l?o.gaugeAxisLayoutPanel.pointerRenderer.performRangeBarAnimation(e,n.currentValue,i,r,n,a,a-n.pointerWidth):o.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(r,n,i)):(e.id.indexOf("_Pointer_NeedleCap_")>=0?s.setStyles(e,n.cap.color,n.cap.border):e.id.indexOf("_Pointer_NeedleTail_")>=0?s.setStyles(e,n.needleTail.color,n.needleTail.border):e.id.indexOf("_Pointer_NeedleRect_")>=0?s.setStyles(e,"transparent",{color:"transparent",width:0}):s.setStyles(e,n.color,n.border),l?o.gaugeAxisLayoutPanel.pointerRenderer.performNeedleAnimation(e,n.currentValue,i,r,n,a,a-n.pointerWidth):o.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(r,n,i))}),n.currentValue=i,n.value=i},t.prototype.setAnnotationValue=function(e,t,i){var o=null!==s.getElement(this.element.id+"_Annotations_"+e),n=s.getElement(this.element.id+"_Annotations_"+e)||r.createElement("div",{id:this.element.id+"_Annotations_"+e}),a=this.axes[e].annotations[t];null!==i&&(l.removeElement(this.element.id+"_Axis_"+e+"_Annotation_"+t),a.content=i,this.annotationsModule.createTemplate(n,t,e),o||s.getElement(this.element.id+"_Secondary_Element").appendChild(n))},t.prototype.setRangeValue=function(e,t,i,o){var r=s.getElement(this.element.id+"_Axis_"+e+"_Range_"+t),n=this.axes[e],a=n.ranges[t],l=n.visibleRange,u="ClockWise"===n.direction,d=Math.min(Math.max(i,l.min),o),c=Math.min(Math.max(i,o),l.max),h=p.getAngleFromValue(d,l.max,l.min,n.startAngle,n.endAngle,u),g=p.getAngleFromValue(c,l.max,l.min,n.startAngle,n.endAngle,u),m=a.startWidth,y=a.endWidth;g=u?g:[h,h=g][0],y=u?y:[m,m=y][0],r.setAttribute("d",p.getPathArc(this.midPoint,Math.round(h),Math.round(g),a.currentRadius,m,y)),s.setStyles(r,a.color?a.color:a.rangeColor,{color:a.color?a.color:a.rangeColor,width:0})},t.prototype.calculateBounds=function(){var e=this.margin,t=0;this.title&&(t=s.measureText(this.title,this.titleStyle).height+5);var i=e.top+t+this.border.width,o=e.left+this.border.width,r=this.availableSize.width-o-e.right-this.border.width,n=this.availableSize.height-i-this.border.width-e.bottom,a=Math.min(r,n)/2,l=new s.Rect(o+r/2-a,i+n/2-a,2*a,2*a),p=null!==this.centerX?s.stringToNumber(this.centerX,this.availableSize.width):l.x+l.width/2,u=null!==this.centerY?s.stringToNumber(this.centerY,this.availableSize.height):l.y+l.height/2;this.midPoint=new s.GaugeLocation(p,u),this.gaugeAxisLayoutPanel.measureAxis(l)},t.prototype.unWireEvents=function(){o.EventHandler.remove(this.element,i.Browser.touchStartEvent,this.gaugeOnMouseDown),o.EventHandler.remove(this.element,i.Browser.touchMoveEvent,this.mouseMove),o.EventHandler.remove(this.element,i.Browser.touchEndEvent,this.mouseEnd),o.EventHandler.remove(this.element,"contextmenu",this.gaugeRightClick),o.EventHandler.remove(this.element,i.Browser.isPointer?"pointerleave":"mouseleave",this.mouseLeave),o.EventHandler.remove(window,i.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.gaugeResize.bind(this))},t.prototype.wireEvents=function(){o.EventHandler.add(this.element,i.Browser.touchStartEvent,this.gaugeOnMouseDown,this),o.EventHandler.add(this.element,i.Browser.touchMoveEvent,this.mouseMove,this),o.EventHandler.add(this.element,i.Browser.touchEndEvent,this.mouseEnd,this),o.EventHandler.add(this.element,"contextmenu",this.gaugeRightClick,this),o.EventHandler.add(this.element,i.Browser.isPointer?"pointerleave":"mouseleave",this.mouseLeave,this),o.EventHandler.add(window,i.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.gaugeResize,this),this.setStyle(this.element)},t.prototype.setStyle=function(e){e.style.touchAction=this.enablePointerDrag?"none":"element",e.style.msTouchAction=this.enablePointerDrag?"none":"element",e.style.msContentZooming="none",e.style.msUserSelect="none",e.style.webkitUserSelect="none",e.style.position="relative"},t.prototype.mouseMove=function(e){var t=this.getMouseArgs(e,"touchmove",g.gaugeMouseMove);this.trigger(g.gaugeMouseMove,t);var i,o=this.tooltipModule;return t.cancel||(this.tooltip.enable&&o&&(t.target.id.indexOf("_Pointer_")>=0&&!this.activePointer?o.renderTooltip(t.target):o.ejTooltip.close()),this.enablePointerDrag&&this.activePointer&&(i={axis:this.activeAxis,pointer:this.activePointer,previousValue:this.activePointer.currentValue,name:m.dragMove,currentValue:null},this.pointerDrag(new s.GaugeLocation(t.x,t.y)),i.currentValue=this.activePointer.currentValue,this.trigger(m.dragMove,i))),!1},t.prototype.mouseLeave=function(e){this.activeAxis=null,this.activePointer=null,this.svgObject.setAttribute("cursor","auto");var t=this.getMouseArgs(e,"touchmove",g.gaugeMouseLeave);return this.trigger(g.gaugeMouseLeave,t),this.tooltip.enable&&this.tooltipModule&&this.tooltipModule.ejTooltip.close(),!1},t.prototype.gaugeRightClick=function(e){return 2!==e.buttons&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},t.prototype.pointerDrag=function(e){var t=this.activeAxis,i=t.visibleRange,o=l.getValueFromAngle(l.getAngleFromLocation(this.midPoint,e),i.max,i.min,t.startAngle,t.endAngle,"ClockWise"===t.direction);o>=i.min&&o<=i.max&&(this.activePointer.currentValue=o,this.activePointer.value=o,this.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(t,this.activePointer,o))},t.prototype.gaugeOnMouseDown=function(e){var t,i=this.getMouseArgs(e,"touchstart",g.gaugeMouseDown);return this.trigger(g.gaugeMouseDown,i),!i.cancel&&i.target.id.indexOf("_Pointer_")>=0&&i.target.id.indexOf(this.element.id+"_Axis_")>=0&&(t=s.getPointer(i.target.id,this),this.activeAxis=this.axes[t.axisIndex],this.activePointer=this.activeAxis.pointers[t.pointerIndex],this.trigger(m.dragStart,{axis:this.activeAxis,name:m.dragStart,pointer:this.activePointer,currentValue:this.activePointer.currentValue}),this.svgObject.setAttribute("cursor","pointer")),!1},t.prototype.mouseEnd=function(e){var t=this.getMouseArgs(e,"touchend",m.gaugeMouseUp),i="touch"===e.pointerType||"2"===e.pointerType||"touchend"===e.type,o=this.tooltipModule;return this.trigger(m.gaugeMouseUp,t),this.activeAxis&&this.activePointer&&(this.trigger(m.dragEnd,{name:m.dragEnd,axis:this.activeAxis,pointer:this.activePointer,currentValue:this.activePointer.currentValue}),!t.cancel&&i&&this.tooltip.enable&&o&&t.target.id.indexOf("_Pointer_")>=0&&(o.renderTooltip(t.target),setTimeout(function(){o.ejTooltip.close()},2e3)),this.activeAxis=null,this.activePointer=null),this.svgObject.setAttribute("cursor","auto"),!1},t.prototype.getMouseArgs=function(e,t,i){var o=this.element.getBoundingClientRect(),r=new s.GaugeLocation(-o.left,-o.top),n=e.type===t;return r.x+=n?e.changedTouches[0].clientX:e.clientX,r.y+=n?e.changedTouches[0].clientY:e.clientY,{cancel:!1,name:i,x:r.x,y:r.y,target:e.target}},t.prototype.gaugeResize=function(e){var t=this,i={gauge:this,previousSize:new s.Size(this.availableSize.width,this.availableSize.height),name:m.resized,currentSize:new s.Size(0,0)};return this.animatePointer=!1,this.resizeTo&&clearTimeout(this.resizeTo),this.element.classList.contains("e-circulargauge")&&(this.resizeTo=setTimeout(function(){t.createSvg(),t.calculateBounds(),t.renderElements(),i.currentSize=t.availableSize,t.trigger(m.resized,i)},500)),!1},t.prototype.destroy=function(){this.unWireEvents(),this.removeSvg(),e.prototype.destroy.call(this)},t.prototype.requiredModules=function(){var e=[],t=!1;return this.axes.map(function(e){e.annotations.map(function(e){t=t||null!==e.content})}),t&&e.push({member:"Annotations",args:[this,c.Annotations]}),this.tooltip.enable&&e.push({member:"Tooltip",args:[this,h.GaugeTooltip]}),e},t.prototype.removeSvg=function(){if(l.removeElement(this.element.id+"_Secondary_Element"),this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&r.remove(this.svgObject)}},t.prototype.getPersistData=function(){return this.addOnPersist([])},t.prototype.onPropertyChanged=function(e,t){for(var i=!1,o=!1,r=0,n=Object.keys(e);r<n.length;r++){switch(n[r]){case"height":case"width":case"centerX":case"centerY":case"margin":this.createSvg(),o=!0;break;case"title":o=""===e.title||""===t.title,i=!(""===e.title||""===t.title);break;case"titleStyle":e.titleStyle&&e.titleStyle.size?o=!0:i=!0;break;case"border":i=!0;break;case"background":i=!0}}!o&&i&&(this.removeSvg(),this.renderElements()),o&&(this.removeSvg(),this.calculateBounds(),this.renderElements())},t.prototype.getModuleName=function(){return"circulargauge"},t}(i.Component);a([i.Property(null)],v.prototype,"width",void 0),a([i.Property(null)],v.prototype,"height",void 0),a([i.Complex({color:"transparent",width:0},u.Border)],v.prototype,"border",void 0),a([i.Property("transparent")],v.prototype,"background",void 0),a([i.Property("")],v.prototype,"title",void 0),a([i.Complex({size:"15px",color:"#424242"},u.Font)],v.prototype,"titleStyle",void 0),a([i.Complex({},u.Margin)],v.prototype,"margin",void 0),a([o.Collection([{}],d.Axis)],v.prototype,"axes",void 0),a([i.Complex({},u.TooltipSettings)],v.prototype,"tooltip",void 0),a([i.Property(!1)],v.prototype,"enablePointerDrag",void 0),a([i.Property(null)],v.prototype,"centerX",void 0),a([i.Property(null)],v.prototype,"centerY",void 0),a([i.Property("Material")],v.prototype,"theme",void 0),a([i.Property(!1)],v.prototype,"useGroupingSeparator",void 0),a([i.Property(null)],v.prototype,"description",void 0),a([i.Property(1)],v.prototype,"tabIndex",void 0),a([o.Event()],v.prototype,"loaded",void 0),a([o.Event()],v.prototype,"load",void 0),a([o.Event()],v.prototype,"animationComplete",void 0),a([o.Event()],v.prototype,"axisLabelRender",void 0),a([o.Event()],v.prototype,"annotationRender",void 0),a([o.Event()],v.prototype,"tooltipRender",void 0),a([o.Event()],v.prototype,"dragStart",void 0),a([o.Event()],v.prototype,"dragMove",void 0),a([o.Event()],v.prototype,"dragEnd",void 0),a([o.Event()],v.prototype,"gaugeMouseMove",void 0),a([o.Event()],v.prototype,"gaugeMouseLeave",void 0),a([o.Event()],v.prototype,"gaugeMouseDown",void 0),a([o.Event()],v.prototype,"gaugeMouseUp",void 0),a([o.Event()],v.prototype,"resized",void 0),v=a([i.NotifyPropertyChanges],v),t.CircularGauge=v}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r,n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),a=this&&this.__decorate||function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};o=[i,t,i(4)],void 0!==(r=function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property("")],o.prototype,"color",void 0),a([i.Property(1)],o.prototype,"width",void 0),t.Border=o;var r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property("16px")],r.prototype,"size",void 0),a([i.Property("")],r.prototype,"color",void 0),a([i.Property("Segoe UI")],r.prototype,"fontFamily",void 0),a([i.Property("Normal")],r.prototype,"fontWeight",void 0),a([i.Property("Normal")],r.prototype,"fontStyle",void 0),a([i.Property(1)],r.prototype,"opacity",void 0),t.Font=r;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(10)],l.prototype,"left",void 0),a([i.Property(10)],l.prototype,"right",void 0),a([i.Property(10)],l.prototype,"top",void 0),a([i.Property(10)],l.prototype,"bottom",void 0),t.Margin=l;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(!1)],s.prototype,"enable",void 0),a([i.Property("#FFFFFF")],s.prototype,"fill",void 0),a([i.Complex({color:"#686868",size:"13px"},r)],s.prototype,"textStyle",void 0),a([i.Property(null)],s.prototype,"format",void 0),a([i.Property(null)],s.prototype,"template",void 0),a([i.Property(!0)],s.prototype,"enableAnimation",void 0),a([i.Complex({color:"black",width:2},o)],s.prototype,"border",void 0),t.TooltipSettings=s}.apply(t,o))&&(e.exports=r)},function(t,i){t.exports=e},function(e,t,i){var o,r,n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();o=[i,t,i(4),i(4),i(4)],void 0!==(r=function(e,t,i,o,r){"use strict";function a(e,t){var i=document.getElementById("gauge-measuretext");null===i&&(i=r.createElement("text",{id:"gauge-measuretext"}),document.body.appendChild(i));var o="position: absolute; visibility: hidden;;left: 0; top: -100; white-space: nowrap;"+l(t);return i.innerHTML=e,i.setAttribute("style",o),new F(i.clientWidth,i.clientHeight)}function l(e){return"font-size:"+e.size+"; font-style:"+e.fontStyle+"; font-weight:"+e.fontWeight+"; font-family:"+e.fontFamily+";opacity:"+e.opacity+"; color:"+e.color+";"}function s(e,t,i){r.setStyleAttribute(e,{stroke:i.color,"stroke-width":i.width,fill:t})}function p(e){var t;return document.body.appendChild(e),t=e.getBoundingClientRect(),L(e.id),t}function u(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function d(e,t,o,r,n){var a,l={},s=new i.SvgRenderer(""),p=n+" font-size:"+t.size+"; font-style:"+t.fontStyle+" ; font-weight:"+t.fontWeight+"; font-family:"+t.fontFamily+";";return l={id:e.id,x:e.x,y:e.y,fill:o,"text-anchor":e.anchor,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine,style:p},a=s.createText(l,e.text),r.appendChild(a),a}function c(e,t,i,o){o=o||"Path";var r=i.renderer["draw"+o](e);return r.setAttribute("transform",e.transform),r.setAttribute("style",e.style),t.appendChild(r),r}function h(e,t,i){for(var o=0,r=i.length;e<r;e++)o+=i[e];return o}function g(e,t,i,o){return-i*Math.cos(e/o*(Math.PI/2))+i+t}function m(e,t,i,o,r,n){var a;return r-=f(o,r)?1e-4:0,o-=90,r-=90,n?a=(e-i)*(y(o,r)/(t-i))+o:(a=r-(e-i)*(y(o,r)/(t-i)),a=a<0?360+a:a),a=Math.round(a)>=360?a-360:Math.round(a)<0?360+a:a}function y(e,t){var i=t-e;return i<0?i+360:i}function v(e,t,i,o,r,n){return r-=f(o,r)?1e-4:0,e=e<o?e+360:e,n?(e-o)/y(o,r)*(t-i)+i:t-((e-o)/y(o,r)*(t-i)+i)}function f(e,t){var i=t-e;return i=i<=0?i+360:i,0!==Math.floor(i/360)}function b(e,t){var i=Math.atan2(t.y-e.y,t.x-e.x);return i=Math.round((i<0?6.283+i:i)*(180/Math.PI))-270,i+=i<0?360:0}function x(e,t,i){var o=e*Math.PI/180;return new W(Math.cos(o)*t+i.x,Math.sin(o)*t+i.y)}function P(e,t,i,o,r,n){i-=f(t,i)?1e-4:0;var a=y(t,i),l=o-r,s=o-n,p=o-(r+n)/2;return void 0!==r&&void 0!==n?A(x(t,o,e),x(i,o,e),x(t,l,e),x(i,s,e),o,p,p,a<180?0:1):w(x(t,o,e),x(i,o,e),o,a<180?0:1)}function A(e,t,i,o,r,n,a,l){return"M "+e.x+" "+e.y+" A "+r+" "+r+" 0 "+l+" 1 "+t.x+" "+t.y+" L "+o.x+" "+o.y+" A "+a+" "+n+" 0 "+l+" 0 "+i.x+" "+i.y+" Z"}function _(e,t,i,o,r){i-=f(t,i)?1e-4:0;var n=y(t,i);return S(e,x(t,o,e),x(i,o,e),o,x(t,r,e),x(i,r,e),r,n<180?0:1)}function w(e,t,i,o){return"M "+e.x+" "+e.y+" A "+i+" "+i+" 0 "+o+" 1 "+t.x+" "+t.y}function S(e,t,i,o,r,n,a,l){return"M "+t.x+" "+t.y+" A "+o+" "+o+" 0 "+l+" 1 "+i.x+" "+i.y+" L "+n.x+" "+n.y+" A "+a+" "+a+" 0 "+l+",0 "+r.x+" "+r.y+" Z"}function R(e){return document.getElementById(e)}function C(e){var t=null;try{document.querySelectorAll(e).length&&(t=i.compile(document.querySelector(e).innerHTML.trim()))}catch(o){t=i.compile(e)}return t}function L(e){var t=R(e);t&&r.remove(t)}function M(e,t){var i;return i=e.split(t.element.id+"_Axis_")[1],{axisIndex:+i[0],pointerIndex:+i[i.length-1]}}function T(e){return e&&null!==e.match("{value}")?"":e}function O(e,t,i,r,n){var a,l=i.width,s=i.height,p=e.x,u=e.y,d=e.x+-l/2,c=e.y+-s/2;switch(t){case"Circle":o.merge(n,{rx:l/2,ry:s/2,cx:p,cy:u});break;case"Diamond":a="M "+d+" "+u+" L "+p+" "+(u+-s/2)+" L "+(p+l/2)+" "+u+" L "+p+" "+(u+s/2)+" L "+d+" "+u+" Z",o.merge(n,{d:a});break;case"Rectangle":a="M "+d+" "+(u+-s/2)+" L "+(p+l/2)+" "+(u+-s/2)+" L "+(p+l/2)+" "+(u+s/2)+" L "+d+" "+(u+s/2)+" L "+d+" "+(u+-s/2)+" Z",o.merge(n,{d:a});break;case"Triangle":a="M "+p+" "+u+" L "+(p-s)+" "+(u-l/2)+"L "+(p-s)+" "+(u+l/2)+" Z",o.merge(n,{d:a});break;case"InvertedTriangle":a="M "+p+" "+u+" L "+(p+s)+" "+(u-l/2)+"L "+(p+s)+" "+(u+l/2)+" Z",o.merge(n,{d:a});break;case"Image":o.merge(n,{href:r,height:s,width:l,x:d,y:c})}return n}function z(e,t,i){var o=0,r=0,n=t.filter(function(t){return o=Math.min(t.start,t.end),r=Math.max(t.start,t.end),e>=o&&r>=e});return n.length?n[0].rangeColor:i}Object.defineProperty(t,"__esModule",{value:!0}),t.measureText=a,t.getFontStyle=l,t.setStyles=s,t.measureElementRect=p,t.stringToNumber=u,t.textElement=d,t.appendPath=c,t.calculateSum=h,t.linear=g,t.getAngleFromValue=m,t.getDegree=y,t.getValueFromAngle=v,t.isCompleteAngle=f,t.getAngleFromLocation=b,t.getLocationFromAngle=x,t.getPathArc=P,t.getRangePath=A,t.getCompleteArc=_,t.getCirclePath=w,t.getCompletePath=S,t.getElement=R,t.getTemplateFunction=C,t.removeElement=L,t.getPointer=M,t.getLabelFormat=T,t.calculateShapes=O,t.getRangeColor=z;var E=function(){function e(e){this.id=e}return e}();t.CustomizeOption=E;var j=function(e){function t(t,i,o,r,n,a,l,s,p){void 0===s&&(s=""),void 0===p&&(p="");var u=e.call(this,t)||this;return u.opacity=n,u.fill=i,u.stroke=r,u["stroke-width"]=o,u["stroke-dasharray"]=a,u.d=l,u.transform=s,u.style=p,u}return n(t,e),t}(E);t.PathOption=j;var k=function(e){function t(t,i,o,r,n){var a=e.call(this,t)||this;return a.y=n.y,a.x=n.x,a.height=n.height,a.width=n.width,a.opacity=r,a.fill=i,a.stroke=o.color,a["stroke-width"]=o.width,a}return n(t,e),t}(E);t.RectOption=k;var F=function(){function e(e,t){this.width=e,this.height=t}return e}();t.Size=F;var W=function(){function e(e,t){this.x=e,this.y=t}return e}();t.GaugeLocation=W;var V=function(){function e(e,t,i,o){this.x=e,this.y=t,this.width=i,this.height=o}return e}();t.Rect=V;var B=function(e){function t(t,i,o,r,n,a,l){void 0===a&&(a="");var s=e.call(this,t)||this;return s.transform="",s.baseLine="auto",s.x=i,s.y=o,s.anchor=r,s.text=n,s.transform=a,s.baseLine=l,s}return n(t,e),t}(E);t.TextOption=B;var N=function(){function e(e,t,i){this.text=e,this.value=t,this.size=i}return e}();t.VisibleLabels=N}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r,n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),a=this&&this.__decorate||function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};o=[i,t,i(4),i(3),i(7)],void 0!==(r=function(e,t,i,o,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(2)],l.prototype,"width",void 0),a([i.Property("")],l.prototype,"dashArray",void 0),a([i.Property(r.Theme.axisLineColor)],l.prototype,"color",void 0),t.Line=l;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Complex(r.Theme.axisLabelFont,o.Font)],s.prototype,"font",void 0),a([i.Property("")],s.prototype,"format",void 0),a([i.Property("Inside")],s.prototype,"position",void 0),a([i.Property("None")],s.prototype,"hiddenLabel",void 0),a([i.Property(!1)],s.prototype,"autoAngle",void 0),a([i.Property(!1)],s.prototype,"useRangeColor",void 0),a([i.Property(0)],s.prototype,"offset",void 0),t.Label=s;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(null)],p.prototype,"start",void 0),a([i.Property(null)],p.prototype,"end",void 0),a([i.Property(null)],p.prototype,"radius",void 0),a([i.Property(10)],p.prototype,"startWidth",void 0),a([i.Property(10)],p.prototype,"endWidth",void 0),a([i.Property(null)],p.prototype,"color",void 0),t.Range=p;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(null)],u.prototype,"width",void 0),a([i.Property(null)],u.prototype,"height",void 0),a([i.Property(null)],u.prototype,"interval",void 0),a([i.Property(0)],u.prototype,"offset",void 0),a([i.Property(r.Theme.tickLineColor)],u.prototype,"color",void 0),a([i.Property("Inside")],u.prototype,"position",void 0),a([i.Property(!1)],u.prototype,"useRangeColor",void 0),t.Tick=u;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property("#FFFFFF")],d.prototype,"color",void 0),a([i.Complex({color:r.Theme.pointerColor,width:8},o.Border)],d.prototype,"border",void 0),a([i.Property(8)],d.prototype,"radius",void 0),t.Cap=d;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(r.Theme.pointerColor)],c.prototype,"color",void 0),a([i.Complex({color:r.Theme.pointerColor,width:0},o.Border)],c.prototype,"border",void 0),a([i.Property("0%")],c.prototype,"length",void 0),t.NeedleTail=c;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(!0)],h.prototype,"enable",void 0),a([i.Property(1e3)],h.prototype,"duration",void 0),t.Animation=h;var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(null)],g.prototype,"content",void 0),a([i.Property(90)],g.prototype,"angle",void 0),a([i.Property("50%")],g.prototype,"radius",void 0),a([i.Property("-1")],g.prototype,"zIndex",void 0),a([i.Property(!1)],g.prototype,"autoAngle",void 0),a([i.Complex({size:"12px",color:"#686868"},o.Font)],g.prototype,"textStyle",void 0),a([i.Property(null)],g.prototype,"description",void 0),t.Annotation=g;var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(null)],m.prototype,"value",void 0),a([i.Property("Needle")],m.prototype,"type",void 0),a([i.Property(null)],m.prototype,"imageUrl",void 0),a([i.Property(null)],m.prototype,"radius",void 0),a([i.Property(20)],m.prototype,"pointerWidth",void 0),a([i.Complex({},d)],m.prototype,"cap",void 0),a([i.Complex({},c)],m.prototype,"needleTail",void 0),a([i.Property(r.Theme.pointerColor)],m.prototype,"color",void 0),a([i.Complex({color:"#DDDDDD",width:0},o.Border)],m.prototype,"border",void 0),a([i.Complex(null,h)],m.prototype,"animation",void 0),a([i.Property("Circle")],m.prototype,"markerShape",void 0),a([i.Property(5)],m.prototype,"markerHeight",void 0),a([i.Property(null)],m.prototype,"description",void 0),a([i.Property(5)],m.prototype,"markerWidth",void 0),t.Pointer=m;var y=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.visibleLabels=[],t}return n(t,e),t}(i.ChildProperty);a([i.Property(null)],y.prototype,"minimum",void 0),a([i.Property(null)],y.prototype,"maximum",void 0),a([i.Property(null)],y.prototype,"radius",void 0),a([i.Complex({},l)],y.prototype,"lineStyle",void 0),a([i.Collection([{}],p)],y.prototype,"ranges",void 0),a([i.Collection([{}],m)],y.prototype,"pointers",void 0),a([i.Collection([{}],g)],y.prototype,"annotations",void 0),a([i.Complex({width:2,height:10},u)],y.prototype,"majorTicks",void 0),a([i.Complex({width:2,height:5},u)],y.prototype,"minorTicks",void 0),a([i.Property(200)],y.prototype,"startAngle",void 0),a([i.Property(160)],y.prototype,"endAngle",void 0),a([i.Property("ClockWise")],y.prototype,"direction",void 0),a([i.Property(null)],y.prototype,"background",void 0),a([i.Complex({},s)],y.prototype,"labelStyle",void 0),t.Axis=y}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t],void 0!==(r=function(e,t){"use strict";function i(e){var t;switch(e){case"Material":case"Fabric":t=["#50c917","#27d5ff","#fcde0b","#ffb133","#ff5985"]}return t}Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.axisLabelFont={size:"12px",fontWeight:"Normal",color:"#212121",fontStyle:"Normal",fontFamily:"Segoe UI"},e.axisLineColor="#757575",e.tickLineColor="#757575",e.pointerColor="#757575"}(t.Theme||(t.Theme={})),t.getRangePalette=i}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t,i(5),i(5),i(9),i(4)],void 0!==(r=function(e,t,i,o,r,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e){this.gauge=e,this.elementId=e.element.id}return e.prototype.renderAnnotation=function(e,t){var i=this,r=n.createElement("div",{id:this.elementId+"_Annotations_"+t}),a=o.getElement(this.elementId+"_Secondary_Element");e.annotations.map(function(e,o){null!==e.content&&i.createTemplate(r,o,t)}),a&&r.childElementCount&&a.appendChild(r)},e.prototype.createTemplate=function(e,t,a){var l=this.gauge.axes[a],s=l.annotations[t],p=n.createElement("div",{id:this.elementId+"_Axis_"+a+"_Annotation_"+t,styles:"position: absolute; z-index:"+s.zIndex+";transform:"+(s.autoAngle?"rotate("+(s.angle-90)+"deg)":"rotate(0deg)")+";"}),u={cancel:!1,name:r.annotationRender,content:s.content,axis:l,annotation:s,textStyle:s.textStyle};this.gauge.trigger(r.annotationRender,u);var d,c;if(!u.cancel){if((d=o.getTemplateFunction(u.content))&&d(l).length)for(c=d(l);c.length>0;)p.appendChild(c[0]);else p.appendChild(n.createElement("div",{innerHTML:u.content,styles:i.getFontStyle(u.textStyle)}));this.updateLocation(p,l,s),e.appendChild(p)}},e.prototype.updateLocation=function(e,t,r){var n=i.getLocationFromAngle(r.angle-90,i.stringToNumber(r.radius,t.currentRadius),this.gauge.midPoint),a=o.measureElementRect(e);e.style.left=n.x-a.width/2+"px",e.style.top=n.y-a.height/2+"px",e.setAttribute("aria-label",r.description||"Annotation")},e.prototype.getModuleName=function(){return"Annotations"},e.prototype.destroy=function(e){},e}();t.Annotations=a}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t],void 0!==(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loaded="loaded",t.load="load",t.animationComplete="animationComplete",t.axisLabelRender="axisLabelRender",t.tooltipRender="tooltipRender",t.annotationRender="annotationRender",t.gaugeMouseMove="gaugeMouseMove",t.gaugeMouseLeave="gaugeMouseLeave",t.gaugeMouseDown="gaugeMouseDown",t.gaugeMouseUp="gaugeMouseUp",t.dragStart="dragStart",t.dragMove="dragMove",t.dragEnd="dragEnd",t.resized="resized"}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t,i(4),i(11),i(5),i(5),i(9)],void 0!==(r=function(e,t,i,o,r,n,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e){this.gauge=e,this.element=e.element,this.tooltip=e.tooltip,this.textStyle=this.tooltip.textStyle,this.borderStyle=this.tooltip.border,this.ejTooltip=new o.Tooltip({opensOn:"custom",beforeRender:this.onBeforeRender.bind(this),beforeOpen:this.tooltipCustomization.bind(this),openDelay:0,closeDelay:1e3}),this.ejTooltip.appendTo(this.element)}return e.prototype.renderTooltip=function(e){var t,i,o=r.getPointer(e.id,this.gauge);this.currentAxis=this.gauge.axes[o.axisIndex],this.currentPointer=this.currentAxis.pointers[o.pointerIndex],i=n.getAngleFromValue(this.currentPointer.currentValue,this.currentAxis.visibleRange.max,this.currentAxis.visibleRange.min,this.currentAxis.startAngle,this.currentAxis.endAngle,"ClockWise"===this.currentAxis.direction)%360,t=this.appendTargetElement(i),null===t.getAttribute("data-tooltip-id")&&(this.findPosition(i),this.ejTooltip.open(t))},e.prototype.appendTargetElement=function(e){var t=n.getLocationFromAngle(e,this.currentAxis.currentRadius,this.gauge.midPoint),o=n.getElement(this.element.id+"_GaugeTooltip");return o?(o.style.left=t.x+"px",o.style.top=t.y+"px"):(o=i.createElement("div",{id:this.element.id+"_GaugeTooltip",styles:"position:absolute;left:"+t.x+"px;top:"+t.y+"px;width:2px;height:2px;background:transparent"}),n.getElement(this.element.id+"_Secondary_Element").appendChild(o)),o},e.prototype.findPosition=function(e){switch(!0){case e>=0&&e<=45:this.ejTooltip.position="right bottom";break;case e>=45&&e<90:this.ejTooltip.position="bottom right";break;case e>=90&&e<135:this.ejTooltip.position="bottom left";break;case e>=135&&e<180:this.ejTooltip.position="left bottom";break;case e>=180&&e<225:this.ejTooltip.position="left top";break;case e>=225&&e<270:this.ejTooltip.position="top left";break;case e>=270&&e<315:this.ejTooltip.position="top right";break;default:this.ejTooltip.position="right top"}this.ejTooltip.dataBind()},e.prototype.onBeforeRender=function(e){var t=this.gauge.tooltip.format||this.currentAxis.labelStyle.format,i=t&&null!==t.match("{value}"),o=this.gauge.intl.getNumberFormat({format:n.getLabelFormat(t),useGrouping:this.gauge.useGroupingSeparator}),l=i?t.replace(new RegExp("{value}","g"),o(this.currentPointer.currentValue)):o(this.currentPointer.currentValue);l=this.tooltip.template?r.getTemplateFunction(this.tooltip.template)(this.currentAxis)[0]:l;var s={cancel:!1,name:a.tooltipRender,content:l,border:this.borderStyle,axis:this.currentAxis,pointer:this.currentPointer,textStyle:this.textStyle};this.gauge.trigger(a.tooltipRender,s),this.borderStyle=s.border,e.cancel=s.cancel,this.ejTooltip.content=s.content,this.textStyle=s.textStyle,this.ejTooltip.dataBind()},e.prototype.tooltipCustomization=function(e){var t,o,r=this.textStyle,n=this.borderStyle.color,a=this.borderStyle.width,l=5;e.element.classList.remove("e-popup-close"),e.element.classList.add("e-popup-open");var s=e.element.querySelector(".e-arrow-tip");i.setStyleAttribute(e.element,{backgroundColor:this.tooltip.fill,borderColor:n||"#212121",borderWidth:a+"px"}),i.setStyleAttribute(e.element.querySelector(".e-tip-content"),{color:r.color,fontFamily:r.fontFamily,fontSize:r.size,fontWeight:r.fontWeight,opacity:r.opacity.toString(),fontStyle:r.fontStyle}),i.setStyleAttribute(e.element.querySelector(".e-arrow-tip"),{width:2*(l+a)+"px",height:l+a+"px"}),s.classList.contains("e-tip-top")?(l=e.element.querySelector(".e-arrow-tip").offsetHeight,t=l+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-outer"),{borderRightColor:"transparent",borderLeftColor:"transparent",borderBottomColor:n,borderLeftWidth:t,borderRightWidth:t,borderBottomWidth:t}),o=l-a+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-inner"),{borderRightColor:"transparent",borderLeftColor:"transparent",borderBottomColor:this.tooltip.fill,borderLeftWidth:o,borderRightWidth:o,borderBottomWidth:o,left:a+"px",top:a+"px"})):s.classList.contains("e-tip-bottom")?(l=e.element.querySelector(".e-arrow-tip").offsetHeight,t=l+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-outer"),{borderRightColor:"transparent",borderLeftColor:"transparent",borderTopColor:n,borderLeftWidth:t,borderRightWidth:t,borderTopWidth:t}),o=l-a+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-inner"),{borderRightColor:"transparent",borderLeftColor:"transparent",borderTopColor:this.tooltip.fill,borderLeftWidth:o,borderRightWidth:o,borderTopWidth:o,left:a+"px",top:"0"})):s.classList.contains("e-tip-left")?(i.setStyleAttribute(e.element.querySelector(".e-arrow-tip"),{width:l+a+"px",height:2*(l+a)+"px"}),l=e.element.querySelector(".e-arrow-tip").offsetWidth,t=l+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-outer"),{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:n,borderTopWidth:t,borderBottomWidth:t,borderRightWidth:t}),o=l-a+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-inner"),{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:this.tooltip.fill,borderTopWidth:o,borderBottomWidth:o,borderRightWidth:o,left:a+"px",top:a+"px"})):(i.setStyleAttribute(e.element.querySelector(".e-arrow-tip"),{width:l+a+"px",height:2*(l+a)+"px"}),l=e.element.querySelector(".e-arrow-tip").offsetWidth,t=l+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-outer"),{borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:n,borderTopWidth:t,borderBottomWidth:t,borderLeftWidth:t}),o=l-a+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-inner"),{borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:this.tooltip.fill,borderTopWidth:o,borderBottomWidth:o,borderLeftWidth:o,left:(a<=1?0:-1)+"px",top:a+"px"})),this.ejTooltip.refresh(e.target),i.setStyleAttribute(e.element,{display:"block",transitionProperty:"left,top",transitionDuration:this.tooltip.enableAnimation?"1000ms":"0ms"})},e.prototype.getModuleName=function(){return"Tooltip"},e.prototype.destroy=function(e){},e}();t.GaugeTooltip=l}.apply(t,o))&&(e.exports=r)},function(e,i){e.exports=t},function(e,t,i){var o,r;o=[i,t,i(4),i(5),i(5),i(9),i(13),i(14)],void 0!==(r=function(e,t,i,o,r,n,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e){this.gauge=e,this.axisRenderer=new a.AxisRenderer(e),this.pointerRenderer=new l.PointerRenderer(e)}return e.prototype.measureAxis=function(e){this.measureAxisSize(this.gauge,e),this.calculateAxesRadius()},e.prototype.calculateAxesRadius=function(){for(var e,t,i=0,o=0,n=this.gauge.axes;o<n.length;o++){var a=n[o];e=Math.min(a.rect.width,a.rect.height)/2,t=null!=a.radius?r.stringToNumber(a.radius,e):e,i=Math.max.apply(Math,a.ranges.map(function(e){return e.radius?e.radius.indexOf("%")<0?100:parseInt(e.radius,10):0})),t=i>100&&null==a.radius?100*t/i:t,a.currentRadius=t-a.nearSize,a.visibleRange.interval=this.calculateNumericInterval(a,a.rect),this.calculateVisibleLabels(a)}},e.prototype.measureAxisSize=function(e,t){var i,n=this;this.computeSize(e.axes,t),e.axes.map(function(e,a){i=o.calculateSum(a,n.farSizes.length-1,n.farSizes),e.rect=new r.Rect(t.x+i,t.y+i,t.width-2*i,t.height-2*i)})},e.prototype.calculateAxisValues=function(e){for(var t=0,i=this.gauge.axes;t<i.length;t++){var o=i[t];this.calculateVisibleRange(o,e),this.calculateVisibleLabels(o)}},e.prototype.calculateVisibleRange=function(e,t){var i=e.majorTicks.interval,o=Math.min(null===e.minimum?0:e.minimum,e.maximum),r=Math.max(e.minimum,null===e.maximum?100:e.maximum);e.pointers.map(function(t){t.currentValue=null!==t.value?t.value<o?o:t.value>r?r:t.value:o,o=null===e.minimum?Math.min(t.currentValue,o):o,r=null===e.maximum?Math.max(t.currentValue,r):r}),o=o===r?null!==i?o-i:o-1:o,e.visibleRange={min:o,max:r,interval:i},e.visibleRange.interval=this.calculateNumericInterval(e,t)},e.prototype.calculateNumericInterval=function(e,t){if(null!==e.majorTicks.interval)return e.majorTicks.interval;var i=e.endAngle-e.startAngle;return i=i<=0?i+360:i,this.calculateNiceInterval(e.visibleRange.max,e.visibleRange.min,e.currentRadius?e.currentRadius:t.width/2,i)},e.prototype.calculateNiceInterval=function(e,t,i,o){for(var r=e-t,n=2*Math.PI*i*(o/360),a=Math.max(.01599*n,1),l=r/a,s=Math.pow(10,Math.floor(Math.log(l)/Math.log(10))),p=0,u=[10,5,2,1];p<u.length;p++){var d=u[p],c=s*d;if(a<r/c)break;l=c}return l},e.prototype.calculateVisibleLabels=function(e){var t,i=e.labelStyle,a=i.format&&null!==i.format.match("{value}"),l=this.gauge.intl.getNumberFormat({format:r.getLabelFormat(i.format),useGrouping:this.gauge.useGroupingSeparator});e.visibleLabels=[];for(var s=e.visibleRange.min,p=e.visibleRange.interval,u=e.visibleRange.max;s<=u&&p;s+=p)t={cancel:!1,name:n.axisLabelRender,axis:e,text:a?i.format.replace(new RegExp("{value}","g"),l(s)):l(s),value:s},this.gauge.trigger(n.axisLabelRender,t),t.cancel||e.visibleLabels.push(new o.VisibleLabels(t.text,s));this.getMaxLabelWidth(this.gauge,e)},e.prototype.computeSize=function(e,t){var i,o,r,n,a,l,s=0,p=0,u=0;this.farSizes=[],this.calculateAxisValues(t);for(var d=0,c=e;d<c.length;d++){var h=c[d];i=h.lineStyle.width/2,o=0,r=0,n="Outside"===h.majorTicks.position,s=h.majorTicks.offset,a="Outside"===h.minorTicks.position,p=h.minorTicks.offset,l="Outside"===h.labelStyle.position,u=h.labelStyle.offset,o+=n&&a&&l?0:5,o+=(n?h.majorTicks.height+i:0)+(l?h.maxLabelSize.height+10+u:0)+(a&&!n?h.minorTicks.height+i:0)+i,o+=n&&a?Math.max(s,p):n?s:a?p:0,r+=(n?0:h.majorTicks.height+i)+(l?0:h.maxLabelSize.height+10+u)+(!a&&n?h.minorTicks.height+i:0)+i,r+=n||a?n?a?0:p:s:Math.max(s,p),this.farSizes[this.farSizes.length-1]&&(this.farSizes[this.farSizes.length-1]+=r+o),h.nearSize=o-5,h.farSize=r,o=this.gauge.axes.length===this.farSizes.length+1?0:o,this.farSizes.push(o)}},e.prototype.renderAxes=function(){var e,t=this,o=this.gauge,r=this.axisRenderer,n=o.renderer.createGroup({id:o.element.id+"_AxesCollection","clip-path":"url(#"+o.element.id+"_GaugeAreaClipRect_)"});o.element.appendChild(i.createElement("div",{id:o.element.id+"_Secondary_Element",styles:"position: relative"})),o.axes.map(function(i,a){e=o.renderer.createGroup({id:o.element.id+"_Axis_Group_"+a}),r.drawAxisOuterLine(i,a,e,o),r.drawAxisRange(i,a,e,o),r.drawAxisLine(i,a,e,o),r.drawMajorTickLines(i,a,e,o),r.drawMinorTickLines(i,a,e,o),r.drawAxisLabels(i,a,e,o),t.pointerRenderer.drawPointers(i,a,e,o),o.annotationsModule&&o.annotationsModule.renderAnnotation(i,a),n.appendChild(e)}),o.svgObject.appendChild(o.renderer.drawClipPath({id:o.element.id+"_GaugeAreaClipRect_",x:0,y:0,width:o.availableSize.width,height:o.availableSize.height,fill:"transparent",stroke:"transparent"})),o.svgObject.appendChild(n)},e.prototype.getMaxLabelWidth=function(e,t){t.maxLabelSize=new r.Size(0,0);for(var i=0,n=t.visibleLabels;i<n.length;i++){var a=n[i];a.size=o.measureText(a.text,t.labelStyle.font),t.maxLabelSize.width=a.size.width>t.maxLabelSize.width?a.size.width:t.maxLabelSize.width,t.maxLabelSize.height=a.size.height>t.maxLabelSize.height?a.size.height:t.maxLabelSize.height}},e}();t.AxisLayoutPanel=s}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t,i(5),i(5),i(7)],void 0!==(r=function(e,t,i,o,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.gauge=e}return e.prototype.drawAxisOuterLine=function(e,t,r,n){var a=e.background;this.setRangeColor(e),null!==a&&i.appendPath(new i.PathOption(n.element.id+"_AxisOuterLine_"+t,a,0,"transparent",null,"0",o.getPathArc(n.midPoint,0,360,Math.min(e.rect.width,e.rect.height)/2),"","pointer-events:none;"),r,n)},e.prototype.drawAxisLine=function(e,t,r,n){var a=e.startAngle,l=e.endAngle;e.lineStyle.width>0&&(a=o.isCompleteAngle(a,l)?[0,l=360][0]:a,i.appendPath(new i.PathOption(n.element.id+"_AxisLine_"+t,"transparent",e.lineStyle.width,e.lineStyle.color,null,e.lineStyle.dashArray,o.getPathArc(n.midPoint,a-90,l-90,e.currentRadius),"","pointer-events:none;"),r,n))},e.prototype.drawAxisLabels=function(e,t,r,n){var a,l,s,p,u=n.renderer.createGroup({id:n.element.id+"_Axis_Labels_"+t}),d=e.visibleRange.min,c=e.visibleRange.max,h=e.visibleLabels,g=e.labelStyle,m=e.currentRadius;"Outside"===g.position?m+=e.nearSize-(e.maxLabelSize.height+e.lineStyle.width/2)+5:m-=e.farSize-(e.maxLabelSize.height+e.lineStyle.width/2)+(g.autoAngle?10:0);for(var y=0,v=h.length;y<v;y++)0===y&&"First"===g.hiddenLabel||y===v-1&&"Last"===g.hiddenLabel||(p=h[y],s=Math.round(o.getAngleFromValue(p.value,c,d,e.startAngle,e.endAngle,"ClockWise"===e.direction)),a=i.getLocationFromAngle(s,m,n.midPoint),l=this.findAnchor(a,g,s,p),i.textElement(new i.TextOption(n.element.id+"_Axis_"+t+"_Label_"+y,a.x,a.y,l,p.text,g.autoAngle?"rotate("+(s+90)+","+a.x+","+a.y+")":"","auto"),g.font,g.useRangeColor?o.getRangeColor(p.value,e.ranges,g.font.color):g.font.color,u,"pointer-events:none;"));r.appendChild(u)},e.prototype.findAnchor=function(e,t,i,o){if(t.autoAngle)return"middle";var r="Inside"===t.position?i>120&&i<240?"start":300<i||i<60?"end":"middle":i>120&&i<240?"end":300<i||i<60?"start":"middle";return e.y+="Inside"===t.position?i>=240&&i<=300?o.size.height/2:i>=60&&i<=120?0:o.size.height/4:i>=240&&i<=300?0:i>=60&&i<=120?o.size.height/2:o.size.height/4,r},e.prototype.drawMinorTickLines=function(e,t,r,n){var a=n.renderer.createGroup({id:n.element.id+"_Axis_MinorTickLines_"+t}),l=e.minorTicks,s=null!==l.interval?l.interval:e.visibleRange.interval/2,p=l.useRangeColor;if(l.width&&l.height&&s){for(var u=e.visibleRange.min,d=e.visibleRange.max;u<=d;u+=s)this.majorValues.indexOf(+u.toFixed(3))<0&&i.appendPath(new i.PathOption(n.element.id+"_Axis_Minor_TickLine_"+t+"_"+u,"transparent",l.width,p?o.getRangeColor(u,e.ranges,l.color):l.color,null,"0",this.calculateTicks(u,l,e),"","pointer-events:none;"),a,n);r.appendChild(a)}},e.prototype.drawMajorTickLines=function(e,t,r,n){var a=n.renderer.createGroup({id:n.element.id+"_Axis_MajorTickLines_"+t}),l=e.majorTicks,s=l.useRangeColor;if(this.majorValues=[],l.width&&l.height&&e.visibleRange.interval){for(var p=e.visibleRange.min,u=e.visibleRange.max,d=e.visibleRange.interval;p<=u;p+=d)this.majorValues.push(+p.toFixed(3)),i.appendPath(new i.PathOption(n.element.id+"_Axis_Major_TickLine_"+t+"_"+p,"transparent",l.width,s?o.getRangeColor(p,e.ranges,l.color):l.color,null,"0",this.calculateTicks(p,l,e),"","pointer-events:none;"),a,n);r.appendChild(a)}},e.prototype.calculateTicks=function(e,t,r){var n=r.lineStyle.width/2+t.offset,a="Outside"===t.position,l=o.getAngleFromValue(e,r.visibleRange.max,r.visibleRange.min,r.startAngle,r.endAngle,"ClockWise"===r.direction),s=i.getLocationFromAngle(l,r.currentRadius+(a?n:-n),this.gauge.midPoint),p=i.getLocationFromAngle(l,r.currentRadius+(a?n:-n)+(a?t.height:-t.height),this.gauge.midPoint);return"M "+s.x+" "+s.y+" L "+p.x+" "+p.y+" "},e.prototype.drawAxisRange=function(e,t,r,n){var a,l,s,p,u,d,c=this,h=n.renderer.createGroup({id:n.element.id+"_Axis_Ranges_"+t}),g="ClockWise"===e.direction,m=e.visibleRange.min,y=e.visibleRange.max;e.ranges.map(function(r,v){c.calculateRangeRadius(e,r),s=Math.min(Math.max(r.start,m),r.end),p=Math.min(Math.max(r.start,r.end),y),s!==p&&(a=o.getAngleFromValue(s,y,m,e.startAngle,e.endAngle,g),l=o.getAngleFromValue(p,y,m,e.startAngle,e.endAngle,g),u=r.startWidth,d=r.endWidth,l=g?l:[a,a=l][0],d=g?d:[u,u=d][0],i.appendPath(new i.PathOption(n.element.id+"_Axis_"+t+"_Range_"+v,r.rangeColor,0,r.rangeColor,1,"0",o.getPathArc(n.midPoint,Math.round(a),Math.round(l),r.currentRadius,u,d),"","pointer-events:none;"),h,n))}),r.appendChild(h)},e.prototype.calculateRangeRadius=function(e,t){var o=null!==t.radius?t.radius:"100%";t.currentRadius=i.stringToNumber(o,e.currentRadius)},e.prototype.setRangeColor=function(e){var t=r.getRangePalette(this.gauge.theme);e.ranges.map(function(e,i){e.rangeColor=e.color?e.color:t[i%t.length]})},e}();t.AxisRenderer=n}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t,i(5),i(5),i(5),i(4),i(9)],void 0!==(r=function(e,t,i,o,r,n,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e){this.gauge=e}return e.prototype.drawPointers=function(e,t,i,o){var r,n,a=this,l=o.renderer.createGroup({id:o.element.id+"_Axis_Pointers_"+t});e.pointers.map(function(i,s){n=e.visibleRange,i.pathElement=[],a.calculatePointerRadius(e,i),r=o.renderer.createGroup({id:o.element.id+"_Axis_"+t+"_Pointer_"+s}),a["draw"+i.type+"Pointer"](e,t,s,r,o),a.setPointerValue(e,i,i.currentValue),l.appendChild(r),a.doPointerAnimation(i,e)}),i.appendChild(l)},e.prototype.calculatePointerRadius=function(e,t){t.currentRadius=null===t.radius?e.currentRadius-(e.farSize+5):i.stringToNumber(t.radius,e.currentRadius)},e.prototype.drawNeedlePointer=function(e,t,r,n,a){var l,s,p,u,d=e.pointers[r],c=a.midPoint,h=d.pointerWidth/2;s=o.getLocationFromAngle(0,d.currentRadius,c),p="M "+c.x+" "+(c.y-h)+" L "+s.x+" "+c.y+" L "+c.x+" "+(c.y+h)+" Z",d.pathElement.push(i.appendPath(new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_Needle_"+r,d.color,d.border.width,d.border.color,null,"0",p),n,a)),l=i.stringToNumber(d.needleTail.length,d.currentRadius),u="M "+c.x+" "+(c.y-h)+" L "+s.x+" "+(c.y-h)+" L "+s.x+" "+(c.y+h)+" L "+c.x+" "+(c.y+h),l&&(s=o.getLocationFromAngle(180,l,a.midPoint),p="M "+c.x+" "+(c.y-h)+" L "+s.x+" "+(c.y-h)+" L "+s.x+" "+(c.y+h)+" L "+c.x+" "+(c.y+h)+" Z",d.pathElement.push(i.appendPath(new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_NeedleTail_"+r,d.needleTail.color,d.needleTail.border.width,d.needleTail.border.color,null,"0",p),n,a)),u+=" L "+s.x+" "+(c.y+h)+" L "+s.x+" "+(c.y-h)),d.cap.radius&&d.pathElement.push(i.appendPath(i.calculateShapes(c,"Circle",new i.Size(2*d.cap.radius,2*d.cap.radius),"",new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_NeedleCap_"+r,d.cap.color,d.cap.border.width,d.cap.border.color,null,"0","","")),n,a,"Ellipse")),d.pathElement.push(i.appendPath(new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_NeedleRect_"+r,"transparent",0,"transpanret",null,"0",u+" Z"),n,a))},e.prototype.setPointerValue=function(e,t,i){var o=this.gauge.midPoint,n="ClockWise"===e.direction,a=r.getAngleFromValue(e.visibleRange.min,e.visibleRange.max,e.visibleRange.min,e.startAngle,e.endAngle,n),l=r.getAngleFromValue(i,e.visibleRange.max,e.visibleRange.min,e.startAngle,e.endAngle,n);l=n?l:[a,a=l][0],t.pathElement.map(function(s){"RangeBar"===t.type?s.setAttribute("d",r.getCompleteArc(o,a,l,t.currentRadius,t.currentRadius-t.pointerWidth)):s.setAttribute("transform","rotate("+r.getAngleFromValue(i,e.visibleRange.max,e.visibleRange.min,e.startAngle,e.endAngle,n)+","+o.x+","+o.y+")"),s.setAttribute("aria-label",t.description||"Pointer:"+i.toString())})},e.prototype.drawMarkerPointer=function(e,t,r,n,a){var l=e.pointers[r],s=o.getLocationFromAngle(0,l.currentRadius,a.midPoint);l.pathElement.push(i.appendPath(i.calculateShapes(s,l.markerShape,new i.Size(l.markerWidth,l.markerHeight),l.imageUrl,new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_Marker_"+r,l.color,l.border.width,l.border.color,null,"0","","")),n,a,"Circle"===l.markerShape?"Ellipse":"Image"===l.markerShape?"Image":"Path"))},e.prototype.drawRangeBarPointer=function(e,t,r,n,a){var l=e.pointers[r];l.pathElement.push(i.appendPath(new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_RangeBar_"+r,l.color,l.border.width,l.border.color,1,"0",""),n,a))},e.prototype.doPointerAnimation=function(e,t){var i=this,o=t.visibleRange.min,r=e.currentValue;e.animation.enable&&o!==r&&this.gauge.animatePointer&&e.pathElement.map(function(n){"RangeBar"===e.type?i.performRangeBarAnimation(n,o,r,t,e,e.currentRadius,e.currentRadius-e.pointerWidth):i.performNeedleAnimation(n,o,r,t,e,e.currentRadius,e.currentRadius-e.pointerWidth)})},e.prototype.performNeedleAnimation=function(e,t,i,o,l,s,p){var u,d=this,c="ClockWise"===o.direction,h=r.getAngleFromValue(t,o.visibleRange.max,o.visibleRange.min,o.startAngle,o.endAngle,c),g=r.getAngleFromValue(i,o.visibleRange.max,o.visibleRange.min,o.startAngle,o.endAngle,c),m=h>g?g+360:g;new n.Animation({}).animate(e,{duration:l.animation.duration,progress:function(o){u=t<i||Math.round(h)===Math.round(m)?c?m-h:m-h-360:c?m-h-360:m-h,e.style.animation="None",e.setAttribute("transform","rotate("+r.linear(o.timeStamp,h,u,o.duration)+","+d.gauge.midPoint.x.toString()+","+d.gauge.midPoint.y.toString()+")")},end:function(t){d.setPointerValue(o,l,i),("Marker"===l.type||e.id.indexOf("_Pointer_NeedleCap")>=0)&&d.gauge.trigger(a.animationComplete,{axis:o,pointer:l})}})},e.prototype.performRangeBarAnimation=function(e,t,i,o,l,s,p){var u,d=this,c="ClockWise"===o.direction,h=r.getAngleFromValue(t,o.visibleRange.max,o.visibleRange.min,o.startAngle,o.endAngle,c),g=r.getAngleFromValue(o.visibleRange.min,o.visibleRange.max,o.visibleRange.min,o.startAngle,o.endAngle,c),m=r.getAngleFromValue(i,o.visibleRange.max,o.visibleRange.min,o.startAngle,o.endAngle,c),y=h>m?m+360:m;new n.Animation({}).animate(e,{duration:l.animation.duration,progress:function(o){e.style.animation="None",u=t<i||Math.round(h)===Math.round(y)?c?y-h:y-h-360:c?y-h-360:y-h,c?e.setAttribute("d",r.getCompleteArc(d.gauge.midPoint,g,r.linear(o.timeStamp,h,u,o.duration)+1e-4,s,p)):e.setAttribute("d",r.getCompleteArc(d.gauge.midPoint,r.linear(o.timeStamp,h,u,o.duration),g+1e-4,s,p))},end:function(e){d.setPointerValue(o,l,i),d.gauge.trigger(a.animationComplete,{axis:o,pointer:l})}})},e}();t.PointerRenderer=l}.apply(t,o))&&(e.exports=r)}])}); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"));else if("function"==typeof define&&define.amd)define(["@syncfusion/ej2-base","@syncfusion/ej2-popups"],t);else{var i="object"==typeof exports?t(require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups")):t(e["@syncfusion/ej2-base"],e["@syncfusion/ej2-popups"]);for(var o in i)("object"==typeof exports?exports:e)[o]=i[o]}}(this,function(e,t){return function(e){function t(o){if(i[o])return i[o].exports;var r=i[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){var o,r;o=[i,t,i(1)],void 0!==(r=function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}(i)}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t,i(2),i(8),i(6),i(3),i(10),i(5)],void 0!==(r=function(e,t,i,o,r,n,a,l){"use strict";function s(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}Object.defineProperty(t,"__esModule",{value:!0}),s(i),s(o),s(r),s(n),s(a),s(l)}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r,n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),a=this&&this.__decorate||function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};o=[i,t,i(4),i(4),i(4),i(5),i(5),i(5),i(3),i(6),i(8),i(10),i(9),i(9),i(12)],void 0!==(r=function(e,t,i,o,r,l,s,p,u,d,c,h,g,m,y){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var v=function(e){function t(t,i){return e.call(this,t,i)||this}return n(t,e),t.prototype.preRender=function(){this.unWireEvents(),this.trigger(g.load,{gauge:this}),this.initPrivateVariable(),this.setCulture(),this.createSvg(),this.wireEvents()},t.prototype.render=function(){this.calculateBounds(),this.renderElements()},t.prototype.unWireEvents=function(){o.EventHandler.remove(this.element,i.Browser.touchStartEvent,this.gaugeOnMouseDown),o.EventHandler.remove(this.element,i.Browser.touchMoveEvent,this.mouseMove),o.EventHandler.remove(this.element,i.Browser.touchEndEvent,this.mouseEnd),o.EventHandler.remove(this.element,"contextmenu",this.gaugeRightClick),o.EventHandler.remove(this.element,i.Browser.isPointer?"pointerleave":"mouseleave",this.mouseLeave),window.removeEventListener(i.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.gaugeResize)},t.prototype.wireEvents=function(){o.EventHandler.add(this.element,i.Browser.touchStartEvent,this.gaugeOnMouseDown,this),o.EventHandler.add(this.element,i.Browser.touchMoveEvent,this.mouseMove,this),o.EventHandler.add(this.element,i.Browser.touchEndEvent,this.mouseEnd,this),o.EventHandler.add(this.element,"contextmenu",this.gaugeRightClick,this),o.EventHandler.add(this.element,i.Browser.isPointer?"pointerleave":"mouseleave",this.mouseLeave,this),window.addEventListener(i.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.gaugeResize.bind(this)),this.setGaugeStyle(this.element)},t.prototype.mouseMove=function(e){var t=this.getMouseArgs(e,"touchmove",g.gaugeMouseMove);this.trigger(g.gaugeMouseMove,t);var i,o=this.tooltipModule;return t.cancel||(this.tooltip.enable&&o&&(t.target.id.indexOf("_Pointer_")>=0&&!this.activePointer?o.renderTooltip(t.target):o.ejTooltip.close()),this.enablePointerDrag&&this.activePointer&&(i={axis:this.activeAxis,pointer:this.activePointer,previousValue:this.activePointer.currentValue,name:m.dragMove,currentValue:null},this.pointerDrag(new s.GaugeLocation(t.x,t.y)),i.currentValue=this.activePointer.currentValue,this.trigger(m.dragMove,i))),!1},t.prototype.mouseLeave=function(e){this.activeAxis=null,this.activePointer=null,this.svgObject.setAttribute("cursor","auto");var t=this.getMouseArgs(e,"touchmove",g.gaugeMouseLeave);return this.trigger(g.gaugeMouseLeave,t),this.tooltip.enable&&this.tooltipModule&&this.tooltipModule.ejTooltip.close(),!1},t.prototype.gaugeRightClick=function(e){return 2!==e.buttons&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},t.prototype.pointerDrag=function(e){var t=this.activeAxis,i=t.visibleRange,o=l.getValueFromAngle(l.getAngleFromLocation(this.midPoint,e),i.max,i.min,t.startAngle,t.endAngle,"ClockWise"===t.direction);o>=i.min&&o<=i.max&&(this.activePointer.currentValue=o,this.activePointer.value=o,this.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(t,this.activePointer,o))},t.prototype.gaugeOnMouseDown=function(e){var t,i=this.getMouseArgs(e,"touchstart",g.gaugeMouseDown);return this.trigger(g.gaugeMouseDown,i),!i.cancel&&i.target.id.indexOf("_Pointer_")>=0&&i.target.id.indexOf(this.element.id+"_Axis_")>=0&&(t=s.getPointer(i.target.id,this),this.activeAxis=this.axes[t.axisIndex],this.activePointer=this.activeAxis.pointers[t.pointerIndex],this.trigger(m.dragStart,{axis:this.activeAxis,name:m.dragStart,pointer:this.activePointer,currentValue:this.activePointer.currentValue}),this.svgObject.setAttribute("cursor","pointer")),!1},t.prototype.mouseEnd=function(e){var t=this.getMouseArgs(e,"touchend",m.gaugeMouseUp),i="touch"===e.pointerType||"2"===e.pointerType||"touchend"===e.type,o=this.tooltipModule;return this.trigger(m.gaugeMouseUp,t),this.activeAxis&&this.activePointer&&(this.trigger(m.dragEnd,{name:m.dragEnd,axis:this.activeAxis,pointer:this.activePointer,currentValue:this.activePointer.currentValue}),!t.cancel&&i&&this.tooltip.enable&&o&&t.target.id.indexOf("_Pointer_")>=0&&(o.renderTooltip(t.target),setTimeout(function(){o.ejTooltip.close()},2e3)),this.activeAxis=null,this.activePointer=null),this.svgObject.setAttribute("cursor","auto"),!1},t.prototype.getMouseArgs=function(e,t,i){var o=this.element.getBoundingClientRect(),r=new s.GaugeLocation(-o.left,-o.top),n=e.type===t;return r.x+=n?e.changedTouches[0].clientX:e.clientX,r.y+=n?e.changedTouches[0].clientY:e.clientY,{cancel:!1,name:i,x:r.x,y:r.y,target:e.target}},t.prototype.gaugeResize=function(e){var t=this,i={gauge:this,previousSize:new s.Size(this.availableSize.width,this.availableSize.height),name:m.resized,currentSize:new s.Size(0,0)};return this.animatePointer=!1,this.resizeTo&&clearTimeout(this.resizeTo),this.element.classList.contains("e-circulargauge")&&(this.resizeTo=setTimeout(function(){t.createSvg(),t.calculateBounds(),t.renderElements(),i.currentSize=t.availableSize,t.trigger(m.resized,i)},500)),!1},t.prototype.setGaugeStyle=function(e){e.style.touchAction=this.enablePointerDrag?"none":"element",e.style.msTouchAction=this.enablePointerDrag?"none":"element",e.style.msContentZooming="none",e.style.msUserSelect="none",e.style.webkitUserSelect="none",e.style.position="relative"},t.prototype.setCulture=function(){this.intl=new o.Internationalization},t.prototype.createSvg=function(){this.removeSvg(),this.calculateSvgSize(),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},t.prototype.removeSvg=function(){if(l.removeElement(this.element.id+"_Secondary_Element"),this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&r.remove(this.svgObject)}},t.prototype.initPrivateVariable=function(){this.renderer=new o.SvgRenderer(this.element.id),this.gaugeAxisLayoutPanel=new y.AxisLayoutPanel(this),this.animatePointer=!0},t.prototype.calculateSvgSize=function(){var e=this.element.offsetWidth,t=this.element.offsetHeight,i=s.stringToNumber(this.width,e)||e||600,o=s.stringToNumber(this.height,t)||t||450;this.availableSize=new s.Size(i,o)},t.prototype.calculateBounds=function(){var e=this.margin,t=0;this.title&&(t=s.measureText(this.title,this.titleStyle).height+5);var i=e.top+t+this.border.width,o=e.left+this.border.width,r=this.availableSize.width-o-e.right-this.border.width,n=this.availableSize.height-i-this.border.width-e.bottom,a=Math.min(r,n)/2,l=new s.Rect(o+r/2-a,i+n/2-a,2*a,2*a),p=null!==this.centerX?s.stringToNumber(this.centerX,this.availableSize.width):l.x+l.width/2,u=null!==this.centerY?s.stringToNumber(this.centerY,this.availableSize.height):l.y+l.height/2;this.midPoint=new s.GaugeLocation(p,u),this.gaugeAxisLayoutPanel.measureAxis(l)},t.prototype.renderElements=function(){this.renderBorder(),this.renderTitle(),this.gaugeAxisLayoutPanel.renderAxes(),this.element.appendChild(this.svgObject),this.trigger(g.loaded,{gauge:this})},t.prototype.renderTitle=function(){if(this.title){var e=s.measureText(this.title,this.titleStyle),t=new l.TextOption(this.element.id+"_CircularGaugeTitle",this.availableSize.width/2,this.margin.top+e.height/4*3,"middle",this.title),i=l.textElement(t,this.titleStyle,this.titleStyle.color,this.svgObject,"");i.setAttribute("aria-label",this.description||this.title),i.setAttribute("tabindex",this.tabIndex.toString())}},t.prototype.renderBorder=function(){var e=this.border.width;(e>0||null!==this.background&&"transparent"!==this.background)&&this.svgObject.appendChild(this.renderer.drawRectangle(new l.RectOption(this.element.id+"_CircularGaugeBorder",this.background,this.border,null,new s.Rect(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e))))},t.prototype.setPointerValue=function(e,t,i){var o=this,r=this.axes[e],n=r.pointers[t],a=n.currentRadius,l=n.animation.enable;i=i<r.visibleRange.min?r.visibleRange.min:i,i=i>r.visibleRange.max?r.visibleRange.max:i,n.pathElement.map(function(e){"RangeBar"===n.type?(s.setStyles(e,n.color,n.border),l?o.gaugeAxisLayoutPanel.pointerRenderer.performRangeBarAnimation(e,n.currentValue,i,r,n,a,a-n.pointerWidth):o.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(r,n,i)):(e.id.indexOf("_Pointer_NeedleCap_")>=0?s.setStyles(e,n.cap.color,n.cap.border):e.id.indexOf("_Pointer_NeedleTail_")>=0?s.setStyles(e,n.needleTail.color,n.needleTail.border):e.id.indexOf("_Pointer_NeedleRect_")>=0?s.setStyles(e,"transparent",{color:"transparent",width:0}):s.setStyles(e,n.color,n.border),l?o.gaugeAxisLayoutPanel.pointerRenderer.performNeedleAnimation(e,n.currentValue,i,r,n,a,a-n.pointerWidth):o.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(r,n,i))}),n.currentValue=i,n.value=i},t.prototype.setAnnotationValue=function(e,t,i){var o=null!==s.getElement(this.element.id+"_Annotations_"+e),n=s.getElement(this.element.id+"_Annotations_"+e)||r.createElement("div",{id:this.element.id+"_Annotations_"+e}),a=this.axes[e].annotations[t];null!==i&&(l.removeElement(this.element.id+"_Axis_"+e+"_Annotation_"+t),a.content=i,this.annotationsModule.createTemplate(n,t,e),o||s.getElement(this.element.id+"_Secondary_Element").appendChild(n))},t.prototype.setRangeValue=function(e,t,i,o){var r=s.getElement(this.element.id+"_Axis_"+e+"_Range_"+t),n=this.axes[e],a=n.ranges[t],l=n.visibleRange,u="ClockWise"===n.direction,d=Math.min(Math.max(i,l.min),o),c=Math.min(Math.max(i,o),l.max),h=p.getAngleFromValue(d,l.max,l.min,n.startAngle,n.endAngle,u),g=p.getAngleFromValue(c,l.max,l.min,n.startAngle,n.endAngle,u),m=a.startWidth,y=a.endWidth;g=u?g:[h,h=g][0],y=u?y:[m,m=y][0],r.setAttribute("d",p.getPathArc(this.midPoint,Math.round(h),Math.round(g),a.currentRadius,m,y)),s.setStyles(r,a.color?a.color:a.rangeColor,{color:a.color?a.color:a.rangeColor,width:0})},t.prototype.destroy=function(){this.unWireEvents(),this.removeSvg(),e.prototype.destroy.call(this)},t.prototype.requiredModules=function(){var e=[],t=!1;return this.axes.map(function(e){e.annotations.map(function(e){t=t||null!==e.content})}),t&&e.push({member:"Annotations",args:[this,c.Annotations]}),this.tooltip.enable&&e.push({member:"Tooltip",args:[this,h.GaugeTooltip]}),e},t.prototype.getPersistData=function(){return this.addOnPersist([])},t.prototype.onPropertyChanged=function(e,t){for(var i=!1,o=!1,r=0,n=Object.keys(e);r<n.length;r++){switch(n[r]){case"height":case"width":case"centerX":case"centerY":case"margin":this.createSvg(),o=!0;break;case"title":o=""===e.title||""===t.title,i=!(""===e.title||""===t.title);break;case"titleStyle":e.titleStyle&&e.titleStyle.size?o=!0:i=!0;break;case"border":i=!0;break;case"background":i=!0}}!o&&i&&(this.removeSvg(),this.renderElements()),o&&(this.removeSvg(),this.calculateBounds(),this.renderElements())},t.prototype.getModuleName=function(){return"circulargauge"},t}(i.Component);a([i.Property(null)],v.prototype,"width",void 0),a([i.Property(null)],v.prototype,"height",void 0),a([i.Complex({color:"transparent",width:0},u.Border)],v.prototype,"border",void 0),a([i.Property("transparent")],v.prototype,"background",void 0),a([i.Property("")],v.prototype,"title",void 0),a([i.Complex({size:"15px",color:"#424242"},u.Font)],v.prototype,"titleStyle",void 0),a([i.Complex({},u.Margin)],v.prototype,"margin",void 0),a([o.Collection([{}],d.Axis)],v.prototype,"axes",void 0),a([i.Complex({},u.TooltipSettings)],v.prototype,"tooltip",void 0),a([i.Property(!1)],v.prototype,"enablePointerDrag",void 0),a([i.Property(null)],v.prototype,"centerX",void 0),a([i.Property(null)],v.prototype,"centerY",void 0),a([i.Property("Material")],v.prototype,"theme",void 0),a([i.Property(!1)],v.prototype,"useGroupingSeparator",void 0),a([i.Property(null)],v.prototype,"description",void 0),a([i.Property(1)],v.prototype,"tabIndex",void 0),a([o.Event()],v.prototype,"loaded",void 0),a([o.Event()],v.prototype,"load",void 0),a([o.Event()],v.prototype,"animationComplete",void 0),a([o.Event()],v.prototype,"axisLabelRender",void 0),a([o.Event()],v.prototype,"annotationRender",void 0),a([o.Event()],v.prototype,"tooltipRender",void 0),a([o.Event()],v.prototype,"dragStart",void 0),a([o.Event()],v.prototype,"dragMove",void 0),a([o.Event()],v.prototype,"dragEnd",void 0),a([o.Event()],v.prototype,"gaugeMouseMove",void 0),a([o.Event()],v.prototype,"gaugeMouseLeave",void 0),a([o.Event()],v.prototype,"gaugeMouseDown",void 0),a([o.Event()],v.prototype,"gaugeMouseUp",void 0),a([o.Event()],v.prototype,"resized",void 0),v=a([i.NotifyPropertyChanges],v),t.CircularGauge=v}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r,n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),a=this&&this.__decorate||function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};o=[i,t,i(4)],void 0!==(r=function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property("")],o.prototype,"color",void 0),a([i.Property(1)],o.prototype,"width",void 0),t.Border=o;var r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property("16px")],r.prototype,"size",void 0),a([i.Property("")],r.prototype,"color",void 0),a([i.Property("Segoe UI")],r.prototype,"fontFamily",void 0),a([i.Property("Normal")],r.prototype,"fontWeight",void 0),a([i.Property("Normal")],r.prototype,"fontStyle",void 0),a([i.Property(1)],r.prototype,"opacity",void 0),t.Font=r;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(10)],l.prototype,"left",void 0),a([i.Property(10)],l.prototype,"right",void 0),a([i.Property(10)],l.prototype,"top",void 0),a([i.Property(10)],l.prototype,"bottom",void 0),t.Margin=l;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(!1)],s.prototype,"enable",void 0),a([i.Property("#FFFFFF")],s.prototype,"fill",void 0),a([i.Complex({color:"#686868",size:"13px"},r)],s.prototype,"textStyle",void 0),a([i.Property(null)],s.prototype,"format",void 0),a([i.Property(null)],s.prototype,"template",void 0),a([i.Property(!0)],s.prototype,"enableAnimation",void 0),a([i.Complex({color:"black",width:2},o)],s.prototype,"border",void 0),t.TooltipSettings=s}.apply(t,o))&&(e.exports=r)},function(t,i){t.exports=e},function(e,t,i){var o,r,n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();o=[i,t,i(4),i(4),i(4)],void 0!==(r=function(e,t,i,o,r){"use strict";function a(e,t){var i=document.getElementById("gauge-measuretext");null===i&&(i=r.createElement("text",{id:"gauge-measuretext"}),document.body.appendChild(i));var o="position: absolute; visibility: hidden;;left: 0; top: -100; white-space: nowrap;"+l(t);return i.innerHTML=e,i.setAttribute("style",o),new F(i.clientWidth,i.clientHeight)}function l(e){return"font-size:"+e.size+"; font-style:"+e.fontStyle+"; font-weight:"+e.fontWeight+"; font-family:"+e.fontFamily+";opacity:"+e.opacity+"; color:"+e.color+";"}function s(e,t,i){r.setStyleAttribute(e,{stroke:i.color,"stroke-width":i.width,fill:t})}function p(e){var t;return document.body.appendChild(e),t=e.getBoundingClientRect(),L(e.id),t}function u(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function d(e,t,o,r,n){var a,l={},s=new i.SvgRenderer(""),p=n+" font-size:"+t.size+"; font-style:"+t.fontStyle+" ; font-weight:"+t.fontWeight+"; font-family:"+t.fontFamily+";";return l={id:e.id,x:e.x,y:e.y,fill:o,"text-anchor":e.anchor,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine,style:p},a=s.createText(l,e.text),r.appendChild(a),a}function c(e,t,i,o){o=o||"Path";var r=i.renderer["draw"+o](e);return r.setAttribute("transform",e.transform),r.setAttribute("style",e.style),t.appendChild(r),r}function h(e,t,i){for(var o=0,r=i.length;e<r;e++)o+=i[e];return o}function g(e,t,i,o){return-i*Math.cos(e/o*(Math.PI/2))+i+t}function m(e,t,i,o,r,n){var a;return r-=f(o,r)?1e-4:0,o-=90,r-=90,n?a=(e-i)*(y(o,r)/(t-i))+o:(a=r-(e-i)*(y(o,r)/(t-i)),a=a<0?360+a:a),a=Math.round(a)>=360?a-360:Math.round(a)<0?360+a:a}function y(e,t){var i=t-e;return i<0?i+360:i}function v(e,t,i,o,r,n){return r-=f(o,r)?1e-4:0,e=e<o?e+360:e,n?(e-o)/y(o,r)*(t-i)+i:t-((e-o)/y(o,r)*(t-i)+i)}function f(e,t){var i=t-e;return i=i<=0?i+360:i,0!==Math.floor(i/360)}function b(e,t){var i=Math.atan2(t.y-e.y,t.x-e.x);return i=Math.round((i<0?6.283+i:i)*(180/Math.PI))-270,i+=i<0?360:0}function x(e,t,i){var o=e*Math.PI/180;return new W(Math.cos(o)*t+i.x,Math.sin(o)*t+i.y)}function P(e,t,i,o,r,n){i-=f(t,i)?1e-4:0;var a=y(t,i),l=o-r,s=o-n,p=o-(r+n)/2;return void 0!==r&&void 0!==n?A(x(t,o,e),x(i,o,e),x(t,l,e),x(i,s,e),o,p,p,a<180?0:1):w(x(t,o,e),x(i,o,e),o,a<180?0:1)}function A(e,t,i,o,r,n,a,l){return"M "+e.x+" "+e.y+" A "+r+" "+r+" 0 "+l+" 1 "+t.x+" "+t.y+" L "+o.x+" "+o.y+" A "+a+" "+n+" 0 "+l+" 0 "+i.x+" "+i.y+" Z"}function _(e,t,i,o,r){i-=f(t,i)?1e-4:0;var n=y(t,i);return S(e,x(t,o,e),x(i,o,e),o,x(t,r,e),x(i,r,e),r,n<180?0:1)}function w(e,t,i,o){return"M "+e.x+" "+e.y+" A "+i+" "+i+" 0 "+o+" 1 "+t.x+" "+t.y}function S(e,t,i,o,r,n,a,l){return"M "+t.x+" "+t.y+" A "+o+" "+o+" 0 "+l+" 1 "+i.x+" "+i.y+" L "+n.x+" "+n.y+" A "+a+" "+a+" 0 "+l+",0 "+r.x+" "+r.y+" Z"}function R(e){return document.getElementById(e)}function C(e){var t=null;try{document.querySelectorAll(e).length&&(t=i.compile(document.querySelector(e).innerHTML.trim()))}catch(o){t=i.compile(e)}return t}function L(e){var t=R(e);t&&r.remove(t)}function M(e,t){var i;return i=e.split(t.element.id+"_Axis_")[1],{axisIndex:+i[0],pointerIndex:+i[i.length-1]}}function T(e){return e&&null!==e.match("{value}")?"":e}function O(e,t,i,r,n){var a,l=i.width,s=i.height,p=e.x,u=e.y,d=e.x+-l/2,c=e.y+-s/2;switch(t){case"Circle":o.merge(n,{rx:l/2,ry:s/2,cx:p,cy:u});break;case"Diamond":a="M "+d+" "+u+" L "+p+" "+(u+-s/2)+" L "+(p+l/2)+" "+u+" L "+p+" "+(u+s/2)+" L "+d+" "+u+" Z",o.merge(n,{d:a});break;case"Rectangle":a="M "+d+" "+(u+-s/2)+" L "+(p+l/2)+" "+(u+-s/2)+" L "+(p+l/2)+" "+(u+s/2)+" L "+d+" "+(u+s/2)+" L "+d+" "+(u+-s/2)+" Z",o.merge(n,{d:a});break;case"Triangle":a="M "+p+" "+u+" L "+(p-s)+" "+(u-l/2)+"L "+(p-s)+" "+(u+l/2)+" Z",o.merge(n,{d:a});break;case"InvertedTriangle":a="M "+p+" "+u+" L "+(p+s)+" "+(u-l/2)+"L "+(p+s)+" "+(u+l/2)+" Z",o.merge(n,{d:a});break;case"Image":o.merge(n,{href:r,height:s,width:l,x:d,y:c})}return n}function z(e,t,i){var o=0,r=0,n=t.filter(function(t){return o=Math.min(t.start,t.end),r=Math.max(t.start,t.end),e>=o&&r>=e});return n.length?n[0].rangeColor:i}Object.defineProperty(t,"__esModule",{value:!0}),t.measureText=a,t.getFontStyle=l,t.setStyles=s,t.measureElementRect=p,t.stringToNumber=u,t.textElement=d,t.appendPath=c,t.calculateSum=h,t.linear=g,t.getAngleFromValue=m,t.getDegree=y,t.getValueFromAngle=v,t.isCompleteAngle=f,t.getAngleFromLocation=b,t.getLocationFromAngle=x,t.getPathArc=P,t.getRangePath=A,t.getCompleteArc=_,t.getCirclePath=w,t.getCompletePath=S,t.getElement=R,t.getTemplateFunction=C,t.removeElement=L,t.getPointer=M,t.getLabelFormat=T,t.calculateShapes=O,t.getRangeColor=z;var E=function(){function e(e){this.id=e}return e}();t.CustomizeOption=E;var j=function(e){function t(t,i,o,r,n,a,l,s,p){void 0===s&&(s=""),void 0===p&&(p="");var u=e.call(this,t)||this;return u.opacity=n,u.fill=i,u.stroke=r,u["stroke-width"]=o,u["stroke-dasharray"]=a,u.d=l,u.transform=s,u.style=p,u}return n(t,e),t}(E);t.PathOption=j;var k=function(e){function t(t,i,o,r,n){var a=e.call(this,t)||this;return a.y=n.y,a.x=n.x,a.height=n.height,a.width=n.width,a.opacity=r,a.fill=i,a.stroke=o.color,a["stroke-width"]=o.width,a}return n(t,e),t}(E);t.RectOption=k;var F=function(){function e(e,t){this.width=e,this.height=t}return e}();t.Size=F;var W=function(){function e(e,t){this.x=e,this.y=t}return e}();t.GaugeLocation=W;var V=function(){function e(e,t,i,o){this.x=e,this.y=t,this.width=i,this.height=o}return e}();t.Rect=V;var B=function(e){function t(t,i,o,r,n,a,l){void 0===a&&(a="");var s=e.call(this,t)||this;return s.transform="",s.baseLine="auto",s.x=i,s.y=o,s.anchor=r,s.text=n,s.transform=a,s.baseLine=l,s}return n(t,e),t}(E);t.TextOption=B;var N=function(){function e(e,t,i){this.text=e,this.value=t,this.size=i}return e}();t.VisibleLabels=N}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r,n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),a=this&&this.__decorate||function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};o=[i,t,i(4),i(3),i(7)],void 0!==(r=function(e,t,i,o,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(2)],l.prototype,"width",void 0),a([i.Property("")],l.prototype,"dashArray",void 0),a([i.Property(r.Theme.axisLineColor)],l.prototype,"color",void 0),t.Line=l;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Complex(r.Theme.axisLabelFont,o.Font)],s.prototype,"font",void 0),a([i.Property("")],s.prototype,"format",void 0),a([i.Property("Inside")],s.prototype,"position",void 0),a([i.Property("None")],s.prototype,"hiddenLabel",void 0),a([i.Property(!1)],s.prototype,"autoAngle",void 0),a([i.Property(!1)],s.prototype,"useRangeColor",void 0),a([i.Property(0)],s.prototype,"offset",void 0),t.Label=s;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(null)],p.prototype,"start",void 0),a([i.Property(null)],p.prototype,"end",void 0),a([i.Property(null)],p.prototype,"radius",void 0),a([i.Property(10)],p.prototype,"startWidth",void 0),a([i.Property(10)],p.prototype,"endWidth",void 0),a([i.Property(null)],p.prototype,"color",void 0),t.Range=p;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(null)],u.prototype,"width",void 0),a([i.Property(null)],u.prototype,"height",void 0),a([i.Property(null)],u.prototype,"interval",void 0),a([i.Property(0)],u.prototype,"offset",void 0),a([i.Property(r.Theme.tickLineColor)],u.prototype,"color",void 0),a([i.Property("Inside")],u.prototype,"position",void 0),a([i.Property(!1)],u.prototype,"useRangeColor",void 0),t.Tick=u;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property("#FFFFFF")],d.prototype,"color",void 0),a([i.Complex({color:r.Theme.pointerColor,width:8},o.Border)],d.prototype,"border",void 0),a([i.Property(8)],d.prototype,"radius",void 0),t.Cap=d;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(r.Theme.pointerColor)],c.prototype,"color",void 0),a([i.Complex({color:r.Theme.pointerColor,width:0},o.Border)],c.prototype,"border",void 0),a([i.Property("0%")],c.prototype,"length",void 0),t.NeedleTail=c;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(!0)],h.prototype,"enable",void 0),a([i.Property(1e3)],h.prototype,"duration",void 0),t.Animation=h;var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(null)],g.prototype,"content",void 0),a([i.Property(90)],g.prototype,"angle",void 0),a([i.Property("50%")],g.prototype,"radius",void 0),a([i.Property("-1")],g.prototype,"zIndex",void 0),a([i.Property(!1)],g.prototype,"autoAngle",void 0),a([i.Complex({size:"12px",color:"#686868"},o.Font)],g.prototype,"textStyle",void 0),a([i.Property(null)],g.prototype,"description",void 0),t.Annotation=g;var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i.ChildProperty);a([i.Property(null)],m.prototype,"value",void 0),a([i.Property("Needle")],m.prototype,"type",void 0),a([i.Property(null)],m.prototype,"imageUrl",void 0),a([i.Property(null)],m.prototype,"radius",void 0),a([i.Property(20)],m.prototype,"pointerWidth",void 0),a([i.Complex({},d)],m.prototype,"cap",void 0),a([i.Complex({},c)],m.prototype,"needleTail",void 0),a([i.Property(r.Theme.pointerColor)],m.prototype,"color",void 0),a([i.Complex({color:"#DDDDDD",width:0},o.Border)],m.prototype,"border",void 0),a([i.Complex(null,h)],m.prototype,"animation",void 0),a([i.Property("Circle")],m.prototype,"markerShape",void 0),a([i.Property(5)],m.prototype,"markerHeight",void 0),a([i.Property(null)],m.prototype,"description",void 0),a([i.Property(5)],m.prototype,"markerWidth",void 0),t.Pointer=m;var y=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.visibleLabels=[],t}return n(t,e),t}(i.ChildProperty);a([i.Property(null)],y.prototype,"minimum",void 0),a([i.Property(null)],y.prototype,"maximum",void 0),a([i.Property(null)],y.prototype,"radius",void 0),a([i.Complex({},l)],y.prototype,"lineStyle",void 0),a([i.Collection([{}],p)],y.prototype,"ranges",void 0),a([i.Collection([{}],m)],y.prototype,"pointers",void 0),a([i.Collection([{}],g)],y.prototype,"annotations",void 0),a([i.Complex({width:2,height:10},u)],y.prototype,"majorTicks",void 0),a([i.Complex({width:2,height:5},u)],y.prototype,"minorTicks",void 0),a([i.Property(200)],y.prototype,"startAngle",void 0),a([i.Property(160)],y.prototype,"endAngle",void 0),a([i.Property("ClockWise")],y.prototype,"direction",void 0),a([i.Property(null)],y.prototype,"background",void 0),a([i.Complex({},s)],y.prototype,"labelStyle",void 0),t.Axis=y}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t],void 0!==(r=function(e,t){"use strict";function i(e){var t;switch(e){case"Material":case"Fabric":t=["#50c917","#27d5ff","#fcde0b","#ffb133","#ff5985"]}return t}Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.axisLabelFont={size:"12px",fontWeight:"Normal",color:"#212121",fontStyle:"Normal",fontFamily:"Segoe UI"},e.axisLineColor="#757575",e.tickLineColor="#757575",e.pointerColor="#757575"}(t.Theme||(t.Theme={})),t.getRangePalette=i}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t,i(5),i(5),i(9),i(4)],void 0!==(r=function(e,t,i,o,r,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e){this.gauge=e,this.elementId=e.element.id}return e.prototype.renderAnnotation=function(e,t){var i=this,r=n.createElement("div",{id:this.elementId+"_Annotations_"+t}),a=o.getElement(this.elementId+"_Secondary_Element");e.annotations.map(function(e,o){null!==e.content&&i.createTemplate(r,o,t)}),a&&r.childElementCount&&a.appendChild(r)},e.prototype.createTemplate=function(e,t,a){var l=this.gauge.axes[a],s=l.annotations[t],p=n.createElement("div",{id:this.elementId+"_Axis_"+a+"_Annotation_"+t,styles:"position: absolute; z-index:"+s.zIndex+";transform:"+(s.autoAngle?"rotate("+(s.angle-90)+"deg)":"rotate(0deg)")+";"}),u={cancel:!1,name:r.annotationRender,content:s.content,axis:l,annotation:s,textStyle:s.textStyle};this.gauge.trigger(r.annotationRender,u);var d,c;if(!u.cancel){if((d=o.getTemplateFunction(u.content))&&d(l).length)for(c=d(l);c.length>0;)p.appendChild(c[0]);else p.appendChild(n.createElement("div",{innerHTML:u.content,styles:i.getFontStyle(u.textStyle)}));this.updateLocation(p,l,s),e.appendChild(p)}},e.prototype.updateLocation=function(e,t,r){var n=i.getLocationFromAngle(r.angle-90,i.stringToNumber(r.radius,t.currentRadius),this.gauge.midPoint),a=o.measureElementRect(e);e.style.left=n.x-a.width/2+"px",e.style.top=n.y-a.height/2+"px",e.setAttribute("aria-label",r.description||"Annotation")},e.prototype.getModuleName=function(){return"Annotations"},e.prototype.destroy=function(e){},e}();t.Annotations=a}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t],void 0!==(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loaded="loaded",t.load="load",t.animationComplete="animationComplete",t.axisLabelRender="axisLabelRender",t.tooltipRender="tooltipRender",t.annotationRender="annotationRender",t.gaugeMouseMove="gaugeMouseMove",t.gaugeMouseLeave="gaugeMouseLeave",t.gaugeMouseDown="gaugeMouseDown",t.gaugeMouseUp="gaugeMouseUp",t.dragStart="dragStart",t.dragMove="dragMove",t.dragEnd="dragEnd",t.resized="resized"}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t,i(4),i(11),i(5),i(5),i(9)],void 0!==(r=function(e,t,i,o,r,n,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e){this.gauge=e,this.element=e.element,this.tooltip=e.tooltip,this.textStyle=this.tooltip.textStyle,this.borderStyle=this.tooltip.border,this.ejTooltip=new o.Tooltip({opensOn:"custom",beforeRender:this.onBeforeRender.bind(this), | ||
beforeOpen:this.tooltipCustomization.bind(this),openDelay:0,closeDelay:1e3}),this.ejTooltip.appendTo(this.element)}return e.prototype.renderTooltip=function(e){var t,i,o=r.getPointer(e.id,this.gauge);this.currentAxis=this.gauge.axes[o.axisIndex],this.currentPointer=this.currentAxis.pointers[o.pointerIndex],i=n.getAngleFromValue(this.currentPointer.currentValue,this.currentAxis.visibleRange.max,this.currentAxis.visibleRange.min,this.currentAxis.startAngle,this.currentAxis.endAngle,"ClockWise"===this.currentAxis.direction)%360,t=this.appendTargetElement(i),null===t.getAttribute("data-tooltip-id")&&(this.findPosition(i),this.ejTooltip.open(t))},e.prototype.appendTargetElement=function(e){var t=n.getLocationFromAngle(e,this.currentAxis.currentRadius,this.gauge.midPoint),o=n.getElement(this.element.id+"_GaugeTooltip");return o?(o.style.left=t.x+"px",o.style.top=t.y+"px"):(o=i.createElement("div",{id:this.element.id+"_GaugeTooltip",styles:"position:absolute;left:"+t.x+"px;top:"+t.y+"px;width:2px;height:2px;background:transparent"}),n.getElement(this.element.id+"_Secondary_Element").appendChild(o)),o},e.prototype.findPosition=function(e){switch(!0){case e>=0&&e<=45:this.ejTooltip.position="right bottom";break;case e>=45&&e<90:this.ejTooltip.position="bottom right";break;case e>=90&&e<135:this.ejTooltip.position="bottom left";break;case e>=135&&e<180:this.ejTooltip.position="left bottom";break;case e>=180&&e<225:this.ejTooltip.position="left top";break;case e>=225&&e<270:this.ejTooltip.position="top left";break;case e>=270&&e<315:this.ejTooltip.position="top right";break;default:this.ejTooltip.position="right top"}this.ejTooltip.dataBind()},e.prototype.onBeforeRender=function(e){var t=this.gauge.tooltip.format||this.currentAxis.labelStyle.format,i=t&&null!==t.match("{value}"),o=this.gauge.intl.getNumberFormat({format:n.getLabelFormat(t),useGrouping:this.gauge.useGroupingSeparator}),l=i?t.replace(new RegExp("{value}","g"),o(this.currentPointer.currentValue)):o(this.currentPointer.currentValue);l=this.tooltip.template?r.getTemplateFunction(this.tooltip.template)(this.currentAxis)[0]:l;var s={cancel:!1,name:a.tooltipRender,content:l,border:this.borderStyle,axis:this.currentAxis,pointer:this.currentPointer,textStyle:this.textStyle};this.gauge.trigger(a.tooltipRender,s),this.borderStyle=s.border,e.cancel=s.cancel,this.ejTooltip.content=s.content,this.textStyle=s.textStyle,this.ejTooltip.dataBind()},e.prototype.tooltipCustomization=function(e){var t,o,r=this.textStyle,n=this.borderStyle.color,a=this.borderStyle.width,l=5;e.element.classList.remove("e-popup-close"),e.element.classList.add("e-popup-open");var s=e.element.querySelector(".e-arrow-tip");i.setStyleAttribute(e.element,{backgroundColor:this.tooltip.fill,borderColor:n||"#212121",borderWidth:a+"px"}),i.setStyleAttribute(e.element.querySelector(".e-tip-content"),{color:r.color,fontFamily:r.fontFamily,fontSize:r.size,fontWeight:r.fontWeight,opacity:r.opacity.toString(),fontStyle:r.fontStyle}),i.setStyleAttribute(e.element.querySelector(".e-arrow-tip"),{width:2*(l+a)+"px",height:l+a+"px"}),s.classList.contains("e-tip-top")?(l=e.element.querySelector(".e-arrow-tip").offsetHeight,t=l+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-outer"),{borderRightColor:"transparent",borderLeftColor:"transparent",borderBottomColor:n,borderLeftWidth:t,borderRightWidth:t,borderBottomWidth:t}),o=l-a+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-inner"),{borderRightColor:"transparent",borderLeftColor:"transparent",borderBottomColor:this.tooltip.fill,borderLeftWidth:o,borderRightWidth:o,borderBottomWidth:o,left:a+"px",top:a+"px"})):s.classList.contains("e-tip-bottom")?(l=e.element.querySelector(".e-arrow-tip").offsetHeight,t=l+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-outer"),{borderRightColor:"transparent",borderLeftColor:"transparent",borderTopColor:n,borderLeftWidth:t,borderRightWidth:t,borderTopWidth:t}),o=l-a+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-inner"),{borderRightColor:"transparent",borderLeftColor:"transparent",borderTopColor:this.tooltip.fill,borderLeftWidth:o,borderRightWidth:o,borderTopWidth:o,left:a+"px",top:"0"})):s.classList.contains("e-tip-left")?(i.setStyleAttribute(e.element.querySelector(".e-arrow-tip"),{width:l+a+"px",height:2*(l+a)+"px"}),l=e.element.querySelector(".e-arrow-tip").offsetWidth,t=l+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-outer"),{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:n,borderTopWidth:t,borderBottomWidth:t,borderRightWidth:t}),o=l-a+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-inner"),{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:this.tooltip.fill,borderTopWidth:o,borderBottomWidth:o,borderRightWidth:o,left:a+"px",top:a+"px"})):(i.setStyleAttribute(e.element.querySelector(".e-arrow-tip"),{width:l+a+"px",height:2*(l+a)+"px"}),l=e.element.querySelector(".e-arrow-tip").offsetWidth,t=l+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-outer"),{borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:n,borderTopWidth:t,borderBottomWidth:t,borderLeftWidth:t}),o=l-a+"px",i.setStyleAttribute(e.element.querySelector(".e-arrow-tip-inner"),{borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:this.tooltip.fill,borderTopWidth:o,borderBottomWidth:o,borderLeftWidth:o,left:(a<=1?0:-1)+"px",top:a+"px"})),this.ejTooltip.refresh(e.target),i.setStyleAttribute(e.element,{display:"block",transitionProperty:"left,top",transitionDuration:this.tooltip.enableAnimation?"1000ms":"0ms"})},e.prototype.getModuleName=function(){return"Tooltip"},e.prototype.destroy=function(e){},e}();t.GaugeTooltip=l}.apply(t,o))&&(e.exports=r)},function(e,i){e.exports=t},function(e,t,i){var o,r;o=[i,t,i(4),i(5),i(5),i(9),i(13),i(14)],void 0!==(r=function(e,t,i,o,r,n,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e){this.gauge=e,this.axisRenderer=new a.AxisRenderer(e),this.pointerRenderer=new l.PointerRenderer(e)}return e.prototype.measureAxis=function(e){this.measureAxisSize(this.gauge,e),this.calculateAxesRadius()},e.prototype.calculateAxesRadius=function(){for(var e,t,i=0,o=0,n=this.gauge.axes;o<n.length;o++){var a=n[o];e=Math.min(a.rect.width,a.rect.height)/2,t=null!=a.radius?r.stringToNumber(a.radius,e):e,i=Math.max.apply(Math,a.ranges.map(function(e){return e.radius?e.radius.indexOf("%")<0?100:parseInt(e.radius,10):0})),t=i>100&&null==a.radius?100*t/i:t,a.currentRadius=t-a.nearSize,a.visibleRange.interval=this.calculateNumericInterval(a,a.rect),this.calculateVisibleLabels(a)}},e.prototype.measureAxisSize=function(e,t){var i,n=this;this.computeSize(e.axes,t),e.axes.map(function(e,a){i=o.calculateSum(a,n.farSizes.length-1,n.farSizes),e.rect=new r.Rect(t.x+i,t.y+i,t.width-2*i,t.height-2*i)})},e.prototype.calculateAxisValues=function(e){for(var t=0,i=this.gauge.axes;t<i.length;t++){var o=i[t];this.calculateVisibleRange(o,e),this.calculateVisibleLabels(o)}},e.prototype.calculateVisibleRange=function(e,t){var i=e.majorTicks.interval,o=Math.min(null===e.minimum?0:e.minimum,e.maximum),r=Math.max(e.minimum,null===e.maximum?100:e.maximum);e.pointers.map(function(t){t.currentValue=null!==t.value?t.value<o?o:t.value>r?r:t.value:o,o=null===e.minimum?Math.min(t.currentValue,o):o,r=null===e.maximum?Math.max(t.currentValue,r):r}),o=o===r?null!==i?o-i:o-1:o,e.visibleRange={min:o,max:r,interval:i},e.visibleRange.interval=this.calculateNumericInterval(e,t)},e.prototype.calculateNumericInterval=function(e,t){if(null!==e.majorTicks.interval)return e.majorTicks.interval;var i=e.endAngle-e.startAngle;return i=i<=0?i+360:i,this.calculateNiceInterval(e.visibleRange.max,e.visibleRange.min,e.currentRadius?e.currentRadius:t.width/2,i)},e.prototype.calculateNiceInterval=function(e,t,i,o){for(var r=e-t,n=2*Math.PI*i*(o/360),a=Math.max(.01599*n,1),l=r/a,s=Math.pow(10,Math.floor(Math.log(l)/Math.log(10))),p=0,u=[10,5,2,1];p<u.length;p++){var d=u[p],c=s*d;if(a<r/c)break;l=c}return l},e.prototype.calculateVisibleLabels=function(e){var t,i=e.labelStyle,a=i.format&&null!==i.format.match("{value}"),l=this.gauge.intl.getNumberFormat({format:r.getLabelFormat(i.format),useGrouping:this.gauge.useGroupingSeparator});e.visibleLabels=[];for(var s=e.visibleRange.min,p=e.visibleRange.interval,u=e.visibleRange.max;s<=u&&p;s+=p)t={cancel:!1,name:n.axisLabelRender,axis:e,text:a?i.format.replace(new RegExp("{value}","g"),l(s)):l(s),value:s},this.gauge.trigger(n.axisLabelRender,t),t.cancel||e.visibleLabels.push(new o.VisibleLabels(t.text,s));this.getMaxLabelWidth(this.gauge,e)},e.prototype.computeSize=function(e,t){var i,o,r,n,a,l,s=0,p=0,u=0;this.farSizes=[],this.calculateAxisValues(t);for(var d=0,c=e;d<c.length;d++){var h=c[d];i=h.lineStyle.width/2,o=0,r=0,n="Outside"===h.majorTicks.position,s=h.majorTicks.offset,a="Outside"===h.minorTicks.position,p=h.minorTicks.offset,l="Outside"===h.labelStyle.position,u=h.labelStyle.offset,o+=n&&a&&l?0:5,o+=(n?h.majorTicks.height+i:0)+(l?h.maxLabelSize.height+10+u:0)+(a&&!n?h.minorTicks.height+i:0)+i,o+=n&&a?Math.max(s,p):n?s:a?p:0,r+=(n?0:h.majorTicks.height+i)+(l?0:h.maxLabelSize.height+10+u)+(!a&&n?h.minorTicks.height+i:0)+i,r+=n||a?n?a?0:p:s:Math.max(s,p),this.farSizes[this.farSizes.length-1]&&(this.farSizes[this.farSizes.length-1]+=r+o),h.nearSize=o-5,h.farSize=r,o=this.gauge.axes.length===this.farSizes.length+1?0:o,this.farSizes.push(o)}},e.prototype.renderAxes=function(){var e,t=this,o=this.gauge,r=this.axisRenderer,n=o.renderer.createGroup({id:o.element.id+"_AxesCollection","clip-path":"url(#"+o.element.id+"_GaugeAreaClipRect_)"});o.element.appendChild(i.createElement("div",{id:o.element.id+"_Secondary_Element",styles:"position: relative"})),o.axes.map(function(i,a){e=o.renderer.createGroup({id:o.element.id+"_Axis_Group_"+a}),r.drawAxisOuterLine(i,a,e,o),r.drawAxisRange(i,a,e,o),r.drawAxisLine(i,a,e,o),r.drawMajorTickLines(i,a,e,o),r.drawMinorTickLines(i,a,e,o),r.drawAxisLabels(i,a,e,o),t.pointerRenderer.drawPointers(i,a,e,o),o.annotationsModule&&o.annotationsModule.renderAnnotation(i,a),n.appendChild(e)}),o.svgObject.appendChild(o.renderer.drawClipPath({id:o.element.id+"_GaugeAreaClipRect_",x:0,y:0,width:o.availableSize.width,height:o.availableSize.height,fill:"transparent",stroke:"transparent"})),o.svgObject.appendChild(n)},e.prototype.getMaxLabelWidth=function(e,t){t.maxLabelSize=new r.Size(0,0);for(var i=0,n=t.visibleLabels;i<n.length;i++){var a=n[i];a.size=o.measureText(a.text,t.labelStyle.font),t.maxLabelSize.width=a.size.width>t.maxLabelSize.width?a.size.width:t.maxLabelSize.width,t.maxLabelSize.height=a.size.height>t.maxLabelSize.height?a.size.height:t.maxLabelSize.height}},e}();t.AxisLayoutPanel=s}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t,i(5),i(5),i(7)],void 0!==(r=function(e,t,i,o,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.gauge=e}return e.prototype.drawAxisOuterLine=function(e,t,r,n){var a=e.background;this.setRangeColor(e),null!==a&&i.appendPath(new i.PathOption(n.element.id+"_AxisOuterLine_"+t,a,0,"transparent",null,"0",o.getPathArc(n.midPoint,0,360,Math.min(e.rect.width,e.rect.height)/2),"","pointer-events:none;"),r,n)},e.prototype.drawAxisLine=function(e,t,r,n){var a=e.startAngle,l=e.endAngle;e.lineStyle.width>0&&(a=o.isCompleteAngle(a,l)?[0,l=360][0]:a,i.appendPath(new i.PathOption(n.element.id+"_AxisLine_"+t,"transparent",e.lineStyle.width,e.lineStyle.color,null,e.lineStyle.dashArray,o.getPathArc(n.midPoint,a-90,l-90,e.currentRadius),"","pointer-events:none;"),r,n))},e.prototype.drawAxisLabels=function(e,t,r,n){var a,l,s,p,u=n.renderer.createGroup({id:n.element.id+"_Axis_Labels_"+t}),d=e.visibleRange.min,c=e.visibleRange.max,h=e.visibleLabels,g=e.labelStyle,m=e.currentRadius;"Outside"===g.position?m+=e.nearSize-(e.maxLabelSize.height+e.lineStyle.width/2)+5:m-=e.farSize-(e.maxLabelSize.height+e.lineStyle.width/2)+(g.autoAngle?10:0);for(var y=0,v=h.length;y<v;y++)0===y&&"First"===g.hiddenLabel||y===v-1&&"Last"===g.hiddenLabel||(p=h[y],s=Math.round(o.getAngleFromValue(p.value,c,d,e.startAngle,e.endAngle,"ClockWise"===e.direction)),a=i.getLocationFromAngle(s,m,n.midPoint),l=this.findAnchor(a,g,s,p),i.textElement(new i.TextOption(n.element.id+"_Axis_"+t+"_Label_"+y,a.x,a.y,l,p.text,g.autoAngle?"rotate("+(s+90)+","+a.x+","+a.y+")":"","auto"),g.font,g.useRangeColor?o.getRangeColor(p.value,e.ranges,g.font.color):g.font.color,u,"pointer-events:none;"));r.appendChild(u)},e.prototype.findAnchor=function(e,t,i,o){if(t.autoAngle)return"middle";var r="Inside"===t.position?i>120&&i<240?"start":300<i||i<60?"end":"middle":i>120&&i<240?"end":300<i||i<60?"start":"middle";return e.y+="Inside"===t.position?i>=240&&i<=300?o.size.height/2:i>=60&&i<=120?0:o.size.height/4:i>=240&&i<=300?0:i>=60&&i<=120?o.size.height/2:o.size.height/4,r},e.prototype.drawMinorTickLines=function(e,t,r,n){var a=n.renderer.createGroup({id:n.element.id+"_Axis_MinorTickLines_"+t}),l=e.minorTicks,s=null!==l.interval?l.interval:e.visibleRange.interval/2,p=l.useRangeColor;if(l.width&&l.height&&s){for(var u=e.visibleRange.min,d=e.visibleRange.max;u<=d;u+=s)this.majorValues.indexOf(+u.toFixed(3))<0&&i.appendPath(new i.PathOption(n.element.id+"_Axis_Minor_TickLine_"+t+"_"+u,"transparent",l.width,p?o.getRangeColor(u,e.ranges,l.color):l.color,null,"0",this.calculateTicks(u,l,e),"","pointer-events:none;"),a,n);r.appendChild(a)}},e.prototype.drawMajorTickLines=function(e,t,r,n){var a=n.renderer.createGroup({id:n.element.id+"_Axis_MajorTickLines_"+t}),l=e.majorTicks,s=l.useRangeColor;if(this.majorValues=[],l.width&&l.height&&e.visibleRange.interval){for(var p=e.visibleRange.min,u=e.visibleRange.max,d=e.visibleRange.interval;p<=u;p+=d)this.majorValues.push(+p.toFixed(3)),i.appendPath(new i.PathOption(n.element.id+"_Axis_Major_TickLine_"+t+"_"+p,"transparent",l.width,s?o.getRangeColor(p,e.ranges,l.color):l.color,null,"0",this.calculateTicks(p,l,e),"","pointer-events:none;"),a,n);r.appendChild(a)}},e.prototype.calculateTicks=function(e,t,r){var n=r.lineStyle.width/2+t.offset,a="Outside"===t.position,l=o.getAngleFromValue(e,r.visibleRange.max,r.visibleRange.min,r.startAngle,r.endAngle,"ClockWise"===r.direction),s=i.getLocationFromAngle(l,r.currentRadius+(a?n:-n),this.gauge.midPoint),p=i.getLocationFromAngle(l,r.currentRadius+(a?n:-n)+(a?t.height:-t.height),this.gauge.midPoint);return"M "+s.x+" "+s.y+" L "+p.x+" "+p.y+" "},e.prototype.drawAxisRange=function(e,t,r,n){var a,l,s,p,u,d,c=this,h=n.renderer.createGroup({id:n.element.id+"_Axis_Ranges_"+t}),g="ClockWise"===e.direction,m=e.visibleRange.min,y=e.visibleRange.max;e.ranges.map(function(r,v){c.calculateRangeRadius(e,r),s=Math.min(Math.max(r.start,m),r.end),p=Math.min(Math.max(r.start,r.end),y),s!==p&&(a=o.getAngleFromValue(s,y,m,e.startAngle,e.endAngle,g),l=o.getAngleFromValue(p,y,m,e.startAngle,e.endAngle,g),u=r.startWidth,d=r.endWidth,l=g?l:[a,a=l][0],d=g?d:[u,u=d][0],i.appendPath(new i.PathOption(n.element.id+"_Axis_"+t+"_Range_"+v,r.rangeColor,0,r.rangeColor,1,"0",o.getPathArc(n.midPoint,Math.round(a),Math.round(l),r.currentRadius,u,d),"","pointer-events:none;"),h,n))}),r.appendChild(h)},e.prototype.calculateRangeRadius=function(e,t){var o=null!==t.radius?t.radius:"100%";t.currentRadius=i.stringToNumber(o,e.currentRadius)},e.prototype.setRangeColor=function(e){var t=r.getRangePalette(this.gauge.theme);e.ranges.map(function(e,i){e.rangeColor=e.color?e.color:t[i%t.length]})},e}();t.AxisRenderer=n}.apply(t,o))&&(e.exports=r)},function(e,t,i){var o,r;o=[i,t,i(5),i(5),i(5),i(4),i(9)],void 0!==(r=function(e,t,i,o,r,n,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e){this.gauge=e}return e.prototype.drawPointers=function(e,t,i,o){var r,n,a=this,l=o.renderer.createGroup({id:o.element.id+"_Axis_Pointers_"+t});e.pointers.map(function(i,s){n=e.visibleRange,i.pathElement=[],a.calculatePointerRadius(e,i),r=o.renderer.createGroup({id:o.element.id+"_Axis_"+t+"_Pointer_"+s}),a["draw"+i.type+"Pointer"](e,t,s,r,o),a.setPointerValue(e,i,i.currentValue),l.appendChild(r),a.doPointerAnimation(i,e)}),i.appendChild(l)},e.prototype.calculatePointerRadius=function(e,t){t.currentRadius=null===t.radius?e.currentRadius-(e.farSize+5):i.stringToNumber(t.radius,e.currentRadius)},e.prototype.drawNeedlePointer=function(e,t,r,n,a){var l,s,p,u,d=e.pointers[r],c=a.midPoint,h=d.pointerWidth/2;s=o.getLocationFromAngle(0,d.currentRadius,c),p="M "+c.x+" "+(c.y-h)+" L "+s.x+" "+c.y+" L "+c.x+" "+(c.y+h)+" Z",d.pathElement.push(i.appendPath(new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_Needle_"+r,d.color,d.border.width,d.border.color,null,"0",p),n,a)),l=i.stringToNumber(d.needleTail.length,d.currentRadius),u="M "+c.x+" "+(c.y-h)+" L "+s.x+" "+(c.y-h)+" L "+s.x+" "+(c.y+h)+" L "+c.x+" "+(c.y+h),l&&(s=o.getLocationFromAngle(180,l,a.midPoint),p="M "+c.x+" "+(c.y-h)+" L "+s.x+" "+(c.y-h)+" L "+s.x+" "+(c.y+h)+" L "+c.x+" "+(c.y+h)+" Z",d.pathElement.push(i.appendPath(new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_NeedleTail_"+r,d.needleTail.color,d.needleTail.border.width,d.needleTail.border.color,null,"0",p),n,a)),u+=" L "+s.x+" "+(c.y+h)+" L "+s.x+" "+(c.y-h)),d.cap.radius&&d.pathElement.push(i.appendPath(i.calculateShapes(c,"Circle",new i.Size(2*d.cap.radius,2*d.cap.radius),"",new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_NeedleCap_"+r,d.cap.color,d.cap.border.width,d.cap.border.color,null,"0","","")),n,a,"Ellipse")),d.pathElement.push(i.appendPath(new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_NeedleRect_"+r,"transparent",0,"transpanret",null,"0",u+" Z"),n,a))},e.prototype.setPointerValue=function(e,t,i){var o=this.gauge.midPoint,n="ClockWise"===e.direction,a=r.getAngleFromValue(e.visibleRange.min,e.visibleRange.max,e.visibleRange.min,e.startAngle,e.endAngle,n),l=r.getAngleFromValue(i,e.visibleRange.max,e.visibleRange.min,e.startAngle,e.endAngle,n);l=n?l:[a,a=l][0],t.pathElement.map(function(s){"RangeBar"===t.type?s.setAttribute("d",r.getCompleteArc(o,a,l,t.currentRadius,t.currentRadius-t.pointerWidth)):s.setAttribute("transform","rotate("+r.getAngleFromValue(i,e.visibleRange.max,e.visibleRange.min,e.startAngle,e.endAngle,n)+","+o.x+","+o.y+")"),s.setAttribute("aria-label",t.description||"Pointer:"+i.toString())})},e.prototype.drawMarkerPointer=function(e,t,r,n,a){var l=e.pointers[r],s=o.getLocationFromAngle(0,l.currentRadius,a.midPoint);l.pathElement.push(i.appendPath(i.calculateShapes(s,l.markerShape,new i.Size(l.markerWidth,l.markerHeight),l.imageUrl,new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_Marker_"+r,l.color,l.border.width,l.border.color,null,"0","","")),n,a,"Circle"===l.markerShape?"Ellipse":"Image"===l.markerShape?"Image":"Path"))},e.prototype.drawRangeBarPointer=function(e,t,r,n,a){var l=e.pointers[r];l.pathElement.push(i.appendPath(new o.PathOption(a.element.id+"_Axis_"+t+"_Pointer_RangeBar_"+r,l.color,l.border.width,l.border.color,1,"0",""),n,a))},e.prototype.doPointerAnimation=function(e,t){var i=this,o=t.visibleRange.min,r=e.currentValue;e.animation.enable&&o!==r&&this.gauge.animatePointer&&e.pathElement.map(function(n){"RangeBar"===e.type?i.performRangeBarAnimation(n,o,r,t,e,e.currentRadius,e.currentRadius-e.pointerWidth):i.performNeedleAnimation(n,o,r,t,e,e.currentRadius,e.currentRadius-e.pointerWidth)})},e.prototype.performNeedleAnimation=function(e,t,i,o,l,s,p){var u,d=this,c="ClockWise"===o.direction,h=r.getAngleFromValue(t,o.visibleRange.max,o.visibleRange.min,o.startAngle,o.endAngle,c),g=r.getAngleFromValue(i,o.visibleRange.max,o.visibleRange.min,o.startAngle,o.endAngle,c),m=h>g?g+360:g;new n.Animation({}).animate(e,{duration:l.animation.duration,progress:function(o){u=t<i||Math.round(h)===Math.round(m)?c?m-h:m-h-360:c?m-h-360:m-h,e.style.animation="None",e.setAttribute("transform","rotate("+r.linear(o.timeStamp,h,u,o.duration)+","+d.gauge.midPoint.x.toString()+","+d.gauge.midPoint.y.toString()+")")},end:function(t){d.setPointerValue(o,l,i),("Marker"===l.type||e.id.indexOf("_Pointer_NeedleCap")>=0)&&d.gauge.trigger(a.animationComplete,{axis:o,pointer:l})}})},e.prototype.performRangeBarAnimation=function(e,t,i,o,l,s,p){var u,d=this,c="ClockWise"===o.direction,h=r.getAngleFromValue(t,o.visibleRange.max,o.visibleRange.min,o.startAngle,o.endAngle,c),g=r.getAngleFromValue(o.visibleRange.min,o.visibleRange.max,o.visibleRange.min,o.startAngle,o.endAngle,c),m=r.getAngleFromValue(i,o.visibleRange.max,o.visibleRange.min,o.startAngle,o.endAngle,c),y=h>m?m+360:m;new n.Animation({}).animate(e,{duration:l.animation.duration,progress:function(o){e.style.animation="None",u=t<i||Math.round(h)===Math.round(y)?c?y-h:y-h-360:c?y-h-360:y-h,c?e.setAttribute("d",r.getCompleteArc(d.gauge.midPoint,g,r.linear(o.timeStamp,h,u,o.duration)+1e-4,s,p)):e.setAttribute("d",r.getCompleteArc(d.gauge.midPoint,r.linear(o.timeStamp,h,u,o.duration),g+1e-4,s,p))},end:function(e){d.setPointerValue(o,l,i),d.gauge.trigger(a.animationComplete,{axis:o,pointer:l})}})},e}();t.PointerRenderer=l}.apply(t,o))&&(e.exports=r)}])}); | ||
//# sourceMappingURL=ej2-circulargauge.umd.min.js.map |
@@ -43,26 +43,2 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
CircularGauge.prototype.initPrivateVariable = function () { | ||
this.renderer = new SvgRenderer(this.element.id); | ||
this.gaugeAxisLayoutPanel = new AxisLayoutPanel(this); | ||
this.animatePointer = true; | ||
}; | ||
CircularGauge.prototype.createSvg = function () { | ||
this.removeSvg(); | ||
this.calculateSvgSize(); | ||
this.svgObject = this.renderer.createSvg({ | ||
id: this.element.id + '_svg', | ||
width: this.availableSize.width, | ||
height: this.availableSize.height | ||
}); | ||
}; | ||
CircularGauge.prototype.setCulture = function () { | ||
this.intl = new Internationalization(); | ||
}; | ||
CircularGauge.prototype.calculateSvgSize = function () { | ||
var containerWidth = this.element.offsetWidth; | ||
var containerHeight = this.element.offsetHeight; | ||
var width = stringToNumber(this.width, containerWidth) || containerWidth || 600; | ||
var height = stringToNumber(this.height, containerHeight) || containerHeight || 450; | ||
this.availableSize = new Size(width, height); | ||
}; | ||
CircularGauge.prototype.render = function () { | ||
@@ -72,122 +48,2 @@ this.calculateBounds(); | ||
}; | ||
CircularGauge.prototype.renderElements = function () { | ||
this.renderBorder(); | ||
this.renderTitle(); | ||
this.gaugeAxisLayoutPanel.renderAxes(); | ||
this.element.appendChild(this.svgObject); | ||
this.trigger(loaded, { gauge: this }); | ||
}; | ||
CircularGauge.prototype.renderTitle = function () { | ||
if (this.title) { | ||
var size = measureText(this.title, this.titleStyle); | ||
var options = new TextOption(this.element.id + '_CircularGaugeTitle', this.availableSize.width / 2, this.margin.top + 3 * (size.height / 4), 'middle', this.title); | ||
var element = textElement(options, this.titleStyle, this.titleStyle.color, this.svgObject, ''); | ||
element.setAttribute('aria-label', this.description || this.title); | ||
element.setAttribute('tabindex', this.tabIndex.toString()); | ||
} | ||
}; | ||
CircularGauge.prototype.renderBorder = function () { | ||
var borderWidth = this.border.width; | ||
if (borderWidth > 0 || (this.background !== null && this.background !== 'transparent')) { | ||
this.svgObject.appendChild(this.renderer.drawRectangle(new RectOption(this.element.id + '_CircularGaugeBorder', this.background, this.border, null, new Rect(borderWidth / 2, borderWidth / 2, this.availableSize.width - borderWidth, this.availableSize.height - borderWidth)))); | ||
} | ||
}; | ||
CircularGauge.prototype.setPointerValue = function (axisIndex, pointerIndex, value) { | ||
var _this = this; | ||
var axis = this.axes[axisIndex]; | ||
var pointer = axis.pointers[pointerIndex]; | ||
var pointerRadius = pointer.currentRadius; | ||
var enableAnimation = pointer.animation.enable; | ||
value = value < axis.visibleRange.min ? axis.visibleRange.min : value; | ||
value = value > axis.visibleRange.max ? axis.visibleRange.max : value; | ||
pointer.pathElement.map(function (element) { | ||
if (pointer.type === 'RangeBar') { | ||
setStyles(element, pointer.color, pointer.border); | ||
if (enableAnimation) { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.performRangeBarAnimation(element, pointer.currentValue, value, axis, pointer, pointerRadius, (pointerRadius - pointer.pointerWidth)); | ||
} | ||
else { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(axis, pointer, value); | ||
} | ||
} | ||
else { | ||
if (element.id.indexOf('_Pointer_NeedleCap_') >= 0) { | ||
setStyles(element, pointer.cap.color, pointer.cap.border); | ||
} | ||
else if (element.id.indexOf('_Pointer_NeedleTail_') >= 0) { | ||
setStyles(element, pointer.needleTail.color, pointer.needleTail.border); | ||
} | ||
else if (element.id.indexOf('_Pointer_NeedleRect_') >= 0) { | ||
setStyles(element, 'transparent', { color: 'transparent', width: 0 }); | ||
} | ||
else { | ||
setStyles(element, pointer.color, pointer.border); | ||
} | ||
if (enableAnimation) { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.performNeedleAnimation(element, pointer.currentValue, value, axis, pointer, pointerRadius, (pointerRadius - pointer.pointerWidth)); | ||
} | ||
else { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(axis, pointer, value); | ||
} | ||
} | ||
}); | ||
pointer.currentValue = value; | ||
pointer.value = value; | ||
}; | ||
CircularGauge.prototype.setAnnotationValue = function (axisIndex, annotationIndex, content) { | ||
var isElementExist = getElement(this.element.id + '_Annotations_' + axisIndex) !== null; | ||
var element = getElement(this.element.id + '_Annotations_' + axisIndex) || | ||
createElement('div', { | ||
id: this.element.id + '_Annotations_' + axisIndex | ||
}); | ||
var annotation = this.axes[axisIndex].annotations[annotationIndex]; | ||
if (content !== null) { | ||
removeElement(this.element.id + '_Axis_' + axisIndex + '_Annotation_' + annotationIndex); | ||
annotation.content = content; | ||
this.annotationsModule.createTemplate(element, annotationIndex, axisIndex); | ||
if (!isElementExist) { | ||
getElement(this.element.id + '_Secondary_Element').appendChild(element); | ||
} | ||
} | ||
}; | ||
CircularGauge.prototype.setRangeValue = function (axisIndex, rangeIndex, start, end) { | ||
var element = getElement(this.element.id + '_Axis_' + axisIndex + '_Range_' + rangeIndex); | ||
var axis = this.axes[axisIndex]; | ||
var range = axis.ranges[rangeIndex]; | ||
var axisRange = axis.visibleRange; | ||
var isClockWise = axis.direction === 'ClockWise'; | ||
var startValue = Math.min(Math.max(start, axisRange.min), end); | ||
var endValue = Math.min(Math.max(start, end), axisRange.max); | ||
var startAngle = getAngleFromValue(startValue, axisRange.max, axisRange.min, axis.startAngle, axis.endAngle, isClockWise); | ||
var endAngle = getAngleFromValue(endValue, axisRange.max, axisRange.min, axis.startAngle, axis.endAngle, isClockWise); | ||
var startWidth = range.startWidth; | ||
var endWidth = range.endWidth; | ||
endAngle = isClockWise ? endAngle : [startAngle, startAngle = endAngle][0]; | ||
endWidth = isClockWise ? endWidth : [startWidth, startWidth = endWidth][0]; | ||
element.setAttribute('d', getPathArc(this.midPoint, Math.round(startAngle), Math.round(endAngle), range.currentRadius, startWidth, endWidth)); | ||
setStyles(element, (range.color ? range.color : range.rangeColor), { | ||
color: (range.color ? range.color : range.rangeColor), | ||
width: 0 | ||
}); | ||
}; | ||
CircularGauge.prototype.calculateBounds = function () { | ||
var padding = 5; | ||
var margin = this.margin; | ||
var titleHeight = 0; | ||
if (this.title) { | ||
titleHeight = measureText(this.title, this.titleStyle).height + padding; | ||
} | ||
var top = margin.top + titleHeight + this.border.width; | ||
var left = margin.left + this.border.width; | ||
var width = this.availableSize.width - left - margin.right - this.border.width; | ||
var height = this.availableSize.height - top - this.border.width - margin.bottom; | ||
var radius = Math.min(width, height) / 2; | ||
var rect = new Rect((left + (width / 2) - radius), (top + (height / 2) - radius), radius * 2, radius * 2); | ||
var centerX = this.centerX !== null ? | ||
stringToNumber(this.centerX, this.availableSize.width) : rect.x + (rect.width / 2); | ||
var centerY = this.centerY !== null ? | ||
stringToNumber(this.centerY, this.availableSize.height) : rect.y + (rect.height / 2); | ||
this.midPoint = new GaugeLocation(centerX, centerY); | ||
this.gaugeAxisLayoutPanel.measureAxis(rect); | ||
}; | ||
CircularGauge.prototype.unWireEvents = function () { | ||
@@ -199,3 +55,3 @@ EventHandler.remove(this.element, Browser.touchStartEvent, this.gaugeOnMouseDown); | ||
EventHandler.remove(this.element, (Browser.isPointer ? 'pointerleave' : 'mouseleave'), this.mouseLeave); | ||
EventHandler.remove(window, (Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.gaugeResize.bind(this)); | ||
window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.gaugeResize); | ||
}; | ||
@@ -208,13 +64,5 @@ CircularGauge.prototype.wireEvents = function () { | ||
EventHandler.add(this.element, (Browser.isPointer ? 'pointerleave' : 'mouseleave'), this.mouseLeave, this); | ||
EventHandler.add(window, (Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.gaugeResize, this); | ||
this.setStyle(this.element); | ||
window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.gaugeResize.bind(this)); | ||
this.setGaugeStyle(this.element); | ||
}; | ||
CircularGauge.prototype.setStyle = function (element) { | ||
element.style.touchAction = this.enablePointerDrag ? 'none' : 'element'; | ||
element.style.msTouchAction = this.enablePointerDrag ? 'none' : 'element'; | ||
element.style.msContentZooming = 'none'; | ||
element.style.msUserSelect = 'none'; | ||
element.style.webkitUserSelect = 'none'; | ||
element.style.position = 'relative'; | ||
}; | ||
CircularGauge.prototype.mouseMove = function (e) { | ||
@@ -359,2 +207,165 @@ var args = this.getMouseArgs(e, 'touchmove', gaugeMouseMove); | ||
}; | ||
CircularGauge.prototype.setGaugeStyle = function (element) { | ||
element.style.touchAction = this.enablePointerDrag ? 'none' : 'element'; | ||
element.style.msTouchAction = this.enablePointerDrag ? 'none' : 'element'; | ||
element.style.msContentZooming = 'none'; | ||
element.style.msUserSelect = 'none'; | ||
element.style.webkitUserSelect = 'none'; | ||
element.style.position = 'relative'; | ||
}; | ||
CircularGauge.prototype.setCulture = function () { | ||
this.intl = new Internationalization(); | ||
}; | ||
CircularGauge.prototype.createSvg = function () { | ||
this.removeSvg(); | ||
this.calculateSvgSize(); | ||
this.svgObject = this.renderer.createSvg({ | ||
id: this.element.id + '_svg', | ||
width: this.availableSize.width, | ||
height: this.availableSize.height | ||
}); | ||
}; | ||
CircularGauge.prototype.removeSvg = function () { | ||
removeElement(this.element.id + '_Secondary_Element'); | ||
if (this.svgObject) { | ||
while (this.svgObject.childNodes.length > 0) { | ||
this.svgObject.removeChild(this.svgObject.firstChild); | ||
} | ||
if (!this.svgObject.hasChildNodes() && this.svgObject.parentNode) { | ||
remove(this.svgObject); | ||
} | ||
} | ||
}; | ||
CircularGauge.prototype.initPrivateVariable = function () { | ||
this.renderer = new SvgRenderer(this.element.id); | ||
this.gaugeAxisLayoutPanel = new AxisLayoutPanel(this); | ||
this.animatePointer = true; | ||
}; | ||
CircularGauge.prototype.calculateSvgSize = function () { | ||
var containerWidth = this.element.offsetWidth; | ||
var containerHeight = this.element.offsetHeight; | ||
var width = stringToNumber(this.width, containerWidth) || containerWidth || 600; | ||
var height = stringToNumber(this.height, containerHeight) || containerHeight || 450; | ||
this.availableSize = new Size(width, height); | ||
}; | ||
CircularGauge.prototype.calculateBounds = function () { | ||
var padding = 5; | ||
var margin = this.margin; | ||
var titleHeight = 0; | ||
if (this.title) { | ||
titleHeight = measureText(this.title, this.titleStyle).height + padding; | ||
} | ||
var top = margin.top + titleHeight + this.border.width; | ||
var left = margin.left + this.border.width; | ||
var width = this.availableSize.width - left - margin.right - this.border.width; | ||
var height = this.availableSize.height - top - this.border.width - margin.bottom; | ||
var radius = Math.min(width, height) / 2; | ||
var rect = new Rect((left + (width / 2) - radius), (top + (height / 2) - radius), radius * 2, radius * 2); | ||
var centerX = this.centerX !== null ? | ||
stringToNumber(this.centerX, this.availableSize.width) : rect.x + (rect.width / 2); | ||
var centerY = this.centerY !== null ? | ||
stringToNumber(this.centerY, this.availableSize.height) : rect.y + (rect.height / 2); | ||
this.midPoint = new GaugeLocation(centerX, centerY); | ||
this.gaugeAxisLayoutPanel.measureAxis(rect); | ||
}; | ||
CircularGauge.prototype.renderElements = function () { | ||
this.renderBorder(); | ||
this.renderTitle(); | ||
this.gaugeAxisLayoutPanel.renderAxes(); | ||
this.element.appendChild(this.svgObject); | ||
this.trigger(loaded, { gauge: this }); | ||
}; | ||
CircularGauge.prototype.renderTitle = function () { | ||
if (this.title) { | ||
var size = measureText(this.title, this.titleStyle); | ||
var options = new TextOption(this.element.id + '_CircularGaugeTitle', this.availableSize.width / 2, this.margin.top + 3 * (size.height / 4), 'middle', this.title); | ||
var element = textElement(options, this.titleStyle, this.titleStyle.color, this.svgObject, ''); | ||
element.setAttribute('aria-label', this.description || this.title); | ||
element.setAttribute('tabindex', this.tabIndex.toString()); | ||
} | ||
}; | ||
CircularGauge.prototype.renderBorder = function () { | ||
var borderWidth = this.border.width; | ||
if (borderWidth > 0 || (this.background !== null && this.background !== 'transparent')) { | ||
this.svgObject.appendChild(this.renderer.drawRectangle(new RectOption(this.element.id + '_CircularGaugeBorder', this.background, this.border, null, new Rect(borderWidth / 2, borderWidth / 2, this.availableSize.width - borderWidth, this.availableSize.height - borderWidth)))); | ||
} | ||
}; | ||
CircularGauge.prototype.setPointerValue = function (axisIndex, pointerIndex, value) { | ||
var _this = this; | ||
var axis = this.axes[axisIndex]; | ||
var pointer = axis.pointers[pointerIndex]; | ||
var pointerRadius = pointer.currentRadius; | ||
var enableAnimation = pointer.animation.enable; | ||
value = value < axis.visibleRange.min ? axis.visibleRange.min : value; | ||
value = value > axis.visibleRange.max ? axis.visibleRange.max : value; | ||
pointer.pathElement.map(function (element) { | ||
if (pointer.type === 'RangeBar') { | ||
setStyles(element, pointer.color, pointer.border); | ||
if (enableAnimation) { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.performRangeBarAnimation(element, pointer.currentValue, value, axis, pointer, pointerRadius, (pointerRadius - pointer.pointerWidth)); | ||
} | ||
else { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(axis, pointer, value); | ||
} | ||
} | ||
else { | ||
if (element.id.indexOf('_Pointer_NeedleCap_') >= 0) { | ||
setStyles(element, pointer.cap.color, pointer.cap.border); | ||
} | ||
else if (element.id.indexOf('_Pointer_NeedleTail_') >= 0) { | ||
setStyles(element, pointer.needleTail.color, pointer.needleTail.border); | ||
} | ||
else if (element.id.indexOf('_Pointer_NeedleRect_') >= 0) { | ||
setStyles(element, 'transparent', { color: 'transparent', width: 0 }); | ||
} | ||
else { | ||
setStyles(element, pointer.color, pointer.border); | ||
} | ||
if (enableAnimation) { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.performNeedleAnimation(element, pointer.currentValue, value, axis, pointer, pointerRadius, (pointerRadius - pointer.pointerWidth)); | ||
} | ||
else { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(axis, pointer, value); | ||
} | ||
} | ||
}); | ||
pointer.currentValue = value; | ||
pointer.value = value; | ||
}; | ||
CircularGauge.prototype.setAnnotationValue = function (axisIndex, annotationIndex, content) { | ||
var isElementExist = getElement(this.element.id + '_Annotations_' + axisIndex) !== null; | ||
var element = getElement(this.element.id + '_Annotations_' + axisIndex) || | ||
createElement('div', { | ||
id: this.element.id + '_Annotations_' + axisIndex | ||
}); | ||
var annotation = this.axes[axisIndex].annotations[annotationIndex]; | ||
if (content !== null) { | ||
removeElement(this.element.id + '_Axis_' + axisIndex + '_Annotation_' + annotationIndex); | ||
annotation.content = content; | ||
this.annotationsModule.createTemplate(element, annotationIndex, axisIndex); | ||
if (!isElementExist) { | ||
getElement(this.element.id + '_Secondary_Element').appendChild(element); | ||
} | ||
} | ||
}; | ||
CircularGauge.prototype.setRangeValue = function (axisIndex, rangeIndex, start, end) { | ||
var element = getElement(this.element.id + '_Axis_' + axisIndex + '_Range_' + rangeIndex); | ||
var axis = this.axes[axisIndex]; | ||
var range = axis.ranges[rangeIndex]; | ||
var axisRange = axis.visibleRange; | ||
var isClockWise = axis.direction === 'ClockWise'; | ||
var startValue = Math.min(Math.max(start, axisRange.min), end); | ||
var endValue = Math.min(Math.max(start, end), axisRange.max); | ||
var startAngle = getAngleFromValue(startValue, axisRange.max, axisRange.min, axis.startAngle, axis.endAngle, isClockWise); | ||
var endAngle = getAngleFromValue(endValue, axisRange.max, axisRange.min, axis.startAngle, axis.endAngle, isClockWise); | ||
var startWidth = range.startWidth; | ||
var endWidth = range.endWidth; | ||
endAngle = isClockWise ? endAngle : [startAngle, startAngle = endAngle][0]; | ||
endWidth = isClockWise ? endWidth : [startWidth, startWidth = endWidth][0]; | ||
element.setAttribute('d', getPathArc(this.midPoint, Math.round(startAngle), Math.round(endAngle), range.currentRadius, startWidth, endWidth)); | ||
setStyles(element, (range.color ? range.color : range.rangeColor), { | ||
color: (range.color ? range.color : range.rangeColor), | ||
width: 0 | ||
}); | ||
}; | ||
CircularGauge.prototype.destroy = function () { | ||
@@ -388,13 +399,2 @@ this.unWireEvents(); | ||
}; | ||
CircularGauge.prototype.removeSvg = function () { | ||
removeElement(this.element.id + '_Secondary_Element'); | ||
if (this.svgObject) { | ||
while (this.svgObject.childNodes.length > 0) { | ||
this.svgObject.removeChild(this.svgObject.firstChild); | ||
} | ||
if (!this.svgObject.hasChildNodes() && this.svgObject.parentNode) { | ||
remove(this.svgObject); | ||
} | ||
} | ||
}; | ||
CircularGauge.prototype.getPersistData = function () { | ||
@@ -401,0 +401,0 @@ return this.addOnPersist([]); |
{ | ||
"_args": [ | ||
[ | ||
{ | ||
"raw": "@syncfusion/ej2-circulargauge", | ||
"scope": "@syncfusion", | ||
"escapedName": "@syncfusion%2fej2-circulargauge", | ||
"name": "@syncfusion/ej2-circulargauge", | ||
"rawSpec": "", | ||
"spec": "latest", | ||
"type": "tag" | ||
}, | ||
"C:\\Users\\ajithr\\Desktop\\fix" | ||
] | ||
], | ||
"_from": "@syncfusion/ej2-circulargauge@latest", | ||
"_id": "@syncfusion/ej2-circulargauge@1.0.14", | ||
"_inCache": true, | ||
"_location": "/@syncfusion/ej2-circulargauge", | ||
"_nodeVersion": "8.2.0", | ||
"_npmOperationalInternal": { | ||
"host": "s3://npm-registry-packages", | ||
"tmp": "tmp/ej2-circulargauge-1.0.14.tgz_1504215553651_0.6646160420496017" | ||
}, | ||
"_npmUser": { | ||
"name": "ajithr11", | ||
"email": "ajithr@syncfusion.com" | ||
}, | ||
"_npmVersion": "4.6.1", | ||
"_phantomChildren": {}, | ||
"_requested": { | ||
"raw": "@syncfusion/ej2-circulargauge", | ||
"scope": "@syncfusion", | ||
"escapedName": "@syncfusion%2fej2-circulargauge", | ||
"name": "@syncfusion/ej2-circulargauge", | ||
"rawSpec": "", | ||
"spec": "latest", | ||
"type": "tag" | ||
}, | ||
"_requiredBy": [ | ||
"#USER" | ||
], | ||
"_resolved": "https://registry.npmjs.org/@syncfusion/ej2-circulargauge/-/ej2-circulargauge-1.0.14.tgz", | ||
"_shasum": "735c5b0155f76db7495f41170d175f5f032313ac", | ||
"_shrinkwrap": null, | ||
"_spec": "@syncfusion/ej2-circulargauge", | ||
"_where": "C:\\Users\\ajithr\\Desktop\\fix", | ||
"author": { | ||
"name": "Syncfusion Inc." | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/syncfusion/ej2-circulargauge/issues" | ||
}, | ||
"name": "@syncfusion/ej2-circulargauge", | ||
"version": "15.4.17", | ||
"description": "Essential JS 2 CircularGauge Components", | ||
"author": "Syncfusion Inc.", | ||
"license": "SEE LICENSE IN license", | ||
"module": "dist/es6/index.js", | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "^1.0.14", | ||
"@syncfusion/ej2-popups": "^1.0.14" | ||
"@syncfusion/ej2-base": "^15.4.17", | ||
"@syncfusion/ej2-popups": "^15.4.17" | ||
}, | ||
"description": "Essential JS 2 CircularGauge Components", | ||
"devDependencies": { | ||
@@ -66,9 +19,2 @@ "@types/chai": "^3.4.28", | ||
}, | ||
"directories": {}, | ||
"dist": { | ||
"shasum": "735c5b0155f76db7495f41170d175f5f032313ac", | ||
"tarball": "https://registry.npmjs.org/@syncfusion/ej2-circulargauge/-/ej2-circulargauge-1.0.14.tgz" | ||
}, | ||
"gitHead": "9c0667edb79c42fc300bb3562697b4d927f8453b", | ||
"homepage": "https://github.com/syncfusion/ej2-circulargauge#readme", | ||
"keywords": [ | ||
@@ -80,20 +26,6 @@ "ej2", | ||
], | ||
"license": "SEE LICENSE IN license", | ||
"maintainers": [ | ||
{ | ||
"name": "ajithr11", | ||
"email": "ajithr@syncfusion.com" | ||
} | ||
], | ||
"module": "dist/es6/index.js", | ||
"name": "@syncfusion/ej2-circulargauge", | ||
"optionalDependencies": {}, | ||
"readme": "# Overview\n\nThe Circular Gauge control is ideal to visualize numeric values over a circular scale. Its rich feature set includes functionalities like ranges, multiple axes, annotations, pointers, and tooltip.\n\n## Resources\n\n[Demos](http://ej2.syncfusion.com/demos/#/circulargauge/default.html)\n\n## Changelog\n\nCheck the changelog [here](https://github.com/syncfusion/ej2-circulargauge/blob/master/CHANGELOG.md)", | ||
"readmeFilename": "ReadMe.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/syncfusion/ej2-circulargauge.git" | ||
}, | ||
"scripts": {}, | ||
"version": "1.0.15" | ||
} | ||
"url": "https://github.com/syncfusion/ej2-circulargauge.git" | ||
} | ||
} |
@@ -7,3 +7,3 @@ # Overview | ||
[Demos](http://ej2.syncfusion.com/demos/#/circulargauge/default.html) | ||
[Demos](http://ej2.syncfusion.com/demos/index.html#/material/circulargauge/default.html) | ||
@@ -10,0 +10,0 @@ ## Changelog |
import { CircularGauge } from '../circular-gauge'; | ||
import { Axis, Annotation } from '../axes/axis'; | ||
import { Axis } from '../axes/axis'; | ||
/** | ||
@@ -14,6 +14,15 @@ * Annotation Module handles the annotation of the axis. | ||
constructor(gauge: CircularGauge); | ||
/** | ||
* Method to render the annotation for circular gauge. | ||
*/ | ||
renderAnnotation(axis: Axis, index: number): void; | ||
/** | ||
* Method to create annotation template for circular gauge. | ||
*/ | ||
createTemplate(element: HTMLElement, annotationIndex: number, axisIndex: number): void; | ||
updateLocation(element: HTMLElement, axis: Axis, annotation: Annotation): void; | ||
/** | ||
* Method to update the annotation location for circular gauge. | ||
*/ | ||
private updateLocation(element, axis, annotation); | ||
/** | ||
* Get module name. | ||
@@ -20,0 +29,0 @@ */ |
import { CircularGauge } from '../circular-gauge'; | ||
import { Rect } from '../utils/helper'; | ||
import { Axis } from './axis'; | ||
import { PointerRenderer } from './pointer-renderer'; | ||
@@ -12,3 +11,3 @@ export declare class AxisLayoutPanel { | ||
/** | ||
* Measure the axis size. | ||
* Measure the calculate the axis size and radius. | ||
* @return {void} | ||
@@ -19,3 +18,3 @@ * @private | ||
/** | ||
* Measure the axis element size. | ||
* Measure to calculate the axis radius of the circular gauge. | ||
* @return {void} | ||
@@ -26,3 +25,3 @@ * @private | ||
/** | ||
* Measure the axis size. | ||
* Measure to calculate the axis size. | ||
* @return {void} | ||
@@ -33,3 +32,3 @@ * @private | ||
/** | ||
* Calculate the axis values. | ||
* Calculate the axis values of the circular gauge. | ||
* @return {void} | ||
@@ -40,3 +39,3 @@ * @private | ||
/** | ||
* Calculate the visible range. | ||
* Calculate the visible range of an axis. | ||
* @return {void} | ||
@@ -47,3 +46,3 @@ * @private | ||
/** | ||
* Calculate the numeric intervals. | ||
* Calculate the numeric intervals of an axis range. | ||
* @return {void} | ||
@@ -54,3 +53,3 @@ * @private | ||
/** | ||
* Calculate the nice interval. | ||
* Calculate the nice interval of an axis range. | ||
* @return {void} | ||
@@ -61,3 +60,3 @@ * @private | ||
/** | ||
* Calculate the visible labels. | ||
* Calculate the visible labels of an axis. | ||
* @return {void} | ||
@@ -68,3 +67,3 @@ * @private | ||
/** | ||
* Measure the axis size. | ||
* Measure the axes available size. | ||
* @return {void} | ||
@@ -75,3 +74,3 @@ * @private | ||
/** | ||
* To render the axis element. | ||
* To render the axis element of the circular gauge. | ||
* @return {void} | ||
@@ -84,5 +83,4 @@ * @private | ||
* @return {void} | ||
* @private | ||
*/ | ||
getMaxLabelWidth(gauge: CircularGauge, axis: Axis): void; | ||
private getMaxLabelWidth(gauge, axis); | ||
} |
@@ -9,18 +9,65 @@ import { CircularGauge } from '../circular-gauge'; | ||
private gauge; | ||
/** | ||
* Constructor for axis renderer. | ||
* @private. | ||
*/ | ||
constructor(gauge: CircularGauge); | ||
/** | ||
* Method to render the axis element of the circular gauge. | ||
* @return {void} | ||
* @private | ||
*/ | ||
drawAxisOuterLine(axis: Axis, index: number, element: Element, gauge: CircularGauge): void; | ||
/** | ||
* Method to render the axis line of the circular gauge. | ||
* @return {void} | ||
* @private | ||
*/ | ||
drawAxisLine(axis: Axis, index: number, element: Element, gauge: CircularGauge): void; | ||
/** | ||
* Method to render the axis labels of the circular gauge. | ||
* @return {void} | ||
* @private | ||
*/ | ||
drawAxisLabels(axis: Axis, index: number, element: Element, gauge: CircularGauge): void; | ||
/** | ||
* Method to find the anchor of the axis label. | ||
* @private | ||
*/ | ||
private findAnchor(location, style, angle, label); | ||
/** | ||
* Method to render the axis minor tick lines of the circular gauge. | ||
* @return {void} | ||
* @private | ||
*/ | ||
drawMinorTickLines(axis: Axis, index: number, element: Element, gauge: CircularGauge): void; | ||
/** | ||
* Method to render the axis major tick lines of the circular gauge. | ||
* @return {void} | ||
* @private | ||
*/ | ||
drawMajorTickLines(axis: Axis, index: number, element: Element, gauge: CircularGauge): void; | ||
/** | ||
* Method to calcualte the tick elements for the circular gauge. | ||
* @return {void} | ||
* @private | ||
*/ | ||
calculateTicks(value: number, options: Tick, axis: Axis): string; | ||
/** | ||
* Method to render the axis range of the circular gauge. | ||
* @return {void} | ||
* @private | ||
*/ | ||
drawAxisRange(axis: Axis, index: number, element: Element, gauge: CircularGauge): void; | ||
/** | ||
* Measure the range radius. | ||
* Method to calculate the radius of the axis range. | ||
* @return {void} | ||
*/ | ||
private calculateRangeRadius(axis, range); | ||
/** | ||
* Method to get the range color of the circular gauge. | ||
* @return {void} | ||
* @private | ||
*/ | ||
private calculateRangeRadius(axis, range); | ||
setRangeColor(axis: Axis): void; | ||
} |
@@ -8,18 +8,47 @@ import { CircularGauge } from '../circular-gauge'; | ||
private gauge; | ||
/** | ||
* Constructor for pointer renderer. | ||
* @private. | ||
*/ | ||
constructor(gauge: CircularGauge); | ||
/** | ||
* Method to render the axis pointers of the circular gauge. | ||
* @return {void} | ||
* @private | ||
*/ | ||
drawPointers(axis: Axis, axisIndex: number, element: Element, gauge: CircularGauge): void; | ||
/** | ||
* Measure the pointer length. | ||
* Measure the pointer length of the circular gauge. | ||
* @return {void} | ||
*/ | ||
private calculatePointerRadius(axis, pointer); | ||
/** | ||
* Method to render the needle pointer of the ciruclar gauge. | ||
* @return {void} | ||
*/ | ||
private drawNeedlePointer(axis, axisIndex, index, parentElement, gauge); | ||
/** | ||
* Method to set the pointer value of the circular gauge. | ||
* @return {void} | ||
* @private | ||
*/ | ||
private calculatePointerRadius(axis, pointer); | ||
drawNeedlePointer(axis: Axis, axisIndex: number, index: number, parentElement: Element, gauge: CircularGauge): void; | ||
setPointerValue(axis: Axis, pointer: Pointer, value: number): void; | ||
drawMarkerPointer(axis: Axis, axisIndex: number, index: number, parentElement: Element, gauge: CircularGauge): void; | ||
drawRangeBarPointer(axis: Axis, axisIndex: number, index: number, parentElement: Element, gauge: CircularGauge): void; | ||
doPointerAnimation(pointer: Pointer, axis: Axis): void; | ||
/** | ||
* To do the pointer animation. | ||
* Method to render the marker pointer of the ciruclar gauge. | ||
* @return {void} | ||
*/ | ||
private drawMarkerPointer(axis, axisIndex, index, parentElement, gauge); | ||
/** | ||
* Method to render the range bar pointer of the ciruclar gauge. | ||
* @return {void} | ||
*/ | ||
private drawRangeBarPointer(axis, axisIndex, index, parentElement, gauge); | ||
/** | ||
* Method to perform the animation of the pointer in circular gauge. | ||
* @return {void} | ||
*/ | ||
private doPointerAnimation(pointer, axis); | ||
/** | ||
* Perform the needle and marker pointer animation for circular gauge. | ||
* @return {void} | ||
* @private | ||
@@ -29,3 +58,3 @@ */ | ||
/** | ||
* To do the pointer animation. | ||
* Perform the range bar pointer animation for circular gauge. | ||
* @return {void} | ||
@@ -32,0 +61,0 @@ * @private |
@@ -216,44 +216,17 @@ /** | ||
/** | ||
* Initialize the event handler. | ||
* To create svg object, renderer and binding events for the container. | ||
*/ | ||
protected preRender(): void; | ||
private initPrivateVariable(); | ||
/** | ||
* Methods to create svg element | ||
* To render the circular gauge elements | ||
*/ | ||
private createSvg(); | ||
/** | ||
* Method to set culture for gauge | ||
*/ | ||
private setCulture(); | ||
/** | ||
* Method to calculate the size of the gauge | ||
*/ | ||
private calculateSvgSize(); | ||
/** | ||
* To Initialize the control rendering | ||
*/ | ||
protected render(): void; | ||
/** | ||
* Method to render the gauge elements | ||
* Method to unbind events for circular gauge | ||
*/ | ||
private renderElements(); | ||
private renderTitle(); | ||
private renderBorder(); | ||
setPointerValue(axisIndex: number, pointerIndex: number, value: number): void; | ||
setAnnotationValue(axisIndex: number, annotationIndex: number, content: string): void; | ||
setRangeValue(axisIndex: number, rangeIndex: number, start: number, end: number): void; | ||
/** | ||
* To destroy the widget | ||
* @method destroy | ||
* @return {void} | ||
* @member of Circular-Gauge | ||
*/ | ||
private calculateBounds(); | ||
private unWireEvents(); | ||
/** | ||
* Method to bind the gauge events | ||
* Method to bind events for circular gauge | ||
*/ | ||
private wireEvents(); | ||
private setStyle(element); | ||
/** | ||
@@ -271,8 +244,12 @@ * Handles the mouse move. | ||
mouseLeave(e: PointerEvent): boolean; | ||
gaugeRightClick(event: MouseEvent | PointerEvent): boolean; | ||
/** | ||
* Handles the mouse move on gauge. | ||
* Handles the mouse right click. | ||
* @return {boolean} | ||
* @private | ||
*/ | ||
gaugeRightClick(event: MouseEvent | PointerEvent): boolean; | ||
/** | ||
* Handles the pointer draf while mouse move on gauge. | ||
* @private | ||
*/ | ||
pointerDrag(location: GaugeLocation): void; | ||
@@ -286,3 +263,3 @@ /** | ||
/** | ||
* Handles the mouse up. | ||
* Handles the mouse end. | ||
* @return {boolean} | ||
@@ -304,2 +281,63 @@ * @private | ||
gaugeResize(e: Event): boolean; | ||
/** | ||
* Applying styles for circular gauge elements | ||
*/ | ||
private setGaugeStyle(element); | ||
/** | ||
* Method to set culture for gauge | ||
*/ | ||
private setCulture(); | ||
/** | ||
* Methods to create svg element for circular gauge. | ||
*/ | ||
private createSvg(); | ||
/** | ||
* To Remove the SVG from circular gauge. | ||
* @return {boolean} | ||
* @private | ||
*/ | ||
removeSvg(): void; | ||
/** | ||
* To initialize the circular gauge private variable. | ||
* @private | ||
*/ | ||
private initPrivateVariable(); | ||
/** | ||
* To calculate the size of the circular gauge element. | ||
*/ | ||
private calculateSvgSize(); | ||
/** | ||
* Method to calculate the availble size for circular gauge. | ||
*/ | ||
private calculateBounds(); | ||
/** | ||
* To render elements for circular gauge | ||
*/ | ||
private renderElements(); | ||
/** | ||
* Method to render the title for circular gauge. | ||
*/ | ||
private renderTitle(); | ||
/** | ||
* Method to render the border for circular gauge. | ||
*/ | ||
private renderBorder(); | ||
/** | ||
* Method to set the pointer value dynamically for circular gauge. | ||
*/ | ||
setPointerValue(axisIndex: number, pointerIndex: number, value: number): void; | ||
/** | ||
* Method to set the annotation content dynamically for circular gauge. | ||
*/ | ||
setAnnotationValue(axisIndex: number, annotationIndex: number, content: string): void; | ||
/** | ||
* Method to set the range values dynamically for circular gauge. | ||
*/ | ||
setRangeValue(axisIndex: number, rangeIndex: number, start: number, end: number): void; | ||
/** | ||
* To destroy the widget | ||
* @method destroy | ||
* @return {void} | ||
* @member of Circular-Gauge | ||
*/ | ||
destroy(): void; | ||
@@ -313,8 +351,2 @@ /** | ||
/** | ||
* To Remove the SVG. | ||
* @return {boolean} | ||
* @private | ||
*/ | ||
removeSvg(): void; | ||
/** | ||
* Get the properties to be maintained in the persisted state. | ||
@@ -330,3 +362,3 @@ * @private | ||
/** | ||
* Get component name | ||
* Get component name for circular gauge | ||
* @private | ||
@@ -333,0 +365,0 @@ */ |
@@ -33,26 +33,2 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
CircularGauge.prototype.initPrivateVariable = function () { | ||
this.renderer = new ej2_base_2.SvgRenderer(this.element.id); | ||
this.gaugeAxisLayoutPanel = new axis_panel_1.AxisLayoutPanel(this); | ||
this.animatePointer = true; | ||
}; | ||
CircularGauge.prototype.createSvg = function () { | ||
this.removeSvg(); | ||
this.calculateSvgSize(); | ||
this.svgObject = this.renderer.createSvg({ | ||
id: this.element.id + '_svg', | ||
width: this.availableSize.width, | ||
height: this.availableSize.height | ||
}); | ||
}; | ||
CircularGauge.prototype.setCulture = function () { | ||
this.intl = new ej2_base_2.Internationalization(); | ||
}; | ||
CircularGauge.prototype.calculateSvgSize = function () { | ||
var containerWidth = this.element.offsetWidth; | ||
var containerHeight = this.element.offsetHeight; | ||
var width = helper_2.stringToNumber(this.width, containerWidth) || containerWidth || 600; | ||
var height = helper_2.stringToNumber(this.height, containerHeight) || containerHeight || 450; | ||
this.availableSize = new helper_2.Size(width, height); | ||
}; | ||
CircularGauge.prototype.render = function () { | ||
@@ -62,122 +38,2 @@ this.calculateBounds(); | ||
}; | ||
CircularGauge.prototype.renderElements = function () { | ||
this.renderBorder(); | ||
this.renderTitle(); | ||
this.gaugeAxisLayoutPanel.renderAxes(); | ||
this.element.appendChild(this.svgObject); | ||
this.trigger(constants_1.loaded, { gauge: this }); | ||
}; | ||
CircularGauge.prototype.renderTitle = function () { | ||
if (this.title) { | ||
var size = helper_2.measureText(this.title, this.titleStyle); | ||
var options = new helper_1.TextOption(this.element.id + '_CircularGaugeTitle', this.availableSize.width / 2, this.margin.top + 3 * (size.height / 4), 'middle', this.title); | ||
var element = helper_1.textElement(options, this.titleStyle, this.titleStyle.color, this.svgObject, ''); | ||
element.setAttribute('aria-label', this.description || this.title); | ||
element.setAttribute('tabindex', this.tabIndex.toString()); | ||
} | ||
}; | ||
CircularGauge.prototype.renderBorder = function () { | ||
var borderWidth = this.border.width; | ||
if (borderWidth > 0 || (this.background !== null && this.background !== 'transparent')) { | ||
this.svgObject.appendChild(this.renderer.drawRectangle(new helper_1.RectOption(this.element.id + '_CircularGaugeBorder', this.background, this.border, null, new helper_2.Rect(borderWidth / 2, borderWidth / 2, this.availableSize.width - borderWidth, this.availableSize.height - borderWidth)))); | ||
} | ||
}; | ||
CircularGauge.prototype.setPointerValue = function (axisIndex, pointerIndex, value) { | ||
var _this = this; | ||
var axis = this.axes[axisIndex]; | ||
var pointer = axis.pointers[pointerIndex]; | ||
var pointerRadius = pointer.currentRadius; | ||
var enableAnimation = pointer.animation.enable; | ||
value = value < axis.visibleRange.min ? axis.visibleRange.min : value; | ||
value = value > axis.visibleRange.max ? axis.visibleRange.max : value; | ||
pointer.pathElement.map(function (element) { | ||
if (pointer.type === 'RangeBar') { | ||
helper_2.setStyles(element, pointer.color, pointer.border); | ||
if (enableAnimation) { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.performRangeBarAnimation(element, pointer.currentValue, value, axis, pointer, pointerRadius, (pointerRadius - pointer.pointerWidth)); | ||
} | ||
else { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(axis, pointer, value); | ||
} | ||
} | ||
else { | ||
if (element.id.indexOf('_Pointer_NeedleCap_') >= 0) { | ||
helper_2.setStyles(element, pointer.cap.color, pointer.cap.border); | ||
} | ||
else if (element.id.indexOf('_Pointer_NeedleTail_') >= 0) { | ||
helper_2.setStyles(element, pointer.needleTail.color, pointer.needleTail.border); | ||
} | ||
else if (element.id.indexOf('_Pointer_NeedleRect_') >= 0) { | ||
helper_2.setStyles(element, 'transparent', { color: 'transparent', width: 0 }); | ||
} | ||
else { | ||
helper_2.setStyles(element, pointer.color, pointer.border); | ||
} | ||
if (enableAnimation) { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.performNeedleAnimation(element, pointer.currentValue, value, axis, pointer, pointerRadius, (pointerRadius - pointer.pointerWidth)); | ||
} | ||
else { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(axis, pointer, value); | ||
} | ||
} | ||
}); | ||
pointer.currentValue = value; | ||
pointer.value = value; | ||
}; | ||
CircularGauge.prototype.setAnnotationValue = function (axisIndex, annotationIndex, content) { | ||
var isElementExist = helper_2.getElement(this.element.id + '_Annotations_' + axisIndex) !== null; | ||
var element = helper_2.getElement(this.element.id + '_Annotations_' + axisIndex) || | ||
ej2_base_3.createElement('div', { | ||
id: this.element.id + '_Annotations_' + axisIndex | ||
}); | ||
var annotation = this.axes[axisIndex].annotations[annotationIndex]; | ||
if (content !== null) { | ||
helper_1.removeElement(this.element.id + '_Axis_' + axisIndex + '_Annotation_' + annotationIndex); | ||
annotation.content = content; | ||
this.annotationsModule.createTemplate(element, annotationIndex, axisIndex); | ||
if (!isElementExist) { | ||
helper_2.getElement(this.element.id + '_Secondary_Element').appendChild(element); | ||
} | ||
} | ||
}; | ||
CircularGauge.prototype.setRangeValue = function (axisIndex, rangeIndex, start, end) { | ||
var element = helper_2.getElement(this.element.id + '_Axis_' + axisIndex + '_Range_' + rangeIndex); | ||
var axis = this.axes[axisIndex]; | ||
var range = axis.ranges[rangeIndex]; | ||
var axisRange = axis.visibleRange; | ||
var isClockWise = axis.direction === 'ClockWise'; | ||
var startValue = Math.min(Math.max(start, axisRange.min), end); | ||
var endValue = Math.min(Math.max(start, end), axisRange.max); | ||
var startAngle = helper_3.getAngleFromValue(startValue, axisRange.max, axisRange.min, axis.startAngle, axis.endAngle, isClockWise); | ||
var endAngle = helper_3.getAngleFromValue(endValue, axisRange.max, axisRange.min, axis.startAngle, axis.endAngle, isClockWise); | ||
var startWidth = range.startWidth; | ||
var endWidth = range.endWidth; | ||
endAngle = isClockWise ? endAngle : [startAngle, startAngle = endAngle][0]; | ||
endWidth = isClockWise ? endWidth : [startWidth, startWidth = endWidth][0]; | ||
element.setAttribute('d', helper_3.getPathArc(this.midPoint, Math.round(startAngle), Math.round(endAngle), range.currentRadius, startWidth, endWidth)); | ||
helper_2.setStyles(element, (range.color ? range.color : range.rangeColor), { | ||
color: (range.color ? range.color : range.rangeColor), | ||
width: 0 | ||
}); | ||
}; | ||
CircularGauge.prototype.calculateBounds = function () { | ||
var padding = 5; | ||
var margin = this.margin; | ||
var titleHeight = 0; | ||
if (this.title) { | ||
titleHeight = helper_2.measureText(this.title, this.titleStyle).height + padding; | ||
} | ||
var top = margin.top + titleHeight + this.border.width; | ||
var left = margin.left + this.border.width; | ||
var width = this.availableSize.width - left - margin.right - this.border.width; | ||
var height = this.availableSize.height - top - this.border.width - margin.bottom; | ||
var radius = Math.min(width, height) / 2; | ||
var rect = new helper_2.Rect((left + (width / 2) - radius), (top + (height / 2) - radius), radius * 2, radius * 2); | ||
var centerX = this.centerX !== null ? | ||
helper_2.stringToNumber(this.centerX, this.availableSize.width) : rect.x + (rect.width / 2); | ||
var centerY = this.centerY !== null ? | ||
helper_2.stringToNumber(this.centerY, this.availableSize.height) : rect.y + (rect.height / 2); | ||
this.midPoint = new helper_2.GaugeLocation(centerX, centerY); | ||
this.gaugeAxisLayoutPanel.measureAxis(rect); | ||
}; | ||
CircularGauge.prototype.unWireEvents = function () { | ||
@@ -189,3 +45,3 @@ ej2_base_2.EventHandler.remove(this.element, ej2_base_1.Browser.touchStartEvent, this.gaugeOnMouseDown); | ||
ej2_base_2.EventHandler.remove(this.element, (ej2_base_1.Browser.isPointer ? 'pointerleave' : 'mouseleave'), this.mouseLeave); | ||
ej2_base_2.EventHandler.remove(window, (ej2_base_1.Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.gaugeResize.bind(this)); | ||
window.removeEventListener((ej2_base_1.Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.gaugeResize); | ||
}; | ||
@@ -198,13 +54,5 @@ CircularGauge.prototype.wireEvents = function () { | ||
ej2_base_2.EventHandler.add(this.element, (ej2_base_1.Browser.isPointer ? 'pointerleave' : 'mouseleave'), this.mouseLeave, this); | ||
ej2_base_2.EventHandler.add(window, (ej2_base_1.Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.gaugeResize, this); | ||
this.setStyle(this.element); | ||
window.addEventListener((ej2_base_1.Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.gaugeResize.bind(this)); | ||
this.setGaugeStyle(this.element); | ||
}; | ||
CircularGauge.prototype.setStyle = function (element) { | ||
element.style.touchAction = this.enablePointerDrag ? 'none' : 'element'; | ||
element.style.msTouchAction = this.enablePointerDrag ? 'none' : 'element'; | ||
element.style.msContentZooming = 'none'; | ||
element.style.msUserSelect = 'none'; | ||
element.style.webkitUserSelect = 'none'; | ||
element.style.position = 'relative'; | ||
}; | ||
CircularGauge.prototype.mouseMove = function (e) { | ||
@@ -349,2 +197,165 @@ var args = this.getMouseArgs(e, 'touchmove', constants_1.gaugeMouseMove); | ||
}; | ||
CircularGauge.prototype.setGaugeStyle = function (element) { | ||
element.style.touchAction = this.enablePointerDrag ? 'none' : 'element'; | ||
element.style.msTouchAction = this.enablePointerDrag ? 'none' : 'element'; | ||
element.style.msContentZooming = 'none'; | ||
element.style.msUserSelect = 'none'; | ||
element.style.webkitUserSelect = 'none'; | ||
element.style.position = 'relative'; | ||
}; | ||
CircularGauge.prototype.setCulture = function () { | ||
this.intl = new ej2_base_2.Internationalization(); | ||
}; | ||
CircularGauge.prototype.createSvg = function () { | ||
this.removeSvg(); | ||
this.calculateSvgSize(); | ||
this.svgObject = this.renderer.createSvg({ | ||
id: this.element.id + '_svg', | ||
width: this.availableSize.width, | ||
height: this.availableSize.height | ||
}); | ||
}; | ||
CircularGauge.prototype.removeSvg = function () { | ||
helper_1.removeElement(this.element.id + '_Secondary_Element'); | ||
if (this.svgObject) { | ||
while (this.svgObject.childNodes.length > 0) { | ||
this.svgObject.removeChild(this.svgObject.firstChild); | ||
} | ||
if (!this.svgObject.hasChildNodes() && this.svgObject.parentNode) { | ||
ej2_base_3.remove(this.svgObject); | ||
} | ||
} | ||
}; | ||
CircularGauge.prototype.initPrivateVariable = function () { | ||
this.renderer = new ej2_base_2.SvgRenderer(this.element.id); | ||
this.gaugeAxisLayoutPanel = new axis_panel_1.AxisLayoutPanel(this); | ||
this.animatePointer = true; | ||
}; | ||
CircularGauge.prototype.calculateSvgSize = function () { | ||
var containerWidth = this.element.offsetWidth; | ||
var containerHeight = this.element.offsetHeight; | ||
var width = helper_2.stringToNumber(this.width, containerWidth) || containerWidth || 600; | ||
var height = helper_2.stringToNumber(this.height, containerHeight) || containerHeight || 450; | ||
this.availableSize = new helper_2.Size(width, height); | ||
}; | ||
CircularGauge.prototype.calculateBounds = function () { | ||
var padding = 5; | ||
var margin = this.margin; | ||
var titleHeight = 0; | ||
if (this.title) { | ||
titleHeight = helper_2.measureText(this.title, this.titleStyle).height + padding; | ||
} | ||
var top = margin.top + titleHeight + this.border.width; | ||
var left = margin.left + this.border.width; | ||
var width = this.availableSize.width - left - margin.right - this.border.width; | ||
var height = this.availableSize.height - top - this.border.width - margin.bottom; | ||
var radius = Math.min(width, height) / 2; | ||
var rect = new helper_2.Rect((left + (width / 2) - radius), (top + (height / 2) - radius), radius * 2, radius * 2); | ||
var centerX = this.centerX !== null ? | ||
helper_2.stringToNumber(this.centerX, this.availableSize.width) : rect.x + (rect.width / 2); | ||
var centerY = this.centerY !== null ? | ||
helper_2.stringToNumber(this.centerY, this.availableSize.height) : rect.y + (rect.height / 2); | ||
this.midPoint = new helper_2.GaugeLocation(centerX, centerY); | ||
this.gaugeAxisLayoutPanel.measureAxis(rect); | ||
}; | ||
CircularGauge.prototype.renderElements = function () { | ||
this.renderBorder(); | ||
this.renderTitle(); | ||
this.gaugeAxisLayoutPanel.renderAxes(); | ||
this.element.appendChild(this.svgObject); | ||
this.trigger(constants_1.loaded, { gauge: this }); | ||
}; | ||
CircularGauge.prototype.renderTitle = function () { | ||
if (this.title) { | ||
var size = helper_2.measureText(this.title, this.titleStyle); | ||
var options = new helper_1.TextOption(this.element.id + '_CircularGaugeTitle', this.availableSize.width / 2, this.margin.top + 3 * (size.height / 4), 'middle', this.title); | ||
var element = helper_1.textElement(options, this.titleStyle, this.titleStyle.color, this.svgObject, ''); | ||
element.setAttribute('aria-label', this.description || this.title); | ||
element.setAttribute('tabindex', this.tabIndex.toString()); | ||
} | ||
}; | ||
CircularGauge.prototype.renderBorder = function () { | ||
var borderWidth = this.border.width; | ||
if (borderWidth > 0 || (this.background !== null && this.background !== 'transparent')) { | ||
this.svgObject.appendChild(this.renderer.drawRectangle(new helper_1.RectOption(this.element.id + '_CircularGaugeBorder', this.background, this.border, null, new helper_2.Rect(borderWidth / 2, borderWidth / 2, this.availableSize.width - borderWidth, this.availableSize.height - borderWidth)))); | ||
} | ||
}; | ||
CircularGauge.prototype.setPointerValue = function (axisIndex, pointerIndex, value) { | ||
var _this = this; | ||
var axis = this.axes[axisIndex]; | ||
var pointer = axis.pointers[pointerIndex]; | ||
var pointerRadius = pointer.currentRadius; | ||
var enableAnimation = pointer.animation.enable; | ||
value = value < axis.visibleRange.min ? axis.visibleRange.min : value; | ||
value = value > axis.visibleRange.max ? axis.visibleRange.max : value; | ||
pointer.pathElement.map(function (element) { | ||
if (pointer.type === 'RangeBar') { | ||
helper_2.setStyles(element, pointer.color, pointer.border); | ||
if (enableAnimation) { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.performRangeBarAnimation(element, pointer.currentValue, value, axis, pointer, pointerRadius, (pointerRadius - pointer.pointerWidth)); | ||
} | ||
else { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(axis, pointer, value); | ||
} | ||
} | ||
else { | ||
if (element.id.indexOf('_Pointer_NeedleCap_') >= 0) { | ||
helper_2.setStyles(element, pointer.cap.color, pointer.cap.border); | ||
} | ||
else if (element.id.indexOf('_Pointer_NeedleTail_') >= 0) { | ||
helper_2.setStyles(element, pointer.needleTail.color, pointer.needleTail.border); | ||
} | ||
else if (element.id.indexOf('_Pointer_NeedleRect_') >= 0) { | ||
helper_2.setStyles(element, 'transparent', { color: 'transparent', width: 0 }); | ||
} | ||
else { | ||
helper_2.setStyles(element, pointer.color, pointer.border); | ||
} | ||
if (enableAnimation) { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.performNeedleAnimation(element, pointer.currentValue, value, axis, pointer, pointerRadius, (pointerRadius - pointer.pointerWidth)); | ||
} | ||
else { | ||
_this.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(axis, pointer, value); | ||
} | ||
} | ||
}); | ||
pointer.currentValue = value; | ||
pointer.value = value; | ||
}; | ||
CircularGauge.prototype.setAnnotationValue = function (axisIndex, annotationIndex, content) { | ||
var isElementExist = helper_2.getElement(this.element.id + '_Annotations_' + axisIndex) !== null; | ||
var element = helper_2.getElement(this.element.id + '_Annotations_' + axisIndex) || | ||
ej2_base_3.createElement('div', { | ||
id: this.element.id + '_Annotations_' + axisIndex | ||
}); | ||
var annotation = this.axes[axisIndex].annotations[annotationIndex]; | ||
if (content !== null) { | ||
helper_1.removeElement(this.element.id + '_Axis_' + axisIndex + '_Annotation_' + annotationIndex); | ||
annotation.content = content; | ||
this.annotationsModule.createTemplate(element, annotationIndex, axisIndex); | ||
if (!isElementExist) { | ||
helper_2.getElement(this.element.id + '_Secondary_Element').appendChild(element); | ||
} | ||
} | ||
}; | ||
CircularGauge.prototype.setRangeValue = function (axisIndex, rangeIndex, start, end) { | ||
var element = helper_2.getElement(this.element.id + '_Axis_' + axisIndex + '_Range_' + rangeIndex); | ||
var axis = this.axes[axisIndex]; | ||
var range = axis.ranges[rangeIndex]; | ||
var axisRange = axis.visibleRange; | ||
var isClockWise = axis.direction === 'ClockWise'; | ||
var startValue = Math.min(Math.max(start, axisRange.min), end); | ||
var endValue = Math.min(Math.max(start, end), axisRange.max); | ||
var startAngle = helper_3.getAngleFromValue(startValue, axisRange.max, axisRange.min, axis.startAngle, axis.endAngle, isClockWise); | ||
var endAngle = helper_3.getAngleFromValue(endValue, axisRange.max, axisRange.min, axis.startAngle, axis.endAngle, isClockWise); | ||
var startWidth = range.startWidth; | ||
var endWidth = range.endWidth; | ||
endAngle = isClockWise ? endAngle : [startAngle, startAngle = endAngle][0]; | ||
endWidth = isClockWise ? endWidth : [startWidth, startWidth = endWidth][0]; | ||
element.setAttribute('d', helper_3.getPathArc(this.midPoint, Math.round(startAngle), Math.round(endAngle), range.currentRadius, startWidth, endWidth)); | ||
helper_2.setStyles(element, (range.color ? range.color : range.rangeColor), { | ||
color: (range.color ? range.color : range.rangeColor), | ||
width: 0 | ||
}); | ||
}; | ||
CircularGauge.prototype.destroy = function () { | ||
@@ -378,13 +389,2 @@ this.unWireEvents(); | ||
}; | ||
CircularGauge.prototype.removeSvg = function () { | ||
helper_1.removeElement(this.element.id + '_Secondary_Element'); | ||
if (this.svgObject) { | ||
while (this.svgObject.childNodes.length > 0) { | ||
this.svgObject.removeChild(this.svgObject.firstChild); | ||
} | ||
if (!this.svgObject.hasChildNodes() && this.svgObject.parentNode) { | ||
ej2_base_3.remove(this.svgObject); | ||
} | ||
} | ||
}; | ||
CircularGauge.prototype.getPersistData = function () { | ||
@@ -391,0 +391,0 @@ return this.addOnPersist([]); |
@@ -13,5 +13,11 @@ import { CircularGauge } from '../circular-gauge'; | ||
} | ||
/** | ||
* Specifies Loaded event arguments for circular gauge. | ||
*/ | ||
export interface ILoadedEventArgs extends ICircularGaugeEventArgs { | ||
gauge: CircularGauge; | ||
} | ||
/** | ||
* Specifies AnimationComplete event arguments for circular gauge. | ||
*/ | ||
export interface IAnimationCompleteEventArgs extends ICircularGaugeEventArgs { | ||
@@ -21,2 +27,5 @@ axis: Axis; | ||
} | ||
/** | ||
* Specifies AxisLabelRender event arguments for circular gauge. | ||
*/ | ||
export interface IAxisLabelRenderEventArgs extends ICircularGaugeEventArgs { | ||
@@ -27,2 +36,5 @@ axis: Axis; | ||
} | ||
/** | ||
* Specifies TooltipRender event arguments for circular gauge. | ||
*/ | ||
export interface ITooltipRenderEventArgs extends ICircularGaugeEventArgs { | ||
@@ -35,2 +47,5 @@ content?: string | HTMLElement; | ||
} | ||
/** | ||
* Specifies AnnotationRender event arguments for circular gauge. | ||
*/ | ||
export interface IAnnotationRenderEventArgs extends ICircularGaugeEventArgs { | ||
@@ -42,2 +57,5 @@ content?: string; | ||
} | ||
/** | ||
* Specifies DragStart, DragMove and DragEnd events arguments for circular gauge. | ||
*/ | ||
export interface IPointerDragEventArgs { | ||
@@ -50,2 +68,5 @@ name: string; | ||
} | ||
/** | ||
* Specifies Resize event arguments for circular gauge. | ||
*/ | ||
export interface IResizeEventArgs { | ||
@@ -57,2 +78,5 @@ name: string; | ||
} | ||
/** | ||
* Specifies Mouse events arguments for circular gauge. | ||
*/ | ||
export interface IMouseEventArgs extends ICircularGaugeEventArgs { | ||
@@ -59,0 +83,0 @@ target: Element; |
@@ -15,7 +15,26 @@ import { CircularGauge } from '../circular-gauge'; | ||
ejTooltip: Tooltip; | ||
/** | ||
* Constructor for Tooltip module. | ||
* @private. | ||
*/ | ||
constructor(gauge: CircularGauge); | ||
/** | ||
* Method to render the tooltip for circular gauge. | ||
*/ | ||
renderTooltip(target: Element): void; | ||
/** | ||
* Method to append the target element for tooltip | ||
*/ | ||
private appendTargetElement(angle); | ||
/** | ||
* Method to find the position of the tooltip anchor for circular gauge. | ||
*/ | ||
private findPosition(angle); | ||
/** | ||
* Method to perform the tooltip for circular gauge. | ||
*/ | ||
private onBeforeRender(args); | ||
/** | ||
* Method to customize the tooltip elements for circular gauge. | ||
*/ | ||
private tooltipCustomization(args); | ||
@@ -22,0 +41,0 @@ /** |
@@ -10,19 +10,49 @@ import { CircularGauge } from '../circular-gauge'; | ||
* @param {string} id | ||
* @returns no | ||
* @returns Size | ||
* @private | ||
*/ | ||
export declare function measureText(text: string, font: FontModel): Size; | ||
/** | ||
* Function to get the style from FontModel. | ||
* @returns string | ||
* @private | ||
*/ | ||
export declare function getFontStyle(font: FontModel): string; | ||
/** | ||
* Function to set style to the element. | ||
* @private | ||
*/ | ||
export declare function setStyles(element: HTMLElement, fill: string, border: BorderModel): void; | ||
/** | ||
* Function to measure the element rect. | ||
* @returns ClientRect | ||
* @private | ||
*/ | ||
export declare function measureElementRect(element: HTMLElement): ClientRect; | ||
/** @private */ | ||
/** | ||
* Function to convert the number from string. | ||
* @returns number | ||
* @private | ||
*/ | ||
export declare function stringToNumber(value: string, containerSize: number): number; | ||
/** @private */ | ||
/** | ||
* Function to create the text element. | ||
* @returns Element | ||
* @private | ||
*/ | ||
export declare function textElement(options: TextOption, font: FontModel, color: string, parent: HTMLElement | Element, styles?: string): Element; | ||
/** @private */ | ||
/** | ||
* Function to append the path to the element. | ||
* @returns Element | ||
* @private | ||
*/ | ||
export declare function appendPath(options: PathOption, element: Element, gauge: CircularGauge, functionName?: string): Element; | ||
/** @private */ | ||
/** | ||
* Function to calculate the sum of array values. | ||
* @returns number | ||
* @private | ||
*/ | ||
export declare function calculateSum(from: number, to: number, values: number[]): number; | ||
/** | ||
* Animation Effect Calculation Started Here | ||
* Function to calculate the value for linear animation effect | ||
* @param currentTime | ||
@@ -34,38 +64,109 @@ * @param startValue | ||
*/ | ||
/** @private */ | ||
export declare function linear(currentTime: number, startValue: number, endValue: number, duration: number): number; | ||
/** @private */ | ||
/** | ||
* Function to get the angle from value for circular gauge. | ||
* @returns number | ||
* @private | ||
*/ | ||
export declare function getAngleFromValue(value: number, maximumValue: number, minimumValue: number, startAngle: number, endAngle: number, isClockWise: boolean): number; | ||
/** | ||
* Function to get the degree for circular gauge. | ||
* @returns number | ||
* @private | ||
*/ | ||
export declare function getDegree(startAngle: number, endAngle: number): number; | ||
/** @private */ | ||
/** | ||
* Function to get the value from angle for circular gauge. | ||
* @returns number | ||
* @private | ||
*/ | ||
export declare function getValueFromAngle(angle: number, maximumValue: number, minimumValue: number, startAngle: number, endAngle: number, isClockWise: boolean): number; | ||
/** @private */ | ||
/** | ||
* Function to check whether it's a complete circle for circular gauge. | ||
* @returns boolean | ||
* @private | ||
*/ | ||
export declare function isCompleteAngle(startAngle: number, endAngle: number): boolean; | ||
/** @private */ | ||
/** | ||
* Function to get angle from location for circular gauge. | ||
* @returns number | ||
* @private | ||
*/ | ||
export declare function getAngleFromLocation(center: GaugeLocation, point: GaugeLocation): number; | ||
/** @private */ | ||
/** | ||
* Function to get the location from angle for circular gauge. | ||
* @returns GaugeLocation | ||
* @private | ||
*/ | ||
export declare function getLocationFromAngle(degree: number, radius: number, center: GaugeLocation): GaugeLocation; | ||
/** @private */ | ||
/** | ||
* Function to get the path direction of the circular gauge. | ||
* @returns string | ||
* @private | ||
*/ | ||
export declare function getPathArc(center: GaugeLocation, start: number, end: number, radius: number, startWidth?: number, endWidth?: number): string; | ||
/** @private */ | ||
/** | ||
* Function to get the range path direction of the circular gauge. | ||
* @returns string | ||
* @private | ||
*/ | ||
export declare function getRangePath(start: GaugeLocation, end: GaugeLocation, innerStart: GaugeLocation, innerEnd: GaugeLocation, radius: number, startRadius: number, endRadius: number, clockWise: number): string; | ||
/** @private */ | ||
/** | ||
* Function to calculate the complete path arc of the circular gauge. | ||
* @returns string | ||
* @private | ||
*/ | ||
export declare function getCompleteArc(center: GaugeLocation, start: number, end: number, radius: number, innerRadius: number): string; | ||
/** @private */ | ||
/** | ||
* Function to get the circular path direction of the circular gauge. | ||
* @returns string | ||
* @private | ||
*/ | ||
export declare function getCirclePath(start: GaugeLocation, end: GaugeLocation, radius: number, clockWise: number): string; | ||
/** @private */ | ||
/** | ||
* Function to get the complete path direction of the circular gauge. | ||
* @returns string | ||
* @private | ||
*/ | ||
export declare function getCompletePath(center: GaugeLocation, start: GaugeLocation, end: GaugeLocation, radius: number, innerStart: GaugeLocation, innerEnd: GaugeLocation, innerRadius: number, clockWise: number): string; | ||
/** @private */ | ||
/** | ||
* Function to get element from id. | ||
* @returns Element | ||
* @private | ||
*/ | ||
export declare function getElement(id: string): Element; | ||
/** @private */ | ||
/** | ||
* Function to compile the template function for circular gauge. | ||
* @returns Function | ||
* @private | ||
*/ | ||
export declare function getTemplateFunction(template: string): Function; | ||
/** @private */ | ||
/** | ||
* Function to remove the element from id. | ||
* @private | ||
*/ | ||
export declare function removeElement(id: string): void; | ||
/** @private */ | ||
/** | ||
* Function to get current point for circular gauge using element id. | ||
* @returns IVisiblePointer | ||
* @private | ||
*/ | ||
export declare function getPointer(targetId: string, gauge: CircularGauge): IVisiblePointer; | ||
/** @private */ | ||
/** | ||
* Function to convert the label using formar for cirular gauge. | ||
* @returns string | ||
* @private | ||
*/ | ||
export declare function getLabelFormat(format: string): string; | ||
/** @private */ | ||
/** | ||
* Function to calculate the marker shape for circular gauge. | ||
* @returns PathOption | ||
* @private | ||
*/ | ||
export declare function calculateShapes(location: GaugeLocation, shape: string, size: Size, url: string, options: PathOption): PathOption; | ||
/** @private */ | ||
/** | ||
* Function to get range color from value for circular gauge. | ||
* @returns string | ||
* @private | ||
*/ | ||
export declare function getRangeColor(value: number, ranges: Range[], color: string): string; | ||
@@ -72,0 +173,0 @@ /** @private */ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3802493
73
32133
1
+ Added@syncfusion/ej2-base@15.4.23(transitive)
+ Added@syncfusion/ej2-buttons@15.4.30(transitive)
+ Added@syncfusion/ej2-popups@15.4.27(transitive)
- Removed@syncfusion/ej2-base@1.0.25(transitive)
- Removed@syncfusion/ej2-buttons@1.0.25(transitive)
- Removed@syncfusion/ej2-popups@1.0.22(transitive)