@grapecity/wijmo.chart.animation
Advanced tools
Comparing version
/*! | ||
* | ||
* Wijmo Library 5.20242.21 | ||
* Wijmo Library 5.20242.30 | ||
* https://developer.mescius.com/wijmo | ||
@@ -14,2 +14,2 @@ * | ||
"use strict";var __importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);e.default=t;return e};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_1=require("@grapecity/wijmo"),wijmo_chart_1=require("@grapecity/wijmo.chart"),selfModule=__importStar(require("@grapecity/wijmo.chart.animation"));function softFinancial(){return wijmo_1._getModule("wijmo.chart.finance")}exports.softFinancial=softFinancial;function softRadar(){return wijmo_1._getModule("wijmo.chart.radar")}exports.softRadar=softRadar;var Easing,AnimationMode;!function(t){t[t.Linear=0]="Linear";t[t.Swing=1]="Swing";t[t.EaseInQuad=2]="EaseInQuad";t[t.EaseOutQuad=3]="EaseOutQuad";t[t.EaseInOutQuad=4]="EaseInOutQuad";t[t.EaseInCubic=5]="EaseInCubic";t[t.EaseOutCubic=6]="EaseOutCubic";t[t.EaseInOutCubic=7]="EaseInOutCubic";t[t.EaseInQuart=8]="EaseInQuart";t[t.EaseOutQuart=9]="EaseOutQuart";t[t.EaseInOutQuart=10]="EaseInOutQuart";t[t.EaseInQuint=11]="EaseInQuint";t[t.EaseOutQuint=12]="EaseOutQuint";t[t.EaseInOutQuint=13]="EaseInOutQuint";t[t.EaseInSine=14]="EaseInSine";t[t.EaseOutSine=15]="EaseOutSine";t[t.EaseInOutSine=16]="EaseInOutSine";t[t.EaseInExpo=17]="EaseInExpo";t[t.EaseOutExpo=18]="EaseOutExpo";t[t.EaseInOutExpo=19]="EaseInOutExpo";t[t.EaseInCirc=20]="EaseInCirc";t[t.EaseOutCirc=21]="EaseOutCirc";t[t.EaseInOutCirc=22]="EaseInOutCirc";t[t.EaseInBack=23]="EaseInBack";t[t.EaseOutBack=24]="EaseOutBack";t[t.EaseInOutBack=25]="EaseInOutBack";t[t.EaseInBounce=26]="EaseInBounce";t[t.EaseOutBounce=27]="EaseOutBounce";t[t.EaseInOutBounce=28]="EaseInOutBounce";t[t.EaseInElastic=29]="EaseInElastic";t[t.EaseOutElastic=30]="EaseOutElastic";t[t.EaseInOutElastic=31]="EaseInOutElastic"}(Easing=exports.Easing||(exports.Easing={}));!function(t){t[t.All=0]="All";t[t.Point=1]="Point";t[t.Series=2]="Series"}(AnimationMode=exports.AnimationMode||(exports.AnimationMode={}));class ChartAnimation{constructor(t,e){this._play=!0;this.ended=new wijmo_1.Event;var i=this,a=t.hostElement,n=new wijmo_1.Size(a.offsetWidth,a.offsetHeight);i._chart=t;i._updateEventArgs=[];if(t instanceof wijmo_chart_1.FlexPie)i._animation=new FlexPieAnimation(t,i._updateEventArgs);else{softRadar()&&t instanceof softRadar().FlexRadar?i._animation=new FlexRadarAnimation(t,i._updateEventArgs):t instanceof wijmo_chart_1.FlexChartCore&&(i._animation=new FlexChartAnimation(t,i._updateEventArgs));i._chartType=t.chartType}wijmo_1.assert(void 0!==i._animation,"Animation is not supported");i._initOptions(e);t.beginUpdate();window.setTimeout(()=>{t.rendered.addHandler(i._playAnimation,i);t.endUpdate()},0);i._setCV(t.collectionView);window.addEventListener("resize",(function(t){var e=new wijmo_1.Size(a.offsetWidth,a.offsetHeight);if(!n.equals(e)){i._play=!1;n=e}}))}_initOptions(t){if(t){t.duration&&(this.duration=t.duration);t.easing&&(this.easing=t.easing);t.animationMode&&(this.animationMode=t.animationMode);void 0!==t.axisAnimation&&(this.axisAnimation=t.axisAnimation)}}_setCV(t){this._cv=t;this._animation._clearState()}get animationMode(){return this._animation.animationMode}set animationMode(t){(t=wijmo_1.asEnum(t,AnimationMode))!=this.animationMode&&(this._animation.animationMode=t)}get easing(){return this._animation.easing}set easing(t){(t=wijmo_1.asEnum(t,Easing))!=this.easing&&(this._animation.easing=t)}get duration(){return this._animation.duration}set duration(t){(t=wijmo_1.asNumber(t))!=this.duration&&(this._animation.duration=t)}get axisAnimation(){return this._animation.axisAnimation}set axisAnimation(t){(t=wijmo_1.asBoolean(t))!=this.axisAnimation&&(this._animation.axisAnimation=t)}get chart(){return this._chart}_playAnimation(){var t=this,e=t._chart,i=e.chartType;t._cv!==e.collectionView&&t._setCV(e.collectionView);if(null!=t._chartType&&t._chartType!==i){t._chartType=i;t._animation._clearState()}t._play?t._animation.playAnimation(()=>t.ended.raise(t,wijmo_1.EventArgs.empty)):t._play=!0}animate(){var t=this._chart;if(t){var e=t.itemsSource;t.beginUpdate();t.itemsSource=null;t.itemsSource=e;t.endUpdate()}}}exports.ChartAnimation=ChartAnimation;class FlexAnimation{constructor(t,e){this._axisAnimation=!0;this._chart=t;this._timers=[]}get animationMode(){return this._animationMode||AnimationMode.All}set animationMode(t){if((t=wijmo_1.asEnum(t,AnimationMode,!1))!==this._animationMode){this._clearState();this._animationMode=t}}get easing(){return null==this._easing?Easing.Swing:this._easing}set easing(t){t!==this._easing&&(this._easing=wijmo_1.asEnum(t,Easing,!1))}get duration(){return this._duration||400}set duration(t){t!==this._duration&&(this._duration=wijmo_1.asNumber(t,!1,!0))}get axisAnimation(){return!!this._axisAnimation}set axisAnimation(t){t!==this._axisAnimation&&(this._axisAnimation=wijmo_1.asBoolean(t,!1))}playAnimation(t){}_clearState(){this._previousState&&(this._previousState=null);this._currentState&&(this._currentState=null)}_setInitState(t,e,i){var a=AnimationHelper.parseAttrs(e,i);AnimationHelper.setElementAttr(t,a,0)}_getAnimation(t,e){t[e]||(t[e]=[]);return t[e]}_toggleVisibility(t,e){e?AnimationHelper.playAnimation(t,{opacity:0},{opacity:1},null,Easing.Swing,100):t.setAttribute("opacity","0")}_toggleDataLabelVisibility(t){var e=this._chart.hostElement,i=e&&e.querySelector(".wj-data-labels");i&&this._toggleVisibility(i,t)}_playAnimation(t,e){var i,a=this,n=a.duration,s=a.easing,r=t.length;a._toggleDataLabelVisibility(!1);i=a._getDurationAndDelay(t.length,n);if(this._timers&&this._timers.length){this._timers.forEach(t=>window.clearInterval(t));this._timers.length=0}t.forEach((t,n)=>{var o;if(t){o=window.setTimeout(()=>{var o;t.forEach((t,l)=>{if(t&&t.ele){if(n===r-1&&0===l){var h=t.done;t.done=function(){a._toggleDataLabelVisibility(!0);h&&h();e&&e()}}if(wijmo_1.isArray(t.ele)){o=AnimationHelper.playAnimations(t.ele,t.from,t.to,t.done,s,i.duration);this._timers=this._timers.concat.apply(o)}else{o=AnimationHelper.playAnimation(t.ele,t.from,t.to,t.done,s,i.duration);this._timers.push(o)}}})},i.delay*n);this._timers.push(o)}})}_getDurationAndDelay(t,e){var i={duration:e,delay:0};if(t>1)if(this._previousState){i.duration=e/t;i.delay=e/t}else{i.duration=.5*e;i.delay=.5*e/(t-1)}return i}}class FlexPieAnimation extends FlexAnimation{constructor(t,e){super(t,e);t.selectionChanged.addHandler(this._selectionChanged,this)}_selectionChanged(){this._isSelectionChanged=!0}_clearState(){super._clearState();this._isSelectionChanged=!1}_getElementRotate(t){var e,i=t.getAttribute("transform");if(i&&i.indexOf("rotate")>-1){if(1==(i=(i=i.replace("rotate(","").replace(")","")).indexOf(",")>-1?i.split(",").map(t=>+t):i.split(" ").map(t=>+t)).length){e=this._chart._areas[0].center;i.push(e.x,e.y)}}else i=[0,(e=this._chart._areas[0].center).x,e.y];return i}_getDurationAndDelay(t,e){var i={duration:e,delay:0};if(this.animationMode===AnimationMode.Point&&t>1){i.duration=e/t;i.delay=e/t}return i}playAnimation(t){super.playAnimation(t);var e=[];this._playPieAnimation(e);e.length&&this._playAnimation(e,t)}_playPieAnimation(t){var e=this._chart,i=!0;this._previousState=this._currentState;this._currentState={areas:e._areas,pels:e._pels,rotate:e._pels.length&&this._getElementRotate(e._pels[0].parentNode)};this._previousState&&(i=!1);if(this._isSelectionChanged){e.isAnimated||this._playSelectPieAnimation(t);this._isSelectionChanged=!1}else i?this._playLoadPieAnimation(t):this._playUpdatePieAnimation(t)}_playSelectPieAnimation(t){if(null!=this._previousState){var e,i,a,n=this._chart._pels[0].parentNode,s=this._previousState.rotate,r=this._getElementRotate(n),o=s[0],l=r[0];if(o!==l){o-l>180?r[0]+=360:l-o>180&&(s[0]+=360);e=this._getAnimation(t,0);i={rotate:s};a={rotate:r};this._setInitState(n,i,a);e.push({ele:n,from:i,to:a})}}}_playUpdatePieAnimation(t){var e,i,a,n,s=this._chart,r=this._previousState,o=s._areas,l=s._pels,h=r.areas.length,c=o.length,m=Math.max(c,h),u=this._getAnimation(t,0),_=0;if(0!==c&&0!==h){this._playSelectPieAnimation(t);for(e=0;e<m;e++){i={};if(l[e]&&l[e].childNodes&&l[e].childNodes.length>0){if(e<c&&e<h){a=o[0];0===e&&(_=a.angle);1===h?l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(a.center.x,a.center.y,a.radius,_,2*Math.PI,a.innerRadius||0)):l[e].childNodes[0].setAttribute("d",r.pels[e].childNodes[0].getAttribute("d"))}if(e<c){a=o[e];i.to={pie:[a.center.x,a.center.y,a.radius,a.angle,a.sweep,a.innerRadius||0]};i.ele=l[e].childNodes[0]}else{a=o[0];n=r.pels[e];i.to={pie:[a.center.x,a.center.y,a.radius,_+2*Math.PI,0,a.innerRadius||0]};l[0].parentNode.appendChild(n);i.done=function(t){return function(){t.parentNode.removeChild(t)}}(n);i.ele=n.childNodes[0]}if(e<h){a=r.areas[e];i.from={pie:[a.center.x,a.center.y,a.radius,a.angle,a.sweep,a.innerRadius||0]}}else{l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(a.center.x,a.center.y,a.radius,2*Math.PI+_,0,a.innerRadius||0));a=r.areas[0];i.from={pie:[a.center.x,a.center.y,a.radius,2*Math.PI+_,0,a.innerRadius||0]}}u.push(i)}}}}_playLoadPieAnimation(t){var e=this,i=e._chart,a=e.animationMode,n=i._areas;i._pels.forEach((i,s)=>{var r,o=i.childNodes[0],l={},h={};if(o){if(a===AnimationMode.Point){e._parsePathByAngle(n[s],l,h);r=e._getAnimation(t,s)}else{e._parsePathByRadius(n[s],l,h);r=e._getAnimation(t,0)}e._setInitState(o,l,h);r.push({ele:o,from:l,to:h})}})}_parsePathByRadius(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep;a=[s,r,0,l,h,0];n=[s,r,o,l,h,t.innerRadius||0];e.pie=a;i.pie=n}_parsePathByAngle(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep,c=t.innerRadius;a=[s,r,o,l,0,c||0];n=[s,r,o,l,h,c||0];e.pie=a;e["stroke-width"]=0;i.pie=n;i["stroke-width"]=1}}class FlexChartAnimation extends FlexAnimation{constructor(t,e){super(t,e)}playAnimation(t){super.playAnimation(t);var e,i,a,n,s,r,o,l,h,c=!0,m=this._chart,u=softFinancial()&&m instanceof softFinancial().FinancialChart,_=m.series,d=_.length,p=[];this._previousState=this._currentState;this._previousXVal=this._currentXVal;this._currentState=[];this._addStart=0;this._removeStart=0;this._currentXVal=m._xlabels.slice();if(this._previousState&&this._previousState.length){c=!1;s=(r=this._previousState).length;o=this._previousXVal;l=this._currentXVal;o.length>2&&l.length>2&&((e=l.indexOf(o[0]))>0&&e<l.length-2?l[e+1]===o[1]&&l[e+2]===o[2]&&(this._addStart=e):(e=o.indexOf(l[0]))>0&&e<o.length-2&&o[e+1]===l[1]&&o[e+2]===l[2]&&(this._removeStart=e))}for(e=0;e<d;e++){n=null!=(i=_[e])._getChartType()?i._getChartType():m._getChartType();a=this._getChartType(n);this._currentState.push({seriesType:n,ele:i.hostElement});if(u)this._playDefaultAnimation(p,e);else{h=r&&r[e];if("Default"===a){this._playDefaultAnimation(p,e);continue}if(c||h&&h.seriesType!==n||h&&h.ele&&(""==h.ele.innerHTML||0===h.ele.childNodes.length))this._playLoadAnimation(p,e,a);else{this._playUpdateAnimation(p,e,a,i,h&&h.ele||null);if(e===d-1&&e<s-1)for(e++;e<=s-1;e++)this._playUpdateAnimation(p,e,a,null,h.ele)}}}this._adjustAnimations(a,p);p.length&&this._playAnimation(p,t);this.axisAnimation&&!u&&this._playAxesAnimation()}_playAxesAnimation(){var t,e,i,a=this._chart.axes,n=a.length;this._prevAxesStates=this._currAxesStates;this._currAxesStates=[];for(e=0;e<n;e++)(t=a[e]).hostElement&&this._currAxesStates.push({ele:t.hostElement,vals:t._vals,axis:t,maxValue:wijmo_1.isDate(t.actualMax)?t.actualMax.getTime():t.actualMax,minValue:wijmo_1.isDate(t.actualMin)?t.actualMin.getTime():t.actualMin});if(this._prevAxesStates){i=Math.max(this._prevAxesStates.length,this._currAxesStates.length);for(e=0;e<i;e++)this._playAxisAnimation(this._prevAxesStates[e],this._currAxesStates[e])}}_playAxisAnimation(t,e){if(t&&e){var i,a=[],n=[];if(e&&e.maxValue-e.minValue){i=this._parseAxisState(e);this._convertAxisAnimation(a,i.major,e.axis,t.maxValue,t.minValue);this._convertAxisAnimation(a,i.minor,e.axis,t.maxValue,t.minValue)}if(t&&t.maxValue-t.minValue){i=this._parseAxisState(t);this._convertAxisAnimation(n,i.major,t.axis);this._convertAxisAnimation(n,i.minor,t.axis)}a&&n&&this._combineAxisAnimations(a,n);this._playCurrAxisAnimation(a);this._playPrevAxisAnimation(n)}}_combineAxisAnimations(t,e){var i,a,n=e.length;for(i=n-1;i>=0;i--)(a=e[i]).text&&t.some(t=>{if(t.text&&t.text===a.text){this._combineAxisAnimation(t,a);e.splice(i,1);return!0}})}_combineAxisAnimation(t,e){["label","majorGrid","tick"].forEach(i=>{t[i]&&e[i]&&this._resetExistAxisAttrs(t[i],e[i])})}_resetExistAxisAttrs(t,e){var i=t.ele,a=e.ele,n={},s={};["x","y","x1","x2","y1","y2"].forEach(t=>{var e=i.getAttribute(t),r=a.getAttribute(t);if(e!==r){n[t]=r;s[t]=e}});t.calcPos=n;t.elePos=s}_convertAxisAnimation(t,e,i,a,n){var s,r=i.hostElement,o=i.axisType==wijmo_chart_1.AxisType.Y;e.forEach((e,l)=>{var h=i.convert(e.val,a,n);if(!isNaN(h)){s={};e.majorGrid&&(s.majorGrid=this._getAxisAnimationAttrs(e.majorGrid,r,h,o));if(e.label){s.label=this._getAxisAnimationAttrs(e.label,r,h,o);s.text=e.label.innerHTML||e.label.textContent}e.tick&&(s.tick=this._getAxisAnimationAttrs(e.tick,r,h,o));t.push(s)}})}_getAxisAnimationAttrs(t,e,i,a){var n,s,r;n={ele:t,parent:e,elePos:{},calcPos:{}};if("text"===t.nodeName){s=a?"y":"x";r=Number(t.getAttribute(s));n.elePos[s]=r;n.calcPos[s]=i}else{s=a?"y1":"x1";r=Number(t.getAttribute(s));if(a){n.elePos={y1:r,y2:r};n.calcPos={y1:i,y2:i}}else{n.elePos={x1:r,x2:r};n.calcPos={x1:i,x2:i}}}n.elePos.opacity=1;n.calcPos.opacity=0;return n}_playCurrAxisAnimation(t){var e=this.duration;t&&0!==t.length&&t.forEach(t=>{["majorGrid","label","tick"].forEach(i=>{var a=t[i];if(a){a.parent;var n=a.ele,s=a.elePos,r=a.calcPos;AnimationHelper.playAnimation(n,r,s,null,Easing.Swing,e)}})})}_playPrevAxisAnimation(t){var e=this.duration;t&&0!==t.length&&t.forEach(t=>{["majorGrid","label","tick"].forEach(i=>{var a=t[i];if(a){var n=a.parent,s=a.ele,r=a.elePos,o=a.calcPos;n.appendChild(s);AnimationHelper.playAnimation(s,r,o,(function(){s.parentNode===n&&n.removeChild(s)}),Easing.Swing,e)}})})}_parseAxisState(t){if(null==t)return null;var e=t.vals,i=t.axis,a=i.axisType==wijmo_chart_1.AxisType.Y,n=t.ele.childNodes,s=0,r=[],o=[];let l,h,c;if(e){l=e.major;h=e.minor;c=e.hasLbls}l&&l.forEach((t,e)=>{var o,l={},h=!!c[e];r.push(l);l.val=t;o=n[s];if(i.majorGrid&&wijmo_1.hasClass(o,wijmo_chart_1.FlexChart._CSS_GRIDLINE)){l.majorGrid=o;o=n[++s]}if(a){if(h&&o&&i.majorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(o,wijmo_chart_1.FlexChart._CSS_TICK)){l.tick=o;o=n[++s]}if(h&&o&&(wijmo_1.hasClass(o,wijmo_chart_1.FlexChart._CSS_LABEL)||o.querySelector("."+wijmo_chart_1.FlexChart._CSS_LABEL))){l.label=o;s++}}else{if(h&&o&&(wijmo_1.hasClass(o,wijmo_chart_1.FlexChart._CSS_LABEL)||o.querySelector("."+wijmo_chart_1.FlexChart._CSS_LABEL))){l.label=o;o=n[++s]}if(h&&o&&i.majorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(o,wijmo_chart_1.FlexChart._CSS_TICK)){l.tick=o;s++}}});h&&h.forEach((t,e)=>{var a,r={};o.push(r);r.val=t;a=n[s];if(i.minorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(a,wijmo_chart_1.FlexChart._CSS_TICK_MINOR)){r.tick=a;a=n[++s]}if(i.minorGrid&&wijmo_1.hasClass(a,wijmo_chart_1.FlexChart._CSS_GRIDLINE_MINOR)){r.majorGrid=a;s++}});return{major:r,minor:o}}_playLoadAnimation(t,e,i){this["_playLoad"+i+"Animation"](t,e)}_playUpdateAnimation(t,e,i,a,n){null==a||null==n?null==a?this["_play"+i+"RemoveAnimation"](t,n):this["_play"+i+"AddAnimation"](t,a):this["_play"+i+"MoveAnimation"](t,a,n)}_adjustAnimations(t,e){var i,a=e.length;if("Column"===t||"Bar"===t)for(i=a-1;i>=0;i--)null==e[i]&&e.splice(i,1)}_getChartType(t){var e="Default",i=this._chart._isRotated();switch(t){case wijmo_chart_1.ChartType.Scatter:case wijmo_chart_1.ChartType.Bubble:case wijmo_chart_1.ChartType.Candlestick:case wijmo_chart_1.ChartType.HighLowOpenClose:e="Scatter";break;case wijmo_chart_1.ChartType.Column:case wijmo_chart_1.ChartType.Bar:e=i?"Bar":"Column";break;case wijmo_chart_1.ChartType.Line:case wijmo_chart_1.ChartType.LineSymbols:case wijmo_chart_1.ChartType.Area:case wijmo_chart_1.ChartType.Spline:case wijmo_chart_1.ChartType.SplineSymbols:case wijmo_chart_1.ChartType.SplineArea:e="Line";break;default:e="Default"}return e}_playLoadLineAnimation(t,e){var i,a=this,n=a._chart.series[e],s=a.animationMode,r=n.hostElement;if(s===AnimationMode.Point)a._playDefaultAnimation(t,e);else{i=s===AnimationMode.All?a._getAnimation(t,0):a._getAnimation(t,e);[].slice.call(r.childNodes).forEach(t=>{a._setLineRiseDiveAnimation(i,t,!0)})}}_setLineRiseDiveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,m=c._chart,u=e.nodeName,_=[],d=[],p=c._chart._plotRect,A=p.top+p.height,f=p.left,g={},y={};if("g"===u&&e.childNodes)[].slice.call(e.childNodes).forEach(e=>{this._setLineRiseDiveAnimation(t,e,i)});else{if("polyline"===u||"polygon"===u){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){o=l[r]||l.getItem(r);m.rotated?_.push({x:f,y:o.y}):_.push({x:o.x,y:A});d.push({x:o.x,y:o.y})}g[u]=_;y[u]=d}else if("ellipse"===u||"rect"===u){c._toggleVisibility(e,!1);i&&(h=function(){c._toggleVisibility(e,!0)})}a=i?g:y;n=i?y:g;c._setInitState(e,a,n);t.push({ele:e,from:a,to:n,done:h})}}_setLineMoveAnimation(t,e,i,a,n){if(null!=e&&null!=i){var s,r,o,l,h,c,m,u,_,d=e.nodeName,p=[],A=[],f={},g={};if("polyline"===d||"polygon"===d){_="polygon"===d;o=e.points;c=i.points;s=o.length||o.numberOfItems;l=c.length||c.numberOfItems;u=Math.max(s,l);for(m=0;m<u;m++){if(m<s){r=o[m]||o.getItem(m);p.push({x:r.x,y:r.y})}if(m<l){h=c[m]||c.getItem(m);A.push({x:h.x,y:h.y})}}if(this._addStart){this._adjustStartLinePoints(this._addStart,p,o);s+=this._addStart}else if(this._removeStart){this._adjustStartLinePoints(this._removeStart,A,c);l+=this._removeStart}l>s?this._adjustEndLinePoints(l,s,p,o,_):l<s&&this._adjustEndLinePoints(s,l,A,c,_);f[d]=p;g[d]=A;this._setInitState(a,f,g);t.push({ele:a,from:f,to:g,done:n})}}}_adjustStartLinePoints(t,e,i){for(var a=i[0]||i.getItem(0);t;){e.splice(0,0,{x:a.x,y:a.y});t--}}_adjustEndLinePoints(t,e,i,a,n){var s,r,o;if(n&&(a.length>=3||a.numberOfItems>=3)){r=i.pop();s=i.pop();o=a[a.length-3]||a.getItem(a.numberOfItems-3)}else(a.length>0||a.numberOfItems>0)&&(o=a[a.length-1]||a.getItem(a.numberOfItems-1));for(;t>e&&o;){i.push({x:o.x,y:o.y});e++}if(n&&r&&s){i.push(s);i.push(r)}}_playLineRemoveAnimation(t,e){var i,a=this,n=a._chart.series[0].hostElement.parentNode,s=a._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{a._setLineRiseDiveAnimation(s,t,!1)});if(s.length){i=s[0].done;s[0].done=function(){e&&e.parentNode===n&&n.removeChild(e);i&&i()}}}_playLineAddAnimation(t,e){var i=e.hostElement,a=this._getAnimation(t,0);[].slice.call(i.childNodes).forEach(t=>{this._setLineRiseDiveAnimation(a,t,!0)})}_playLineMoveAnimation(t,e,i){var a,n,s,r,o=this,l=(o._chart,o._getAnimation(t,0)),h=[];a=e.hostElement;n=[].slice.call(i.childNodes);[].slice.call(a.childNodes).forEach((t,e)=>{r=t.nodeName;s=n[e];if("g"===r&&t.nodeChilds)[].slice.call(t.nodeChilds).forEach((t,e)=>{if(s){h.push(t);o._toggleVisibility(t,!1)}});else if("polygon"===r||"polyline"===r)o._setLineMoveAnimation(l,s,t,t,0===e?function(){h.forEach(t=>{o._toggleVisibility(t,!0)});h=null}:null);else if(s){h.push(t);o._toggleVisibility(t,!1)}})}_playLoadColumnAnimation(t,e){this._playLoadBarAnimation(t,e,!0)}_playLoadBarAnimation(t,e,i=!1){var a=this,n=a._chart.series[e],s=a.animationMode,r=n.hostElement;[].slice.call(r.childNodes).forEach((n,r)=>{var o,l=n.nodeName;o=s===AnimationMode.Point?a._getAnimation(t,r):s===AnimationMode.Series?a._getAnimation(t,e):a._getAnimation(t,0);"g"===l?n.childNodes&&[].slice.call(n.childNodes).forEach((t,e)=>{a._setLoadBarAnimation(o,t,i)}):a._setLoadBarAnimation(o,n,i)})}_setBarAnimation(t,e,i,a,n){this._setInitState(e,i,a);t.push({ele:e,from:i,to:a,done:n})}_setLoadBarAnimation(t,e,i,a=!1,n){var s,r,o=this,l=i?"height":"width",h=i?"y":"x",c=e.getAttribute(l),m=e.getAttribute(h),u=i?"top":"left",_=o._chart._plotRect,d={},p={};d[l]=0;p[l]=Number(c);if(i){d[h]=_[l]+_[u];p[h]=Number(m)}s=a?p:d;r=a?d:p;"g"===e.nodeName?e.childNodes&&[].slice.call(e.childNodes).forEach(e=>{o._setBarAnimation(t,e,s,r,n)}):o._setBarAnimation(t,e,s,r,n)}_setMoveBarAnimation(t,e,i){var a={},n={};if(null!=e&&null!=i){["width","height","x","y","top","left"].forEach(t=>{var s=e.getAttribute(t),r=i.getAttribute(t);if(s!==r){a[t]=Number(s);n[t]=Number(r)}});this._setInitState(i,a,n);t.push({ele:i,from:a,to:n})}}_playColumnRemoveAnimation(t,e){this._playBarRemoveAnimation(t,e,!0)}_playColumnAddAnimation(t,e){this._playBarAddAnimation(t,e,!0)}_playColumnMoveAnimation(t,e,i){this._playBarMoveAnimation(t,e,i,!0)}_playBarRemoveAnimation(t,e,i=!1){var a=this,n=a._chart.series[0].hostElement.parentNode,s=a._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{a._setLoadBarAnimation(s,t,i,!0)});s.length&&(s[0].done=function(){e&&e.parentNode===n&&n.removeChild(e)})}_playBarAddAnimation(t,e,i=!1){var a=e.hostElement,n=this._getAnimation(t,2);[].slice.call(a.childNodes).forEach(t=>{this._setLoadBarAnimation(n,t,i,!1)})}_playBarMoveAnimation(t,e,i,a=!1){var n,s,r,o,l,h,c,m=this;m._chart;n=e.hostElement;r=[].slice.call(i.childNodes);if(m._addStart){c=0;o=r[0];for(;c<m._addStart;){r.splice(0,0,o);c++}}if(m._removeStart){c=0;o=r[r.length-1];for(;c<m._removeStart;){var u=r.shift();r.push(u);c++}}l=r.length;s=[].slice.call(n.childNodes);h=s.length;s.forEach((e,i)=>{var n;if(i<l){o=r[i];if(i<m._addStart){n=m._getAnimation(t,2);m._setLoadBarAnimation(n,e,a,!1)}else if(i>=l-m._removeStart){n=m._getAnimation(t,2);m._setLoadBarAnimation(n,e,a,!1);n=m._getAnimation(t,0);m._removeBarAnimation(n,e,o,a)}else{n=m._getAnimation(t,1);m._setMoveBarAnimation(n,o,e)}if(i===h-1&&i<l-1){n=m._getAnimation(t,0);for(i++;i<l;i++){o=r[i];m._removeBarAnimation(n,e,o,a)}}}else{n=m._getAnimation(t,2);m._setLoadBarAnimation(n,e,a,!1)}})}_removeBarAnimation(t,e,i,a){var n=e.parentNode;n.appendChild(i);this._setLoadBarAnimation(t,i,a,!0,function(t){return function(){t.parentNode&&t.parentNode===n&&n.removeChild(t)}}(i))}_playLoadScatterAnimation(t,e){var i=this,a=i._chart,n=a.series[e],s=i.animationMode,r=n.hostElement,o=n._xValues||a._xvals;0===o.length&&(o=n._pointIndexes);[].slice.call(r.childNodes).forEach((a,n)=>{var r;r=s===AnimationMode.Point?i._getScatterAnimation(t,o[n]):s===AnimationMode.Series?i._getAnimation(t,e):i._getAnimation(t,0);i._setLoadScatterAnimation(r,a,!1)})}_setLoadScatterAnimation(t,e,i=!1,a){var n,s,r={},o={};if("g"===e.nodeName&&e.childNodes)[].slice.call(e.childNodes).forEach(e=>{this._setLoadScatterAnimation(t,e,i,a)});else{["rx","ry","stroke-width"].forEach(t=>{var i=e.getAttribute(t);r[t]=0;o[t]=Number(i)});n=i?o:r;s=i?r:o;this._setInitState(e,n,s);t.push({ele:e,from:n,to:s,done:a})}}_setUpdateScatterAnimation(t,e,i,a){var n={},s={};["cx","cy"].forEach(t=>{var a=e.getAttribute(t),r=i.getAttribute(t);if(a!==r){n[t]=Number(a);s[t]=Number(r)}});this._setInitState(i,n,s);t.push({ele:i,from:n,to:s,done:a})}_getScatterAnimation(t,e){var i=this._getScatterAnimationIndex(t,e);t[i]||(t[i]=[]);return t[i]}_getScatterAnimationIndex(t,e){var i=this._chart.axisX,a=null==i.min?i.actualMin:i.min,n=null==i.max?i.actualMax:i.max;return Math.ceil((e-a)/((n-a)/20))}_playScatterRemoveAnimation(t,e){var i=this,a=i._chart.series[0].hostElement.parentNode,n=i._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{i._setLoadScatterAnimation(n,t,!0)});n.length&&(n[0].done=function(){e&&e.parentNode===a&&a.removeChild(e)})}_playScatterAddAnimation(t,e){var i=e.hostElement,a=this._getAnimation(t,0);[].slice.call(i.childNodes).forEach(t=>{this._setLoadScatterAnimation(a,t,!1)})}_playScatterMoveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,m=(c._chart,c._getAnimation(t,0));a=e.hostElement;s=[].slice.call(i.childNodes);if(c._addStart){h=0;r=s[0];for(;h<c._addStart;){s.splice(0,0,r);h++}}if(c._removeStart){h=0;r=s[s.length-1];for(;h<c._removeStart;){var u=s.shift();s.push(u);h++}}o=s.length;n=[].slice.call(a.childNodes);l=n.length;n.forEach((t,e)=>{if(e<o){if(e<c._addStart)c._setLoadScatterAnimation(m,t,!1);else if(e>=o-c._removeStart){c._setLoadScatterAnimation(m,t,!1);r=s[e];c._removeScatterAnimation(m,t,r)}else{r=s[e];c._setUpdateScatterAnimation(m,r,t)}if(e===l-1&&e<o-1)for(e++;e<o;e++){r=s[e];c._removeScatterAnimation(m,t,r)}}else c._setLoadScatterAnimation(m,t,!1)})}_removeScatterAnimation(t,e,i){var a=e.parentNode;a.appendChild(i);this._setLoadScatterAnimation(t,i,!0,function(t){return function(){t.parentNode&&t.parentNode===a&&a.removeChild(t)}}(i))}_playDefaultAnimation(t,e){var i,a,n=this._chart,s=n.series[e].hostElement,r=n._plotRect,o=n._currentRenderEngine,l=s.getAttribute("clip-path"),h="clipPath"+(1e6*Math.random()).toFixed();let c=n.axisX.reversed;o.addClipRect(new wijmo_1.Rect(c?r.right:r.left,r.top,0,r.height),h);s.setAttribute("clip-path","url(#"+h+")");i=n.hostElement.querySelector("#"+h);a=this._getAnimation(t,0);let m={width:0},u={width:r.width};if(c){m.x=r.right;u.x=r.left}a.push({ele:i.querySelector("rect"),from:m,to:u,done:function(){if(s){l?s.setAttribute("clip-path",l):s.removeAttribute("clip-path");i&&i.parentNode&&i.parentNode.removeChild(i)}}})}}class FlexRadarAnimation extends FlexChartAnimation{constructor(t,e){super(t,e)}_getDurationAndDelay(t,e){var i=super._getDurationAndDelay(t,e);if(this.animationMode===AnimationMode.Point){i.duration=e/t;i.delay=e/t}return i}_playAxesAnimation(){}_getChartType(t){var e=super._getChartType(t);"Bar"===e&&(e="Column");return e}_playLoadLineAnimation(t,e){var i,a,n,s=this,r=s._chart,o=s._chart.series[e],l=o._xValues||r._xvals,h=s.animationMode,c=o.hostElement;if(h===AnimationMode.Point){0===l.length&&(l=o._pointIndexes);n=[].slice.call(c.childNodes);a=n.length-c.querySelectorAll("ellipse").length;n.forEach((e,i)=>{s._setRadarLinePointAnimation(t,e,i,l,a)})}else{i=h===AnimationMode.All?s._getAnimation(t,0):s._getAnimation(t,e);[].slice.call(c.childNodes).forEach(t=>{s._setLineRiseDiveAnimation(i,t,!0)})}}_setRadarLinePointAnimation(t,e,i,a,n){var s,r,o,l,h,c,m,u=this,_=u._chart,d=e.nodeName,p=[],A=[],f=[],g=[],y=_._center,x=[],E=!1,v={},S={},w=0;if("polyline"===d||"polygon"===d){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){x[m=u._getScatterAnimationIndex(t,a[r])]||(x[m]=[]);x[m].push(r);o=l[r]||l.getItem(r);p.push({x:y.x,y:y.y});A.push({x:o.x,y:o.y})}for(r=0,s=x.length;r<s;r++)if(x[r]){c=u._getAnimation(t,w);f=g.length?g.slice():p.slice();g=f.slice();x[r].forEach(t=>{var e=A[t];g[t]={x:e.x,y:e.y}});S={};(v={})[d]=f;S[d]=g;if(!E){u._setInitState(e,v,S);E=!0}c.push({ele:e,from:v,to:S,done:h});w++}}else if("ellipse"===d){if((r=i-(n||0))<0)return;c=_._isPolar?u._getScatterAnimation(t,a[r]):u._getScatterAnimation(t,r);u._toggleVisibility(e,!1);h=function(){u._toggleVisibility(e,!0)};c.push({ele:e,from:v,to:S,done:h})}}_setLineRiseDiveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,m=c._chart,u=e.nodeName,_=[],d=[],p=m._center,A={},f={};if("polyline"===u||"polygon"===u){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){o=l[r]||l.getItem(r);_.push({x:p.x,y:p.y});d.push({x:o.x,y:o.y})}A[u]=_;f[u]=d}else if("ellipse"===u){c._toggleVisibility(e,!1);i&&(h=function(){c._toggleVisibility(e,!0)})}a=i?A:f;n=i?f:A;c._setInitState(e,a,n);t.push({ele:e,from:a,to:n,done:h})}_parsePathByRadius(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep;a=[s,r,0,l,h,0];n=[s,r,o,l,h,t.innerRadius||0];e.pie=a;i.pie=n}_playUpdateAnimation(t,e,i,a,n){if("Bar"===i||"Column"===i){if(null==a)return;this._playLoadBarAnimation(t,e,!1)}else super._playUpdateAnimation(t,e,i,a,n)}_playLoadBarAnimation(t,e,i=!1){var a=this,n=a._chart,s=n.series[e],r=n._areas[e],o=a.animationMode,l=s.hostElement;[].slice.call(l.childNodes).forEach((i,n)=>{var s,l,h={},c={};s=o===AnimationMode.Point?a._getAnimation(t,n):o===AnimationMode.Series?a._getAnimation(t,e):a._getAnimation(t,0);l=r[n];a._parsePathByRadius(l,h,c);a._setInitState(i,h,c);s.push({ele:i,from:h,to:c})})}}class AnimationHelper{static playAnimations(t,e,i,a,n=Easing.Swing,s,r){var o=t.length,l=0,h=[];t.forEach((t,c)=>{var m=AnimationHelper.playAnimation(t,e[c],i[c],(function(){l===o-1&&a&&a();l++}),n,s,r);h.push(m)});return h}static playAnimation(t,e,i,a,n=Easing.Swing,s,r){var o=AnimationHelper.parseAttrs(e,i);return AnimationHelper.animate((function(e){AnimationHelper.setElementAttr(t,o,e)}),a,n,s,r)}static setElementAttr(t,e,i){var a,n;for(n in e){a=e[n];AnimationHelper.calcValue(a,i);t.setAttribute(n,a.getValue(a.value,i))}}static getPathDescOfPie(t,e,i,a,n,s=0){var r=!1;if(n>=2*Math.PI){r=!0;n=2*Math.PI-.001}var o=new wijmo_1.Point(t,e);o.x+=i*Math.cos(a);o.y+=i*Math.sin(a);var l=a+n,h=new wijmo_1.Point(t,e);h.x+=i*Math.cos(l);h.y+=i*Math.sin(l);if(s){var c=new wijmo_1.Point(t,e);c.x+=s*Math.cos(l);c.y+=s*Math.sin(l);var m=new wijmo_1.Point(t,e);m.x+=s*Math.cos(a);m.y+=s*Math.sin(a)}var u=" 0 0,1 ",_=" 0 0,0 ";if(Math.abs(n)>Math.PI){u=" 0 1,1 ";_=" 0 1,0 "}var d="M "+o.x.toFixed(3)+","+o.y.toFixed(3);d+=" A "+i.toFixed(3)+","+i.toFixed(3)+u;d+=h.x.toFixed(3)+","+h.y.toFixed(3);if(s){d+=r?" M "+c.x.toFixed(3)+","+c.y.toFixed(3):" L "+c.x.toFixed(3)+","+c.y.toFixed(3);d+=" A "+s.toFixed(3)+","+s.toFixed(3)+_;d+=m.x.toFixed(3)+","+m.y.toFixed(3)}else d+=" L "+t.toFixed(3)+","+e.toFixed(3);r||(d+=" z");return d}static parseAttrs(t,e){var i={};for(var a in t)if(null!=e[a])switch(a){case"polyline":i.points=AnimationHelper.parseAttr(t[a],e[a],(function(t,e){if(1===e){for(var i,a,n;t.length>1;){a=t[0];n=t[1];if(a.x!==n.x||a.y!==n.y){a=null;n=null;break}t.splice(1,1)}for(i=t.length-1;i>0;i--){a=n;n=t[i];if(a){if(a.x!==n.x||a.y!==n.y)break;t.pop()}}}return t.map(t=>t.x+","+t.y).join(" ")}));break;case"polygon":i.points=AnimationHelper.parseAttr(t[a],e[a],(function(t,e){if(1===e){var i,a,n,s,r;s=t.pop();r=t.pop();for(;t.length>1;){a=t[0];n=t[1];if(a.x!==n.x||a.y!==n.y){a=null;n=null;break}t.splice(1,1)}for(i=t.length-1;i>=0;i--){a=n;n=t[i];if(a){if(a.x!==n.x||a.y!==n.y)break;t.splice(i,1)}}t.push(r);t.push(s)}return t.map(t=>t.x+","+t.y).join(" ")}));break;case"d":i[a]=AnimationHelper.parseAttr(t[a],e[a],(function(t){return t.map(t=>"string"==typeof t?t:t[0]+","+t[1]).join(" ")}));break;case"pie":i.d=AnimationHelper.parseAttr(t[a],e[a],(function(t){return AnimationHelper.getPathDescOfPie.apply(AnimationHelper,t)}));break;case"rotate":i.transform=AnimationHelper.parseAttr(t[a],e[a],(function(t){return"rotate("+t.join(" ")+")"}));break;case"x":case"width":case"height":case"rx":case"ry":case"stroke-width":i[a]=AnimationHelper.parseAttr(t[a],e[a],(function(t){return Math.abs(t)}));break;default:i[a]=AnimationHelper.parseAttr(t[a],e[a])}return i}static animate(t,e,i=Easing.Swing,a=400,n=16){wijmo_1.asFunction(t);wijmo_1.asNumber(a,!1,!0);wijmo_1.asNumber(n,!1,!0);var s=0,r=setInterval((function(){Date.now();var o=s/a;o=EasingHelper[Easing[i]](o);t(o);if((s+=n)>=a){clearInterval(r);(o<1||o>1)&&t(1);e&&e()}}),n);return r}static calcValue(t,e){var i=t.from,a=t.diff,n=t.value;wijmo_1.isNumber(i)?t.value=0===a?i:i+a*e:wijmo_1.isArray(i)&&AnimationHelper.parseArrayAttr(n,i,a,(function(t,i){return"number"==typeof t?t+i*e:t}))}static parseAttr(t,e,i){var a,n,s,r;if(wijmo_1.isArray(t)&&wijmo_1.isArray(e)){n=e;s=[];r=(a=t).slice();AnimationHelper.parseArrayAttr(s,a,n,(function(t,e){return t===e?0:e-t}))}else{r=a=Number(t);s=(n=Number(e))-a}return{from:a,to:n,value:r,diff:s,getValue:i||function(t,e){return t}}}static parseArrayAttr(t,e,i,a){e.forEach((e,n)=>{var s={},r=[],o=i[n];if(wijmo_1.isNumber(e)||"string"==typeof e)t[n]=a(e,o);else if(wijmo_1.isArray(e)){e.forEach((t,i)=>{r[i]=a(e[i],o[i])});t[n]=r}else{Object.getOwnPropertyNames(e).forEach(t=>{s[t]=a(e[t],o[t])});t[n]=s}})}}class EasingHelper{static Linear(t){return t}static Swing(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)}static EaseInQuad(t){return t*t}static EaseOutQuad(t){return t*(2-t)}static EaseInOutQuad(t){return t<.5?2*t*t:(4-2*t)*t-1}static EaseInCubic(t){return t*t*t}static EaseOutCubic(t){return--t*t*t+1}static EaseInOutCubic(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}static EaseInQuart(t){return t*t*t*t}static EaseOutQuart(t){return 1- --t*t*t*t}static EaseInOutQuart(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t}static EaseInQuint(t){return t*t*t*t*t}static EaseOutQuint(t){return 1+--t*t*t*t*t}static EaseInOutQuint(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}static EaseInSine(t){return 1-Math.cos(t*(Math.PI/2))}static EaseOutSine(t){return Math.sin(t*(Math.PI/2))}static EaseInOutSine(t){return-.5*(Math.cos(Math.PI*t)-1)}static EaseInExpo(t){return 0==t?0:Math.pow(2,10*(t-1))}static EaseOutExpo(t){return 1==t?1:1-Math.pow(2,-10*t)}static EaseInOutExpo(t){return t==!!t?t:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))}static EaseInCirc(t){return-(Math.sqrt(1-t*t)-1)}static EaseOutCirc(t){return Math.sqrt(1-Math.pow(t-1,2))}static EaseInOutCirc(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static EaseInBack(t){var e=1.70158;return t*t*((e+1)*t-e)}static EaseOutBack(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1}static EaseInOutBack(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)}static EaseInBounce(t){return 1-EasingHelper.EaseOutBounce(1-t)}static EaseOutBounce(t){var e=7.5625;return t<1/2.75?e*t*t:t<2/2.75?e*(t-=1.5/2.75)*t+.75:t<2.5/2.75?e*(t-=2.25/2.75)*t+.9375:e*(t-=2.625/2.75)*t+.984375}static EaseInOutBounce(t){return t<.5?.5*EasingHelper.EaseInBounce(2*t):.5*EasingHelper.EaseOutBounce(2*t-1)+.5}static EaseInElastic(t){return t==!!t?t:-Math.pow(2,10*(t-=1))*Math.sin((t-.075)*(2*Math.PI)/.3)}static EaseOutElastic(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1}static EaseInOutElastic(t){return t==!!t?t:(t*=2)<1?Math.pow(2,10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*-.5:Math.pow(2,-10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*.5+1}}wijmo_1._registerModule("wijmo.chart.animation",selfModule); | ||
"use strict";var __importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);e.default=t;return e};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_1=require("@grapecity/wijmo"),wijmo_chart_1=require("@grapecity/wijmo.chart"),selfModule=__importStar(require("@grapecity/wijmo.chart.animation"));function softFinancial(){return wijmo_1._getModule("wijmo.chart.finance")}exports.softFinancial=softFinancial;function softRadar(){return wijmo_1._getModule("wijmo.chart.radar")}exports.softRadar=softRadar;var Easing,AnimationMode;!function(t){t[t.Linear=0]="Linear";t[t.Swing=1]="Swing";t[t.EaseInQuad=2]="EaseInQuad";t[t.EaseOutQuad=3]="EaseOutQuad";t[t.EaseInOutQuad=4]="EaseInOutQuad";t[t.EaseInCubic=5]="EaseInCubic";t[t.EaseOutCubic=6]="EaseOutCubic";t[t.EaseInOutCubic=7]="EaseInOutCubic";t[t.EaseInQuart=8]="EaseInQuart";t[t.EaseOutQuart=9]="EaseOutQuart";t[t.EaseInOutQuart=10]="EaseInOutQuart";t[t.EaseInQuint=11]="EaseInQuint";t[t.EaseOutQuint=12]="EaseOutQuint";t[t.EaseInOutQuint=13]="EaseInOutQuint";t[t.EaseInSine=14]="EaseInSine";t[t.EaseOutSine=15]="EaseOutSine";t[t.EaseInOutSine=16]="EaseInOutSine";t[t.EaseInExpo=17]="EaseInExpo";t[t.EaseOutExpo=18]="EaseOutExpo";t[t.EaseInOutExpo=19]="EaseInOutExpo";t[t.EaseInCirc=20]="EaseInCirc";t[t.EaseOutCirc=21]="EaseOutCirc";t[t.EaseInOutCirc=22]="EaseInOutCirc";t[t.EaseInBack=23]="EaseInBack";t[t.EaseOutBack=24]="EaseOutBack";t[t.EaseInOutBack=25]="EaseInOutBack";t[t.EaseInBounce=26]="EaseInBounce";t[t.EaseOutBounce=27]="EaseOutBounce";t[t.EaseInOutBounce=28]="EaseInOutBounce";t[t.EaseInElastic=29]="EaseInElastic";t[t.EaseOutElastic=30]="EaseOutElastic";t[t.EaseInOutElastic=31]="EaseInOutElastic"}(Easing=exports.Easing||(exports.Easing={}));!function(t){t[t.All=0]="All";t[t.Point=1]="Point";t[t.Series=2]="Series"}(AnimationMode=exports.AnimationMode||(exports.AnimationMode={}));class ChartAnimation{constructor(t,e){this._play=!0;this.ended=new wijmo_1.Event;var i=this,a=t.hostElement,n=new wijmo_1.Size(a.offsetWidth,a.offsetHeight);i._chart=t;i._updateEventArgs=[];if(t instanceof wijmo_chart_1.FlexPie)i._animation=new FlexPieAnimation(t,i._updateEventArgs);else{softRadar()&&t instanceof softRadar().FlexRadar?i._animation=new FlexRadarAnimation(t,i._updateEventArgs):t instanceof wijmo_chart_1.FlexChartCore&&(i._animation=new FlexChartAnimation(t,i._updateEventArgs));i._chartType=t.chartType}wijmo_1.assert(void 0!==i._animation,"Animation is not supported");i._initOptions(e);t.beginUpdate();window.setTimeout(()=>{t.rendered.addHandler(i._playAnimation,i);t.endUpdate()},0);i._setCV(t.collectionView);window.addEventListener("resize",(function(t){var e=new wijmo_1.Size(a.offsetWidth,a.offsetHeight);if(!n.equals(e)){i._play=!1;n=e}}))}_initOptions(t){if(t){t.duration&&(this.duration=t.duration);t.easing&&(this.easing=t.easing);t.animationMode&&(this.animationMode=t.animationMode);void 0!==t.axisAnimation&&(this.axisAnimation=t.axisAnimation)}}_setCV(t){this._cv=t;this._animation._clearState()}get animationMode(){return this._animation.animationMode}set animationMode(t){(t=wijmo_1.asEnum(t,AnimationMode))!=this.animationMode&&(this._animation.animationMode=t)}get easing(){return this._animation.easing}set easing(t){(t=wijmo_1.asEnum(t,Easing))!=this.easing&&(this._animation.easing=t)}get duration(){return this._animation.duration}set duration(t){(t=wijmo_1.asNumber(t))!=this.duration&&(this._animation.duration=t)}get axisAnimation(){return this._animation.axisAnimation}set axisAnimation(t){(t=wijmo_1.asBoolean(t))!=this.axisAnimation&&(this._animation.axisAnimation=t)}get chart(){return this._chart}_playAnimation(){var t=this,e=t._chart,i=e.chartType;t._cv!==e.collectionView&&t._setCV(e.collectionView);if(null!=t._chartType&&t._chartType!==i){t._chartType=i;t._animation._clearState()}t._play?t._animation.playAnimation(()=>t.ended.raise(t,wijmo_1.EventArgs.empty)):t._play=!0}animate(){var t=this._chart;if(t){var e=t.itemsSource;t.beginUpdate();t.itemsSource=null;t.itemsSource=e;t.endUpdate()}}}exports.ChartAnimation=ChartAnimation;class FlexAnimation{constructor(t,e){this._axisAnimation=!0;this._chart=t;this._timers=[]}get animationMode(){return this._animationMode||AnimationMode.All}set animationMode(t){if((t=wijmo_1.asEnum(t,AnimationMode,!1))!==this._animationMode){this._clearState();this._animationMode=t}}get easing(){return null==this._easing?Easing.Swing:this._easing}set easing(t){t!==this._easing&&(this._easing=wijmo_1.asEnum(t,Easing,!1))}get duration(){return this._duration||400}set duration(t){t!==this._duration&&(this._duration=wijmo_1.asNumber(t,!1,!0))}get axisAnimation(){return!!this._axisAnimation}set axisAnimation(t){t!==this._axisAnimation&&(this._axisAnimation=wijmo_1.asBoolean(t,!1))}playAnimation(t){}_clearState(){this._previousState&&(this._previousState=null);this._currentState&&(this._currentState=null)}_setInitState(t,e,i){var a=AnimationHelper.parseAttrs(e,i);AnimationHelper.setElementAttr(t,a,0)}_getAnimation(t,e){t[e]||(t[e]=[]);return t[e]}_toggleVisibility(t,e){e?AnimationHelper.playAnimation(t,{opacity:0},{opacity:1},null,Easing.Swing,100):t.setAttribute("opacity","0")}_toggleDataLabelVisibility(t){var e=this._chart.hostElement,i=e&&e.querySelector(`.${wijmo_chart_1.DataLabelClsNames.labels}`);i&&this._toggleVisibility(i,t)}_playAnimation(t,e){var i,a=this,n=a.duration,s=a.easing,r=t.length;a._toggleDataLabelVisibility(!1);i=a._getDurationAndDelay(t.length,n);if(this._timers&&this._timers.length){this._timers.forEach(t=>window.clearInterval(t));this._timers.length=0}t.forEach((t,n)=>{var o;if(t){o=window.setTimeout(()=>{var o;t.forEach((t,l)=>{if(t&&t.ele){if(n===r-1&&0===l){var h=t.done;t.done=function(){a._toggleDataLabelVisibility(!0);h&&h();e&&e()}}if(wijmo_1.isArray(t.ele)){o=AnimationHelper.playAnimations(t.ele,t.from,t.to,t.done,s,i.duration);this._timers=this._timers.concat.apply(o)}else{o=AnimationHelper.playAnimation(t.ele,t.from,t.to,t.done,s,i.duration);this._timers.push(o)}}})},i.delay*n);this._timers.push(o)}})}_getDurationAndDelay(t,e){var i={duration:e,delay:0};if(t>1)if(this._previousState){i.duration=e/t;i.delay=e/t}else{i.duration=.5*e;i.delay=.5*e/(t-1)}return i}}class FlexPieAnimation extends FlexAnimation{constructor(t,e){super(t,e);t.selectionChanged.addHandler(this._selectionChanged,this)}_selectionChanged(){this._isSelectionChanged=!0}_clearState(){super._clearState();this._isSelectionChanged=!1}_getElementRotate(t){var e,i=t.getAttribute("transform");if(i&&i.indexOf("rotate")>-1){if(1==(i=(i=i.replace("rotate(","").replace(")","")).indexOf(",")>-1?i.split(",").map(t=>+t):i.split(" ").map(t=>+t)).length){e=this._chart._areas[0].center;i.push(e.x,e.y)}}else i=[0,(e=this._chart._areas[0].center).x,e.y];return i}_getDurationAndDelay(t,e){var i={duration:e,delay:0};if(this.animationMode===AnimationMode.Point&&t>1){i.duration=e/t;i.delay=e/t}return i}playAnimation(t){super.playAnimation(t);var e=[];this._playPieAnimation(e);e.length&&this._playAnimation(e,t)}_playPieAnimation(t){var e=this._chart,i=!0;this._previousState=this._currentState;this._currentState={areas:e._areas,pels:e._pels,rotate:e._pels.length&&this._getElementRotate(e._pels[0].parentNode)};this._previousState&&(i=!1);if(this._isSelectionChanged){e.isAnimated||this._playSelectPieAnimation(t);this._isSelectionChanged=!1}else i?this._playLoadPieAnimation(t):this._playUpdatePieAnimation(t)}_playSelectPieAnimation(t){if(null!=this._previousState){var e,i,a,n=this._chart._pels[0].parentNode,s=this._previousState.rotate,r=this._getElementRotate(n),o=s[0],l=r[0];if(o!==l){o-l>180?r[0]+=360:l-o>180&&(s[0]+=360);e=this._getAnimation(t,0);i={rotate:s};a={rotate:r};this._setInitState(n,i,a);e.push({ele:n,from:i,to:a})}}}_playUpdatePieAnimation(t){var e,i,a,n,s=this._chart,r=this._previousState,o=s._areas,l=s._pels,h=r.areas.length,c=o.length,m=Math.max(c,h),u=this._getAnimation(t,0),_=0;if(0!==c&&0!==h){this._playSelectPieAnimation(t);for(e=0;e<m;e++){i={};if(l[e]&&l[e].childNodes&&l[e].childNodes.length>0){if(e<c&&e<h){a=o[0];0===e&&(_=a.angle);1===h?l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(a.center.x,a.center.y,a.radius,_,2*Math.PI,a.innerRadius||0)):l[e].childNodes[0].setAttribute("d",r.pels[e].childNodes[0].getAttribute("d"))}if(e<c){a=o[e];i.to={pie:[a.center.x,a.center.y,a.radius,a.angle,a.sweep,a.innerRadius||0]};i.ele=l[e].childNodes[0]}else{a=o[0];n=r.pels[e];i.to={pie:[a.center.x,a.center.y,a.radius,_+2*Math.PI,0,a.innerRadius||0]};l[0].parentNode.appendChild(n);i.done=function(t){return function(){t.parentNode.removeChild(t)}}(n);i.ele=n.childNodes[0]}if(e<h){a=r.areas[e];i.from={pie:[a.center.x,a.center.y,a.radius,a.angle,a.sweep,a.innerRadius||0]}}else{l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(a.center.x,a.center.y,a.radius,2*Math.PI+_,0,a.innerRadius||0));a=r.areas[0];i.from={pie:[a.center.x,a.center.y,a.radius,2*Math.PI+_,0,a.innerRadius||0]}}u.push(i)}}}}_playLoadPieAnimation(t){var e=this,i=e._chart,a=e.animationMode,n=i._areas;i._pels.forEach((i,s)=>{var r,o=i.childNodes[0],l={},h={};if(o){if(a===AnimationMode.Point){e._parsePathByAngle(n[s],l,h);r=e._getAnimation(t,s)}else{e._parsePathByRadius(n[s],l,h);r=e._getAnimation(t,0)}e._setInitState(o,l,h);r.push({ele:o,from:l,to:h})}})}_parsePathByRadius(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep;a=[s,r,0,l,h,0];n=[s,r,o,l,h,t.innerRadius||0];e.pie=a;i.pie=n}_parsePathByAngle(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep,c=t.innerRadius;a=[s,r,o,l,0,c||0];n=[s,r,o,l,h,c||0];e.pie=a;e["stroke-width"]=0;i.pie=n;i["stroke-width"]=1}}class FlexChartAnimation extends FlexAnimation{constructor(t,e){super(t,e)}playAnimation(t){super.playAnimation(t);var e,i,a,n,s,r,o,l,h,c=!0,m=this._chart,u=softFinancial()&&m instanceof softFinancial().FinancialChart,_=m.series,d=_.length,p=[];this._previousState=this._currentState;this._previousXVal=this._currentXVal;this._currentState=[];this._addStart=0;this._removeStart=0;this._currentXVal=m._xlabels.slice();if(this._previousState&&this._previousState.length){c=!1;s=(r=this._previousState).length;o=this._previousXVal;l=this._currentXVal;o.length>2&&l.length>2&&((e=l.indexOf(o[0]))>0&&e<l.length-2?l[e+1]===o[1]&&l[e+2]===o[2]&&(this._addStart=e):(e=o.indexOf(l[0]))>0&&e<o.length-2&&o[e+1]===l[1]&&o[e+2]===l[2]&&(this._removeStart=e))}for(e=0;e<d;e++){n=null!=(i=_[e])._getChartType()?i._getChartType():m._getChartType();a=this._getChartType(n);this._currentState.push({seriesType:n,ele:i.hostElement});if(u)this._playDefaultAnimation(p,e);else{h=r&&r[e];if("Default"===a){this._playDefaultAnimation(p,e);continue}if(c||h&&h.seriesType!==n||h&&h.ele&&(""==h.ele.innerHTML||0===h.ele.childNodes.length))this._playLoadAnimation(p,e,a);else{this._playUpdateAnimation(p,e,a,i,h&&h.ele||null);if(e===d-1&&e<s-1)for(e++;e<=s-1;e++)this._playUpdateAnimation(p,e,a,null,h.ele)}}}this._adjustAnimations(a,p);p.length&&this._playAnimation(p,t);this.axisAnimation&&!u&&this._playAxesAnimation()}_playAxesAnimation(){var t,e,i,a=this._chart.axes,n=a.length;this._prevAxesStates=this._currAxesStates;this._currAxesStates=[];for(e=0;e<n;e++)(t=a[e]).hostElement&&this._currAxesStates.push({ele:t.hostElement,vals:t._vals,axis:t,maxValue:wijmo_1.isDate(t.actualMax)?t.actualMax.getTime():t.actualMax,minValue:wijmo_1.isDate(t.actualMin)?t.actualMin.getTime():t.actualMin});if(this._prevAxesStates){i=Math.max(this._prevAxesStates.length,this._currAxesStates.length);for(e=0;e<i;e++)this._playAxisAnimation(this._prevAxesStates[e],this._currAxesStates[e])}}_playAxisAnimation(t,e){if(t&&e){var i,a=[],n=[];if(e&&e.maxValue-e.minValue){i=this._parseAxisState(e);this._convertAxisAnimation(a,i.major,e.axis,t.maxValue,t.minValue);this._convertAxisAnimation(a,i.minor,e.axis,t.maxValue,t.minValue)}if(t&&t.maxValue-t.minValue){i=this._parseAxisState(t);this._convertAxisAnimation(n,i.major,t.axis);this._convertAxisAnimation(n,i.minor,t.axis)}a&&n&&this._combineAxisAnimations(a,n);this._playCurrAxisAnimation(a);this._playPrevAxisAnimation(n)}}_combineAxisAnimations(t,e){var i,a,n=e.length;for(i=n-1;i>=0;i--)(a=e[i]).text&&t.some(t=>{if(t.text&&t.text===a.text){this._combineAxisAnimation(t,a);e.splice(i,1);return!0}})}_combineAxisAnimation(t,e){["label","majorGrid","tick"].forEach(i=>{t[i]&&e[i]&&this._resetExistAxisAttrs(t[i],e[i])})}_resetExistAxisAttrs(t,e){var i=t.ele,a=e.ele,n={},s={};["x","y","x1","x2","y1","y2"].forEach(t=>{var e=i.getAttribute(t),r=a.getAttribute(t);if(e!==r){n[t]=r;s[t]=e}});t.calcPos=n;t.elePos=s}_convertAxisAnimation(t,e,i,a,n){var s,r=i.hostElement,o=i.axisType==wijmo_chart_1.AxisType.Y;e.forEach((e,l)=>{var h=i.convert(e.val,a,n);if(!isNaN(h)){s={};e.majorGrid&&(s.majorGrid=this._getAxisAnimationAttrs(e.majorGrid,r,h,o));if(e.label){s.label=this._getAxisAnimationAttrs(e.label,r,h,o);s.text=e.label.innerHTML||e.label.textContent}e.tick&&(s.tick=this._getAxisAnimationAttrs(e.tick,r,h,o));t.push(s)}})}_getAxisAnimationAttrs(t,e,i,a){var n,s,r;n={ele:t,parent:e,elePos:{},calcPos:{}};if("text"===t.nodeName){s=a?"y":"x";r=Number(t.getAttribute(s));n.elePos[s]=r;n.calcPos[s]=i}else{s=a?"y1":"x1";r=Number(t.getAttribute(s));if(a){n.elePos={y1:r,y2:r};n.calcPos={y1:i,y2:i}}else{n.elePos={x1:r,x2:r};n.calcPos={x1:i,x2:i}}}n.elePos.opacity=1;n.calcPos.opacity=0;return n}_playCurrAxisAnimation(t){var e=this.duration;t&&0!==t.length&&t.forEach(t=>{["majorGrid","label","tick"].forEach(i=>{var a=t[i];if(a){a.parent;var n=a.ele,s=a.elePos,r=a.calcPos;AnimationHelper.playAnimation(n,r,s,null,Easing.Swing,e)}})})}_playPrevAxisAnimation(t){var e=this.duration;t&&0!==t.length&&t.forEach(t=>{["majorGrid","label","tick"].forEach(i=>{var a=t[i];if(a){var n=a.parent,s=a.ele,r=a.elePos,o=a.calcPos;n.appendChild(s);AnimationHelper.playAnimation(s,r,o,(function(){s.parentNode===n&&n.removeChild(s)}),Easing.Swing,e)}})})}_parseAxisState(t){if(null==t)return null;var e=t.vals,i=t.axis,a=i.axisType==wijmo_chart_1.AxisType.Y,n=t.ele.childNodes,s=0,r=[],o=[];let l,h,c;if(e){l=e.major;h=e.minor;c=e.hasLbls}l&&l.forEach((t,e)=>{var o,l={},h=!!c[e];r.push(l);l.val=t;o=n[s];if(i.majorGrid&&wijmo_1.hasClass(o,wijmo_chart_1.FlexChart._CSS_GRIDLINE)){l.majorGrid=o;o=n[++s]}if(a){if(h&&o&&i.majorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(o,wijmo_chart_1.FlexChart._CSS_TICK)){l.tick=o;o=n[++s]}if(h&&o&&(wijmo_1.hasClass(o,wijmo_chart_1.FlexChart._CSS_LABEL)||o.querySelector("."+wijmo_chart_1.FlexChart._CSS_LABEL))){l.label=o;s++}}else{if(h&&o&&(wijmo_1.hasClass(o,wijmo_chart_1.FlexChart._CSS_LABEL)||o.querySelector("."+wijmo_chart_1.FlexChart._CSS_LABEL))){l.label=o;o=n[++s]}if(h&&o&&i.majorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(o,wijmo_chart_1.FlexChart._CSS_TICK)){l.tick=o;s++}}});h&&h.forEach((t,e)=>{var a,r={};o.push(r);r.val=t;a=n[s];if(i.minorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(a,wijmo_chart_1.FlexChart._CSS_TICK_MINOR)){r.tick=a;a=n[++s]}if(i.minorGrid&&wijmo_1.hasClass(a,wijmo_chart_1.FlexChart._CSS_GRIDLINE_MINOR)){r.majorGrid=a;s++}});return{major:r,minor:o}}_playLoadAnimation(t,e,i){this["_playLoad"+i+"Animation"](t,e)}_playUpdateAnimation(t,e,i,a,n){null==a||null==n?null==a?this["_play"+i+"RemoveAnimation"](t,n):this["_play"+i+"AddAnimation"](t,a):this["_play"+i+"MoveAnimation"](t,a,n)}_adjustAnimations(t,e){var i,a=e.length;if("Column"===t||"Bar"===t)for(i=a-1;i>=0;i--)null==e[i]&&e.splice(i,1)}_getChartType(t){var e="Default",i=this._chart._isRotated();switch(t){case wijmo_chart_1.ChartType.Scatter:case wijmo_chart_1.ChartType.Bubble:case wijmo_chart_1.ChartType.Candlestick:case wijmo_chart_1.ChartType.HighLowOpenClose:e="Scatter";break;case wijmo_chart_1.ChartType.Column:case wijmo_chart_1.ChartType.Bar:e=i?"Bar":"Column";break;case wijmo_chart_1.ChartType.Line:case wijmo_chart_1.ChartType.LineSymbols:case wijmo_chart_1.ChartType.Area:case wijmo_chart_1.ChartType.Spline:case wijmo_chart_1.ChartType.SplineSymbols:case wijmo_chart_1.ChartType.SplineArea:e="Line";break;default:e="Default"}return e}_playLoadLineAnimation(t,e){var i,a=this,n=a._chart.series[e],s=a.animationMode,r=n.hostElement;if(s===AnimationMode.Point)a._playDefaultAnimation(t,e);else{i=s===AnimationMode.All?a._getAnimation(t,0):a._getAnimation(t,e);[].slice.call(r.childNodes).forEach(t=>{a._setLineRiseDiveAnimation(i,t,!0)})}}_setLineRiseDiveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,m=c._chart,u=e.nodeName,_=[],d=[],p=c._chart._plotRect,A=p.top+p.height,f=p.left,g={},y={};if("g"===u&&e.childNodes)[].slice.call(e.childNodes).forEach(e=>{this._setLineRiseDiveAnimation(t,e,i)});else{if("polyline"===u||"polygon"===u){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){o=l[r]||l.getItem(r);m.rotated?_.push({x:f,y:o.y}):_.push({x:o.x,y:A});d.push({x:o.x,y:o.y})}g[u]=_;y[u]=d}else if("ellipse"===u||"rect"===u){c._toggleVisibility(e,!1);i&&(h=function(){c._toggleVisibility(e,!0)})}a=i?g:y;n=i?y:g;c._setInitState(e,a,n);t.push({ele:e,from:a,to:n,done:h})}}_setLineMoveAnimation(t,e,i,a,n){if(null!=e&&null!=i){var s,r,o,l,h,c,m,u,_,d=e.nodeName,p=[],A=[],f={},g={};if("polyline"===d||"polygon"===d){_="polygon"===d;o=e.points;c=i.points;s=o.length||o.numberOfItems;l=c.length||c.numberOfItems;u=Math.max(s,l);for(m=0;m<u;m++){if(m<s){r=o[m]||o.getItem(m);p.push({x:r.x,y:r.y})}if(m<l){h=c[m]||c.getItem(m);A.push({x:h.x,y:h.y})}}if(this._addStart){this._adjustStartLinePoints(this._addStart,p,o);s+=this._addStart}else if(this._removeStart){this._adjustStartLinePoints(this._removeStart,A,c);l+=this._removeStart}l>s?this._adjustEndLinePoints(l,s,p,o,_):l<s&&this._adjustEndLinePoints(s,l,A,c,_);f[d]=p;g[d]=A;this._setInitState(a,f,g);t.push({ele:a,from:f,to:g,done:n})}}}_adjustStartLinePoints(t,e,i){for(var a=i[0]||i.getItem(0);t;){e.splice(0,0,{x:a.x,y:a.y});t--}}_adjustEndLinePoints(t,e,i,a,n){var s,r,o;if(n&&(a.length>=3||a.numberOfItems>=3)){r=i.pop();s=i.pop();o=a[a.length-3]||a.getItem(a.numberOfItems-3)}else(a.length>0||a.numberOfItems>0)&&(o=a[a.length-1]||a.getItem(a.numberOfItems-1));for(;t>e&&o;){i.push({x:o.x,y:o.y});e++}if(n&&r&&s){i.push(s);i.push(r)}}_playLineRemoveAnimation(t,e){var i,a=this,n=a._chart.series[0].hostElement.parentNode,s=a._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{a._setLineRiseDiveAnimation(s,t,!1)});if(s.length){i=s[0].done;s[0].done=function(){e&&e.parentNode===n&&n.removeChild(e);i&&i()}}}_playLineAddAnimation(t,e){var i=e.hostElement,a=this._getAnimation(t,0);[].slice.call(i.childNodes).forEach(t=>{this._setLineRiseDiveAnimation(a,t,!0)})}_playLineMoveAnimation(t,e,i){var a,n,s,r,o=this,l=(o._chart,o._getAnimation(t,0)),h=[];a=e.hostElement;n=[].slice.call(i.childNodes);[].slice.call(a.childNodes).forEach((t,e)=>{r=t.nodeName;s=n[e];if("g"===r&&t.nodeChilds)[].slice.call(t.nodeChilds).forEach((t,e)=>{if(s){h.push(t);o._toggleVisibility(t,!1)}});else if("polygon"===r||"polyline"===r)o._setLineMoveAnimation(l,s,t,t,0===e?function(){h.forEach(t=>{o._toggleVisibility(t,!0)});h=null}:null);else if(s){h.push(t);o._toggleVisibility(t,!1)}})}_playLoadColumnAnimation(t,e){this._playLoadBarAnimation(t,e,!0)}_playLoadBarAnimation(t,e,i=!1){var a=this,n=a._chart.series[e],s=a.animationMode,r=n.hostElement;[].slice.call(r.childNodes).forEach((n,r)=>{var o,l=n.nodeName;o=s===AnimationMode.Point?a._getAnimation(t,r):s===AnimationMode.Series?a._getAnimation(t,e):a._getAnimation(t,0);"g"===l?n.childNodes&&[].slice.call(n.childNodes).forEach((t,e)=>{a._setLoadBarAnimation(o,t,i)}):a._setLoadBarAnimation(o,n,i)})}_setBarAnimation(t,e,i,a,n){this._setInitState(e,i,a);t.push({ele:e,from:i,to:a,done:n})}_setLoadBarAnimation(t,e,i,a=!1,n){var s,r,o=this,l=i?"height":"width",h=i?"y":"x",c=e.getAttribute(l),m=e.getAttribute(h),u=i?"top":"left",_=o._chart._plotRect,d={},p={};d[l]=0;p[l]=Number(c);if(i){d[h]=_[l]+_[u];p[h]=Number(m)}s=a?p:d;r=a?d:p;"g"===e.nodeName?e.childNodes&&[].slice.call(e.childNodes).forEach(e=>{o._setBarAnimation(t,e,s,r,n)}):o._setBarAnimation(t,e,s,r,n)}_setMoveBarAnimation(t,e,i){var a={},n={};if(null!=e&&null!=i){["width","height","x","y","top","left"].forEach(t=>{var s=e.getAttribute(t),r=i.getAttribute(t);if(s!==r){a[t]=Number(s);n[t]=Number(r)}});this._setInitState(i,a,n);t.push({ele:i,from:a,to:n})}}_playColumnRemoveAnimation(t,e){this._playBarRemoveAnimation(t,e,!0)}_playColumnAddAnimation(t,e){this._playBarAddAnimation(t,e,!0)}_playColumnMoveAnimation(t,e,i){this._playBarMoveAnimation(t,e,i,!0)}_playBarRemoveAnimation(t,e,i=!1){var a=this,n=a._chart.series[0].hostElement.parentNode,s=a._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{a._setLoadBarAnimation(s,t,i,!0)});s.length&&(s[0].done=function(){e&&e.parentNode===n&&n.removeChild(e)})}_playBarAddAnimation(t,e,i=!1){var a=e.hostElement,n=this._getAnimation(t,2);[].slice.call(a.childNodes).forEach(t=>{this._setLoadBarAnimation(n,t,i,!1)})}_playBarMoveAnimation(t,e,i,a=!1){var n,s,r,o,l,h,c,m=this;m._chart;n=e.hostElement;r=[].slice.call(i.childNodes);if(m._addStart){c=0;o=r[0];for(;c<m._addStart;){r.splice(0,0,o);c++}}if(m._removeStart){c=0;o=r[r.length-1];for(;c<m._removeStart;){var u=r.shift();r.push(u);c++}}l=r.length;s=[].slice.call(n.childNodes);h=s.length;s.forEach((e,i)=>{var n;if(i<l){o=r[i];if(i<m._addStart){n=m._getAnimation(t,2);m._setLoadBarAnimation(n,e,a,!1)}else if(i>=l-m._removeStart){n=m._getAnimation(t,2);m._setLoadBarAnimation(n,e,a,!1);n=m._getAnimation(t,0);m._removeBarAnimation(n,e,o,a)}else{n=m._getAnimation(t,1);m._setMoveBarAnimation(n,o,e)}if(i===h-1&&i<l-1){n=m._getAnimation(t,0);for(i++;i<l;i++){o=r[i];m._removeBarAnimation(n,e,o,a)}}}else{n=m._getAnimation(t,2);m._setLoadBarAnimation(n,e,a,!1)}})}_removeBarAnimation(t,e,i,a){var n=e.parentNode;n.appendChild(i);this._setLoadBarAnimation(t,i,a,!0,function(t){return function(){t.parentNode&&t.parentNode===n&&n.removeChild(t)}}(i))}_playLoadScatterAnimation(t,e){var i=this,a=i._chart,n=a.series[e],s=i.animationMode,r=n.hostElement,o=n._xValues||a._xvals;0===o.length&&(o=n._pointIndexes);[].slice.call(r.childNodes).forEach((a,n)=>{var r;r=s===AnimationMode.Point?i._getScatterAnimation(t,o[n]):s===AnimationMode.Series?i._getAnimation(t,e):i._getAnimation(t,0);i._setLoadScatterAnimation(r,a,!1)})}_setLoadScatterAnimation(t,e,i=!1,a){var n,s,r={},o={};if("g"===e.nodeName&&e.childNodes)[].slice.call(e.childNodes).forEach(e=>{this._setLoadScatterAnimation(t,e,i,a)});else{["rx","ry","stroke-width"].forEach(t=>{var i=e.getAttribute(t);r[t]=0;o[t]=Number(i)});n=i?o:r;s=i?r:o;this._setInitState(e,n,s);t.push({ele:e,from:n,to:s,done:a})}}_setUpdateScatterAnimation(t,e,i,a){var n={},s={};["cx","cy"].forEach(t=>{var a=e.getAttribute(t),r=i.getAttribute(t);if(a!==r){n[t]=Number(a);s[t]=Number(r)}});this._setInitState(i,n,s);t.push({ele:i,from:n,to:s,done:a})}_getScatterAnimation(t,e){var i=this._getScatterAnimationIndex(t,e);t[i]||(t[i]=[]);return t[i]}_getScatterAnimationIndex(t,e){var i=this._chart.axisX,a=null==i.min?i.actualMin:i.min,n=null==i.max?i.actualMax:i.max;return Math.ceil((e-a)/((n-a)/20))}_playScatterRemoveAnimation(t,e){var i=this,a=i._chart.series[0].hostElement.parentNode,n=i._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{i._setLoadScatterAnimation(n,t,!0)});n.length&&(n[0].done=function(){e&&e.parentNode===a&&a.removeChild(e)})}_playScatterAddAnimation(t,e){var i=e.hostElement,a=this._getAnimation(t,0);[].slice.call(i.childNodes).forEach(t=>{this._setLoadScatterAnimation(a,t,!1)})}_playScatterMoveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,m=(c._chart,c._getAnimation(t,0));a=e.hostElement;s=[].slice.call(i.childNodes);if(c._addStart){h=0;r=s[0];for(;h<c._addStart;){s.splice(0,0,r);h++}}if(c._removeStart){h=0;r=s[s.length-1];for(;h<c._removeStart;){var u=s.shift();s.push(u);h++}}o=s.length;n=[].slice.call(a.childNodes);l=n.length;n.forEach((t,e)=>{if(e<o){if(e<c._addStart)c._setLoadScatterAnimation(m,t,!1);else if(e>=o-c._removeStart){c._setLoadScatterAnimation(m,t,!1);r=s[e];c._removeScatterAnimation(m,t,r)}else{r=s[e];c._setUpdateScatterAnimation(m,r,t)}if(e===l-1&&e<o-1)for(e++;e<o;e++){r=s[e];c._removeScatterAnimation(m,t,r)}}else c._setLoadScatterAnimation(m,t,!1)})}_removeScatterAnimation(t,e,i){var a=e.parentNode;a.appendChild(i);this._setLoadScatterAnimation(t,i,!0,function(t){return function(){t.parentNode&&t.parentNode===a&&a.removeChild(t)}}(i))}_playDefaultAnimation(t,e){var i,a,n=this._chart,s=n.series[e].hostElement,r=n._plotRect,o=n._currentRenderEngine,l=s.getAttribute("clip-path"),h="clipPath"+(1e6*Math.random()).toFixed();let c=n.axisX.reversed;o.addClipRect(new wijmo_1.Rect(c?r.right:r.left,r.top,0,r.height),h);s.setAttribute("clip-path","url(#"+h+")");i=n.hostElement.querySelector("#"+h);a=this._getAnimation(t,0);let m={width:0},u={width:r.width};if(c){m.x=r.right;u.x=r.left}a.push({ele:i.querySelector("rect"),from:m,to:u,done:function(){if(s){l?s.setAttribute("clip-path",l):s.removeAttribute("clip-path");i&&i.parentNode&&i.parentNode.removeChild(i)}}})}}class FlexRadarAnimation extends FlexChartAnimation{constructor(t,e){super(t,e)}_getDurationAndDelay(t,e){var i=super._getDurationAndDelay(t,e);if(this.animationMode===AnimationMode.Point){i.duration=e/t;i.delay=e/t}return i}_playAxesAnimation(){}_getChartType(t){var e=super._getChartType(t);"Bar"===e&&(e="Column");return e}_playLoadLineAnimation(t,e){var i,a,n,s=this,r=s._chart,o=s._chart.series[e],l=o._xValues||r._xvals,h=s.animationMode,c=o.hostElement;if(h===AnimationMode.Point){0===l.length&&(l=o._pointIndexes);n=[].slice.call(c.childNodes);a=n.length-c.querySelectorAll("ellipse").length;n.forEach((e,i)=>{s._setRadarLinePointAnimation(t,e,i,l,a)})}else{i=h===AnimationMode.All?s._getAnimation(t,0):s._getAnimation(t,e);[].slice.call(c.childNodes).forEach(t=>{s._setLineRiseDiveAnimation(i,t,!0)})}}_setRadarLinePointAnimation(t,e,i,a,n){var s,r,o,l,h,c,m,u=this,_=u._chart,d=e.nodeName,p=[],A=[],f=[],g=[],y=_._center,x=[],E=!1,v={},S={},w=0;if("polyline"===d||"polygon"===d){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){x[m=u._getScatterAnimationIndex(t,a[r])]||(x[m]=[]);x[m].push(r);o=l[r]||l.getItem(r);p.push({x:y.x,y:y.y});A.push({x:o.x,y:o.y})}for(r=0,s=x.length;r<s;r++)if(x[r]){c=u._getAnimation(t,w);f=g.length?g.slice():p.slice();g=f.slice();x[r].forEach(t=>{var e=A[t];g[t]={x:e.x,y:e.y}});S={};(v={})[d]=f;S[d]=g;if(!E){u._setInitState(e,v,S);E=!0}c.push({ele:e,from:v,to:S,done:h});w++}}else if("ellipse"===d){if((r=i-(n||0))<0)return;c=_._isPolar?u._getScatterAnimation(t,a[r]):u._getScatterAnimation(t,r);u._toggleVisibility(e,!1);h=function(){u._toggleVisibility(e,!0)};c.push({ele:e,from:v,to:S,done:h})}}_setLineRiseDiveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,m=c._chart,u=e.nodeName,_=[],d=[],p=m._center,A={},f={};if("polyline"===u||"polygon"===u){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){o=l[r]||l.getItem(r);_.push({x:p.x,y:p.y});d.push({x:o.x,y:o.y})}A[u]=_;f[u]=d}else if("ellipse"===u){c._toggleVisibility(e,!1);i&&(h=function(){c._toggleVisibility(e,!0)})}a=i?A:f;n=i?f:A;c._setInitState(e,a,n);t.push({ele:e,from:a,to:n,done:h})}_parsePathByRadius(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep;a=[s,r,0,l,h,0];n=[s,r,o,l,h,t.innerRadius||0];e.pie=a;i.pie=n}_playUpdateAnimation(t,e,i,a,n){if("Bar"===i||"Column"===i){if(null==a)return;this._playLoadBarAnimation(t,e,!1)}else super._playUpdateAnimation(t,e,i,a,n)}_playLoadBarAnimation(t,e,i=!1){var a=this,n=a._chart,s=n.series[e],r=n._areas[e],o=a.animationMode,l=s.hostElement;[].slice.call(l.childNodes).forEach((i,n)=>{var s,l,h={},c={};s=o===AnimationMode.Point?a._getAnimation(t,n):o===AnimationMode.Series?a._getAnimation(t,e):a._getAnimation(t,0);l=r[n];a._parsePathByRadius(l,h,c);a._setInitState(i,h,c);s.push({ele:i,from:h,to:c})})}}class AnimationHelper{static playAnimations(t,e,i,a,n=Easing.Swing,s,r){var o=t.length,l=0,h=[];t.forEach((t,c)=>{var m=AnimationHelper.playAnimation(t,e[c],i[c],(function(){l===o-1&&a&&a();l++}),n,s,r);h.push(m)});return h}static playAnimation(t,e,i,a,n=Easing.Swing,s,r){var o=AnimationHelper.parseAttrs(e,i);return AnimationHelper.animate((function(e){AnimationHelper.setElementAttr(t,o,e)}),a,n,s,r)}static setElementAttr(t,e,i){var a,n;for(n in e){a=e[n];AnimationHelper.calcValue(a,i);t.setAttribute(n,a.getValue(a.value,i))}}static getPathDescOfPie(t,e,i,a,n,s=0){var r=!1;if(n>=2*Math.PI){r=!0;n=2*Math.PI-.001}var o=new wijmo_1.Point(t,e);o.x+=i*Math.cos(a);o.y+=i*Math.sin(a);var l=a+n,h=new wijmo_1.Point(t,e);h.x+=i*Math.cos(l);h.y+=i*Math.sin(l);if(s){var c=new wijmo_1.Point(t,e);c.x+=s*Math.cos(l);c.y+=s*Math.sin(l);var m=new wijmo_1.Point(t,e);m.x+=s*Math.cos(a);m.y+=s*Math.sin(a)}var u=" 0 0,1 ",_=" 0 0,0 ";if(Math.abs(n)>Math.PI){u=" 0 1,1 ";_=" 0 1,0 "}var d="M "+o.x.toFixed(3)+","+o.y.toFixed(3);d+=" A "+i.toFixed(3)+","+i.toFixed(3)+u;d+=h.x.toFixed(3)+","+h.y.toFixed(3);if(s){d+=r?" M "+c.x.toFixed(3)+","+c.y.toFixed(3):" L "+c.x.toFixed(3)+","+c.y.toFixed(3);d+=" A "+s.toFixed(3)+","+s.toFixed(3)+_;d+=m.x.toFixed(3)+","+m.y.toFixed(3)}else d+=" L "+t.toFixed(3)+","+e.toFixed(3);r||(d+=" z");return d}static parseAttrs(t,e){var i={};for(var a in t)if(null!=e[a])switch(a){case"polyline":i.points=AnimationHelper.parseAttr(t[a],e[a],(function(t,e){if(1===e){for(var i,a,n;t.length>1;){a=t[0];n=t[1];if(a.x!==n.x||a.y!==n.y){a=null;n=null;break}t.splice(1,1)}for(i=t.length-1;i>0;i--){a=n;n=t[i];if(a){if(a.x!==n.x||a.y!==n.y)break;t.pop()}}}return t.map(t=>t.x+","+t.y).join(" ")}));break;case"polygon":i.points=AnimationHelper.parseAttr(t[a],e[a],(function(t,e){if(1===e){var i,a,n,s,r;s=t.pop();r=t.pop();for(;t.length>1;){a=t[0];n=t[1];if(a.x!==n.x||a.y!==n.y){a=null;n=null;break}t.splice(1,1)}for(i=t.length-1;i>=0;i--){a=n;n=t[i];if(a){if(a.x!==n.x||a.y!==n.y)break;t.splice(i,1)}}t.push(r);t.push(s)}return t.map(t=>t.x+","+t.y).join(" ")}));break;case"d":i[a]=AnimationHelper.parseAttr(t[a],e[a],(function(t){return t.map(t=>"string"==typeof t?t:t[0]+","+t[1]).join(" ")}));break;case"pie":i.d=AnimationHelper.parseAttr(t[a],e[a],(function(t){return AnimationHelper.getPathDescOfPie.apply(AnimationHelper,t)}));break;case"rotate":i.transform=AnimationHelper.parseAttr(t[a],e[a],(function(t){return"rotate("+t.join(" ")+")"}));break;case"x":case"width":case"height":case"rx":case"ry":case"stroke-width":i[a]=AnimationHelper.parseAttr(t[a],e[a],(function(t){return Math.abs(t)}));break;default:i[a]=AnimationHelper.parseAttr(t[a],e[a])}return i}static animate(t,e,i=Easing.Swing,a=400,n=16){wijmo_1.asFunction(t);wijmo_1.asNumber(a,!1,!0);wijmo_1.asNumber(n,!1,!0);var s=0,r=setInterval((function(){Date.now();var o=s/a;o=EasingHelper[Easing[i]](o);t(o);if((s+=n)>=a){clearInterval(r);(o<1||o>1)&&t(1);e&&e()}}),n);return r}static calcValue(t,e){var i=t.from,a=t.diff,n=t.value;wijmo_1.isNumber(i)?t.value=0===a?i:i+a*e:wijmo_1.isArray(i)&&AnimationHelper.parseArrayAttr(n,i,a,(function(t,i){return"number"==typeof t?t+i*e:t}))}static parseAttr(t,e,i){var a,n,s,r;if(wijmo_1.isArray(t)&&wijmo_1.isArray(e)){n=e;s=[];r=(a=t).slice();AnimationHelper.parseArrayAttr(s,a,n,(function(t,e){return t===e?0:e-t}))}else{r=a=Number(t);s=(n=Number(e))-a}return{from:a,to:n,value:r,diff:s,getValue:i||function(t,e){return t}}}static parseArrayAttr(t,e,i,a){e.forEach((e,n)=>{var s={},r=[],o=i[n];if(wijmo_1.isNumber(e)||"string"==typeof e)t[n]=a(e,o);else if(wijmo_1.isArray(e)){e.forEach((t,i)=>{r[i]=a(e[i],o[i])});t[n]=r}else{Object.getOwnPropertyNames(e).forEach(t=>{s[t]=a(e[t],o[t])});t[n]=s}})}}class EasingHelper{static Linear(t){return t}static Swing(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)}static EaseInQuad(t){return t*t}static EaseOutQuad(t){return t*(2-t)}static EaseInOutQuad(t){return t<.5?2*t*t:(4-2*t)*t-1}static EaseInCubic(t){return t*t*t}static EaseOutCubic(t){return--t*t*t+1}static EaseInOutCubic(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}static EaseInQuart(t){return t*t*t*t}static EaseOutQuart(t){return 1- --t*t*t*t}static EaseInOutQuart(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t}static EaseInQuint(t){return t*t*t*t*t}static EaseOutQuint(t){return 1+--t*t*t*t*t}static EaseInOutQuint(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}static EaseInSine(t){return 1-Math.cos(t*(Math.PI/2))}static EaseOutSine(t){return Math.sin(t*(Math.PI/2))}static EaseInOutSine(t){return-.5*(Math.cos(Math.PI*t)-1)}static EaseInExpo(t){return 0==t?0:Math.pow(2,10*(t-1))}static EaseOutExpo(t){return 1==t?1:1-Math.pow(2,-10*t)}static EaseInOutExpo(t){return t==!!t?t:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))}static EaseInCirc(t){return-(Math.sqrt(1-t*t)-1)}static EaseOutCirc(t){return Math.sqrt(1-Math.pow(t-1,2))}static EaseInOutCirc(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static EaseInBack(t){var e=1.70158;return t*t*((e+1)*t-e)}static EaseOutBack(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1}static EaseInOutBack(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)}static EaseInBounce(t){return 1-EasingHelper.EaseOutBounce(1-t)}static EaseOutBounce(t){var e=7.5625;return t<1/2.75?e*t*t:t<2/2.75?e*(t-=1.5/2.75)*t+.75:t<2.5/2.75?e*(t-=2.25/2.75)*t+.9375:e*(t-=2.625/2.75)*t+.984375}static EaseInOutBounce(t){return t<.5?.5*EasingHelper.EaseInBounce(2*t):.5*EasingHelper.EaseOutBounce(2*t-1)+.5}static EaseInElastic(t){return t==!!t?t:-Math.pow(2,10*(t-=1))*Math.sin((t-.075)*(2*Math.PI)/.3)}static EaseOutElastic(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1}static EaseInOutElastic(t){return t==!!t?t:(t*=2)<1?Math.pow(2,10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*-.5:Math.pow(2,-10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*.5+1}}wijmo_1._registerModule("wijmo.chart.animation",selfModule); |
/*! | ||
* | ||
* Wijmo Library 5.20242.21 | ||
* Wijmo Library 5.20242.30 | ||
* https://developer.mescius.com/wijmo | ||
@@ -14,2 +14,2 @@ * | ||
import{_getModule,isNumber,isArray,asNumber,asFunction,Point,Rect,hasClass,isDate,asBoolean,Size,asEnum,Event,EventArgs,assert,_registerModule}from"@grapecity/wijmo";import{ChartType,FlexChart,TickMark,AxisType,FlexPie,FlexChartCore}from"@grapecity/wijmo.chart";import*as selfModule from"@grapecity/wijmo.chart.animation";export function softFinancial(){return _getModule("wijmo.chart.finance")}export function softRadar(){return _getModule("wijmo.chart.radar")}export var Easing;!function(t){t[t.Linear=0]="Linear";t[t.Swing=1]="Swing";t[t.EaseInQuad=2]="EaseInQuad";t[t.EaseOutQuad=3]="EaseOutQuad";t[t.EaseInOutQuad=4]="EaseInOutQuad";t[t.EaseInCubic=5]="EaseInCubic";t[t.EaseOutCubic=6]="EaseOutCubic";t[t.EaseInOutCubic=7]="EaseInOutCubic";t[t.EaseInQuart=8]="EaseInQuart";t[t.EaseOutQuart=9]="EaseOutQuart";t[t.EaseInOutQuart=10]="EaseInOutQuart";t[t.EaseInQuint=11]="EaseInQuint";t[t.EaseOutQuint=12]="EaseOutQuint";t[t.EaseInOutQuint=13]="EaseInOutQuint";t[t.EaseInSine=14]="EaseInSine";t[t.EaseOutSine=15]="EaseOutSine";t[t.EaseInOutSine=16]="EaseInOutSine";t[t.EaseInExpo=17]="EaseInExpo";t[t.EaseOutExpo=18]="EaseOutExpo";t[t.EaseInOutExpo=19]="EaseInOutExpo";t[t.EaseInCirc=20]="EaseInCirc";t[t.EaseOutCirc=21]="EaseOutCirc";t[t.EaseInOutCirc=22]="EaseInOutCirc";t[t.EaseInBack=23]="EaseInBack";t[t.EaseOutBack=24]="EaseOutBack";t[t.EaseInOutBack=25]="EaseInOutBack";t[t.EaseInBounce=26]="EaseInBounce";t[t.EaseOutBounce=27]="EaseOutBounce";t[t.EaseInOutBounce=28]="EaseInOutBounce";t[t.EaseInElastic=29]="EaseInElastic";t[t.EaseOutElastic=30]="EaseOutElastic";t[t.EaseInOutElastic=31]="EaseInOutElastic"}(Easing||(Easing={}));export var AnimationMode;!function(t){t[t.All=0]="All";t[t.Point=1]="Point";t[t.Series=2]="Series"}(AnimationMode||(AnimationMode={}));export class ChartAnimation{constructor(t,e){this._play=!0;this.ended=new Event;var i=this,a=t.hostElement,n=new Size(a.offsetWidth,a.offsetHeight);i._chart=t;i._updateEventArgs=[];if(t instanceof FlexPie)i._animation=new FlexPieAnimation(t,i._updateEventArgs);else{softRadar()&&t instanceof softRadar().FlexRadar?i._animation=new FlexRadarAnimation(t,i._updateEventArgs):t instanceof FlexChartCore&&(i._animation=new FlexChartAnimation(t,i._updateEventArgs));i._chartType=t.chartType}assert(void 0!==i._animation,"Animation is not supported");i._initOptions(e);t.beginUpdate();window.setTimeout(()=>{t.rendered.addHandler(i._playAnimation,i);t.endUpdate()},0);i._setCV(t.collectionView);window.addEventListener("resize",(function(t){var e=new Size(a.offsetWidth,a.offsetHeight);if(!n.equals(e)){i._play=!1;n=e}}))}_initOptions(t){if(t){t.duration&&(this.duration=t.duration);t.easing&&(this.easing=t.easing);t.animationMode&&(this.animationMode=t.animationMode);void 0!==t.axisAnimation&&(this.axisAnimation=t.axisAnimation)}}_setCV(t){this._cv=t;this._animation._clearState()}get animationMode(){return this._animation.animationMode}set animationMode(t){(t=asEnum(t,AnimationMode))!=this.animationMode&&(this._animation.animationMode=t)}get easing(){return this._animation.easing}set easing(t){(t=asEnum(t,Easing))!=this.easing&&(this._animation.easing=t)}get duration(){return this._animation.duration}set duration(t){(t=asNumber(t))!=this.duration&&(this._animation.duration=t)}get axisAnimation(){return this._animation.axisAnimation}set axisAnimation(t){(t=asBoolean(t))!=this.axisAnimation&&(this._animation.axisAnimation=t)}get chart(){return this._chart}_playAnimation(){var t=this,e=t._chart,i=e.chartType;t._cv!==e.collectionView&&t._setCV(e.collectionView);if(null!=t._chartType&&t._chartType!==i){t._chartType=i;t._animation._clearState()}t._play?t._animation.playAnimation(()=>t.ended.raise(t,EventArgs.empty)):t._play=!0}animate(){var t=this._chart;if(t){var e=t.itemsSource;t.beginUpdate();t.itemsSource=null;t.itemsSource=e;t.endUpdate()}}}class FlexAnimation{constructor(t,e){this._axisAnimation=!0;this._chart=t;this._timers=[]}get animationMode(){return this._animationMode||AnimationMode.All}set animationMode(t){if((t=asEnum(t,AnimationMode,!1))!==this._animationMode){this._clearState();this._animationMode=t}}get easing(){return null==this._easing?Easing.Swing:this._easing}set easing(t){t!==this._easing&&(this._easing=asEnum(t,Easing,!1))}get duration(){return this._duration||400}set duration(t){t!==this._duration&&(this._duration=asNumber(t,!1,!0))}get axisAnimation(){return!!this._axisAnimation}set axisAnimation(t){t!==this._axisAnimation&&(this._axisAnimation=asBoolean(t,!1))}playAnimation(t){}_clearState(){this._previousState&&(this._previousState=null);this._currentState&&(this._currentState=null)}_setInitState(t,e,i){var a=AnimationHelper.parseAttrs(e,i);AnimationHelper.setElementAttr(t,a,0)}_getAnimation(t,e){t[e]||(t[e]=[]);return t[e]}_toggleVisibility(t,e){e?AnimationHelper.playAnimation(t,{opacity:0},{opacity:1},null,Easing.Swing,100):t.setAttribute("opacity","0")}_toggleDataLabelVisibility(t){var e=this._chart.hostElement,i=e&&e.querySelector(".wj-data-labels");i&&this._toggleVisibility(i,t)}_playAnimation(t,e){var i,a=this,n=a.duration,s=a.easing,r=t.length;a._toggleDataLabelVisibility(!1);i=a._getDurationAndDelay(t.length,n);if(this._timers&&this._timers.length){this._timers.forEach(t=>window.clearInterval(t));this._timers.length=0}t.forEach((t,n)=>{var o;if(t){o=window.setTimeout(()=>{var o;t.forEach((t,l)=>{if(t&&t.ele){if(n===r-1&&0===l){var h=t.done;t.done=function(){a._toggleDataLabelVisibility(!0);h&&h();e&&e()}}if(isArray(t.ele)){o=AnimationHelper.playAnimations(t.ele,t.from,t.to,t.done,s,i.duration);this._timers=this._timers.concat.apply(o)}else{o=AnimationHelper.playAnimation(t.ele,t.from,t.to,t.done,s,i.duration);this._timers.push(o)}}})},i.delay*n);this._timers.push(o)}})}_getDurationAndDelay(t,e){var i={duration:e,delay:0};if(t>1)if(this._previousState){i.duration=e/t;i.delay=e/t}else{i.duration=.5*e;i.delay=.5*e/(t-1)}return i}}class FlexPieAnimation extends FlexAnimation{constructor(t,e){super(t,e);t.selectionChanged.addHandler(this._selectionChanged,this)}_selectionChanged(){this._isSelectionChanged=!0}_clearState(){super._clearState();this._isSelectionChanged=!1}_getElementRotate(t){var e,i=t.getAttribute("transform");if(i&&i.indexOf("rotate")>-1){if(1==(i=(i=i.replace("rotate(","").replace(")","")).indexOf(",")>-1?i.split(",").map(t=>+t):i.split(" ").map(t=>+t)).length){e=this._chart._areas[0].center;i.push(e.x,e.y)}}else i=[0,(e=this._chart._areas[0].center).x,e.y];return i}_getDurationAndDelay(t,e){var i={duration:e,delay:0};if(this.animationMode===AnimationMode.Point&&t>1){i.duration=e/t;i.delay=e/t}return i}playAnimation(t){super.playAnimation(t);var e=[];this._playPieAnimation(e);e.length&&this._playAnimation(e,t)}_playPieAnimation(t){var e=this._chart,i=!0;this._previousState=this._currentState;this._currentState={areas:e._areas,pels:e._pels,rotate:e._pels.length&&this._getElementRotate(e._pels[0].parentNode)};this._previousState&&(i=!1);if(this._isSelectionChanged){e.isAnimated||this._playSelectPieAnimation(t);this._isSelectionChanged=!1}else i?this._playLoadPieAnimation(t):this._playUpdatePieAnimation(t)}_playSelectPieAnimation(t){if(null!=this._previousState){var e,i,a,n=this._chart._pels[0].parentNode,s=this._previousState.rotate,r=this._getElementRotate(n),o=s[0],l=r[0];if(o!==l){o-l>180?r[0]+=360:l-o>180&&(s[0]+=360);e=this._getAnimation(t,0);i={rotate:s};a={rotate:r};this._setInitState(n,i,a);e.push({ele:n,from:i,to:a})}}}_playUpdatePieAnimation(t){var e,i,a,n,s=this._chart,r=this._previousState,o=s._areas,l=s._pels,h=r.areas.length,c=o.length,u=Math.max(c,h),m=this._getAnimation(t,0),d=0;if(0!==c&&0!==h){this._playSelectPieAnimation(t);for(e=0;e<u;e++){i={};if(l[e]&&l[e].childNodes&&l[e].childNodes.length>0){if(e<c&&e<h){a=o[0];0===e&&(d=a.angle);1===h?l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(a.center.x,a.center.y,a.radius,d,2*Math.PI,a.innerRadius||0)):l[e].childNodes[0].setAttribute("d",r.pels[e].childNodes[0].getAttribute("d"))}if(e<c){a=o[e];i.to={pie:[a.center.x,a.center.y,a.radius,a.angle,a.sweep,a.innerRadius||0]};i.ele=l[e].childNodes[0]}else{a=o[0];n=r.pels[e];i.to={pie:[a.center.x,a.center.y,a.radius,d+2*Math.PI,0,a.innerRadius||0]};l[0].parentNode.appendChild(n);i.done=function(t){return function(){t.parentNode.removeChild(t)}}(n);i.ele=n.childNodes[0]}if(e<h){a=r.areas[e];i.from={pie:[a.center.x,a.center.y,a.radius,a.angle,a.sweep,a.innerRadius||0]}}else{l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(a.center.x,a.center.y,a.radius,2*Math.PI+d,0,a.innerRadius||0));a=r.areas[0];i.from={pie:[a.center.x,a.center.y,a.radius,2*Math.PI+d,0,a.innerRadius||0]}}m.push(i)}}}}_playLoadPieAnimation(t){var e=this,i=e._chart,a=e.animationMode,n=i._areas;i._pels.forEach((i,s)=>{var r,o=i.childNodes[0],l={},h={};if(o){if(a===AnimationMode.Point){e._parsePathByAngle(n[s],l,h);r=e._getAnimation(t,s)}else{e._parsePathByRadius(n[s],l,h);r=e._getAnimation(t,0)}e._setInitState(o,l,h);r.push({ele:o,from:l,to:h})}})}_parsePathByRadius(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep;a=[s,r,0,l,h,0];n=[s,r,o,l,h,t.innerRadius||0];e.pie=a;i.pie=n}_parsePathByAngle(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep,c=t.innerRadius;a=[s,r,o,l,0,c||0];n=[s,r,o,l,h,c||0];e.pie=a;e["stroke-width"]=0;i.pie=n;i["stroke-width"]=1}}class FlexChartAnimation extends FlexAnimation{constructor(t,e){super(t,e)}playAnimation(t){super.playAnimation(t);var e,i,a,n,s,r,o,l,h,c=!0,u=this._chart,m=softFinancial()&&u instanceof softFinancial().FinancialChart,d=u.series,p=d.length,_=[];this._previousState=this._currentState;this._previousXVal=this._currentXVal;this._currentState=[];this._addStart=0;this._removeStart=0;this._currentXVal=u._xlabels.slice();if(this._previousState&&this._previousState.length){c=!1;s=(r=this._previousState).length;o=this._previousXVal;l=this._currentXVal;o.length>2&&l.length>2&&((e=l.indexOf(o[0]))>0&&e<l.length-2?l[e+1]===o[1]&&l[e+2]===o[2]&&(this._addStart=e):(e=o.indexOf(l[0]))>0&&e<o.length-2&&o[e+1]===l[1]&&o[e+2]===l[2]&&(this._removeStart=e))}for(e=0;e<p;e++){n=null!=(i=d[e])._getChartType()?i._getChartType():u._getChartType();a=this._getChartType(n);this._currentState.push({seriesType:n,ele:i.hostElement});if(m)this._playDefaultAnimation(_,e);else{h=r&&r[e];if("Default"===a){this._playDefaultAnimation(_,e);continue}if(c||h&&h.seriesType!==n||h&&h.ele&&(""==h.ele.innerHTML||0===h.ele.childNodes.length))this._playLoadAnimation(_,e,a);else{this._playUpdateAnimation(_,e,a,i,h&&h.ele||null);if(e===p-1&&e<s-1)for(e++;e<=s-1;e++)this._playUpdateAnimation(_,e,a,null,h.ele)}}}this._adjustAnimations(a,_);_.length&&this._playAnimation(_,t);this.axisAnimation&&!m&&this._playAxesAnimation()}_playAxesAnimation(){var t,e,i,a=this._chart.axes,n=a.length;this._prevAxesStates=this._currAxesStates;this._currAxesStates=[];for(e=0;e<n;e++)(t=a[e]).hostElement&&this._currAxesStates.push({ele:t.hostElement,vals:t._vals,axis:t,maxValue:isDate(t.actualMax)?t.actualMax.getTime():t.actualMax,minValue:isDate(t.actualMin)?t.actualMin.getTime():t.actualMin});if(this._prevAxesStates){i=Math.max(this._prevAxesStates.length,this._currAxesStates.length);for(e=0;e<i;e++)this._playAxisAnimation(this._prevAxesStates[e],this._currAxesStates[e])}}_playAxisAnimation(t,e){if(t&&e){var i,a=[],n=[];if(e&&e.maxValue-e.minValue){i=this._parseAxisState(e);this._convertAxisAnimation(a,i.major,e.axis,t.maxValue,t.minValue);this._convertAxisAnimation(a,i.minor,e.axis,t.maxValue,t.minValue)}if(t&&t.maxValue-t.minValue){i=this._parseAxisState(t);this._convertAxisAnimation(n,i.major,t.axis);this._convertAxisAnimation(n,i.minor,t.axis)}a&&n&&this._combineAxisAnimations(a,n);this._playCurrAxisAnimation(a);this._playPrevAxisAnimation(n)}}_combineAxisAnimations(t,e){var i,a,n=e.length;for(i=n-1;i>=0;i--)(a=e[i]).text&&t.some(t=>{if(t.text&&t.text===a.text){this._combineAxisAnimation(t,a);e.splice(i,1);return!0}})}_combineAxisAnimation(t,e){["label","majorGrid","tick"].forEach(i=>{t[i]&&e[i]&&this._resetExistAxisAttrs(t[i],e[i])})}_resetExistAxisAttrs(t,e){var i=t.ele,a=e.ele,n={},s={};["x","y","x1","x2","y1","y2"].forEach(t=>{var e=i.getAttribute(t),r=a.getAttribute(t);if(e!==r){n[t]=r;s[t]=e}});t.calcPos=n;t.elePos=s}_convertAxisAnimation(t,e,i,a,n){var s,r=i.hostElement,o=i.axisType==AxisType.Y;e.forEach((e,l)=>{var h=i.convert(e.val,a,n);if(!isNaN(h)){s={};e.majorGrid&&(s.majorGrid=this._getAxisAnimationAttrs(e.majorGrid,r,h,o));if(e.label){s.label=this._getAxisAnimationAttrs(e.label,r,h,o);s.text=e.label.innerHTML||e.label.textContent}e.tick&&(s.tick=this._getAxisAnimationAttrs(e.tick,r,h,o));t.push(s)}})}_getAxisAnimationAttrs(t,e,i,a){var n,s,r;n={ele:t,parent:e,elePos:{},calcPos:{}};if("text"===t.nodeName){s=a?"y":"x";r=Number(t.getAttribute(s));n.elePos[s]=r;n.calcPos[s]=i}else{s=a?"y1":"x1";r=Number(t.getAttribute(s));if(a){n.elePos={y1:r,y2:r};n.calcPos={y1:i,y2:i}}else{n.elePos={x1:r,x2:r};n.calcPos={x1:i,x2:i}}}n.elePos.opacity=1;n.calcPos.opacity=0;return n}_playCurrAxisAnimation(t){var e=this.duration;t&&0!==t.length&&t.forEach(t=>{["majorGrid","label","tick"].forEach(i=>{var a=t[i];if(a){a.parent;var n=a.ele,s=a.elePos,r=a.calcPos;AnimationHelper.playAnimation(n,r,s,null,Easing.Swing,e)}})})}_playPrevAxisAnimation(t){var e=this.duration;t&&0!==t.length&&t.forEach(t=>{["majorGrid","label","tick"].forEach(i=>{var a=t[i];if(a){var n=a.parent,s=a.ele,r=a.elePos,o=a.calcPos;n.appendChild(s);AnimationHelper.playAnimation(s,r,o,(function(){s.parentNode===n&&n.removeChild(s)}),Easing.Swing,e)}})})}_parseAxisState(t){if(null==t)return null;var e=t.vals,i=t.axis,a=i.axisType==AxisType.Y,n=t.ele.childNodes,s=0,r=[],o=[];let l,h,c;if(e){l=e.major;h=e.minor;c=e.hasLbls}l&&l.forEach((t,e)=>{var o,l={},h=!!c[e];r.push(l);l.val=t;o=n[s];if(i.majorGrid&&hasClass(o,FlexChart._CSS_GRIDLINE)){l.majorGrid=o;o=n[++s]}if(a){if(h&&o&&i.majorTickMarks!==TickMark.None&&hasClass(o,FlexChart._CSS_TICK)){l.tick=o;o=n[++s]}if(h&&o&&(hasClass(o,FlexChart._CSS_LABEL)||o.querySelector("."+FlexChart._CSS_LABEL))){l.label=o;s++}}else{if(h&&o&&(hasClass(o,FlexChart._CSS_LABEL)||o.querySelector("."+FlexChart._CSS_LABEL))){l.label=o;o=n[++s]}if(h&&o&&i.majorTickMarks!==TickMark.None&&hasClass(o,FlexChart._CSS_TICK)){l.tick=o;s++}}});h&&h.forEach((t,e)=>{var a,r={};o.push(r);r.val=t;a=n[s];if(i.minorTickMarks!==TickMark.None&&hasClass(a,FlexChart._CSS_TICK_MINOR)){r.tick=a;a=n[++s]}if(i.minorGrid&&hasClass(a,FlexChart._CSS_GRIDLINE_MINOR)){r.majorGrid=a;s++}});return{major:r,minor:o}}_playLoadAnimation(t,e,i){this["_playLoad"+i+"Animation"](t,e)}_playUpdateAnimation(t,e,i,a,n){null==a||null==n?null==a?this["_play"+i+"RemoveAnimation"](t,n):this["_play"+i+"AddAnimation"](t,a):this["_play"+i+"MoveAnimation"](t,a,n)}_adjustAnimations(t,e){var i,a=e.length;if("Column"===t||"Bar"===t)for(i=a-1;i>=0;i--)null==e[i]&&e.splice(i,1)}_getChartType(t){var e="Default",i=this._chart._isRotated();switch(t){case ChartType.Scatter:case ChartType.Bubble:case ChartType.Candlestick:case ChartType.HighLowOpenClose:e="Scatter";break;case ChartType.Column:case ChartType.Bar:e=i?"Bar":"Column";break;case ChartType.Line:case ChartType.LineSymbols:case ChartType.Area:case ChartType.Spline:case ChartType.SplineSymbols:case ChartType.SplineArea:e="Line";break;default:e="Default"}return e}_playLoadLineAnimation(t,e){var i,a=this,n=a._chart.series[e],s=a.animationMode,r=n.hostElement;if(s===AnimationMode.Point)a._playDefaultAnimation(t,e);else{i=s===AnimationMode.All?a._getAnimation(t,0):a._getAnimation(t,e);[].slice.call(r.childNodes).forEach(t=>{a._setLineRiseDiveAnimation(i,t,!0)})}}_setLineRiseDiveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,u=c._chart,m=e.nodeName,d=[],p=[],_=c._chart._plotRect,A=_.top+_.height,f=_.left,g={},y={};if("g"===m&&e.childNodes)[].slice.call(e.childNodes).forEach(e=>{this._setLineRiseDiveAnimation(t,e,i)});else{if("polyline"===m||"polygon"===m){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){o=l[r]||l.getItem(r);u.rotated?d.push({x:f,y:o.y}):d.push({x:o.x,y:A});p.push({x:o.x,y:o.y})}g[m]=d;y[m]=p}else if("ellipse"===m||"rect"===m){c._toggleVisibility(e,!1);i&&(h=function(){c._toggleVisibility(e,!0)})}a=i?g:y;n=i?y:g;c._setInitState(e,a,n);t.push({ele:e,from:a,to:n,done:h})}}_setLineMoveAnimation(t,e,i,a,n){if(null!=e&&null!=i){var s,r,o,l,h,c,u,m,d,p=e.nodeName,_=[],A=[],f={},g={};if("polyline"===p||"polygon"===p){d="polygon"===p;o=e.points;c=i.points;s=o.length||o.numberOfItems;l=c.length||c.numberOfItems;m=Math.max(s,l);for(u=0;u<m;u++){if(u<s){r=o[u]||o.getItem(u);_.push({x:r.x,y:r.y})}if(u<l){h=c[u]||c.getItem(u);A.push({x:h.x,y:h.y})}}if(this._addStart){this._adjustStartLinePoints(this._addStart,_,o);s+=this._addStart}else if(this._removeStart){this._adjustStartLinePoints(this._removeStart,A,c);l+=this._removeStart}l>s?this._adjustEndLinePoints(l,s,_,o,d):l<s&&this._adjustEndLinePoints(s,l,A,c,d);f[p]=_;g[p]=A;this._setInitState(a,f,g);t.push({ele:a,from:f,to:g,done:n})}}}_adjustStartLinePoints(t,e,i){for(var a=i[0]||i.getItem(0);t;){e.splice(0,0,{x:a.x,y:a.y});t--}}_adjustEndLinePoints(t,e,i,a,n){var s,r,o;if(n&&(a.length>=3||a.numberOfItems>=3)){r=i.pop();s=i.pop();o=a[a.length-3]||a.getItem(a.numberOfItems-3)}else(a.length>0||a.numberOfItems>0)&&(o=a[a.length-1]||a.getItem(a.numberOfItems-1));for(;t>e&&o;){i.push({x:o.x,y:o.y});e++}if(n&&r&&s){i.push(s);i.push(r)}}_playLineRemoveAnimation(t,e){var i,a=this,n=a._chart.series[0].hostElement.parentNode,s=a._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{a._setLineRiseDiveAnimation(s,t,!1)});if(s.length){i=s[0].done;s[0].done=function(){e&&e.parentNode===n&&n.removeChild(e);i&&i()}}}_playLineAddAnimation(t,e){var i=e.hostElement,a=this._getAnimation(t,0);[].slice.call(i.childNodes).forEach(t=>{this._setLineRiseDiveAnimation(a,t,!0)})}_playLineMoveAnimation(t,e,i){var a,n,s,r,o=this,l=(o._chart,o._getAnimation(t,0)),h=[];a=e.hostElement;n=[].slice.call(i.childNodes);[].slice.call(a.childNodes).forEach((t,e)=>{r=t.nodeName;s=n[e];if("g"===r&&t.nodeChilds)[].slice.call(t.nodeChilds).forEach((t,e)=>{if(s){h.push(t);o._toggleVisibility(t,!1)}});else if("polygon"===r||"polyline"===r)o._setLineMoveAnimation(l,s,t,t,0===e?function(){h.forEach(t=>{o._toggleVisibility(t,!0)});h=null}:null);else if(s){h.push(t);o._toggleVisibility(t,!1)}})}_playLoadColumnAnimation(t,e){this._playLoadBarAnimation(t,e,!0)}_playLoadBarAnimation(t,e,i=!1){var a=this,n=a._chart.series[e],s=a.animationMode,r=n.hostElement;[].slice.call(r.childNodes).forEach((n,r)=>{var o,l=n.nodeName;o=s===AnimationMode.Point?a._getAnimation(t,r):s===AnimationMode.Series?a._getAnimation(t,e):a._getAnimation(t,0);"g"===l?n.childNodes&&[].slice.call(n.childNodes).forEach((t,e)=>{a._setLoadBarAnimation(o,t,i)}):a._setLoadBarAnimation(o,n,i)})}_setBarAnimation(t,e,i,a,n){this._setInitState(e,i,a);t.push({ele:e,from:i,to:a,done:n})}_setLoadBarAnimation(t,e,i,a=!1,n){var s,r,o=this,l=i?"height":"width",h=i?"y":"x",c=e.getAttribute(l),u=e.getAttribute(h),m=i?"top":"left",d=o._chart._plotRect,p={},_={};p[l]=0;_[l]=Number(c);if(i){p[h]=d[l]+d[m];_[h]=Number(u)}s=a?_:p;r=a?p:_;"g"===e.nodeName?e.childNodes&&[].slice.call(e.childNodes).forEach(e=>{o._setBarAnimation(t,e,s,r,n)}):o._setBarAnimation(t,e,s,r,n)}_setMoveBarAnimation(t,e,i){var a={},n={};if(null!=e&&null!=i){["width","height","x","y","top","left"].forEach(t=>{var s=e.getAttribute(t),r=i.getAttribute(t);if(s!==r){a[t]=Number(s);n[t]=Number(r)}});this._setInitState(i,a,n);t.push({ele:i,from:a,to:n})}}_playColumnRemoveAnimation(t,e){this._playBarRemoveAnimation(t,e,!0)}_playColumnAddAnimation(t,e){this._playBarAddAnimation(t,e,!0)}_playColumnMoveAnimation(t,e,i){this._playBarMoveAnimation(t,e,i,!0)}_playBarRemoveAnimation(t,e,i=!1){var a=this,n=a._chart.series[0].hostElement.parentNode,s=a._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{a._setLoadBarAnimation(s,t,i,!0)});s.length&&(s[0].done=function(){e&&e.parentNode===n&&n.removeChild(e)})}_playBarAddAnimation(t,e,i=!1){var a=e.hostElement,n=this._getAnimation(t,2);[].slice.call(a.childNodes).forEach(t=>{this._setLoadBarAnimation(n,t,i,!1)})}_playBarMoveAnimation(t,e,i,a=!1){var n,s,r,o,l,h,c,u=this;u._chart;n=e.hostElement;r=[].slice.call(i.childNodes);if(u._addStart){c=0;o=r[0];for(;c<u._addStart;){r.splice(0,0,o);c++}}if(u._removeStart){c=0;o=r[r.length-1];for(;c<u._removeStart;){var m=r.shift();r.push(m);c++}}l=r.length;s=[].slice.call(n.childNodes);h=s.length;s.forEach((e,i)=>{var n;if(i<l){o=r[i];if(i<u._addStart){n=u._getAnimation(t,2);u._setLoadBarAnimation(n,e,a,!1)}else if(i>=l-u._removeStart){n=u._getAnimation(t,2);u._setLoadBarAnimation(n,e,a,!1);n=u._getAnimation(t,0);u._removeBarAnimation(n,e,o,a)}else{n=u._getAnimation(t,1);u._setMoveBarAnimation(n,o,e)}if(i===h-1&&i<l-1){n=u._getAnimation(t,0);for(i++;i<l;i++){o=r[i];u._removeBarAnimation(n,e,o,a)}}}else{n=u._getAnimation(t,2);u._setLoadBarAnimation(n,e,a,!1)}})}_removeBarAnimation(t,e,i,a){var n=e.parentNode;n.appendChild(i);this._setLoadBarAnimation(t,i,a,!0,function(t){return function(){t.parentNode&&t.parentNode===n&&n.removeChild(t)}}(i))}_playLoadScatterAnimation(t,e){var i=this,a=i._chart,n=a.series[e],s=i.animationMode,r=n.hostElement,o=n._xValues||a._xvals;0===o.length&&(o=n._pointIndexes);[].slice.call(r.childNodes).forEach((a,n)=>{var r;r=s===AnimationMode.Point?i._getScatterAnimation(t,o[n]):s===AnimationMode.Series?i._getAnimation(t,e):i._getAnimation(t,0);i._setLoadScatterAnimation(r,a,!1)})}_setLoadScatterAnimation(t,e,i=!1,a){var n,s,r={},o={};if("g"===e.nodeName&&e.childNodes)[].slice.call(e.childNodes).forEach(e=>{this._setLoadScatterAnimation(t,e,i,a)});else{["rx","ry","stroke-width"].forEach(t=>{var i=e.getAttribute(t);r[t]=0;o[t]=Number(i)});n=i?o:r;s=i?r:o;this._setInitState(e,n,s);t.push({ele:e,from:n,to:s,done:a})}}_setUpdateScatterAnimation(t,e,i,a){var n={},s={};["cx","cy"].forEach(t=>{var a=e.getAttribute(t),r=i.getAttribute(t);if(a!==r){n[t]=Number(a);s[t]=Number(r)}});this._setInitState(i,n,s);t.push({ele:i,from:n,to:s,done:a})}_getScatterAnimation(t,e){var i=this._getScatterAnimationIndex(t,e);t[i]||(t[i]=[]);return t[i]}_getScatterAnimationIndex(t,e){var i=this._chart.axisX,a=null==i.min?i.actualMin:i.min,n=null==i.max?i.actualMax:i.max;return Math.ceil((e-a)/((n-a)/20))}_playScatterRemoveAnimation(t,e){var i=this,a=i._chart.series[0].hostElement.parentNode,n=i._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{i._setLoadScatterAnimation(n,t,!0)});n.length&&(n[0].done=function(){e&&e.parentNode===a&&a.removeChild(e)})}_playScatterAddAnimation(t,e){var i=e.hostElement,a=this._getAnimation(t,0);[].slice.call(i.childNodes).forEach(t=>{this._setLoadScatterAnimation(a,t,!1)})}_playScatterMoveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,u=(c._chart,c._getAnimation(t,0));a=e.hostElement;s=[].slice.call(i.childNodes);if(c._addStart){h=0;r=s[0];for(;h<c._addStart;){s.splice(0,0,r);h++}}if(c._removeStart){h=0;r=s[s.length-1];for(;h<c._removeStart;){var m=s.shift();s.push(m);h++}}o=s.length;n=[].slice.call(a.childNodes);l=n.length;n.forEach((t,e)=>{if(e<o){if(e<c._addStart)c._setLoadScatterAnimation(u,t,!1);else if(e>=o-c._removeStart){c._setLoadScatterAnimation(u,t,!1);r=s[e];c._removeScatterAnimation(u,t,r)}else{r=s[e];c._setUpdateScatterAnimation(u,r,t)}if(e===l-1&&e<o-1)for(e++;e<o;e++){r=s[e];c._removeScatterAnimation(u,t,r)}}else c._setLoadScatterAnimation(u,t,!1)})}_removeScatterAnimation(t,e,i){var a=e.parentNode;a.appendChild(i);this._setLoadScatterAnimation(t,i,!0,function(t){return function(){t.parentNode&&t.parentNode===a&&a.removeChild(t)}}(i))}_playDefaultAnimation(t,e){var i,a,n=this._chart,s=n.series[e].hostElement,r=n._plotRect,o=n._currentRenderEngine,l=s.getAttribute("clip-path"),h="clipPath"+(1e6*Math.random()).toFixed();let c=n.axisX.reversed;o.addClipRect(new Rect(c?r.right:r.left,r.top,0,r.height),h);s.setAttribute("clip-path","url(#"+h+")");i=n.hostElement.querySelector("#"+h);a=this._getAnimation(t,0);let u={width:0},m={width:r.width};if(c){u.x=r.right;m.x=r.left}a.push({ele:i.querySelector("rect"),from:u,to:m,done:function(){if(s){l?s.setAttribute("clip-path",l):s.removeAttribute("clip-path");i&&i.parentNode&&i.parentNode.removeChild(i)}}})}}class FlexRadarAnimation extends FlexChartAnimation{constructor(t,e){super(t,e)}_getDurationAndDelay(t,e){var i=super._getDurationAndDelay(t,e);if(this.animationMode===AnimationMode.Point){i.duration=e/t;i.delay=e/t}return i}_playAxesAnimation(){}_getChartType(t){var e=super._getChartType(t);"Bar"===e&&(e="Column");return e}_playLoadLineAnimation(t,e){var i,a,n,s=this,r=s._chart,o=s._chart.series[e],l=o._xValues||r._xvals,h=s.animationMode,c=o.hostElement;if(h===AnimationMode.Point){0===l.length&&(l=o._pointIndexes);n=[].slice.call(c.childNodes);a=n.length-c.querySelectorAll("ellipse").length;n.forEach((e,i)=>{s._setRadarLinePointAnimation(t,e,i,l,a)})}else{i=h===AnimationMode.All?s._getAnimation(t,0):s._getAnimation(t,e);[].slice.call(c.childNodes).forEach(t=>{s._setLineRiseDiveAnimation(i,t,!0)})}}_setRadarLinePointAnimation(t,e,i,a,n){var s,r,o,l,h,c,u,m=this,d=m._chart,p=e.nodeName,_=[],A=[],f=[],g=[],y=d._center,x=[],E=!1,v={},S={},M=0;if("polyline"===p||"polygon"===p){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){x[u=m._getScatterAnimationIndex(t,a[r])]||(x[u]=[]);x[u].push(r);o=l[r]||l.getItem(r);_.push({x:y.x,y:y.y});A.push({x:o.x,y:o.y})}for(r=0,s=x.length;r<s;r++)if(x[r]){c=m._getAnimation(t,M);f=g.length?g.slice():_.slice();g=f.slice();x[r].forEach(t=>{var e=A[t];g[t]={x:e.x,y:e.y}});S={};(v={})[p]=f;S[p]=g;if(!E){m._setInitState(e,v,S);E=!0}c.push({ele:e,from:v,to:S,done:h});M++}}else if("ellipse"===p){if((r=i-(n||0))<0)return;c=d._isPolar?m._getScatterAnimation(t,a[r]):m._getScatterAnimation(t,r);m._toggleVisibility(e,!1);h=function(){m._toggleVisibility(e,!0)};c.push({ele:e,from:v,to:S,done:h})}}_setLineRiseDiveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,u=c._chart,m=e.nodeName,d=[],p=[],_=u._center,A={},f={};if("polyline"===m||"polygon"===m){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){o=l[r]||l.getItem(r);d.push({x:_.x,y:_.y});p.push({x:o.x,y:o.y})}A[m]=d;f[m]=p}else if("ellipse"===m){c._toggleVisibility(e,!1);i&&(h=function(){c._toggleVisibility(e,!0)})}a=i?A:f;n=i?f:A;c._setInitState(e,a,n);t.push({ele:e,from:a,to:n,done:h})}_parsePathByRadius(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep;a=[s,r,0,l,h,0];n=[s,r,o,l,h,t.innerRadius||0];e.pie=a;i.pie=n}_playUpdateAnimation(t,e,i,a,n){if("Bar"===i||"Column"===i){if(null==a)return;this._playLoadBarAnimation(t,e,!1)}else super._playUpdateAnimation(t,e,i,a,n)}_playLoadBarAnimation(t,e,i=!1){var a=this,n=a._chart,s=n.series[e],r=n._areas[e],o=a.animationMode,l=s.hostElement;[].slice.call(l.childNodes).forEach((i,n)=>{var s,l,h={},c={};s=o===AnimationMode.Point?a._getAnimation(t,n):o===AnimationMode.Series?a._getAnimation(t,e):a._getAnimation(t,0);l=r[n];a._parsePathByRadius(l,h,c);a._setInitState(i,h,c);s.push({ele:i,from:h,to:c})})}}class AnimationHelper{static playAnimations(t,e,i,a,n=Easing.Swing,s,r){var o=t.length,l=0,h=[];t.forEach((t,c)=>{var u=AnimationHelper.playAnimation(t,e[c],i[c],(function(){l===o-1&&a&&a();l++}),n,s,r);h.push(u)});return h}static playAnimation(t,e,i,a,n=Easing.Swing,s,r){var o=AnimationHelper.parseAttrs(e,i);return AnimationHelper.animate((function(e){AnimationHelper.setElementAttr(t,o,e)}),a,n,s,r)}static setElementAttr(t,e,i){var a,n;for(n in e){a=e[n];AnimationHelper.calcValue(a,i);t.setAttribute(n,a.getValue(a.value,i))}}static getPathDescOfPie(t,e,i,a,n,s=0){var r=!1;if(n>=2*Math.PI){r=!0;n=2*Math.PI-.001}var o=new Point(t,e);o.x+=i*Math.cos(a);o.y+=i*Math.sin(a);var l=a+n,h=new Point(t,e);h.x+=i*Math.cos(l);h.y+=i*Math.sin(l);if(s){var c=new Point(t,e);c.x+=s*Math.cos(l);c.y+=s*Math.sin(l);var u=new Point(t,e);u.x+=s*Math.cos(a);u.y+=s*Math.sin(a)}var m=" 0 0,1 ",d=" 0 0,0 ";if(Math.abs(n)>Math.PI){m=" 0 1,1 ";d=" 0 1,0 "}var p="M "+o.x.toFixed(3)+","+o.y.toFixed(3);p+=" A "+i.toFixed(3)+","+i.toFixed(3)+m;p+=h.x.toFixed(3)+","+h.y.toFixed(3);if(s){p+=r?" M "+c.x.toFixed(3)+","+c.y.toFixed(3):" L "+c.x.toFixed(3)+","+c.y.toFixed(3);p+=" A "+s.toFixed(3)+","+s.toFixed(3)+d;p+=u.x.toFixed(3)+","+u.y.toFixed(3)}else p+=" L "+t.toFixed(3)+","+e.toFixed(3);r||(p+=" z");return p}static parseAttrs(t,e){var i={};for(var a in t)if(null!=e[a])switch(a){case"polyline":i.points=AnimationHelper.parseAttr(t[a],e[a],(function(t,e){if(1===e){for(var i,a,n;t.length>1;){a=t[0];n=t[1];if(a.x!==n.x||a.y!==n.y){a=null;n=null;break}t.splice(1,1)}for(i=t.length-1;i>0;i--){a=n;n=t[i];if(a){if(a.x!==n.x||a.y!==n.y)break;t.pop()}}}return t.map(t=>t.x+","+t.y).join(" ")}));break;case"polygon":i.points=AnimationHelper.parseAttr(t[a],e[a],(function(t,e){if(1===e){var i,a,n,s,r;s=t.pop();r=t.pop();for(;t.length>1;){a=t[0];n=t[1];if(a.x!==n.x||a.y!==n.y){a=null;n=null;break}t.splice(1,1)}for(i=t.length-1;i>=0;i--){a=n;n=t[i];if(a){if(a.x!==n.x||a.y!==n.y)break;t.splice(i,1)}}t.push(r);t.push(s)}return t.map(t=>t.x+","+t.y).join(" ")}));break;case"d":i[a]=AnimationHelper.parseAttr(t[a],e[a],(function(t){return t.map(t=>"string"==typeof t?t:t[0]+","+t[1]).join(" ")}));break;case"pie":i.d=AnimationHelper.parseAttr(t[a],e[a],(function(t){return AnimationHelper.getPathDescOfPie.apply(AnimationHelper,t)}));break;case"rotate":i.transform=AnimationHelper.parseAttr(t[a],e[a],(function(t){return"rotate("+t.join(" ")+")"}));break;case"x":case"width":case"height":case"rx":case"ry":case"stroke-width":i[a]=AnimationHelper.parseAttr(t[a],e[a],(function(t){return Math.abs(t)}));break;default:i[a]=AnimationHelper.parseAttr(t[a],e[a])}return i}static animate(t,e,i=Easing.Swing,a=400,n=16){asFunction(t);asNumber(a,!1,!0);asNumber(n,!1,!0);var s=0,r=setInterval((function(){Date.now();var o=s/a;o=EasingHelper[Easing[i]](o);t(o);if((s+=n)>=a){clearInterval(r);(o<1||o>1)&&t(1);e&&e()}}),n);return r}static calcValue(t,e){var i=t.from,a=t.diff,n=t.value;isNumber(i)?t.value=0===a?i:i+a*e:isArray(i)&&AnimationHelper.parseArrayAttr(n,i,a,(function(t,i){return"number"==typeof t?t+i*e:t}))}static parseAttr(t,e,i){var a,n,s,r;if(isArray(t)&&isArray(e)){n=e;s=[];r=(a=t).slice();AnimationHelper.parseArrayAttr(s,a,n,(function(t,e){return t===e?0:e-t}))}else{r=a=Number(t);s=(n=Number(e))-a}return{from:a,to:n,value:r,diff:s,getValue:i||function(t,e){return t}}}static parseArrayAttr(t,e,i,a){e.forEach((e,n)=>{var s={},r=[],o=i[n];if(isNumber(e)||"string"==typeof e)t[n]=a(e,o);else if(isArray(e)){e.forEach((t,i)=>{r[i]=a(e[i],o[i])});t[n]=r}else{Object.getOwnPropertyNames(e).forEach(t=>{s[t]=a(e[t],o[t])});t[n]=s}})}}class EasingHelper{static Linear(t){return t}static Swing(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)}static EaseInQuad(t){return t*t}static EaseOutQuad(t){return t*(2-t)}static EaseInOutQuad(t){return t<.5?2*t*t:(4-2*t)*t-1}static EaseInCubic(t){return t*t*t}static EaseOutCubic(t){return--t*t*t+1}static EaseInOutCubic(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}static EaseInQuart(t){return t*t*t*t}static EaseOutQuart(t){return 1- --t*t*t*t}static EaseInOutQuart(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t}static EaseInQuint(t){return t*t*t*t*t}static EaseOutQuint(t){return 1+--t*t*t*t*t}static EaseInOutQuint(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}static EaseInSine(t){return 1-Math.cos(t*(Math.PI/2))}static EaseOutSine(t){return Math.sin(t*(Math.PI/2))}static EaseInOutSine(t){return-.5*(Math.cos(Math.PI*t)-1)}static EaseInExpo(t){return 0==t?0:Math.pow(2,10*(t-1))}static EaseOutExpo(t){return 1==t?1:1-Math.pow(2,-10*t)}static EaseInOutExpo(t){return t==!!t?t:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))}static EaseInCirc(t){return-(Math.sqrt(1-t*t)-1)}static EaseOutCirc(t){return Math.sqrt(1-Math.pow(t-1,2))}static EaseInOutCirc(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static EaseInBack(t){var e=1.70158;return t*t*((e+1)*t-e)}static EaseOutBack(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1}static EaseInOutBack(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)}static EaseInBounce(t){return 1-EasingHelper.EaseOutBounce(1-t)}static EaseOutBounce(t){var e=7.5625;return t<1/2.75?e*t*t:t<2/2.75?e*(t-=1.5/2.75)*t+.75:t<2.5/2.75?e*(t-=2.25/2.75)*t+.9375:e*(t-=2.625/2.75)*t+.984375}static EaseInOutBounce(t){return t<.5?.5*EasingHelper.EaseInBounce(2*t):.5*EasingHelper.EaseOutBounce(2*t-1)+.5}static EaseInElastic(t){return t==!!t?t:-Math.pow(2,10*(t-=1))*Math.sin((t-.075)*(2*Math.PI)/.3)}static EaseOutElastic(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1}static EaseInOutElastic(t){return t==!!t?t:(t*=2)<1?Math.pow(2,10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*-.5:Math.pow(2,-10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*.5+1}}_registerModule("wijmo.chart.animation",selfModule); | ||
import{_getModule,isNumber,isArray,asNumber,asFunction,Point,Rect,hasClass,isDate,asBoolean,Size,asEnum,Event,EventArgs,assert,_registerModule}from"@grapecity/wijmo";import{ChartType,FlexChart,TickMark,AxisType,FlexPie,FlexChartCore,DataLabelClsNames}from"@grapecity/wijmo.chart";import*as selfModule from"@grapecity/wijmo.chart.animation";export function softFinancial(){return _getModule("wijmo.chart.finance")}export function softRadar(){return _getModule("wijmo.chart.radar")}export var Easing;!function(t){t[t.Linear=0]="Linear";t[t.Swing=1]="Swing";t[t.EaseInQuad=2]="EaseInQuad";t[t.EaseOutQuad=3]="EaseOutQuad";t[t.EaseInOutQuad=4]="EaseInOutQuad";t[t.EaseInCubic=5]="EaseInCubic";t[t.EaseOutCubic=6]="EaseOutCubic";t[t.EaseInOutCubic=7]="EaseInOutCubic";t[t.EaseInQuart=8]="EaseInQuart";t[t.EaseOutQuart=9]="EaseOutQuart";t[t.EaseInOutQuart=10]="EaseInOutQuart";t[t.EaseInQuint=11]="EaseInQuint";t[t.EaseOutQuint=12]="EaseOutQuint";t[t.EaseInOutQuint=13]="EaseInOutQuint";t[t.EaseInSine=14]="EaseInSine";t[t.EaseOutSine=15]="EaseOutSine";t[t.EaseInOutSine=16]="EaseInOutSine";t[t.EaseInExpo=17]="EaseInExpo";t[t.EaseOutExpo=18]="EaseOutExpo";t[t.EaseInOutExpo=19]="EaseInOutExpo";t[t.EaseInCirc=20]="EaseInCirc";t[t.EaseOutCirc=21]="EaseOutCirc";t[t.EaseInOutCirc=22]="EaseInOutCirc";t[t.EaseInBack=23]="EaseInBack";t[t.EaseOutBack=24]="EaseOutBack";t[t.EaseInOutBack=25]="EaseInOutBack";t[t.EaseInBounce=26]="EaseInBounce";t[t.EaseOutBounce=27]="EaseOutBounce";t[t.EaseInOutBounce=28]="EaseInOutBounce";t[t.EaseInElastic=29]="EaseInElastic";t[t.EaseOutElastic=30]="EaseOutElastic";t[t.EaseInOutElastic=31]="EaseInOutElastic"}(Easing||(Easing={}));export var AnimationMode;!function(t){t[t.All=0]="All";t[t.Point=1]="Point";t[t.Series=2]="Series"}(AnimationMode||(AnimationMode={}));export class ChartAnimation{constructor(t,e){this._play=!0;this.ended=new Event;var i=this,a=t.hostElement,n=new Size(a.offsetWidth,a.offsetHeight);i._chart=t;i._updateEventArgs=[];if(t instanceof FlexPie)i._animation=new FlexPieAnimation(t,i._updateEventArgs);else{softRadar()&&t instanceof softRadar().FlexRadar?i._animation=new FlexRadarAnimation(t,i._updateEventArgs):t instanceof FlexChartCore&&(i._animation=new FlexChartAnimation(t,i._updateEventArgs));i._chartType=t.chartType}assert(void 0!==i._animation,"Animation is not supported");i._initOptions(e);t.beginUpdate();window.setTimeout(()=>{t.rendered.addHandler(i._playAnimation,i);t.endUpdate()},0);i._setCV(t.collectionView);window.addEventListener("resize",(function(t){var e=new Size(a.offsetWidth,a.offsetHeight);if(!n.equals(e)){i._play=!1;n=e}}))}_initOptions(t){if(t){t.duration&&(this.duration=t.duration);t.easing&&(this.easing=t.easing);t.animationMode&&(this.animationMode=t.animationMode);void 0!==t.axisAnimation&&(this.axisAnimation=t.axisAnimation)}}_setCV(t){this._cv=t;this._animation._clearState()}get animationMode(){return this._animation.animationMode}set animationMode(t){(t=asEnum(t,AnimationMode))!=this.animationMode&&(this._animation.animationMode=t)}get easing(){return this._animation.easing}set easing(t){(t=asEnum(t,Easing))!=this.easing&&(this._animation.easing=t)}get duration(){return this._animation.duration}set duration(t){(t=asNumber(t))!=this.duration&&(this._animation.duration=t)}get axisAnimation(){return this._animation.axisAnimation}set axisAnimation(t){(t=asBoolean(t))!=this.axisAnimation&&(this._animation.axisAnimation=t)}get chart(){return this._chart}_playAnimation(){var t=this,e=t._chart,i=e.chartType;t._cv!==e.collectionView&&t._setCV(e.collectionView);if(null!=t._chartType&&t._chartType!==i){t._chartType=i;t._animation._clearState()}t._play?t._animation.playAnimation(()=>t.ended.raise(t,EventArgs.empty)):t._play=!0}animate(){var t=this._chart;if(t){var e=t.itemsSource;t.beginUpdate();t.itemsSource=null;t.itemsSource=e;t.endUpdate()}}}class FlexAnimation{constructor(t,e){this._axisAnimation=!0;this._chart=t;this._timers=[]}get animationMode(){return this._animationMode||AnimationMode.All}set animationMode(t){if((t=asEnum(t,AnimationMode,!1))!==this._animationMode){this._clearState();this._animationMode=t}}get easing(){return null==this._easing?Easing.Swing:this._easing}set easing(t){t!==this._easing&&(this._easing=asEnum(t,Easing,!1))}get duration(){return this._duration||400}set duration(t){t!==this._duration&&(this._duration=asNumber(t,!1,!0))}get axisAnimation(){return!!this._axisAnimation}set axisAnimation(t){t!==this._axisAnimation&&(this._axisAnimation=asBoolean(t,!1))}playAnimation(t){}_clearState(){this._previousState&&(this._previousState=null);this._currentState&&(this._currentState=null)}_setInitState(t,e,i){var a=AnimationHelper.parseAttrs(e,i);AnimationHelper.setElementAttr(t,a,0)}_getAnimation(t,e){t[e]||(t[e]=[]);return t[e]}_toggleVisibility(t,e){e?AnimationHelper.playAnimation(t,{opacity:0},{opacity:1},null,Easing.Swing,100):t.setAttribute("opacity","0")}_toggleDataLabelVisibility(t){var e=this._chart.hostElement,i=e&&e.querySelector(`.${DataLabelClsNames.labels}`);i&&this._toggleVisibility(i,t)}_playAnimation(t,e){var i,a=this,n=a.duration,s=a.easing,r=t.length;a._toggleDataLabelVisibility(!1);i=a._getDurationAndDelay(t.length,n);if(this._timers&&this._timers.length){this._timers.forEach(t=>window.clearInterval(t));this._timers.length=0}t.forEach((t,n)=>{var o;if(t){o=window.setTimeout(()=>{var o;t.forEach((t,l)=>{if(t&&t.ele){if(n===r-1&&0===l){var h=t.done;t.done=function(){a._toggleDataLabelVisibility(!0);h&&h();e&&e()}}if(isArray(t.ele)){o=AnimationHelper.playAnimations(t.ele,t.from,t.to,t.done,s,i.duration);this._timers=this._timers.concat.apply(o)}else{o=AnimationHelper.playAnimation(t.ele,t.from,t.to,t.done,s,i.duration);this._timers.push(o)}}})},i.delay*n);this._timers.push(o)}})}_getDurationAndDelay(t,e){var i={duration:e,delay:0};if(t>1)if(this._previousState){i.duration=e/t;i.delay=e/t}else{i.duration=.5*e;i.delay=.5*e/(t-1)}return i}}class FlexPieAnimation extends FlexAnimation{constructor(t,e){super(t,e);t.selectionChanged.addHandler(this._selectionChanged,this)}_selectionChanged(){this._isSelectionChanged=!0}_clearState(){super._clearState();this._isSelectionChanged=!1}_getElementRotate(t){var e,i=t.getAttribute("transform");if(i&&i.indexOf("rotate")>-1){if(1==(i=(i=i.replace("rotate(","").replace(")","")).indexOf(",")>-1?i.split(",").map(t=>+t):i.split(" ").map(t=>+t)).length){e=this._chart._areas[0].center;i.push(e.x,e.y)}}else i=[0,(e=this._chart._areas[0].center).x,e.y];return i}_getDurationAndDelay(t,e){var i={duration:e,delay:0};if(this.animationMode===AnimationMode.Point&&t>1){i.duration=e/t;i.delay=e/t}return i}playAnimation(t){super.playAnimation(t);var e=[];this._playPieAnimation(e);e.length&&this._playAnimation(e,t)}_playPieAnimation(t){var e=this._chart,i=!0;this._previousState=this._currentState;this._currentState={areas:e._areas,pels:e._pels,rotate:e._pels.length&&this._getElementRotate(e._pels[0].parentNode)};this._previousState&&(i=!1);if(this._isSelectionChanged){e.isAnimated||this._playSelectPieAnimation(t);this._isSelectionChanged=!1}else i?this._playLoadPieAnimation(t):this._playUpdatePieAnimation(t)}_playSelectPieAnimation(t){if(null!=this._previousState){var e,i,a,n=this._chart._pels[0].parentNode,s=this._previousState.rotate,r=this._getElementRotate(n),o=s[0],l=r[0];if(o!==l){o-l>180?r[0]+=360:l-o>180&&(s[0]+=360);e=this._getAnimation(t,0);i={rotate:s};a={rotate:r};this._setInitState(n,i,a);e.push({ele:n,from:i,to:a})}}}_playUpdatePieAnimation(t){var e,i,a,n,s=this._chart,r=this._previousState,o=s._areas,l=s._pels,h=r.areas.length,c=o.length,u=Math.max(c,h),m=this._getAnimation(t,0),d=0;if(0!==c&&0!==h){this._playSelectPieAnimation(t);for(e=0;e<u;e++){i={};if(l[e]&&l[e].childNodes&&l[e].childNodes.length>0){if(e<c&&e<h){a=o[0];0===e&&(d=a.angle);1===h?l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(a.center.x,a.center.y,a.radius,d,2*Math.PI,a.innerRadius||0)):l[e].childNodes[0].setAttribute("d",r.pels[e].childNodes[0].getAttribute("d"))}if(e<c){a=o[e];i.to={pie:[a.center.x,a.center.y,a.radius,a.angle,a.sweep,a.innerRadius||0]};i.ele=l[e].childNodes[0]}else{a=o[0];n=r.pels[e];i.to={pie:[a.center.x,a.center.y,a.radius,d+2*Math.PI,0,a.innerRadius||0]};l[0].parentNode.appendChild(n);i.done=function(t){return function(){t.parentNode.removeChild(t)}}(n);i.ele=n.childNodes[0]}if(e<h){a=r.areas[e];i.from={pie:[a.center.x,a.center.y,a.radius,a.angle,a.sweep,a.innerRadius||0]}}else{l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(a.center.x,a.center.y,a.radius,2*Math.PI+d,0,a.innerRadius||0));a=r.areas[0];i.from={pie:[a.center.x,a.center.y,a.radius,2*Math.PI+d,0,a.innerRadius||0]}}m.push(i)}}}}_playLoadPieAnimation(t){var e=this,i=e._chart,a=e.animationMode,n=i._areas;i._pels.forEach((i,s)=>{var r,o=i.childNodes[0],l={},h={};if(o){if(a===AnimationMode.Point){e._parsePathByAngle(n[s],l,h);r=e._getAnimation(t,s)}else{e._parsePathByRadius(n[s],l,h);r=e._getAnimation(t,0)}e._setInitState(o,l,h);r.push({ele:o,from:l,to:h})}})}_parsePathByRadius(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep;a=[s,r,0,l,h,0];n=[s,r,o,l,h,t.innerRadius||0];e.pie=a;i.pie=n}_parsePathByAngle(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep,c=t.innerRadius;a=[s,r,o,l,0,c||0];n=[s,r,o,l,h,c||0];e.pie=a;e["stroke-width"]=0;i.pie=n;i["stroke-width"]=1}}class FlexChartAnimation extends FlexAnimation{constructor(t,e){super(t,e)}playAnimation(t){super.playAnimation(t);var e,i,a,n,s,r,o,l,h,c=!0,u=this._chart,m=softFinancial()&&u instanceof softFinancial().FinancialChart,d=u.series,p=d.length,_=[];this._previousState=this._currentState;this._previousXVal=this._currentXVal;this._currentState=[];this._addStart=0;this._removeStart=0;this._currentXVal=u._xlabels.slice();if(this._previousState&&this._previousState.length){c=!1;s=(r=this._previousState).length;o=this._previousXVal;l=this._currentXVal;o.length>2&&l.length>2&&((e=l.indexOf(o[0]))>0&&e<l.length-2?l[e+1]===o[1]&&l[e+2]===o[2]&&(this._addStart=e):(e=o.indexOf(l[0]))>0&&e<o.length-2&&o[e+1]===l[1]&&o[e+2]===l[2]&&(this._removeStart=e))}for(e=0;e<p;e++){n=null!=(i=d[e])._getChartType()?i._getChartType():u._getChartType();a=this._getChartType(n);this._currentState.push({seriesType:n,ele:i.hostElement});if(m)this._playDefaultAnimation(_,e);else{h=r&&r[e];if("Default"===a){this._playDefaultAnimation(_,e);continue}if(c||h&&h.seriesType!==n||h&&h.ele&&(""==h.ele.innerHTML||0===h.ele.childNodes.length))this._playLoadAnimation(_,e,a);else{this._playUpdateAnimation(_,e,a,i,h&&h.ele||null);if(e===p-1&&e<s-1)for(e++;e<=s-1;e++)this._playUpdateAnimation(_,e,a,null,h.ele)}}}this._adjustAnimations(a,_);_.length&&this._playAnimation(_,t);this.axisAnimation&&!m&&this._playAxesAnimation()}_playAxesAnimation(){var t,e,i,a=this._chart.axes,n=a.length;this._prevAxesStates=this._currAxesStates;this._currAxesStates=[];for(e=0;e<n;e++)(t=a[e]).hostElement&&this._currAxesStates.push({ele:t.hostElement,vals:t._vals,axis:t,maxValue:isDate(t.actualMax)?t.actualMax.getTime():t.actualMax,minValue:isDate(t.actualMin)?t.actualMin.getTime():t.actualMin});if(this._prevAxesStates){i=Math.max(this._prevAxesStates.length,this._currAxesStates.length);for(e=0;e<i;e++)this._playAxisAnimation(this._prevAxesStates[e],this._currAxesStates[e])}}_playAxisAnimation(t,e){if(t&&e){var i,a=[],n=[];if(e&&e.maxValue-e.minValue){i=this._parseAxisState(e);this._convertAxisAnimation(a,i.major,e.axis,t.maxValue,t.minValue);this._convertAxisAnimation(a,i.minor,e.axis,t.maxValue,t.minValue)}if(t&&t.maxValue-t.minValue){i=this._parseAxisState(t);this._convertAxisAnimation(n,i.major,t.axis);this._convertAxisAnimation(n,i.minor,t.axis)}a&&n&&this._combineAxisAnimations(a,n);this._playCurrAxisAnimation(a);this._playPrevAxisAnimation(n)}}_combineAxisAnimations(t,e){var i,a,n=e.length;for(i=n-1;i>=0;i--)(a=e[i]).text&&t.some(t=>{if(t.text&&t.text===a.text){this._combineAxisAnimation(t,a);e.splice(i,1);return!0}})}_combineAxisAnimation(t,e){["label","majorGrid","tick"].forEach(i=>{t[i]&&e[i]&&this._resetExistAxisAttrs(t[i],e[i])})}_resetExistAxisAttrs(t,e){var i=t.ele,a=e.ele,n={},s={};["x","y","x1","x2","y1","y2"].forEach(t=>{var e=i.getAttribute(t),r=a.getAttribute(t);if(e!==r){n[t]=r;s[t]=e}});t.calcPos=n;t.elePos=s}_convertAxisAnimation(t,e,i,a,n){var s,r=i.hostElement,o=i.axisType==AxisType.Y;e.forEach((e,l)=>{var h=i.convert(e.val,a,n);if(!isNaN(h)){s={};e.majorGrid&&(s.majorGrid=this._getAxisAnimationAttrs(e.majorGrid,r,h,o));if(e.label){s.label=this._getAxisAnimationAttrs(e.label,r,h,o);s.text=e.label.innerHTML||e.label.textContent}e.tick&&(s.tick=this._getAxisAnimationAttrs(e.tick,r,h,o));t.push(s)}})}_getAxisAnimationAttrs(t,e,i,a){var n,s,r;n={ele:t,parent:e,elePos:{},calcPos:{}};if("text"===t.nodeName){s=a?"y":"x";r=Number(t.getAttribute(s));n.elePos[s]=r;n.calcPos[s]=i}else{s=a?"y1":"x1";r=Number(t.getAttribute(s));if(a){n.elePos={y1:r,y2:r};n.calcPos={y1:i,y2:i}}else{n.elePos={x1:r,x2:r};n.calcPos={x1:i,x2:i}}}n.elePos.opacity=1;n.calcPos.opacity=0;return n}_playCurrAxisAnimation(t){var e=this.duration;t&&0!==t.length&&t.forEach(t=>{["majorGrid","label","tick"].forEach(i=>{var a=t[i];if(a){a.parent;var n=a.ele,s=a.elePos,r=a.calcPos;AnimationHelper.playAnimation(n,r,s,null,Easing.Swing,e)}})})}_playPrevAxisAnimation(t){var e=this.duration;t&&0!==t.length&&t.forEach(t=>{["majorGrid","label","tick"].forEach(i=>{var a=t[i];if(a){var n=a.parent,s=a.ele,r=a.elePos,o=a.calcPos;n.appendChild(s);AnimationHelper.playAnimation(s,r,o,(function(){s.parentNode===n&&n.removeChild(s)}),Easing.Swing,e)}})})}_parseAxisState(t){if(null==t)return null;var e=t.vals,i=t.axis,a=i.axisType==AxisType.Y,n=t.ele.childNodes,s=0,r=[],o=[];let l,h,c;if(e){l=e.major;h=e.minor;c=e.hasLbls}l&&l.forEach((t,e)=>{var o,l={},h=!!c[e];r.push(l);l.val=t;o=n[s];if(i.majorGrid&&hasClass(o,FlexChart._CSS_GRIDLINE)){l.majorGrid=o;o=n[++s]}if(a){if(h&&o&&i.majorTickMarks!==TickMark.None&&hasClass(o,FlexChart._CSS_TICK)){l.tick=o;o=n[++s]}if(h&&o&&(hasClass(o,FlexChart._CSS_LABEL)||o.querySelector("."+FlexChart._CSS_LABEL))){l.label=o;s++}}else{if(h&&o&&(hasClass(o,FlexChart._CSS_LABEL)||o.querySelector("."+FlexChart._CSS_LABEL))){l.label=o;o=n[++s]}if(h&&o&&i.majorTickMarks!==TickMark.None&&hasClass(o,FlexChart._CSS_TICK)){l.tick=o;s++}}});h&&h.forEach((t,e)=>{var a,r={};o.push(r);r.val=t;a=n[s];if(i.minorTickMarks!==TickMark.None&&hasClass(a,FlexChart._CSS_TICK_MINOR)){r.tick=a;a=n[++s]}if(i.minorGrid&&hasClass(a,FlexChart._CSS_GRIDLINE_MINOR)){r.majorGrid=a;s++}});return{major:r,minor:o}}_playLoadAnimation(t,e,i){this["_playLoad"+i+"Animation"](t,e)}_playUpdateAnimation(t,e,i,a,n){null==a||null==n?null==a?this["_play"+i+"RemoveAnimation"](t,n):this["_play"+i+"AddAnimation"](t,a):this["_play"+i+"MoveAnimation"](t,a,n)}_adjustAnimations(t,e){var i,a=e.length;if("Column"===t||"Bar"===t)for(i=a-1;i>=0;i--)null==e[i]&&e.splice(i,1)}_getChartType(t){var e="Default",i=this._chart._isRotated();switch(t){case ChartType.Scatter:case ChartType.Bubble:case ChartType.Candlestick:case ChartType.HighLowOpenClose:e="Scatter";break;case ChartType.Column:case ChartType.Bar:e=i?"Bar":"Column";break;case ChartType.Line:case ChartType.LineSymbols:case ChartType.Area:case ChartType.Spline:case ChartType.SplineSymbols:case ChartType.SplineArea:e="Line";break;default:e="Default"}return e}_playLoadLineAnimation(t,e){var i,a=this,n=a._chart.series[e],s=a.animationMode,r=n.hostElement;if(s===AnimationMode.Point)a._playDefaultAnimation(t,e);else{i=s===AnimationMode.All?a._getAnimation(t,0):a._getAnimation(t,e);[].slice.call(r.childNodes).forEach(t=>{a._setLineRiseDiveAnimation(i,t,!0)})}}_setLineRiseDiveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,u=c._chart,m=e.nodeName,d=[],p=[],_=c._chart._plotRect,A=_.top+_.height,f=_.left,g={},y={};if("g"===m&&e.childNodes)[].slice.call(e.childNodes).forEach(e=>{this._setLineRiseDiveAnimation(t,e,i)});else{if("polyline"===m||"polygon"===m){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){o=l[r]||l.getItem(r);u.rotated?d.push({x:f,y:o.y}):d.push({x:o.x,y:A});p.push({x:o.x,y:o.y})}g[m]=d;y[m]=p}else if("ellipse"===m||"rect"===m){c._toggleVisibility(e,!1);i&&(h=function(){c._toggleVisibility(e,!0)})}a=i?g:y;n=i?y:g;c._setInitState(e,a,n);t.push({ele:e,from:a,to:n,done:h})}}_setLineMoveAnimation(t,e,i,a,n){if(null!=e&&null!=i){var s,r,o,l,h,c,u,m,d,p=e.nodeName,_=[],A=[],f={},g={};if("polyline"===p||"polygon"===p){d="polygon"===p;o=e.points;c=i.points;s=o.length||o.numberOfItems;l=c.length||c.numberOfItems;m=Math.max(s,l);for(u=0;u<m;u++){if(u<s){r=o[u]||o.getItem(u);_.push({x:r.x,y:r.y})}if(u<l){h=c[u]||c.getItem(u);A.push({x:h.x,y:h.y})}}if(this._addStart){this._adjustStartLinePoints(this._addStart,_,o);s+=this._addStart}else if(this._removeStart){this._adjustStartLinePoints(this._removeStart,A,c);l+=this._removeStart}l>s?this._adjustEndLinePoints(l,s,_,o,d):l<s&&this._adjustEndLinePoints(s,l,A,c,d);f[p]=_;g[p]=A;this._setInitState(a,f,g);t.push({ele:a,from:f,to:g,done:n})}}}_adjustStartLinePoints(t,e,i){for(var a=i[0]||i.getItem(0);t;){e.splice(0,0,{x:a.x,y:a.y});t--}}_adjustEndLinePoints(t,e,i,a,n){var s,r,o;if(n&&(a.length>=3||a.numberOfItems>=3)){r=i.pop();s=i.pop();o=a[a.length-3]||a.getItem(a.numberOfItems-3)}else(a.length>0||a.numberOfItems>0)&&(o=a[a.length-1]||a.getItem(a.numberOfItems-1));for(;t>e&&o;){i.push({x:o.x,y:o.y});e++}if(n&&r&&s){i.push(s);i.push(r)}}_playLineRemoveAnimation(t,e){var i,a=this,n=a._chart.series[0].hostElement.parentNode,s=a._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{a._setLineRiseDiveAnimation(s,t,!1)});if(s.length){i=s[0].done;s[0].done=function(){e&&e.parentNode===n&&n.removeChild(e);i&&i()}}}_playLineAddAnimation(t,e){var i=e.hostElement,a=this._getAnimation(t,0);[].slice.call(i.childNodes).forEach(t=>{this._setLineRiseDiveAnimation(a,t,!0)})}_playLineMoveAnimation(t,e,i){var a,n,s,r,o=this,l=(o._chart,o._getAnimation(t,0)),h=[];a=e.hostElement;n=[].slice.call(i.childNodes);[].slice.call(a.childNodes).forEach((t,e)=>{r=t.nodeName;s=n[e];if("g"===r&&t.nodeChilds)[].slice.call(t.nodeChilds).forEach((t,e)=>{if(s){h.push(t);o._toggleVisibility(t,!1)}});else if("polygon"===r||"polyline"===r)o._setLineMoveAnimation(l,s,t,t,0===e?function(){h.forEach(t=>{o._toggleVisibility(t,!0)});h=null}:null);else if(s){h.push(t);o._toggleVisibility(t,!1)}})}_playLoadColumnAnimation(t,e){this._playLoadBarAnimation(t,e,!0)}_playLoadBarAnimation(t,e,i=!1){var a=this,n=a._chart.series[e],s=a.animationMode,r=n.hostElement;[].slice.call(r.childNodes).forEach((n,r)=>{var o,l=n.nodeName;o=s===AnimationMode.Point?a._getAnimation(t,r):s===AnimationMode.Series?a._getAnimation(t,e):a._getAnimation(t,0);"g"===l?n.childNodes&&[].slice.call(n.childNodes).forEach((t,e)=>{a._setLoadBarAnimation(o,t,i)}):a._setLoadBarAnimation(o,n,i)})}_setBarAnimation(t,e,i,a,n){this._setInitState(e,i,a);t.push({ele:e,from:i,to:a,done:n})}_setLoadBarAnimation(t,e,i,a=!1,n){var s,r,o=this,l=i?"height":"width",h=i?"y":"x",c=e.getAttribute(l),u=e.getAttribute(h),m=i?"top":"left",d=o._chart._plotRect,p={},_={};p[l]=0;_[l]=Number(c);if(i){p[h]=d[l]+d[m];_[h]=Number(u)}s=a?_:p;r=a?p:_;"g"===e.nodeName?e.childNodes&&[].slice.call(e.childNodes).forEach(e=>{o._setBarAnimation(t,e,s,r,n)}):o._setBarAnimation(t,e,s,r,n)}_setMoveBarAnimation(t,e,i){var a={},n={};if(null!=e&&null!=i){["width","height","x","y","top","left"].forEach(t=>{var s=e.getAttribute(t),r=i.getAttribute(t);if(s!==r){a[t]=Number(s);n[t]=Number(r)}});this._setInitState(i,a,n);t.push({ele:i,from:a,to:n})}}_playColumnRemoveAnimation(t,e){this._playBarRemoveAnimation(t,e,!0)}_playColumnAddAnimation(t,e){this._playBarAddAnimation(t,e,!0)}_playColumnMoveAnimation(t,e,i){this._playBarMoveAnimation(t,e,i,!0)}_playBarRemoveAnimation(t,e,i=!1){var a=this,n=a._chart.series[0].hostElement.parentNode,s=a._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{a._setLoadBarAnimation(s,t,i,!0)});s.length&&(s[0].done=function(){e&&e.parentNode===n&&n.removeChild(e)})}_playBarAddAnimation(t,e,i=!1){var a=e.hostElement,n=this._getAnimation(t,2);[].slice.call(a.childNodes).forEach(t=>{this._setLoadBarAnimation(n,t,i,!1)})}_playBarMoveAnimation(t,e,i,a=!1){var n,s,r,o,l,h,c,u=this;u._chart;n=e.hostElement;r=[].slice.call(i.childNodes);if(u._addStart){c=0;o=r[0];for(;c<u._addStart;){r.splice(0,0,o);c++}}if(u._removeStart){c=0;o=r[r.length-1];for(;c<u._removeStart;){var m=r.shift();r.push(m);c++}}l=r.length;s=[].slice.call(n.childNodes);h=s.length;s.forEach((e,i)=>{var n;if(i<l){o=r[i];if(i<u._addStart){n=u._getAnimation(t,2);u._setLoadBarAnimation(n,e,a,!1)}else if(i>=l-u._removeStart){n=u._getAnimation(t,2);u._setLoadBarAnimation(n,e,a,!1);n=u._getAnimation(t,0);u._removeBarAnimation(n,e,o,a)}else{n=u._getAnimation(t,1);u._setMoveBarAnimation(n,o,e)}if(i===h-1&&i<l-1){n=u._getAnimation(t,0);for(i++;i<l;i++){o=r[i];u._removeBarAnimation(n,e,o,a)}}}else{n=u._getAnimation(t,2);u._setLoadBarAnimation(n,e,a,!1)}})}_removeBarAnimation(t,e,i,a){var n=e.parentNode;n.appendChild(i);this._setLoadBarAnimation(t,i,a,!0,function(t){return function(){t.parentNode&&t.parentNode===n&&n.removeChild(t)}}(i))}_playLoadScatterAnimation(t,e){var i=this,a=i._chart,n=a.series[e],s=i.animationMode,r=n.hostElement,o=n._xValues||a._xvals;0===o.length&&(o=n._pointIndexes);[].slice.call(r.childNodes).forEach((a,n)=>{var r;r=s===AnimationMode.Point?i._getScatterAnimation(t,o[n]):s===AnimationMode.Series?i._getAnimation(t,e):i._getAnimation(t,0);i._setLoadScatterAnimation(r,a,!1)})}_setLoadScatterAnimation(t,e,i=!1,a){var n,s,r={},o={};if("g"===e.nodeName&&e.childNodes)[].slice.call(e.childNodes).forEach(e=>{this._setLoadScatterAnimation(t,e,i,a)});else{["rx","ry","stroke-width"].forEach(t=>{var i=e.getAttribute(t);r[t]=0;o[t]=Number(i)});n=i?o:r;s=i?r:o;this._setInitState(e,n,s);t.push({ele:e,from:n,to:s,done:a})}}_setUpdateScatterAnimation(t,e,i,a){var n={},s={};["cx","cy"].forEach(t=>{var a=e.getAttribute(t),r=i.getAttribute(t);if(a!==r){n[t]=Number(a);s[t]=Number(r)}});this._setInitState(i,n,s);t.push({ele:i,from:n,to:s,done:a})}_getScatterAnimation(t,e){var i=this._getScatterAnimationIndex(t,e);t[i]||(t[i]=[]);return t[i]}_getScatterAnimationIndex(t,e){var i=this._chart.axisX,a=null==i.min?i.actualMin:i.min,n=null==i.max?i.actualMax:i.max;return Math.ceil((e-a)/((n-a)/20))}_playScatterRemoveAnimation(t,e){var i=this,a=i._chart.series[0].hostElement.parentNode,n=i._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach(t=>{i._setLoadScatterAnimation(n,t,!0)});n.length&&(n[0].done=function(){e&&e.parentNode===a&&a.removeChild(e)})}_playScatterAddAnimation(t,e){var i=e.hostElement,a=this._getAnimation(t,0);[].slice.call(i.childNodes).forEach(t=>{this._setLoadScatterAnimation(a,t,!1)})}_playScatterMoveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,u=(c._chart,c._getAnimation(t,0));a=e.hostElement;s=[].slice.call(i.childNodes);if(c._addStart){h=0;r=s[0];for(;h<c._addStart;){s.splice(0,0,r);h++}}if(c._removeStart){h=0;r=s[s.length-1];for(;h<c._removeStart;){var m=s.shift();s.push(m);h++}}o=s.length;n=[].slice.call(a.childNodes);l=n.length;n.forEach((t,e)=>{if(e<o){if(e<c._addStart)c._setLoadScatterAnimation(u,t,!1);else if(e>=o-c._removeStart){c._setLoadScatterAnimation(u,t,!1);r=s[e];c._removeScatterAnimation(u,t,r)}else{r=s[e];c._setUpdateScatterAnimation(u,r,t)}if(e===l-1&&e<o-1)for(e++;e<o;e++){r=s[e];c._removeScatterAnimation(u,t,r)}}else c._setLoadScatterAnimation(u,t,!1)})}_removeScatterAnimation(t,e,i){var a=e.parentNode;a.appendChild(i);this._setLoadScatterAnimation(t,i,!0,function(t){return function(){t.parentNode&&t.parentNode===a&&a.removeChild(t)}}(i))}_playDefaultAnimation(t,e){var i,a,n=this._chart,s=n.series[e].hostElement,r=n._plotRect,o=n._currentRenderEngine,l=s.getAttribute("clip-path"),h="clipPath"+(1e6*Math.random()).toFixed();let c=n.axisX.reversed;o.addClipRect(new Rect(c?r.right:r.left,r.top,0,r.height),h);s.setAttribute("clip-path","url(#"+h+")");i=n.hostElement.querySelector("#"+h);a=this._getAnimation(t,0);let u={width:0},m={width:r.width};if(c){u.x=r.right;m.x=r.left}a.push({ele:i.querySelector("rect"),from:u,to:m,done:function(){if(s){l?s.setAttribute("clip-path",l):s.removeAttribute("clip-path");i&&i.parentNode&&i.parentNode.removeChild(i)}}})}}class FlexRadarAnimation extends FlexChartAnimation{constructor(t,e){super(t,e)}_getDurationAndDelay(t,e){var i=super._getDurationAndDelay(t,e);if(this.animationMode===AnimationMode.Point){i.duration=e/t;i.delay=e/t}return i}_playAxesAnimation(){}_getChartType(t){var e=super._getChartType(t);"Bar"===e&&(e="Column");return e}_playLoadLineAnimation(t,e){var i,a,n,s=this,r=s._chart,o=s._chart.series[e],l=o._xValues||r._xvals,h=s.animationMode,c=o.hostElement;if(h===AnimationMode.Point){0===l.length&&(l=o._pointIndexes);n=[].slice.call(c.childNodes);a=n.length-c.querySelectorAll("ellipse").length;n.forEach((e,i)=>{s._setRadarLinePointAnimation(t,e,i,l,a)})}else{i=h===AnimationMode.All?s._getAnimation(t,0):s._getAnimation(t,e);[].slice.call(c.childNodes).forEach(t=>{s._setLineRiseDiveAnimation(i,t,!0)})}}_setRadarLinePointAnimation(t,e,i,a,n){var s,r,o,l,h,c,u,m=this,d=m._chart,p=e.nodeName,_=[],A=[],f=[],g=[],y=d._center,x=[],E=!1,v={},S={},M=0;if("polyline"===p||"polygon"===p){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){x[u=m._getScatterAnimationIndex(t,a[r])]||(x[u]=[]);x[u].push(r);o=l[r]||l.getItem(r);_.push({x:y.x,y:y.y});A.push({x:o.x,y:o.y})}for(r=0,s=x.length;r<s;r++)if(x[r]){c=m._getAnimation(t,M);f=g.length?g.slice():_.slice();g=f.slice();x[r].forEach(t=>{var e=A[t];g[t]={x:e.x,y:e.y}});S={};(v={})[p]=f;S[p]=g;if(!E){m._setInitState(e,v,S);E=!0}c.push({ele:e,from:v,to:S,done:h});M++}}else if("ellipse"===p){if((r=i-(n||0))<0)return;c=d._isPolar?m._getScatterAnimation(t,a[r]):m._getScatterAnimation(t,r);m._toggleVisibility(e,!1);h=function(){m._toggleVisibility(e,!0)};c.push({ele:e,from:v,to:S,done:h})}}_setLineRiseDiveAnimation(t,e,i){var a,n,s,r,o,l,h,c=this,u=c._chart,m=e.nodeName,d=[],p=[],_=u._center,A={},f={};if("polyline"===m||"polygon"===m){s=(l=e.points).length||l.numberOfItems;for(r=0;r<s;r++){o=l[r]||l.getItem(r);d.push({x:_.x,y:_.y});p.push({x:o.x,y:o.y})}A[m]=d;f[m]=p}else if("ellipse"===m){c._toggleVisibility(e,!1);i&&(h=function(){c._toggleVisibility(e,!0)})}a=i?A:f;n=i?f:A;c._setInitState(e,a,n);t.push({ele:e,from:a,to:n,done:h})}_parsePathByRadius(t,e,i){var a,n,s=t.center.x,r=t.center.y,o=t.radius,l=t.angle,h=t.sweep;a=[s,r,0,l,h,0];n=[s,r,o,l,h,t.innerRadius||0];e.pie=a;i.pie=n}_playUpdateAnimation(t,e,i,a,n){if("Bar"===i||"Column"===i){if(null==a)return;this._playLoadBarAnimation(t,e,!1)}else super._playUpdateAnimation(t,e,i,a,n)}_playLoadBarAnimation(t,e,i=!1){var a=this,n=a._chart,s=n.series[e],r=n._areas[e],o=a.animationMode,l=s.hostElement;[].slice.call(l.childNodes).forEach((i,n)=>{var s,l,h={},c={};s=o===AnimationMode.Point?a._getAnimation(t,n):o===AnimationMode.Series?a._getAnimation(t,e):a._getAnimation(t,0);l=r[n];a._parsePathByRadius(l,h,c);a._setInitState(i,h,c);s.push({ele:i,from:h,to:c})})}}class AnimationHelper{static playAnimations(t,e,i,a,n=Easing.Swing,s,r){var o=t.length,l=0,h=[];t.forEach((t,c)=>{var u=AnimationHelper.playAnimation(t,e[c],i[c],(function(){l===o-1&&a&&a();l++}),n,s,r);h.push(u)});return h}static playAnimation(t,e,i,a,n=Easing.Swing,s,r){var o=AnimationHelper.parseAttrs(e,i);return AnimationHelper.animate((function(e){AnimationHelper.setElementAttr(t,o,e)}),a,n,s,r)}static setElementAttr(t,e,i){var a,n;for(n in e){a=e[n];AnimationHelper.calcValue(a,i);t.setAttribute(n,a.getValue(a.value,i))}}static getPathDescOfPie(t,e,i,a,n,s=0){var r=!1;if(n>=2*Math.PI){r=!0;n=2*Math.PI-.001}var o=new Point(t,e);o.x+=i*Math.cos(a);o.y+=i*Math.sin(a);var l=a+n,h=new Point(t,e);h.x+=i*Math.cos(l);h.y+=i*Math.sin(l);if(s){var c=new Point(t,e);c.x+=s*Math.cos(l);c.y+=s*Math.sin(l);var u=new Point(t,e);u.x+=s*Math.cos(a);u.y+=s*Math.sin(a)}var m=" 0 0,1 ",d=" 0 0,0 ";if(Math.abs(n)>Math.PI){m=" 0 1,1 ";d=" 0 1,0 "}var p="M "+o.x.toFixed(3)+","+o.y.toFixed(3);p+=" A "+i.toFixed(3)+","+i.toFixed(3)+m;p+=h.x.toFixed(3)+","+h.y.toFixed(3);if(s){p+=r?" M "+c.x.toFixed(3)+","+c.y.toFixed(3):" L "+c.x.toFixed(3)+","+c.y.toFixed(3);p+=" A "+s.toFixed(3)+","+s.toFixed(3)+d;p+=u.x.toFixed(3)+","+u.y.toFixed(3)}else p+=" L "+t.toFixed(3)+","+e.toFixed(3);r||(p+=" z");return p}static parseAttrs(t,e){var i={};for(var a in t)if(null!=e[a])switch(a){case"polyline":i.points=AnimationHelper.parseAttr(t[a],e[a],(function(t,e){if(1===e){for(var i,a,n;t.length>1;){a=t[0];n=t[1];if(a.x!==n.x||a.y!==n.y){a=null;n=null;break}t.splice(1,1)}for(i=t.length-1;i>0;i--){a=n;n=t[i];if(a){if(a.x!==n.x||a.y!==n.y)break;t.pop()}}}return t.map(t=>t.x+","+t.y).join(" ")}));break;case"polygon":i.points=AnimationHelper.parseAttr(t[a],e[a],(function(t,e){if(1===e){var i,a,n,s,r;s=t.pop();r=t.pop();for(;t.length>1;){a=t[0];n=t[1];if(a.x!==n.x||a.y!==n.y){a=null;n=null;break}t.splice(1,1)}for(i=t.length-1;i>=0;i--){a=n;n=t[i];if(a){if(a.x!==n.x||a.y!==n.y)break;t.splice(i,1)}}t.push(r);t.push(s)}return t.map(t=>t.x+","+t.y).join(" ")}));break;case"d":i[a]=AnimationHelper.parseAttr(t[a],e[a],(function(t){return t.map(t=>"string"==typeof t?t:t[0]+","+t[1]).join(" ")}));break;case"pie":i.d=AnimationHelper.parseAttr(t[a],e[a],(function(t){return AnimationHelper.getPathDescOfPie.apply(AnimationHelper,t)}));break;case"rotate":i.transform=AnimationHelper.parseAttr(t[a],e[a],(function(t){return"rotate("+t.join(" ")+")"}));break;case"x":case"width":case"height":case"rx":case"ry":case"stroke-width":i[a]=AnimationHelper.parseAttr(t[a],e[a],(function(t){return Math.abs(t)}));break;default:i[a]=AnimationHelper.parseAttr(t[a],e[a])}return i}static animate(t,e,i=Easing.Swing,a=400,n=16){asFunction(t);asNumber(a,!1,!0);asNumber(n,!1,!0);var s=0,r=setInterval((function(){Date.now();var o=s/a;o=EasingHelper[Easing[i]](o);t(o);if((s+=n)>=a){clearInterval(r);(o<1||o>1)&&t(1);e&&e()}}),n);return r}static calcValue(t,e){var i=t.from,a=t.diff,n=t.value;isNumber(i)?t.value=0===a?i:i+a*e:isArray(i)&&AnimationHelper.parseArrayAttr(n,i,a,(function(t,i){return"number"==typeof t?t+i*e:t}))}static parseAttr(t,e,i){var a,n,s,r;if(isArray(t)&&isArray(e)){n=e;s=[];r=(a=t).slice();AnimationHelper.parseArrayAttr(s,a,n,(function(t,e){return t===e?0:e-t}))}else{r=a=Number(t);s=(n=Number(e))-a}return{from:a,to:n,value:r,diff:s,getValue:i||function(t,e){return t}}}static parseArrayAttr(t,e,i,a){e.forEach((e,n)=>{var s={},r=[],o=i[n];if(isNumber(e)||"string"==typeof e)t[n]=a(e,o);else if(isArray(e)){e.forEach((t,i)=>{r[i]=a(e[i],o[i])});t[n]=r}else{Object.getOwnPropertyNames(e).forEach(t=>{s[t]=a(e[t],o[t])});t[n]=s}})}}class EasingHelper{static Linear(t){return t}static Swing(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)}static EaseInQuad(t){return t*t}static EaseOutQuad(t){return t*(2-t)}static EaseInOutQuad(t){return t<.5?2*t*t:(4-2*t)*t-1}static EaseInCubic(t){return t*t*t}static EaseOutCubic(t){return--t*t*t+1}static EaseInOutCubic(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}static EaseInQuart(t){return t*t*t*t}static EaseOutQuart(t){return 1- --t*t*t*t}static EaseInOutQuart(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t}static EaseInQuint(t){return t*t*t*t*t}static EaseOutQuint(t){return 1+--t*t*t*t*t}static EaseInOutQuint(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}static EaseInSine(t){return 1-Math.cos(t*(Math.PI/2))}static EaseOutSine(t){return Math.sin(t*(Math.PI/2))}static EaseInOutSine(t){return-.5*(Math.cos(Math.PI*t)-1)}static EaseInExpo(t){return 0==t?0:Math.pow(2,10*(t-1))}static EaseOutExpo(t){return 1==t?1:1-Math.pow(2,-10*t)}static EaseInOutExpo(t){return t==!!t?t:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))}static EaseInCirc(t){return-(Math.sqrt(1-t*t)-1)}static EaseOutCirc(t){return Math.sqrt(1-Math.pow(t-1,2))}static EaseInOutCirc(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static EaseInBack(t){var e=1.70158;return t*t*((e+1)*t-e)}static EaseOutBack(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1}static EaseInOutBack(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)}static EaseInBounce(t){return 1-EasingHelper.EaseOutBounce(1-t)}static EaseOutBounce(t){var e=7.5625;return t<1/2.75?e*t*t:t<2/2.75?e*(t-=1.5/2.75)*t+.75:t<2.5/2.75?e*(t-=2.25/2.75)*t+.9375:e*(t-=2.625/2.75)*t+.984375}static EaseInOutBounce(t){return t<.5?.5*EasingHelper.EaseInBounce(2*t):.5*EasingHelper.EaseOutBounce(2*t-1)+.5}static EaseInElastic(t){return t==!!t?t:-Math.pow(2,10*(t-=1))*Math.sin((t-.075)*(2*Math.PI)/.3)}static EaseOutElastic(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1}static EaseInOutElastic(t){return t==!!t?t:(t*=2)<1?Math.pow(2,10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*-.5:Math.pow(2,-10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*.5+1}}_registerModule("wijmo.chart.animation",selfModule); |
/*! | ||
* | ||
* Wijmo Library 5.20242.21 | ||
* Wijmo Library 5.20242.30 | ||
* https://developer.mescius.com/wijmo | ||
@@ -14,2 +14,2 @@ * | ||
var __extends=this&&this.__extends||function(){var extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};return function(t,e){extendStatics(t,e);function __(){this.constructor=t}t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();import{_getModule,isNumber,isArray,asNumber,asFunction,Point,Rect,hasClass,isDate,asBoolean,Size,asEnum,Event,EventArgs,assert,_registerModule}from"@grapecity/wijmo";import{ChartType,FlexChart,TickMark,AxisType,FlexPie,FlexChartCore}from"@grapecity/wijmo.chart";import*as selfModule from"@grapecity/wijmo.chart.animation";export function softFinancial(){return _getModule("wijmo.chart.finance")}export function softRadar(){return _getModule("wijmo.chart.radar")}export var Easing;!function(t){t[t.Linear=0]="Linear";t[t.Swing=1]="Swing";t[t.EaseInQuad=2]="EaseInQuad";t[t.EaseOutQuad=3]="EaseOutQuad";t[t.EaseInOutQuad=4]="EaseInOutQuad";t[t.EaseInCubic=5]="EaseInCubic";t[t.EaseOutCubic=6]="EaseOutCubic";t[t.EaseInOutCubic=7]="EaseInOutCubic";t[t.EaseInQuart=8]="EaseInQuart";t[t.EaseOutQuart=9]="EaseOutQuart";t[t.EaseInOutQuart=10]="EaseInOutQuart";t[t.EaseInQuint=11]="EaseInQuint";t[t.EaseOutQuint=12]="EaseOutQuint";t[t.EaseInOutQuint=13]="EaseInOutQuint";t[t.EaseInSine=14]="EaseInSine";t[t.EaseOutSine=15]="EaseOutSine";t[t.EaseInOutSine=16]="EaseInOutSine";t[t.EaseInExpo=17]="EaseInExpo";t[t.EaseOutExpo=18]="EaseOutExpo";t[t.EaseInOutExpo=19]="EaseInOutExpo";t[t.EaseInCirc=20]="EaseInCirc";t[t.EaseOutCirc=21]="EaseOutCirc";t[t.EaseInOutCirc=22]="EaseInOutCirc";t[t.EaseInBack=23]="EaseInBack";t[t.EaseOutBack=24]="EaseOutBack";t[t.EaseInOutBack=25]="EaseInOutBack";t[t.EaseInBounce=26]="EaseInBounce";t[t.EaseOutBounce=27]="EaseOutBounce";t[t.EaseInOutBounce=28]="EaseInOutBounce";t[t.EaseInElastic=29]="EaseInElastic";t[t.EaseOutElastic=30]="EaseOutElastic";t[t.EaseInOutElastic=31]="EaseInOutElastic"}(Easing||(Easing={}));export var AnimationMode;!function(t){t[t.All=0]="All";t[t.Point=1]="Point";t[t.Series=2]="Series"}(AnimationMode||(AnimationMode={}));var ChartAnimation=function(){function ChartAnimation(t,e){this._play=!0;this.ended=new Event;var i=this,n=t.hostElement,a=new Size(n.offsetWidth,n.offsetHeight);i._chart=t;i._updateEventArgs=[];if(t instanceof FlexPie)i._animation=new FlexPieAnimation(t,i._updateEventArgs);else{softRadar()&&t instanceof softRadar().FlexRadar?i._animation=new FlexRadarAnimation(t,i._updateEventArgs):t instanceof FlexChartCore&&(i._animation=new FlexChartAnimation(t,i._updateEventArgs));i._chartType=t.chartType}assert(void 0!==i._animation,"Animation is not supported");i._initOptions(e);t.beginUpdate();window.setTimeout((function(){t.rendered.addHandler(i._playAnimation,i);t.endUpdate()}),0);i._setCV(t.collectionView);window.addEventListener("resize",(function(t){var e=new Size(n.offsetWidth,n.offsetHeight);if(!a.equals(e)){i._play=!1;a=e}}))}ChartAnimation.prototype._initOptions=function(t){if(t){t.duration&&(this.duration=t.duration);t.easing&&(this.easing=t.easing);t.animationMode&&(this.animationMode=t.animationMode);void 0!==t.axisAnimation&&(this.axisAnimation=t.axisAnimation)}};ChartAnimation.prototype._setCV=function(t){this._cv=t;this._animation._clearState()};Object.defineProperty(ChartAnimation.prototype,"animationMode",{get:function(){return this._animation.animationMode},set:function(t){(t=asEnum(t,AnimationMode))!=this.animationMode&&(this._animation.animationMode=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"easing",{get:function(){return this._animation.easing},set:function(t){(t=asEnum(t,Easing))!=this.easing&&(this._animation.easing=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"duration",{get:function(){return this._animation.duration},set:function(t){(t=asNumber(t))!=this.duration&&(this._animation.duration=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"axisAnimation",{get:function(){return this._animation.axisAnimation},set:function(t){(t=asBoolean(t))!=this.axisAnimation&&(this._animation.axisAnimation=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0});ChartAnimation.prototype._playAnimation=function(){var t=this,e=t._chart,i=e.chartType;t._cv!==e.collectionView&&t._setCV(e.collectionView);if(null!=t._chartType&&t._chartType!==i){t._chartType=i;t._animation._clearState()}t._play?t._animation.playAnimation((function(){return t.ended.raise(t,EventArgs.empty)})):t._play=!0};ChartAnimation.prototype.animate=function(){var t=this._chart;if(t){var e=t.itemsSource;t.beginUpdate();t.itemsSource=null;t.itemsSource=e;t.endUpdate()}};return ChartAnimation}();export{ChartAnimation};var FlexAnimation=function(){function FlexAnimation(t,e){this._axisAnimation=!0;this._chart=t;this._timers=[]}Object.defineProperty(FlexAnimation.prototype,"animationMode",{get:function(){return this._animationMode||AnimationMode.All},set:function(t){if((t=asEnum(t,AnimationMode,!1))!==this._animationMode){this._clearState();this._animationMode=t}},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"easing",{get:function(){return null==this._easing?Easing.Swing:this._easing},set:function(t){t!==this._easing&&(this._easing=asEnum(t,Easing,!1))},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"duration",{get:function(){return this._duration||400},set:function(t){t!==this._duration&&(this._duration=asNumber(t,!1,!0))},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"axisAnimation",{get:function(){return!!this._axisAnimation},set:function(t){t!==this._axisAnimation&&(this._axisAnimation=asBoolean(t,!1))},enumerable:!0,configurable:!0});FlexAnimation.prototype.playAnimation=function(t){};FlexAnimation.prototype._clearState=function(){this._previousState&&(this._previousState=null);this._currentState&&(this._currentState=null)};FlexAnimation.prototype._setInitState=function(t,e,i){var n=AnimationHelper.parseAttrs(e,i);AnimationHelper.setElementAttr(t,n,0)};FlexAnimation.prototype._getAnimation=function(t,e){t[e]||(t[e]=[]);return t[e]};FlexAnimation.prototype._toggleVisibility=function(t,e){e?AnimationHelper.playAnimation(t,{opacity:0},{opacity:1},null,Easing.Swing,100):t.setAttribute("opacity","0")};FlexAnimation.prototype._toggleDataLabelVisibility=function(t){var e=this._chart.hostElement,i=e&&e.querySelector(".wj-data-labels");i&&this._toggleVisibility(i,t)};FlexAnimation.prototype._playAnimation=function(t,e){var i,n=this,a=this,o=a.duration,r=a.easing,s=t.length;a._toggleDataLabelVisibility(!1);i=a._getDurationAndDelay(t.length,o);if(this._timers&&this._timers.length){this._timers.forEach((function(t){return window.clearInterval(t)}));this._timers.length=0}t.forEach((function(t,o){var l;if(t){l=window.setTimeout((function(){var l;t.forEach((function(t,u){if(t&&t.ele){if(o===s-1&&0===u){var c=t.done;t.done=function(){a._toggleDataLabelVisibility(!0);c&&c();e&&e()}}if(isArray(t.ele)){l=AnimationHelper.playAnimations(t.ele,t.from,t.to,t.done,r,i.duration);n._timers=n._timers.concat.apply(l)}else{l=AnimationHelper.playAnimation(t.ele,t.from,t.to,t.done,r,i.duration);n._timers.push(l)}}}))}),i.delay*o);n._timers.push(l)}}))};FlexAnimation.prototype._getDurationAndDelay=function(t,e){var i={duration:e,delay:0};if(t>1)if(this._previousState){i.duration=e/t;i.delay=e/t}else{i.duration=.5*e;i.delay=.5*e/(t-1)}return i};return FlexAnimation}(),FlexPieAnimation=function(t){__extends(FlexPieAnimation,t);function FlexPieAnimation(e,i){var n=t.call(this,e,i)||this;e.selectionChanged.addHandler(n._selectionChanged,n);return n}FlexPieAnimation.prototype._selectionChanged=function(){this._isSelectionChanged=!0};FlexPieAnimation.prototype._clearState=function(){t.prototype._clearState.call(this);this._isSelectionChanged=!1};FlexPieAnimation.prototype._getElementRotate=function(t){var e,i=t.getAttribute("transform");if(i&&i.indexOf("rotate")>-1){if(1==(i=(i=i.replace("rotate(","").replace(")","")).indexOf(",")>-1?i.split(",").map((function(t){return+t})):i.split(" ").map((function(t){return+t}))).length){e=this._chart._areas[0].center;i.push(e.x,e.y)}}else i=[0,(e=this._chart._areas[0].center).x,e.y];return i};FlexPieAnimation.prototype._getDurationAndDelay=function(t,e){var i={duration:e,delay:0};if(this.animationMode===AnimationMode.Point&&t>1){i.duration=e/t;i.delay=e/t}return i};FlexPieAnimation.prototype.playAnimation=function(e){t.prototype.playAnimation.call(this,e);var i=[];this._playPieAnimation(i);i.length&&this._playAnimation(i,e)};FlexPieAnimation.prototype._playPieAnimation=function(t){var e=this._chart,i=!0;this._previousState=this._currentState;this._currentState={areas:e._areas,pels:e._pels,rotate:e._pels.length&&this._getElementRotate(e._pels[0].parentNode)};this._previousState&&(i=!1);if(this._isSelectionChanged){e.isAnimated||this._playSelectPieAnimation(t);this._isSelectionChanged=!1}else i?this._playLoadPieAnimation(t):this._playUpdatePieAnimation(t)};FlexPieAnimation.prototype._playSelectPieAnimation=function(t){if(null!=this._previousState){var e,i,n,a=this._chart._pels[0].parentNode,o=this._previousState.rotate,r=this._getElementRotate(a),s=o[0],l=r[0];if(s!==l){s-l>180?r[0]+=360:l-s>180&&(o[0]+=360);e=this._getAnimation(t,0);i={rotate:o};n={rotate:r};this._setInitState(a,i,n);e.push({ele:a,from:i,to:n})}}};FlexPieAnimation.prototype._playUpdatePieAnimation=function(t){var e,i,n,a,o=this._chart,r=this._previousState,s=o._areas,l=o._pels,u=r.areas.length,c=s.length,h=Math.max(c,u),p=this._getAnimation(t,0),m=0;if(0!==c&&0!==u){this._playSelectPieAnimation(t);for(e=0;e<h;e++){i={};if(l[e]&&l[e].childNodes&&l[e].childNodes.length>0){if(e<c&&e<u){n=s[0];0===e&&(m=n.angle);1===u?l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(n.center.x,n.center.y,n.radius,m,2*Math.PI,n.innerRadius||0)):l[e].childNodes[0].setAttribute("d",r.pels[e].childNodes[0].getAttribute("d"))}if(e<c){n=s[e];i.to={pie:[n.center.x,n.center.y,n.radius,n.angle,n.sweep,n.innerRadius||0]};i.ele=l[e].childNodes[0]}else{n=s[0];a=r.pels[e];i.to={pie:[n.center.x,n.center.y,n.radius,m+2*Math.PI,0,n.innerRadius||0]};l[0].parentNode.appendChild(a);i.done=function(t){return function(){t.parentNode.removeChild(t)}}(a);i.ele=a.childNodes[0]}if(e<u){n=r.areas[e];i.from={pie:[n.center.x,n.center.y,n.radius,n.angle,n.sweep,n.innerRadius||0]}}else{l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(n.center.x,n.center.y,n.radius,2*Math.PI+m,0,n.innerRadius||0));n=r.areas[0];i.from={pie:[n.center.x,n.center.y,n.radius,2*Math.PI+m,0,n.innerRadius||0]}}p.push(i)}}}};FlexPieAnimation.prototype._playLoadPieAnimation=function(t){var e=this,i=e._chart,n=e.animationMode,a=i._areas;i._pels.forEach((function(i,o){var r,s=i.childNodes[0],l={},u={};if(s){if(n===AnimationMode.Point){e._parsePathByAngle(a[o],l,u);r=e._getAnimation(t,o)}else{e._parsePathByRadius(a[o],l,u);r=e._getAnimation(t,0)}e._setInitState(s,l,u);r.push({ele:s,from:l,to:u})}}))};FlexPieAnimation.prototype._parsePathByRadius=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,u=t.sweep;n=[o,r,0,l,u,0];a=[o,r,s,l,u,t.innerRadius||0];e.pie=n;i.pie=a};FlexPieAnimation.prototype._parsePathByAngle=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,u=t.sweep,c=t.innerRadius;n=[o,r,s,l,0,c||0];a=[o,r,s,l,u,c||0];e.pie=n;e["stroke-width"]=0;i.pie=a;i["stroke-width"]=1};return FlexPieAnimation}(FlexAnimation),FlexChartAnimation=function(t){__extends(FlexChartAnimation,t);function FlexChartAnimation(e,i){return t.call(this,e,i)||this}FlexChartAnimation.prototype.playAnimation=function(e){t.prototype.playAnimation.call(this,e);var i,n,a,o,r,s,l,u,c,h=!0,p=this._chart,m=softFinancial()&&p instanceof softFinancial().FinancialChart,f=p.series,d=f.length,A=[];this._previousState=this._currentState;this._previousXVal=this._currentXVal;this._currentState=[];this._addStart=0;this._removeStart=0;this._currentXVal=p._xlabels.slice();if(this._previousState&&this._previousState.length){h=!1;r=(s=this._previousState).length;l=this._previousXVal;u=this._currentXVal;l.length>2&&u.length>2&&((i=u.indexOf(l[0]))>0&&i<u.length-2?u[i+1]===l[1]&&u[i+2]===l[2]&&(this._addStart=i):(i=l.indexOf(u[0]))>0&&i<l.length-2&&l[i+1]===u[1]&&l[i+2]===u[2]&&(this._removeStart=i))}for(i=0;i<d;i++){o=null!=(n=f[i])._getChartType()?n._getChartType():p._getChartType();a=this._getChartType(o);this._currentState.push({seriesType:o,ele:n.hostElement});if(m)this._playDefaultAnimation(A,i);else{c=s&&s[i];if("Default"===a){this._playDefaultAnimation(A,i);continue}if(h||c&&c.seriesType!==o||c&&c.ele&&(""==c.ele.innerHTML||0===c.ele.childNodes.length))this._playLoadAnimation(A,i,a);else{this._playUpdateAnimation(A,i,a,n,c&&c.ele||null);if(i===d-1&&i<r-1)for(i++;i<=r-1;i++)this._playUpdateAnimation(A,i,a,null,c.ele)}}}this._adjustAnimations(a,A);A.length&&this._playAnimation(A,e);this.axisAnimation&&!m&&this._playAxesAnimation()};FlexChartAnimation.prototype._playAxesAnimation=function(){var t,e,i,n=this._chart.axes,a=n.length;this._prevAxesStates=this._currAxesStates;this._currAxesStates=[];for(e=0;e<a;e++)(t=n[e]).hostElement&&this._currAxesStates.push({ele:t.hostElement,vals:t._vals,axis:t,maxValue:isDate(t.actualMax)?t.actualMax.getTime():t.actualMax,minValue:isDate(t.actualMin)?t.actualMin.getTime():t.actualMin});if(this._prevAxesStates){i=Math.max(this._prevAxesStates.length,this._currAxesStates.length);for(e=0;e<i;e++)this._playAxisAnimation(this._prevAxesStates[e],this._currAxesStates[e])}};FlexChartAnimation.prototype._playAxisAnimation=function(t,e){if(t&&e){var i,n=[],a=[];if(e&&e.maxValue-e.minValue){i=this._parseAxisState(e);this._convertAxisAnimation(n,i.major,e.axis,t.maxValue,t.minValue);this._convertAxisAnimation(n,i.minor,e.axis,t.maxValue,t.minValue)}if(t&&t.maxValue-t.minValue){i=this._parseAxisState(t);this._convertAxisAnimation(a,i.major,t.axis);this._convertAxisAnimation(a,i.minor,t.axis)}n&&a&&this._combineAxisAnimations(n,a);this._playCurrAxisAnimation(n);this._playPrevAxisAnimation(a)}};FlexChartAnimation.prototype._combineAxisAnimations=function(t,e){var i,n,a=this,o=e.length;for(i=o-1;i>=0;i--)(n=e[i]).text&&t.some((function(t){if(t.text&&t.text===n.text){a._combineAxisAnimation(t,n);e.splice(i,1);return!0}}))};FlexChartAnimation.prototype._combineAxisAnimation=function(t,e){var i=this;["label","majorGrid","tick"].forEach((function(n){t[n]&&e[n]&&i._resetExistAxisAttrs(t[n],e[n])}))};FlexChartAnimation.prototype._resetExistAxisAttrs=function(t,e){var i=t.ele,n=e.ele,a={},o={};["x","y","x1","x2","y1","y2"].forEach((function(t){var e=i.getAttribute(t),r=n.getAttribute(t);if(e!==r){a[t]=r;o[t]=e}}));t.calcPos=a;t.elePos=o};FlexChartAnimation.prototype._convertAxisAnimation=function(t,e,i,n,a){var o,r=this,s=i.hostElement,l=i.axisType==AxisType.Y;e.forEach((function(e,u){var c=i.convert(e.val,n,a);if(!isNaN(c)){o={};e.majorGrid&&(o.majorGrid=r._getAxisAnimationAttrs(e.majorGrid,s,c,l));if(e.label){o.label=r._getAxisAnimationAttrs(e.label,s,c,l);o.text=e.label.innerHTML||e.label.textContent}e.tick&&(o.tick=r._getAxisAnimationAttrs(e.tick,s,c,l));t.push(o)}}))};FlexChartAnimation.prototype._getAxisAnimationAttrs=function(t,e,i,n){var a,o,r;a={ele:t,parent:e,elePos:{},calcPos:{}};if("text"===t.nodeName){o=n?"y":"x";r=Number(t.getAttribute(o));a.elePos[o]=r;a.calcPos[o]=i}else{o=n?"y1":"x1";r=Number(t.getAttribute(o));if(n){a.elePos={y1:r,y2:r};a.calcPos={y1:i,y2:i}}else{a.elePos={x1:r,x2:r};a.calcPos={x1:i,x2:i}}}a.elePos.opacity=1;a.calcPos.opacity=0;return a};FlexChartAnimation.prototype._playCurrAxisAnimation=function(t){var e=this.duration;t&&0!==t.length&&t.forEach((function(t){["majorGrid","label","tick"].forEach((function(i){var n=t[i];if(n){n.parent;var a=n.ele,o=n.elePos,r=n.calcPos;AnimationHelper.playAnimation(a,r,o,null,Easing.Swing,e)}}))}))};FlexChartAnimation.prototype._playPrevAxisAnimation=function(t){var e=this.duration;t&&0!==t.length&&t.forEach((function(t){["majorGrid","label","tick"].forEach((function(i){var n=t[i];if(n){var a=n.parent,o=n.ele,r=n.elePos,s=n.calcPos;a.appendChild(o);AnimationHelper.playAnimation(o,r,s,(function(){o.parentNode===a&&a.removeChild(o)}),Easing.Swing,e)}}))}))};FlexChartAnimation.prototype._parseAxisState=function(t){if(null==t)return null;var e,i,n,a=t.vals,o=t.axis,r=o.axisType==AxisType.Y,s=t.ele.childNodes,l=0,u=[],c=[];if(a){e=a.major;i=a.minor;n=a.hasLbls}e&&e.forEach((function(t,e){var i,a={},c=!!n[e];u.push(a);a.val=t;i=s[l];if(o.majorGrid&&hasClass(i,FlexChart._CSS_GRIDLINE)){a.majorGrid=i;i=s[++l]}if(r){if(c&&i&&o.majorTickMarks!==TickMark.None&&hasClass(i,FlexChart._CSS_TICK)){a.tick=i;i=s[++l]}if(c&&i&&(hasClass(i,FlexChart._CSS_LABEL)||i.querySelector("."+FlexChart._CSS_LABEL))){a.label=i;l++}}else{if(c&&i&&(hasClass(i,FlexChart._CSS_LABEL)||i.querySelector("."+FlexChart._CSS_LABEL))){a.label=i;i=s[++l]}if(c&&i&&o.majorTickMarks!==TickMark.None&&hasClass(i,FlexChart._CSS_TICK)){a.tick=i;l++}}}));i&&i.forEach((function(t,e){var i,n={};c.push(n);n.val=t;i=s[l];if(o.minorTickMarks!==TickMark.None&&hasClass(i,FlexChart._CSS_TICK_MINOR)){n.tick=i;i=s[++l]}if(o.minorGrid&&hasClass(i,FlexChart._CSS_GRIDLINE_MINOR)){n.majorGrid=i;l++}}));return{major:u,minor:c}};FlexChartAnimation.prototype._playLoadAnimation=function(t,e,i){this["_playLoad"+i+"Animation"](t,e)};FlexChartAnimation.prototype._playUpdateAnimation=function(t,e,i,n,a){null==n||null==a?null==n?this["_play"+i+"RemoveAnimation"](t,a):this["_play"+i+"AddAnimation"](t,n):this["_play"+i+"MoveAnimation"](t,n,a)};FlexChartAnimation.prototype._adjustAnimations=function(t,e){var i,n=e.length;if("Column"===t||"Bar"===t)for(i=n-1;i>=0;i--)null==e[i]&&e.splice(i,1)};FlexChartAnimation.prototype._getChartType=function(t){var e="Default",i=this._chart._isRotated();switch(t){case ChartType.Scatter:case ChartType.Bubble:case ChartType.Candlestick:case ChartType.HighLowOpenClose:e="Scatter";break;case ChartType.Column:case ChartType.Bar:e=i?"Bar":"Column";break;case ChartType.Line:case ChartType.LineSymbols:case ChartType.Area:case ChartType.Spline:case ChartType.SplineSymbols:case ChartType.SplineArea:e="Line";break;default:e="Default"}return e};FlexChartAnimation.prototype._playLoadLineAnimation=function(t,e){var i,n=this,a=n._chart.series[e],o=n.animationMode,r=a.hostElement;if(o===AnimationMode.Point)n._playDefaultAnimation(t,e);else{i=o===AnimationMode.All?n._getAnimation(t,0):n._getAnimation(t,e);[].slice.call(r.childNodes).forEach((function(t){n._setLineRiseDiveAnimation(i,t,!0)}))}};FlexChartAnimation.prototype._setLineRiseDiveAnimation=function(t,e,i){var n,a,o,r,s,l,u,c=this,h=this,p=h._chart,m=e.nodeName,f=[],d=[],A=h._chart._plotRect,_=A.top+A.height,y=A.left,g={},x={};if("g"===m&&e.childNodes)[].slice.call(e.childNodes).forEach((function(e){c._setLineRiseDiveAnimation(t,e,i)}));else{if("polyline"===m||"polygon"===m){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){s=l[r]||l.getItem(r);p.rotated?f.push({x:y,y:s.y}):f.push({x:s.x,y:_});d.push({x:s.x,y:s.y})}g[m]=f;x[m]=d}else if("ellipse"===m||"rect"===m){h._toggleVisibility(e,!1);i&&(u=function(){h._toggleVisibility(e,!0)})}n=i?g:x;a=i?x:g;h._setInitState(e,n,a);t.push({ele:e,from:n,to:a,done:u})}};FlexChartAnimation.prototype._setLineMoveAnimation=function(t,e,i,n,a){if(null!=e&&null!=i){var o,r,s,l,u,c,h,p,m,f=e.nodeName,d=[],A=[],_={},y={};if("polyline"===f||"polygon"===f){m="polygon"===f;s=e.points;c=i.points;o=s.length||s.numberOfItems;l=c.length||c.numberOfItems;p=Math.max(o,l);for(h=0;h<p;h++){if(h<o){r=s[h]||s.getItem(h);d.push({x:r.x,y:r.y})}if(h<l){u=c[h]||c.getItem(h);A.push({x:u.x,y:u.y})}}if(this._addStart){this._adjustStartLinePoints(this._addStart,d,s);o+=this._addStart}else if(this._removeStart){this._adjustStartLinePoints(this._removeStart,A,c);l+=this._removeStart}l>o?this._adjustEndLinePoints(l,o,d,s,m):l<o&&this._adjustEndLinePoints(o,l,A,c,m);_[f]=d;y[f]=A;this._setInitState(n,_,y);t.push({ele:n,from:_,to:y,done:a})}}};FlexChartAnimation.prototype._adjustStartLinePoints=function(t,e,i){for(var n=i[0]||i.getItem(0);t;){e.splice(0,0,{x:n.x,y:n.y});t--}};FlexChartAnimation.prototype._adjustEndLinePoints=function(t,e,i,n,a){var o,r,s;if(a&&(n.length>=3||n.numberOfItems>=3)){r=i.pop();o=i.pop();s=n[n.length-3]||n.getItem(n.numberOfItems-3)}else(n.length>0||n.numberOfItems>0)&&(s=n[n.length-1]||n.getItem(n.numberOfItems-1));for(;t>e&&s;){i.push({x:s.x,y:s.y});e++}if(a&&r&&o){i.push(o);i.push(r)}};FlexChartAnimation.prototype._playLineRemoveAnimation=function(t,e){var i,n=this,a=n._chart.series[0].hostElement.parentNode,o=n._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){n._setLineRiseDiveAnimation(o,t,!1)}));if(o.length){i=o[0].done;o[0].done=function(){e&&e.parentNode===a&&a.removeChild(e);i&&i()}}};FlexChartAnimation.prototype._playLineAddAnimation=function(t,e){var i=this,n=e.hostElement,a=this._getAnimation(t,0);[].slice.call(n.childNodes).forEach((function(t){i._setLineRiseDiveAnimation(a,t,!0)}))};FlexChartAnimation.prototype._playLineMoveAnimation=function(t,e,i){var n,a,o,r,s=this,l=(s._chart,s._getAnimation(t,0)),u=[];n=e.hostElement;a=[].slice.call(i.childNodes);[].slice.call(n.childNodes).forEach((function(t,e){r=t.nodeName;o=a[e];if("g"===r&&t.nodeChilds)[].slice.call(t.nodeChilds).forEach((function(t,e){if(o){u.push(t);s._toggleVisibility(t,!1)}}));else if("polygon"===r||"polyline"===r)s._setLineMoveAnimation(l,o,t,t,0===e?function(){u.forEach((function(t){s._toggleVisibility(t,!0)}));u=null}:null);else if(o){u.push(t);s._toggleVisibility(t,!1)}}))};FlexChartAnimation.prototype._playLoadColumnAnimation=function(t,e){this._playLoadBarAnimation(t,e,!0)};FlexChartAnimation.prototype._playLoadBarAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart.series[e],o=n.animationMode,r=a.hostElement;[].slice.call(r.childNodes).forEach((function(a,r){var s,l=a.nodeName;s=o===AnimationMode.Point?n._getAnimation(t,r):o===AnimationMode.Series?n._getAnimation(t,e):n._getAnimation(t,0);"g"===l?a.childNodes&&[].slice.call(a.childNodes).forEach((function(t,e){n._setLoadBarAnimation(s,t,i)})):n._setLoadBarAnimation(s,a,i)}))};FlexChartAnimation.prototype._setBarAnimation=function(t,e,i,n,a){this._setInitState(e,i,n);t.push({ele:e,from:i,to:n,done:a})};FlexChartAnimation.prototype._setLoadBarAnimation=function(t,e,i,n,a){void 0===n&&(n=!1);var o,r,s=this,l=i?"height":"width",u=i?"y":"x",c=e.getAttribute(l),h=e.getAttribute(u),p=i?"top":"left",m=s._chart._plotRect,f={},d={};f[l]=0;d[l]=Number(c);if(i){f[u]=m[l]+m[p];d[u]=Number(h)}o=n?d:f;r=n?f:d;"g"===e.nodeName?e.childNodes&&[].slice.call(e.childNodes).forEach((function(e){s._setBarAnimation(t,e,o,r,a)})):s._setBarAnimation(t,e,o,r,a)};FlexChartAnimation.prototype._setMoveBarAnimation=function(t,e,i){var n={},a={};if(null!=e&&null!=i){["width","height","x","y","top","left"].forEach((function(t){var o=e.getAttribute(t),r=i.getAttribute(t);if(o!==r){n[t]=Number(o);a[t]=Number(r)}}));this._setInitState(i,n,a);t.push({ele:i,from:n,to:a})}};FlexChartAnimation.prototype._playColumnRemoveAnimation=function(t,e){this._playBarRemoveAnimation(t,e,!0)};FlexChartAnimation.prototype._playColumnAddAnimation=function(t,e){this._playBarAddAnimation(t,e,!0)};FlexChartAnimation.prototype._playColumnMoveAnimation=function(t,e,i){this._playBarMoveAnimation(t,e,i,!0)};FlexChartAnimation.prototype._playBarRemoveAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart.series[0].hostElement.parentNode,o=n._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){n._setLoadBarAnimation(o,t,i,!0)}));o.length&&(o[0].done=function(){e&&e.parentNode===a&&a.removeChild(e)})};FlexChartAnimation.prototype._playBarAddAnimation=function(t,e,i){var n=this;void 0===i&&(i=!1);var a=e.hostElement,o=this._getAnimation(t,2);[].slice.call(a.childNodes).forEach((function(t){n._setLoadBarAnimation(o,t,i,!1)}))};FlexChartAnimation.prototype._playBarMoveAnimation=function(t,e,i,n){void 0===n&&(n=!1);var a,o,r,s,l,u,c,h=this;h._chart;a=e.hostElement;r=[].slice.call(i.childNodes);if(h._addStart){c=0;s=r[0];for(;c<h._addStart;){r.splice(0,0,s);c++}}if(h._removeStart){c=0;s=r[r.length-1];for(;c<h._removeStart;){var p=r.shift();r.push(p);c++}}l=r.length;o=[].slice.call(a.childNodes);u=o.length;o.forEach((function(e,i){var a;if(i<l){s=r[i];if(i<h._addStart){a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1)}else if(i>=l-h._removeStart){a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1);a=h._getAnimation(t,0);h._removeBarAnimation(a,e,s,n)}else{a=h._getAnimation(t,1);h._setMoveBarAnimation(a,s,e)}if(i===u-1&&i<l-1){a=h._getAnimation(t,0);for(i++;i<l;i++){s=r[i];h._removeBarAnimation(a,e,s,n)}}}else{a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1)}}))};FlexChartAnimation.prototype._removeBarAnimation=function(t,e,i,n){var a=e.parentNode;a.appendChild(i);this._setLoadBarAnimation(t,i,n,!0,function(t){return function(){t.parentNode&&t.parentNode===a&&a.removeChild(t)}}(i))};FlexChartAnimation.prototype._playLoadScatterAnimation=function(t,e){var i=this,n=i._chart,a=n.series[e],o=i.animationMode,r=a.hostElement,s=a._xValues||n._xvals;0===s.length&&(s=a._pointIndexes);[].slice.call(r.childNodes).forEach((function(n,a){var r;r=o===AnimationMode.Point?i._getScatterAnimation(t,s[a]):o===AnimationMode.Series?i._getAnimation(t,e):i._getAnimation(t,0);i._setLoadScatterAnimation(r,n,!1)}))};FlexChartAnimation.prototype._setLoadScatterAnimation=function(t,e,i,n){var a=this;void 0===i&&(i=!1);var o,r,s={},l={};if("g"===e.nodeName&&e.childNodes)[].slice.call(e.childNodes).forEach((function(e){a._setLoadScatterAnimation(t,e,i,n)}));else{["rx","ry","stroke-width"].forEach((function(t){var i=e.getAttribute(t);s[t]=0;l[t]=Number(i)}));o=i?l:s;r=i?s:l;this._setInitState(e,o,r);t.push({ele:e,from:o,to:r,done:n})}};FlexChartAnimation.prototype._setUpdateScatterAnimation=function(t,e,i,n){var a={},o={};["cx","cy"].forEach((function(t){var n=e.getAttribute(t),r=i.getAttribute(t);if(n!==r){a[t]=Number(n);o[t]=Number(r)}}));this._setInitState(i,a,o);t.push({ele:i,from:a,to:o,done:n})};FlexChartAnimation.prototype._getScatterAnimation=function(t,e){var i=this._getScatterAnimationIndex(t,e);t[i]||(t[i]=[]);return t[i]};FlexChartAnimation.prototype._getScatterAnimationIndex=function(t,e){var i=this._chart.axisX,n=null==i.min?i.actualMin:i.min,a=null==i.max?i.actualMax:i.max;return Math.ceil((e-n)/((a-n)/20))};FlexChartAnimation.prototype._playScatterRemoveAnimation=function(t,e){var i=this,n=i._chart.series[0].hostElement.parentNode,a=i._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){i._setLoadScatterAnimation(a,t,!0)}));a.length&&(a[0].done=function(){e&&e.parentNode===n&&n.removeChild(e)})};FlexChartAnimation.prototype._playScatterAddAnimation=function(t,e){var i=this,n=e.hostElement,a=this._getAnimation(t,0);[].slice.call(n.childNodes).forEach((function(t){i._setLoadScatterAnimation(a,t,!1)}))};FlexChartAnimation.prototype._playScatterMoveAnimation=function(t,e,i){var n,a,o,r,s,l,u,c=this,h=(c._chart,c._getAnimation(t,0));n=e.hostElement;o=[].slice.call(i.childNodes);if(c._addStart){u=0;r=o[0];for(;u<c._addStart;){o.splice(0,0,r);u++}}if(c._removeStart){u=0;r=o[o.length-1];for(;u<c._removeStart;){var p=o.shift();o.push(p);u++}}s=o.length;a=[].slice.call(n.childNodes);l=a.length;a.forEach((function(t,e){if(e<s){if(e<c._addStart)c._setLoadScatterAnimation(h,t,!1);else if(e>=s-c._removeStart){c._setLoadScatterAnimation(h,t,!1);r=o[e];c._removeScatterAnimation(h,t,r)}else{r=o[e];c._setUpdateScatterAnimation(h,r,t)}if(e===l-1&&e<s-1)for(e++;e<s;e++){r=o[e];c._removeScatterAnimation(h,t,r)}}else c._setLoadScatterAnimation(h,t,!1)}))};FlexChartAnimation.prototype._removeScatterAnimation=function(t,e,i){var n=e.parentNode;n.appendChild(i);this._setLoadScatterAnimation(t,i,!0,function(t){return function(){t.parentNode&&t.parentNode===n&&n.removeChild(t)}}(i))};FlexChartAnimation.prototype._playDefaultAnimation=function(t,e){var i,n,a=this._chart,o=a.series[e].hostElement,r=a._plotRect,s=a._currentRenderEngine,l=o.getAttribute("clip-path"),u="clipPath"+(1e6*Math.random()).toFixed(),c=a.axisX.reversed;s.addClipRect(new Rect(c?r.right:r.left,r.top,0,r.height),u);o.setAttribute("clip-path","url(#"+u+")");i=a.hostElement.querySelector("#"+u);n=this._getAnimation(t,0);var h={width:0},p={width:r.width};if(c){h.x=r.right;p.x=r.left}n.push({ele:i.querySelector("rect"),from:h,to:p,done:function(){if(o){l?o.setAttribute("clip-path",l):o.removeAttribute("clip-path");i&&i.parentNode&&i.parentNode.removeChild(i)}}})};return FlexChartAnimation}(FlexAnimation),FlexRadarAnimation=function(t){__extends(FlexRadarAnimation,t);function FlexRadarAnimation(e,i){return t.call(this,e,i)||this}FlexRadarAnimation.prototype._getDurationAndDelay=function(e,i){var n=t.prototype._getDurationAndDelay.call(this,e,i);if(this.animationMode===AnimationMode.Point){n.duration=i/e;n.delay=i/e}return n};FlexRadarAnimation.prototype._playAxesAnimation=function(){};FlexRadarAnimation.prototype._getChartType=function(e){var i=t.prototype._getChartType.call(this,e);"Bar"===i&&(i="Column");return i};FlexRadarAnimation.prototype._playLoadLineAnimation=function(t,e){var i,n,a,o=this,r=o._chart,s=o._chart.series[e],l=s._xValues||r._xvals,u=o.animationMode,c=s.hostElement;if(u===AnimationMode.Point){0===l.length&&(l=s._pointIndexes);a=[].slice.call(c.childNodes);n=a.length-c.querySelectorAll("ellipse").length;a.forEach((function(e,i){o._setRadarLinePointAnimation(t,e,i,l,n)}))}else{i=u===AnimationMode.All?o._getAnimation(t,0):o._getAnimation(t,e);[].slice.call(c.childNodes).forEach((function(t){o._setLineRiseDiveAnimation(i,t,!0)}))}};FlexRadarAnimation.prototype._setRadarLinePointAnimation=function(t,e,i,n,a){var o,r,s,l,u,c,h,p=this,m=p._chart,f=e.nodeName,d=[],A=[],_=[],y=[],g=m._center,x=[],E=!1,v={},C={},S=0;if("polyline"===f||"polygon"===f){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){x[h=p._getScatterAnimationIndex(t,n[r])]||(x[h]=[]);x[h].push(r);s=l[r]||l.getItem(r);d.push({x:g.x,y:g.y});A.push({x:s.x,y:s.y})}for(r=0,o=x.length;r<o;r++)if(x[r]){c=p._getAnimation(t,S);_=y.length?y.slice():d.slice();y=_.slice();x[r].forEach((function(t){var e=A[t];y[t]={x:e.x,y:e.y}}));C={};(v={})[f]=_;C[f]=y;if(!E){p._setInitState(e,v,C);E=!0}c.push({ele:e,from:v,to:C,done:u});S++}}else if("ellipse"===f){if((r=i-(a||0))<0)return;c=m._isPolar?p._getScatterAnimation(t,n[r]):p._getScatterAnimation(t,r);p._toggleVisibility(e,!1);u=function(){p._toggleVisibility(e,!0)};c.push({ele:e,from:v,to:C,done:u})}};FlexRadarAnimation.prototype._setLineRiseDiveAnimation=function(t,e,i){var n,a,o,r,s,l,u,c=this,h=c._chart,p=e.nodeName,m=[],f=[],d=h._center,A={},_={};if("polyline"===p||"polygon"===p){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){s=l[r]||l.getItem(r);m.push({x:d.x,y:d.y});f.push({x:s.x,y:s.y})}A[p]=m;_[p]=f}else if("ellipse"===p){c._toggleVisibility(e,!1);i&&(u=function(){c._toggleVisibility(e,!0)})}n=i?A:_;a=i?_:A;c._setInitState(e,n,a);t.push({ele:e,from:n,to:a,done:u})};FlexRadarAnimation.prototype._parsePathByRadius=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,u=t.sweep;n=[o,r,0,l,u,0];a=[o,r,s,l,u,t.innerRadius||0];e.pie=n;i.pie=a};FlexRadarAnimation.prototype._playUpdateAnimation=function(e,i,n,a,o){if("Bar"===n||"Column"===n){if(null==a)return;this._playLoadBarAnimation(e,i,!1)}else t.prototype._playUpdateAnimation.call(this,e,i,n,a,o)};FlexRadarAnimation.prototype._playLoadBarAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart,o=a.series[e],r=a._areas[e],s=n.animationMode,l=o.hostElement;[].slice.call(l.childNodes).forEach((function(i,a){var o,l,u={},c={};o=s===AnimationMode.Point?n._getAnimation(t,a):s===AnimationMode.Series?n._getAnimation(t,e):n._getAnimation(t,0);l=r[a];n._parsePathByRadius(l,u,c);n._setInitState(i,u,c);o.push({ele:i,from:u,to:c})}))};return FlexRadarAnimation}(FlexChartAnimation),AnimationHelper=function(){function AnimationHelper(){}AnimationHelper.playAnimations=function(t,e,i,n,a,o,r){void 0===a&&(a=Easing.Swing);var s=t.length,l=0,u=[];t.forEach((function(t,c){var h=AnimationHelper.playAnimation(t,e[c],i[c],(function(){l===s-1&&n&&n();l++}),a,o,r);u.push(h)}));return u};AnimationHelper.playAnimation=function(t,e,i,n,a,o,r){void 0===a&&(a=Easing.Swing);var s=AnimationHelper.parseAttrs(e,i);return AnimationHelper.animate((function(e){AnimationHelper.setElementAttr(t,s,e)}),n,a,o,r)};AnimationHelper.setElementAttr=function(t,e,i){var n,a;for(a in e){n=e[a];AnimationHelper.calcValue(n,i);t.setAttribute(a,n.getValue(n.value,i))}};AnimationHelper.getPathDescOfPie=function(t,e,i,n,a,o){void 0===o&&(o=0);var r=!1;if(a>=2*Math.PI){r=!0;a=2*Math.PI-.001}var s=new Point(t,e);s.x+=i*Math.cos(n);s.y+=i*Math.sin(n);var l=n+a,u=new Point(t,e);u.x+=i*Math.cos(l);u.y+=i*Math.sin(l);if(o){var c=new Point(t,e);c.x+=o*Math.cos(l);c.y+=o*Math.sin(l);var h=new Point(t,e);h.x+=o*Math.cos(n);h.y+=o*Math.sin(n)}var p=" 0 0,1 ",m=" 0 0,0 ";if(Math.abs(a)>Math.PI){p=" 0 1,1 ";m=" 0 1,0 "}var f="M "+s.x.toFixed(3)+","+s.y.toFixed(3);f+=" A "+i.toFixed(3)+","+i.toFixed(3)+p;f+=u.x.toFixed(3)+","+u.y.toFixed(3);if(o){f+=r?" M "+c.x.toFixed(3)+","+c.y.toFixed(3):" L "+c.x.toFixed(3)+","+c.y.toFixed(3);f+=" A "+o.toFixed(3)+","+o.toFixed(3)+m;f+=h.x.toFixed(3)+","+h.y.toFixed(3)}else f+=" L "+t.toFixed(3)+","+e.toFixed(3);r||(f+=" z");return f};AnimationHelper.parseAttrs=function(t,e){var i={};for(var n in t)if(null!=e[n])switch(n){case"polyline":i.points=AnimationHelper.parseAttr(t[n],e[n],(function(t,e){if(1===e){for(var i,n,a;t.length>1;){n=t[0];a=t[1];if(n.x!==a.x||n.y!==a.y){n=null;a=null;break}t.splice(1,1)}for(i=t.length-1;i>0;i--){n=a;a=t[i];if(n){if(n.x!==a.x||n.y!==a.y)break;t.pop()}}}return t.map((function(t){return t.x+","+t.y})).join(" ")}));break;case"polygon":i.points=AnimationHelper.parseAttr(t[n],e[n],(function(t,e){if(1===e){var i,n,a,o,r;o=t.pop();r=t.pop();for(;t.length>1;){n=t[0];a=t[1];if(n.x!==a.x||n.y!==a.y){n=null;a=null;break}t.splice(1,1)}for(i=t.length-1;i>=0;i--){n=a;a=t[i];if(n){if(n.x!==a.x||n.y!==a.y)break;t.splice(i,1)}}t.push(r);t.push(o)}return t.map((function(t){return t.x+","+t.y})).join(" ")}));break;case"d":i[n]=AnimationHelper.parseAttr(t[n],e[n],(function(t){return t.map((function(t){return"string"==typeof t?t:t[0]+","+t[1]})).join(" ")}));break;case"pie":i.d=AnimationHelper.parseAttr(t[n],e[n],(function(t){return AnimationHelper.getPathDescOfPie.apply(AnimationHelper,t)}));break;case"rotate":i.transform=AnimationHelper.parseAttr(t[n],e[n],(function(t){return"rotate("+t.join(" ")+")"}));break;case"x":case"width":case"height":case"rx":case"ry":case"stroke-width":i[n]=AnimationHelper.parseAttr(t[n],e[n],(function(t){return Math.abs(t)}));break;default:i[n]=AnimationHelper.parseAttr(t[n],e[n])}return i};AnimationHelper.animate=function(t,e,i,n,a){void 0===i&&(i=Easing.Swing);void 0===n&&(n=400);void 0===a&&(a=16);asFunction(t);asNumber(n,!1,!0);asNumber(a,!1,!0);var o=0,r=setInterval((function(){Date.now();var s=o/n;s=EasingHelper[Easing[i]](s);t(s);if((o+=a)>=n){clearInterval(r);(s<1||s>1)&&t(1);e&&e()}}),a);return r};AnimationHelper.calcValue=function(t,e){var i=t.from,n=t.diff,a=t.value;isNumber(i)?t.value=0===n?i:i+n*e:isArray(i)&&AnimationHelper.parseArrayAttr(a,i,n,(function(t,i){return"number"==typeof t?t+i*e:t}))};AnimationHelper.parseAttr=function(t,e,i){var n,a,o,r;if(isArray(t)&&isArray(e)){a=e;o=[];r=(n=t).slice();AnimationHelper.parseArrayAttr(o,n,a,(function(t,e){return t===e?0:e-t}))}else{r=n=Number(t);o=(a=Number(e))-n}return{from:n,to:a,value:r,diff:o,getValue:i||function(t,e){return t}}};AnimationHelper.parseArrayAttr=function(t,e,i,n){e.forEach((function(e,a){var o={},r=[],s=i[a];if(isNumber(e)||"string"==typeof e)t[a]=n(e,s);else if(isArray(e)){e.forEach((function(t,i){r[i]=n(e[i],s[i])}));t[a]=r}else{Object.getOwnPropertyNames(e).forEach((function(t){o[t]=n(e[t],s[t])}));t[a]=o}}))};return AnimationHelper}(),EasingHelper=function(){function EasingHelper(){}EasingHelper.Linear=function(t){return t};EasingHelper.Swing=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)};EasingHelper.EaseInQuad=function(t){return t*t};EasingHelper.EaseOutQuad=function(t){return t*(2-t)};EasingHelper.EaseInOutQuad=function(t){return t<.5?2*t*t:(4-2*t)*t-1};EasingHelper.EaseInCubic=function(t){return t*t*t};EasingHelper.EaseOutCubic=function(t){return--t*t*t+1};EasingHelper.EaseInOutCubic=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1};EasingHelper.EaseInQuart=function(t){return t*t*t*t};EasingHelper.EaseOutQuart=function(t){return 1- --t*t*t*t};EasingHelper.EaseInOutQuart=function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t};EasingHelper.EaseInQuint=function(t){return t*t*t*t*t};EasingHelper.EaseOutQuint=function(t){return 1+--t*t*t*t*t};EasingHelper.EaseInOutQuint=function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};EasingHelper.EaseInSine=function(t){return 1-Math.cos(t*(Math.PI/2))};EasingHelper.EaseOutSine=function(t){return Math.sin(t*(Math.PI/2))};EasingHelper.EaseInOutSine=function(t){return-.5*(Math.cos(Math.PI*t)-1)};EasingHelper.EaseInExpo=function(t){return 0==t?0:Math.pow(2,10*(t-1))};EasingHelper.EaseOutExpo=function(t){return 1==t?1:1-Math.pow(2,-10*t)};EasingHelper.EaseInOutExpo=function(t){return t==!!t?t:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))};EasingHelper.EaseInCirc=function(t){return-(Math.sqrt(1-t*t)-1)};EasingHelper.EaseOutCirc=function(t){return Math.sqrt(1-Math.pow(t-1,2))};EasingHelper.EaseInOutCirc=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)};EasingHelper.EaseInBack=function(t){var e=1.70158;return t*t*((e+1)*t-e)};EasingHelper.EaseOutBack=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1};EasingHelper.EaseInOutBack=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)};EasingHelper.EaseInBounce=function(t){return 1-EasingHelper.EaseOutBounce(1-t)};EasingHelper.EaseOutBounce=function(t){var e=7.5625;return t<1/2.75?e*t*t:t<2/2.75?e*(t-=1.5/2.75)*t+.75:t<2.5/2.75?e*(t-=2.25/2.75)*t+.9375:e*(t-=2.625/2.75)*t+.984375};EasingHelper.EaseInOutBounce=function(t){return t<.5?.5*EasingHelper.EaseInBounce(2*t):.5*EasingHelper.EaseOutBounce(2*t-1)+.5};EasingHelper.EaseInElastic=function(t){return t==!!t?t:-Math.pow(2,10*(t-=1))*Math.sin((t-.075)*(2*Math.PI)/.3)};EasingHelper.EaseOutElastic=function(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1};EasingHelper.EaseInOutElastic=function(t){return t==!!t?t:(t*=2)<1?Math.pow(2,10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*-.5:Math.pow(2,-10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*.5+1};return EasingHelper}();_registerModule("wijmo.chart.animation",selfModule); | ||
var __extends=this&&this.__extends||function(){var extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};return function(t,e){extendStatics(t,e);function __(){this.constructor=t}t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();import{_getModule,isNumber,isArray,asNumber,asFunction,Point,Rect,hasClass,isDate,asBoolean,Size,asEnum,Event,EventArgs,assert,_registerModule}from"@grapecity/wijmo";import{ChartType,FlexChart,TickMark,AxisType,FlexPie,FlexChartCore,DataLabelClsNames}from"@grapecity/wijmo.chart";import*as selfModule from"@grapecity/wijmo.chart.animation";export function softFinancial(){return _getModule("wijmo.chart.finance")}export function softRadar(){return _getModule("wijmo.chart.radar")}export var Easing;!function(t){t[t.Linear=0]="Linear";t[t.Swing=1]="Swing";t[t.EaseInQuad=2]="EaseInQuad";t[t.EaseOutQuad=3]="EaseOutQuad";t[t.EaseInOutQuad=4]="EaseInOutQuad";t[t.EaseInCubic=5]="EaseInCubic";t[t.EaseOutCubic=6]="EaseOutCubic";t[t.EaseInOutCubic=7]="EaseInOutCubic";t[t.EaseInQuart=8]="EaseInQuart";t[t.EaseOutQuart=9]="EaseOutQuart";t[t.EaseInOutQuart=10]="EaseInOutQuart";t[t.EaseInQuint=11]="EaseInQuint";t[t.EaseOutQuint=12]="EaseOutQuint";t[t.EaseInOutQuint=13]="EaseInOutQuint";t[t.EaseInSine=14]="EaseInSine";t[t.EaseOutSine=15]="EaseOutSine";t[t.EaseInOutSine=16]="EaseInOutSine";t[t.EaseInExpo=17]="EaseInExpo";t[t.EaseOutExpo=18]="EaseOutExpo";t[t.EaseInOutExpo=19]="EaseInOutExpo";t[t.EaseInCirc=20]="EaseInCirc";t[t.EaseOutCirc=21]="EaseOutCirc";t[t.EaseInOutCirc=22]="EaseInOutCirc";t[t.EaseInBack=23]="EaseInBack";t[t.EaseOutBack=24]="EaseOutBack";t[t.EaseInOutBack=25]="EaseInOutBack";t[t.EaseInBounce=26]="EaseInBounce";t[t.EaseOutBounce=27]="EaseOutBounce";t[t.EaseInOutBounce=28]="EaseInOutBounce";t[t.EaseInElastic=29]="EaseInElastic";t[t.EaseOutElastic=30]="EaseOutElastic";t[t.EaseInOutElastic=31]="EaseInOutElastic"}(Easing||(Easing={}));export var AnimationMode;!function(t){t[t.All=0]="All";t[t.Point=1]="Point";t[t.Series=2]="Series"}(AnimationMode||(AnimationMode={}));var ChartAnimation=function(){function ChartAnimation(t,e){this._play=!0;this.ended=new Event;var i=this,n=t.hostElement,a=new Size(n.offsetWidth,n.offsetHeight);i._chart=t;i._updateEventArgs=[];if(t instanceof FlexPie)i._animation=new FlexPieAnimation(t,i._updateEventArgs);else{softRadar()&&t instanceof softRadar().FlexRadar?i._animation=new FlexRadarAnimation(t,i._updateEventArgs):t instanceof FlexChartCore&&(i._animation=new FlexChartAnimation(t,i._updateEventArgs));i._chartType=t.chartType}assert(void 0!==i._animation,"Animation is not supported");i._initOptions(e);t.beginUpdate();window.setTimeout((function(){t.rendered.addHandler(i._playAnimation,i);t.endUpdate()}),0);i._setCV(t.collectionView);window.addEventListener("resize",(function(t){var e=new Size(n.offsetWidth,n.offsetHeight);if(!a.equals(e)){i._play=!1;a=e}}))}ChartAnimation.prototype._initOptions=function(t){if(t){t.duration&&(this.duration=t.duration);t.easing&&(this.easing=t.easing);t.animationMode&&(this.animationMode=t.animationMode);void 0!==t.axisAnimation&&(this.axisAnimation=t.axisAnimation)}};ChartAnimation.prototype._setCV=function(t){this._cv=t;this._animation._clearState()};Object.defineProperty(ChartAnimation.prototype,"animationMode",{get:function(){return this._animation.animationMode},set:function(t){(t=asEnum(t,AnimationMode))!=this.animationMode&&(this._animation.animationMode=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"easing",{get:function(){return this._animation.easing},set:function(t){(t=asEnum(t,Easing))!=this.easing&&(this._animation.easing=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"duration",{get:function(){return this._animation.duration},set:function(t){(t=asNumber(t))!=this.duration&&(this._animation.duration=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"axisAnimation",{get:function(){return this._animation.axisAnimation},set:function(t){(t=asBoolean(t))!=this.axisAnimation&&(this._animation.axisAnimation=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0});ChartAnimation.prototype._playAnimation=function(){var t=this,e=t._chart,i=e.chartType;t._cv!==e.collectionView&&t._setCV(e.collectionView);if(null!=t._chartType&&t._chartType!==i){t._chartType=i;t._animation._clearState()}t._play?t._animation.playAnimation((function(){return t.ended.raise(t,EventArgs.empty)})):t._play=!0};ChartAnimation.prototype.animate=function(){var t=this._chart;if(t){var e=t.itemsSource;t.beginUpdate();t.itemsSource=null;t.itemsSource=e;t.endUpdate()}};return ChartAnimation}();export{ChartAnimation};var FlexAnimation=function(){function FlexAnimation(t,e){this._axisAnimation=!0;this._chart=t;this._timers=[]}Object.defineProperty(FlexAnimation.prototype,"animationMode",{get:function(){return this._animationMode||AnimationMode.All},set:function(t){if((t=asEnum(t,AnimationMode,!1))!==this._animationMode){this._clearState();this._animationMode=t}},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"easing",{get:function(){return null==this._easing?Easing.Swing:this._easing},set:function(t){t!==this._easing&&(this._easing=asEnum(t,Easing,!1))},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"duration",{get:function(){return this._duration||400},set:function(t){t!==this._duration&&(this._duration=asNumber(t,!1,!0))},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"axisAnimation",{get:function(){return!!this._axisAnimation},set:function(t){t!==this._axisAnimation&&(this._axisAnimation=asBoolean(t,!1))},enumerable:!0,configurable:!0});FlexAnimation.prototype.playAnimation=function(t){};FlexAnimation.prototype._clearState=function(){this._previousState&&(this._previousState=null);this._currentState&&(this._currentState=null)};FlexAnimation.prototype._setInitState=function(t,e,i){var n=AnimationHelper.parseAttrs(e,i);AnimationHelper.setElementAttr(t,n,0)};FlexAnimation.prototype._getAnimation=function(t,e){t[e]||(t[e]=[]);return t[e]};FlexAnimation.prototype._toggleVisibility=function(t,e){e?AnimationHelper.playAnimation(t,{opacity:0},{opacity:1},null,Easing.Swing,100):t.setAttribute("opacity","0")};FlexAnimation.prototype._toggleDataLabelVisibility=function(t){var e=this._chart.hostElement,i=e&&e.querySelector("."+DataLabelClsNames.labels);i&&this._toggleVisibility(i,t)};FlexAnimation.prototype._playAnimation=function(t,e){var i,n=this,a=this,o=a.duration,r=a.easing,s=t.length;a._toggleDataLabelVisibility(!1);i=a._getDurationAndDelay(t.length,o);if(this._timers&&this._timers.length){this._timers.forEach((function(t){return window.clearInterval(t)}));this._timers.length=0}t.forEach((function(t,o){var l;if(t){l=window.setTimeout((function(){var l;t.forEach((function(t,u){if(t&&t.ele){if(o===s-1&&0===u){var c=t.done;t.done=function(){a._toggleDataLabelVisibility(!0);c&&c();e&&e()}}if(isArray(t.ele)){l=AnimationHelper.playAnimations(t.ele,t.from,t.to,t.done,r,i.duration);n._timers=n._timers.concat.apply(l)}else{l=AnimationHelper.playAnimation(t.ele,t.from,t.to,t.done,r,i.duration);n._timers.push(l)}}}))}),i.delay*o);n._timers.push(l)}}))};FlexAnimation.prototype._getDurationAndDelay=function(t,e){var i={duration:e,delay:0};if(t>1)if(this._previousState){i.duration=e/t;i.delay=e/t}else{i.duration=.5*e;i.delay=.5*e/(t-1)}return i};return FlexAnimation}(),FlexPieAnimation=function(t){__extends(FlexPieAnimation,t);function FlexPieAnimation(e,i){var n=t.call(this,e,i)||this;e.selectionChanged.addHandler(n._selectionChanged,n);return n}FlexPieAnimation.prototype._selectionChanged=function(){this._isSelectionChanged=!0};FlexPieAnimation.prototype._clearState=function(){t.prototype._clearState.call(this);this._isSelectionChanged=!1};FlexPieAnimation.prototype._getElementRotate=function(t){var e,i=t.getAttribute("transform");if(i&&i.indexOf("rotate")>-1){if(1==(i=(i=i.replace("rotate(","").replace(")","")).indexOf(",")>-1?i.split(",").map((function(t){return+t})):i.split(" ").map((function(t){return+t}))).length){e=this._chart._areas[0].center;i.push(e.x,e.y)}}else i=[0,(e=this._chart._areas[0].center).x,e.y];return i};FlexPieAnimation.prototype._getDurationAndDelay=function(t,e){var i={duration:e,delay:0};if(this.animationMode===AnimationMode.Point&&t>1){i.duration=e/t;i.delay=e/t}return i};FlexPieAnimation.prototype.playAnimation=function(e){t.prototype.playAnimation.call(this,e);var i=[];this._playPieAnimation(i);i.length&&this._playAnimation(i,e)};FlexPieAnimation.prototype._playPieAnimation=function(t){var e=this._chart,i=!0;this._previousState=this._currentState;this._currentState={areas:e._areas,pels:e._pels,rotate:e._pels.length&&this._getElementRotate(e._pels[0].parentNode)};this._previousState&&(i=!1);if(this._isSelectionChanged){e.isAnimated||this._playSelectPieAnimation(t);this._isSelectionChanged=!1}else i?this._playLoadPieAnimation(t):this._playUpdatePieAnimation(t)};FlexPieAnimation.prototype._playSelectPieAnimation=function(t){if(null!=this._previousState){var e,i,n,a=this._chart._pels[0].parentNode,o=this._previousState.rotate,r=this._getElementRotate(a),s=o[0],l=r[0];if(s!==l){s-l>180?r[0]+=360:l-s>180&&(o[0]+=360);e=this._getAnimation(t,0);i={rotate:o};n={rotate:r};this._setInitState(a,i,n);e.push({ele:a,from:i,to:n})}}};FlexPieAnimation.prototype._playUpdatePieAnimation=function(t){var e,i,n,a,o=this._chart,r=this._previousState,s=o._areas,l=o._pels,u=r.areas.length,c=s.length,h=Math.max(c,u),p=this._getAnimation(t,0),m=0;if(0!==c&&0!==u){this._playSelectPieAnimation(t);for(e=0;e<h;e++){i={};if(l[e]&&l[e].childNodes&&l[e].childNodes.length>0){if(e<c&&e<u){n=s[0];0===e&&(m=n.angle);1===u?l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(n.center.x,n.center.y,n.radius,m,2*Math.PI,n.innerRadius||0)):l[e].childNodes[0].setAttribute("d",r.pels[e].childNodes[0].getAttribute("d"))}if(e<c){n=s[e];i.to={pie:[n.center.x,n.center.y,n.radius,n.angle,n.sweep,n.innerRadius||0]};i.ele=l[e].childNodes[0]}else{n=s[0];a=r.pels[e];i.to={pie:[n.center.x,n.center.y,n.radius,m+2*Math.PI,0,n.innerRadius||0]};l[0].parentNode.appendChild(a);i.done=function(t){return function(){t.parentNode.removeChild(t)}}(a);i.ele=a.childNodes[0]}if(e<u){n=r.areas[e];i.from={pie:[n.center.x,n.center.y,n.radius,n.angle,n.sweep,n.innerRadius||0]}}else{l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(n.center.x,n.center.y,n.radius,2*Math.PI+m,0,n.innerRadius||0));n=r.areas[0];i.from={pie:[n.center.x,n.center.y,n.radius,2*Math.PI+m,0,n.innerRadius||0]}}p.push(i)}}}};FlexPieAnimation.prototype._playLoadPieAnimation=function(t){var e=this,i=e._chart,n=e.animationMode,a=i._areas;i._pels.forEach((function(i,o){var r,s=i.childNodes[0],l={},u={};if(s){if(n===AnimationMode.Point){e._parsePathByAngle(a[o],l,u);r=e._getAnimation(t,o)}else{e._parsePathByRadius(a[o],l,u);r=e._getAnimation(t,0)}e._setInitState(s,l,u);r.push({ele:s,from:l,to:u})}}))};FlexPieAnimation.prototype._parsePathByRadius=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,u=t.sweep;n=[o,r,0,l,u,0];a=[o,r,s,l,u,t.innerRadius||0];e.pie=n;i.pie=a};FlexPieAnimation.prototype._parsePathByAngle=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,u=t.sweep,c=t.innerRadius;n=[o,r,s,l,0,c||0];a=[o,r,s,l,u,c||0];e.pie=n;e["stroke-width"]=0;i.pie=a;i["stroke-width"]=1};return FlexPieAnimation}(FlexAnimation),FlexChartAnimation=function(t){__extends(FlexChartAnimation,t);function FlexChartAnimation(e,i){return t.call(this,e,i)||this}FlexChartAnimation.prototype.playAnimation=function(e){t.prototype.playAnimation.call(this,e);var i,n,a,o,r,s,l,u,c,h=!0,p=this._chart,m=softFinancial()&&p instanceof softFinancial().FinancialChart,f=p.series,d=f.length,A=[];this._previousState=this._currentState;this._previousXVal=this._currentXVal;this._currentState=[];this._addStart=0;this._removeStart=0;this._currentXVal=p._xlabels.slice();if(this._previousState&&this._previousState.length){h=!1;r=(s=this._previousState).length;l=this._previousXVal;u=this._currentXVal;l.length>2&&u.length>2&&((i=u.indexOf(l[0]))>0&&i<u.length-2?u[i+1]===l[1]&&u[i+2]===l[2]&&(this._addStart=i):(i=l.indexOf(u[0]))>0&&i<l.length-2&&l[i+1]===u[1]&&l[i+2]===u[2]&&(this._removeStart=i))}for(i=0;i<d;i++){o=null!=(n=f[i])._getChartType()?n._getChartType():p._getChartType();a=this._getChartType(o);this._currentState.push({seriesType:o,ele:n.hostElement});if(m)this._playDefaultAnimation(A,i);else{c=s&&s[i];if("Default"===a){this._playDefaultAnimation(A,i);continue}if(h||c&&c.seriesType!==o||c&&c.ele&&(""==c.ele.innerHTML||0===c.ele.childNodes.length))this._playLoadAnimation(A,i,a);else{this._playUpdateAnimation(A,i,a,n,c&&c.ele||null);if(i===d-1&&i<r-1)for(i++;i<=r-1;i++)this._playUpdateAnimation(A,i,a,null,c.ele)}}}this._adjustAnimations(a,A);A.length&&this._playAnimation(A,e);this.axisAnimation&&!m&&this._playAxesAnimation()};FlexChartAnimation.prototype._playAxesAnimation=function(){var t,e,i,n=this._chart.axes,a=n.length;this._prevAxesStates=this._currAxesStates;this._currAxesStates=[];for(e=0;e<a;e++)(t=n[e]).hostElement&&this._currAxesStates.push({ele:t.hostElement,vals:t._vals,axis:t,maxValue:isDate(t.actualMax)?t.actualMax.getTime():t.actualMax,minValue:isDate(t.actualMin)?t.actualMin.getTime():t.actualMin});if(this._prevAxesStates){i=Math.max(this._prevAxesStates.length,this._currAxesStates.length);for(e=0;e<i;e++)this._playAxisAnimation(this._prevAxesStates[e],this._currAxesStates[e])}};FlexChartAnimation.prototype._playAxisAnimation=function(t,e){if(t&&e){var i,n=[],a=[];if(e&&e.maxValue-e.minValue){i=this._parseAxisState(e);this._convertAxisAnimation(n,i.major,e.axis,t.maxValue,t.minValue);this._convertAxisAnimation(n,i.minor,e.axis,t.maxValue,t.minValue)}if(t&&t.maxValue-t.minValue){i=this._parseAxisState(t);this._convertAxisAnimation(a,i.major,t.axis);this._convertAxisAnimation(a,i.minor,t.axis)}n&&a&&this._combineAxisAnimations(n,a);this._playCurrAxisAnimation(n);this._playPrevAxisAnimation(a)}};FlexChartAnimation.prototype._combineAxisAnimations=function(t,e){var i,n,a=this,o=e.length;for(i=o-1;i>=0;i--)(n=e[i]).text&&t.some((function(t){if(t.text&&t.text===n.text){a._combineAxisAnimation(t,n);e.splice(i,1);return!0}}))};FlexChartAnimation.prototype._combineAxisAnimation=function(t,e){var i=this;["label","majorGrid","tick"].forEach((function(n){t[n]&&e[n]&&i._resetExistAxisAttrs(t[n],e[n])}))};FlexChartAnimation.prototype._resetExistAxisAttrs=function(t,e){var i=t.ele,n=e.ele,a={},o={};["x","y","x1","x2","y1","y2"].forEach((function(t){var e=i.getAttribute(t),r=n.getAttribute(t);if(e!==r){a[t]=r;o[t]=e}}));t.calcPos=a;t.elePos=o};FlexChartAnimation.prototype._convertAxisAnimation=function(t,e,i,n,a){var o,r=this,s=i.hostElement,l=i.axisType==AxisType.Y;e.forEach((function(e,u){var c=i.convert(e.val,n,a);if(!isNaN(c)){o={};e.majorGrid&&(o.majorGrid=r._getAxisAnimationAttrs(e.majorGrid,s,c,l));if(e.label){o.label=r._getAxisAnimationAttrs(e.label,s,c,l);o.text=e.label.innerHTML||e.label.textContent}e.tick&&(o.tick=r._getAxisAnimationAttrs(e.tick,s,c,l));t.push(o)}}))};FlexChartAnimation.prototype._getAxisAnimationAttrs=function(t,e,i,n){var a,o,r;a={ele:t,parent:e,elePos:{},calcPos:{}};if("text"===t.nodeName){o=n?"y":"x";r=Number(t.getAttribute(o));a.elePos[o]=r;a.calcPos[o]=i}else{o=n?"y1":"x1";r=Number(t.getAttribute(o));if(n){a.elePos={y1:r,y2:r};a.calcPos={y1:i,y2:i}}else{a.elePos={x1:r,x2:r};a.calcPos={x1:i,x2:i}}}a.elePos.opacity=1;a.calcPos.opacity=0;return a};FlexChartAnimation.prototype._playCurrAxisAnimation=function(t){var e=this.duration;t&&0!==t.length&&t.forEach((function(t){["majorGrid","label","tick"].forEach((function(i){var n=t[i];if(n){n.parent;var a=n.ele,o=n.elePos,r=n.calcPos;AnimationHelper.playAnimation(a,r,o,null,Easing.Swing,e)}}))}))};FlexChartAnimation.prototype._playPrevAxisAnimation=function(t){var e=this.duration;t&&0!==t.length&&t.forEach((function(t){["majorGrid","label","tick"].forEach((function(i){var n=t[i];if(n){var a=n.parent,o=n.ele,r=n.elePos,s=n.calcPos;a.appendChild(o);AnimationHelper.playAnimation(o,r,s,(function(){o.parentNode===a&&a.removeChild(o)}),Easing.Swing,e)}}))}))};FlexChartAnimation.prototype._parseAxisState=function(t){if(null==t)return null;var e,i,n,a=t.vals,o=t.axis,r=o.axisType==AxisType.Y,s=t.ele.childNodes,l=0,u=[],c=[];if(a){e=a.major;i=a.minor;n=a.hasLbls}e&&e.forEach((function(t,e){var i,a={},c=!!n[e];u.push(a);a.val=t;i=s[l];if(o.majorGrid&&hasClass(i,FlexChart._CSS_GRIDLINE)){a.majorGrid=i;i=s[++l]}if(r){if(c&&i&&o.majorTickMarks!==TickMark.None&&hasClass(i,FlexChart._CSS_TICK)){a.tick=i;i=s[++l]}if(c&&i&&(hasClass(i,FlexChart._CSS_LABEL)||i.querySelector("."+FlexChart._CSS_LABEL))){a.label=i;l++}}else{if(c&&i&&(hasClass(i,FlexChart._CSS_LABEL)||i.querySelector("."+FlexChart._CSS_LABEL))){a.label=i;i=s[++l]}if(c&&i&&o.majorTickMarks!==TickMark.None&&hasClass(i,FlexChart._CSS_TICK)){a.tick=i;l++}}}));i&&i.forEach((function(t,e){var i,n={};c.push(n);n.val=t;i=s[l];if(o.minorTickMarks!==TickMark.None&&hasClass(i,FlexChart._CSS_TICK_MINOR)){n.tick=i;i=s[++l]}if(o.minorGrid&&hasClass(i,FlexChart._CSS_GRIDLINE_MINOR)){n.majorGrid=i;l++}}));return{major:u,minor:c}};FlexChartAnimation.prototype._playLoadAnimation=function(t,e,i){this["_playLoad"+i+"Animation"](t,e)};FlexChartAnimation.prototype._playUpdateAnimation=function(t,e,i,n,a){null==n||null==a?null==n?this["_play"+i+"RemoveAnimation"](t,a):this["_play"+i+"AddAnimation"](t,n):this["_play"+i+"MoveAnimation"](t,n,a)};FlexChartAnimation.prototype._adjustAnimations=function(t,e){var i,n=e.length;if("Column"===t||"Bar"===t)for(i=n-1;i>=0;i--)null==e[i]&&e.splice(i,1)};FlexChartAnimation.prototype._getChartType=function(t){var e="Default",i=this._chart._isRotated();switch(t){case ChartType.Scatter:case ChartType.Bubble:case ChartType.Candlestick:case ChartType.HighLowOpenClose:e="Scatter";break;case ChartType.Column:case ChartType.Bar:e=i?"Bar":"Column";break;case ChartType.Line:case ChartType.LineSymbols:case ChartType.Area:case ChartType.Spline:case ChartType.SplineSymbols:case ChartType.SplineArea:e="Line";break;default:e="Default"}return e};FlexChartAnimation.prototype._playLoadLineAnimation=function(t,e){var i,n=this,a=n._chart.series[e],o=n.animationMode,r=a.hostElement;if(o===AnimationMode.Point)n._playDefaultAnimation(t,e);else{i=o===AnimationMode.All?n._getAnimation(t,0):n._getAnimation(t,e);[].slice.call(r.childNodes).forEach((function(t){n._setLineRiseDiveAnimation(i,t,!0)}))}};FlexChartAnimation.prototype._setLineRiseDiveAnimation=function(t,e,i){var n,a,o,r,s,l,u,c=this,h=this,p=h._chart,m=e.nodeName,f=[],d=[],A=h._chart._plotRect,_=A.top+A.height,y=A.left,g={},x={};if("g"===m&&e.childNodes)[].slice.call(e.childNodes).forEach((function(e){c._setLineRiseDiveAnimation(t,e,i)}));else{if("polyline"===m||"polygon"===m){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){s=l[r]||l.getItem(r);p.rotated?f.push({x:y,y:s.y}):f.push({x:s.x,y:_});d.push({x:s.x,y:s.y})}g[m]=f;x[m]=d}else if("ellipse"===m||"rect"===m){h._toggleVisibility(e,!1);i&&(u=function(){h._toggleVisibility(e,!0)})}n=i?g:x;a=i?x:g;h._setInitState(e,n,a);t.push({ele:e,from:n,to:a,done:u})}};FlexChartAnimation.prototype._setLineMoveAnimation=function(t,e,i,n,a){if(null!=e&&null!=i){var o,r,s,l,u,c,h,p,m,f=e.nodeName,d=[],A=[],_={},y={};if("polyline"===f||"polygon"===f){m="polygon"===f;s=e.points;c=i.points;o=s.length||s.numberOfItems;l=c.length||c.numberOfItems;p=Math.max(o,l);for(h=0;h<p;h++){if(h<o){r=s[h]||s.getItem(h);d.push({x:r.x,y:r.y})}if(h<l){u=c[h]||c.getItem(h);A.push({x:u.x,y:u.y})}}if(this._addStart){this._adjustStartLinePoints(this._addStart,d,s);o+=this._addStart}else if(this._removeStart){this._adjustStartLinePoints(this._removeStart,A,c);l+=this._removeStart}l>o?this._adjustEndLinePoints(l,o,d,s,m):l<o&&this._adjustEndLinePoints(o,l,A,c,m);_[f]=d;y[f]=A;this._setInitState(n,_,y);t.push({ele:n,from:_,to:y,done:a})}}};FlexChartAnimation.prototype._adjustStartLinePoints=function(t,e,i){for(var n=i[0]||i.getItem(0);t;){e.splice(0,0,{x:n.x,y:n.y});t--}};FlexChartAnimation.prototype._adjustEndLinePoints=function(t,e,i,n,a){var o,r,s;if(a&&(n.length>=3||n.numberOfItems>=3)){r=i.pop();o=i.pop();s=n[n.length-3]||n.getItem(n.numberOfItems-3)}else(n.length>0||n.numberOfItems>0)&&(s=n[n.length-1]||n.getItem(n.numberOfItems-1));for(;t>e&&s;){i.push({x:s.x,y:s.y});e++}if(a&&r&&o){i.push(o);i.push(r)}};FlexChartAnimation.prototype._playLineRemoveAnimation=function(t,e){var i,n=this,a=n._chart.series[0].hostElement.parentNode,o=n._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){n._setLineRiseDiveAnimation(o,t,!1)}));if(o.length){i=o[0].done;o[0].done=function(){e&&e.parentNode===a&&a.removeChild(e);i&&i()}}};FlexChartAnimation.prototype._playLineAddAnimation=function(t,e){var i=this,n=e.hostElement,a=this._getAnimation(t,0);[].slice.call(n.childNodes).forEach((function(t){i._setLineRiseDiveAnimation(a,t,!0)}))};FlexChartAnimation.prototype._playLineMoveAnimation=function(t,e,i){var n,a,o,r,s=this,l=(s._chart,s._getAnimation(t,0)),u=[];n=e.hostElement;a=[].slice.call(i.childNodes);[].slice.call(n.childNodes).forEach((function(t,e){r=t.nodeName;o=a[e];if("g"===r&&t.nodeChilds)[].slice.call(t.nodeChilds).forEach((function(t,e){if(o){u.push(t);s._toggleVisibility(t,!1)}}));else if("polygon"===r||"polyline"===r)s._setLineMoveAnimation(l,o,t,t,0===e?function(){u.forEach((function(t){s._toggleVisibility(t,!0)}));u=null}:null);else if(o){u.push(t);s._toggleVisibility(t,!1)}}))};FlexChartAnimation.prototype._playLoadColumnAnimation=function(t,e){this._playLoadBarAnimation(t,e,!0)};FlexChartAnimation.prototype._playLoadBarAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart.series[e],o=n.animationMode,r=a.hostElement;[].slice.call(r.childNodes).forEach((function(a,r){var s,l=a.nodeName;s=o===AnimationMode.Point?n._getAnimation(t,r):o===AnimationMode.Series?n._getAnimation(t,e):n._getAnimation(t,0);"g"===l?a.childNodes&&[].slice.call(a.childNodes).forEach((function(t,e){n._setLoadBarAnimation(s,t,i)})):n._setLoadBarAnimation(s,a,i)}))};FlexChartAnimation.prototype._setBarAnimation=function(t,e,i,n,a){this._setInitState(e,i,n);t.push({ele:e,from:i,to:n,done:a})};FlexChartAnimation.prototype._setLoadBarAnimation=function(t,e,i,n,a){void 0===n&&(n=!1);var o,r,s=this,l=i?"height":"width",u=i?"y":"x",c=e.getAttribute(l),h=e.getAttribute(u),p=i?"top":"left",m=s._chart._plotRect,f={},d={};f[l]=0;d[l]=Number(c);if(i){f[u]=m[l]+m[p];d[u]=Number(h)}o=n?d:f;r=n?f:d;"g"===e.nodeName?e.childNodes&&[].slice.call(e.childNodes).forEach((function(e){s._setBarAnimation(t,e,o,r,a)})):s._setBarAnimation(t,e,o,r,a)};FlexChartAnimation.prototype._setMoveBarAnimation=function(t,e,i){var n={},a={};if(null!=e&&null!=i){["width","height","x","y","top","left"].forEach((function(t){var o=e.getAttribute(t),r=i.getAttribute(t);if(o!==r){n[t]=Number(o);a[t]=Number(r)}}));this._setInitState(i,n,a);t.push({ele:i,from:n,to:a})}};FlexChartAnimation.prototype._playColumnRemoveAnimation=function(t,e){this._playBarRemoveAnimation(t,e,!0)};FlexChartAnimation.prototype._playColumnAddAnimation=function(t,e){this._playBarAddAnimation(t,e,!0)};FlexChartAnimation.prototype._playColumnMoveAnimation=function(t,e,i){this._playBarMoveAnimation(t,e,i,!0)};FlexChartAnimation.prototype._playBarRemoveAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart.series[0].hostElement.parentNode,o=n._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){n._setLoadBarAnimation(o,t,i,!0)}));o.length&&(o[0].done=function(){e&&e.parentNode===a&&a.removeChild(e)})};FlexChartAnimation.prototype._playBarAddAnimation=function(t,e,i){var n=this;void 0===i&&(i=!1);var a=e.hostElement,o=this._getAnimation(t,2);[].slice.call(a.childNodes).forEach((function(t){n._setLoadBarAnimation(o,t,i,!1)}))};FlexChartAnimation.prototype._playBarMoveAnimation=function(t,e,i,n){void 0===n&&(n=!1);var a,o,r,s,l,u,c,h=this;h._chart;a=e.hostElement;r=[].slice.call(i.childNodes);if(h._addStart){c=0;s=r[0];for(;c<h._addStart;){r.splice(0,0,s);c++}}if(h._removeStart){c=0;s=r[r.length-1];for(;c<h._removeStart;){var p=r.shift();r.push(p);c++}}l=r.length;o=[].slice.call(a.childNodes);u=o.length;o.forEach((function(e,i){var a;if(i<l){s=r[i];if(i<h._addStart){a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1)}else if(i>=l-h._removeStart){a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1);a=h._getAnimation(t,0);h._removeBarAnimation(a,e,s,n)}else{a=h._getAnimation(t,1);h._setMoveBarAnimation(a,s,e)}if(i===u-1&&i<l-1){a=h._getAnimation(t,0);for(i++;i<l;i++){s=r[i];h._removeBarAnimation(a,e,s,n)}}}else{a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1)}}))};FlexChartAnimation.prototype._removeBarAnimation=function(t,e,i,n){var a=e.parentNode;a.appendChild(i);this._setLoadBarAnimation(t,i,n,!0,function(t){return function(){t.parentNode&&t.parentNode===a&&a.removeChild(t)}}(i))};FlexChartAnimation.prototype._playLoadScatterAnimation=function(t,e){var i=this,n=i._chart,a=n.series[e],o=i.animationMode,r=a.hostElement,s=a._xValues||n._xvals;0===s.length&&(s=a._pointIndexes);[].slice.call(r.childNodes).forEach((function(n,a){var r;r=o===AnimationMode.Point?i._getScatterAnimation(t,s[a]):o===AnimationMode.Series?i._getAnimation(t,e):i._getAnimation(t,0);i._setLoadScatterAnimation(r,n,!1)}))};FlexChartAnimation.prototype._setLoadScatterAnimation=function(t,e,i,n){var a=this;void 0===i&&(i=!1);var o,r,s={},l={};if("g"===e.nodeName&&e.childNodes)[].slice.call(e.childNodes).forEach((function(e){a._setLoadScatterAnimation(t,e,i,n)}));else{["rx","ry","stroke-width"].forEach((function(t){var i=e.getAttribute(t);s[t]=0;l[t]=Number(i)}));o=i?l:s;r=i?s:l;this._setInitState(e,o,r);t.push({ele:e,from:o,to:r,done:n})}};FlexChartAnimation.prototype._setUpdateScatterAnimation=function(t,e,i,n){var a={},o={};["cx","cy"].forEach((function(t){var n=e.getAttribute(t),r=i.getAttribute(t);if(n!==r){a[t]=Number(n);o[t]=Number(r)}}));this._setInitState(i,a,o);t.push({ele:i,from:a,to:o,done:n})};FlexChartAnimation.prototype._getScatterAnimation=function(t,e){var i=this._getScatterAnimationIndex(t,e);t[i]||(t[i]=[]);return t[i]};FlexChartAnimation.prototype._getScatterAnimationIndex=function(t,e){var i=this._chart.axisX,n=null==i.min?i.actualMin:i.min,a=null==i.max?i.actualMax:i.max;return Math.ceil((e-n)/((a-n)/20))};FlexChartAnimation.prototype._playScatterRemoveAnimation=function(t,e){var i=this,n=i._chart.series[0].hostElement.parentNode,a=i._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){i._setLoadScatterAnimation(a,t,!0)}));a.length&&(a[0].done=function(){e&&e.parentNode===n&&n.removeChild(e)})};FlexChartAnimation.prototype._playScatterAddAnimation=function(t,e){var i=this,n=e.hostElement,a=this._getAnimation(t,0);[].slice.call(n.childNodes).forEach((function(t){i._setLoadScatterAnimation(a,t,!1)}))};FlexChartAnimation.prototype._playScatterMoveAnimation=function(t,e,i){var n,a,o,r,s,l,u,c=this,h=(c._chart,c._getAnimation(t,0));n=e.hostElement;o=[].slice.call(i.childNodes);if(c._addStart){u=0;r=o[0];for(;u<c._addStart;){o.splice(0,0,r);u++}}if(c._removeStart){u=0;r=o[o.length-1];for(;u<c._removeStart;){var p=o.shift();o.push(p);u++}}s=o.length;a=[].slice.call(n.childNodes);l=a.length;a.forEach((function(t,e){if(e<s){if(e<c._addStart)c._setLoadScatterAnimation(h,t,!1);else if(e>=s-c._removeStart){c._setLoadScatterAnimation(h,t,!1);r=o[e];c._removeScatterAnimation(h,t,r)}else{r=o[e];c._setUpdateScatterAnimation(h,r,t)}if(e===l-1&&e<s-1)for(e++;e<s;e++){r=o[e];c._removeScatterAnimation(h,t,r)}}else c._setLoadScatterAnimation(h,t,!1)}))};FlexChartAnimation.prototype._removeScatterAnimation=function(t,e,i){var n=e.parentNode;n.appendChild(i);this._setLoadScatterAnimation(t,i,!0,function(t){return function(){t.parentNode&&t.parentNode===n&&n.removeChild(t)}}(i))};FlexChartAnimation.prototype._playDefaultAnimation=function(t,e){var i,n,a=this._chart,o=a.series[e].hostElement,r=a._plotRect,s=a._currentRenderEngine,l=o.getAttribute("clip-path"),u="clipPath"+(1e6*Math.random()).toFixed(),c=a.axisX.reversed;s.addClipRect(new Rect(c?r.right:r.left,r.top,0,r.height),u);o.setAttribute("clip-path","url(#"+u+")");i=a.hostElement.querySelector("#"+u);n=this._getAnimation(t,0);var h={width:0},p={width:r.width};if(c){h.x=r.right;p.x=r.left}n.push({ele:i.querySelector("rect"),from:h,to:p,done:function(){if(o){l?o.setAttribute("clip-path",l):o.removeAttribute("clip-path");i&&i.parentNode&&i.parentNode.removeChild(i)}}})};return FlexChartAnimation}(FlexAnimation),FlexRadarAnimation=function(t){__extends(FlexRadarAnimation,t);function FlexRadarAnimation(e,i){return t.call(this,e,i)||this}FlexRadarAnimation.prototype._getDurationAndDelay=function(e,i){var n=t.prototype._getDurationAndDelay.call(this,e,i);if(this.animationMode===AnimationMode.Point){n.duration=i/e;n.delay=i/e}return n};FlexRadarAnimation.prototype._playAxesAnimation=function(){};FlexRadarAnimation.prototype._getChartType=function(e){var i=t.prototype._getChartType.call(this,e);"Bar"===i&&(i="Column");return i};FlexRadarAnimation.prototype._playLoadLineAnimation=function(t,e){var i,n,a,o=this,r=o._chart,s=o._chart.series[e],l=s._xValues||r._xvals,u=o.animationMode,c=s.hostElement;if(u===AnimationMode.Point){0===l.length&&(l=s._pointIndexes);a=[].slice.call(c.childNodes);n=a.length-c.querySelectorAll("ellipse").length;a.forEach((function(e,i){o._setRadarLinePointAnimation(t,e,i,l,n)}))}else{i=u===AnimationMode.All?o._getAnimation(t,0):o._getAnimation(t,e);[].slice.call(c.childNodes).forEach((function(t){o._setLineRiseDiveAnimation(i,t,!0)}))}};FlexRadarAnimation.prototype._setRadarLinePointAnimation=function(t,e,i,n,a){var o,r,s,l,u,c,h,p=this,m=p._chart,f=e.nodeName,d=[],A=[],_=[],y=[],g=m._center,x=[],E=!1,v={},C={},S=0;if("polyline"===f||"polygon"===f){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){x[h=p._getScatterAnimationIndex(t,n[r])]||(x[h]=[]);x[h].push(r);s=l[r]||l.getItem(r);d.push({x:g.x,y:g.y});A.push({x:s.x,y:s.y})}for(r=0,o=x.length;r<o;r++)if(x[r]){c=p._getAnimation(t,S);_=y.length?y.slice():d.slice();y=_.slice();x[r].forEach((function(t){var e=A[t];y[t]={x:e.x,y:e.y}}));C={};(v={})[f]=_;C[f]=y;if(!E){p._setInitState(e,v,C);E=!0}c.push({ele:e,from:v,to:C,done:u});S++}}else if("ellipse"===f){if((r=i-(a||0))<0)return;c=m._isPolar?p._getScatterAnimation(t,n[r]):p._getScatterAnimation(t,r);p._toggleVisibility(e,!1);u=function(){p._toggleVisibility(e,!0)};c.push({ele:e,from:v,to:C,done:u})}};FlexRadarAnimation.prototype._setLineRiseDiveAnimation=function(t,e,i){var n,a,o,r,s,l,u,c=this,h=c._chart,p=e.nodeName,m=[],f=[],d=h._center,A={},_={};if("polyline"===p||"polygon"===p){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){s=l[r]||l.getItem(r);m.push({x:d.x,y:d.y});f.push({x:s.x,y:s.y})}A[p]=m;_[p]=f}else if("ellipse"===p){c._toggleVisibility(e,!1);i&&(u=function(){c._toggleVisibility(e,!0)})}n=i?A:_;a=i?_:A;c._setInitState(e,n,a);t.push({ele:e,from:n,to:a,done:u})};FlexRadarAnimation.prototype._parsePathByRadius=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,u=t.sweep;n=[o,r,0,l,u,0];a=[o,r,s,l,u,t.innerRadius||0];e.pie=n;i.pie=a};FlexRadarAnimation.prototype._playUpdateAnimation=function(e,i,n,a,o){if("Bar"===n||"Column"===n){if(null==a)return;this._playLoadBarAnimation(e,i,!1)}else t.prototype._playUpdateAnimation.call(this,e,i,n,a,o)};FlexRadarAnimation.prototype._playLoadBarAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart,o=a.series[e],r=a._areas[e],s=n.animationMode,l=o.hostElement;[].slice.call(l.childNodes).forEach((function(i,a){var o,l,u={},c={};o=s===AnimationMode.Point?n._getAnimation(t,a):s===AnimationMode.Series?n._getAnimation(t,e):n._getAnimation(t,0);l=r[a];n._parsePathByRadius(l,u,c);n._setInitState(i,u,c);o.push({ele:i,from:u,to:c})}))};return FlexRadarAnimation}(FlexChartAnimation),AnimationHelper=function(){function AnimationHelper(){}AnimationHelper.playAnimations=function(t,e,i,n,a,o,r){void 0===a&&(a=Easing.Swing);var s=t.length,l=0,u=[];t.forEach((function(t,c){var h=AnimationHelper.playAnimation(t,e[c],i[c],(function(){l===s-1&&n&&n();l++}),a,o,r);u.push(h)}));return u};AnimationHelper.playAnimation=function(t,e,i,n,a,o,r){void 0===a&&(a=Easing.Swing);var s=AnimationHelper.parseAttrs(e,i);return AnimationHelper.animate((function(e){AnimationHelper.setElementAttr(t,s,e)}),n,a,o,r)};AnimationHelper.setElementAttr=function(t,e,i){var n,a;for(a in e){n=e[a];AnimationHelper.calcValue(n,i);t.setAttribute(a,n.getValue(n.value,i))}};AnimationHelper.getPathDescOfPie=function(t,e,i,n,a,o){void 0===o&&(o=0);var r=!1;if(a>=2*Math.PI){r=!0;a=2*Math.PI-.001}var s=new Point(t,e);s.x+=i*Math.cos(n);s.y+=i*Math.sin(n);var l=n+a,u=new Point(t,e);u.x+=i*Math.cos(l);u.y+=i*Math.sin(l);if(o){var c=new Point(t,e);c.x+=o*Math.cos(l);c.y+=o*Math.sin(l);var h=new Point(t,e);h.x+=o*Math.cos(n);h.y+=o*Math.sin(n)}var p=" 0 0,1 ",m=" 0 0,0 ";if(Math.abs(a)>Math.PI){p=" 0 1,1 ";m=" 0 1,0 "}var f="M "+s.x.toFixed(3)+","+s.y.toFixed(3);f+=" A "+i.toFixed(3)+","+i.toFixed(3)+p;f+=u.x.toFixed(3)+","+u.y.toFixed(3);if(o){f+=r?" M "+c.x.toFixed(3)+","+c.y.toFixed(3):" L "+c.x.toFixed(3)+","+c.y.toFixed(3);f+=" A "+o.toFixed(3)+","+o.toFixed(3)+m;f+=h.x.toFixed(3)+","+h.y.toFixed(3)}else f+=" L "+t.toFixed(3)+","+e.toFixed(3);r||(f+=" z");return f};AnimationHelper.parseAttrs=function(t,e){var i={};for(var n in t)if(null!=e[n])switch(n){case"polyline":i.points=AnimationHelper.parseAttr(t[n],e[n],(function(t,e){if(1===e){for(var i,n,a;t.length>1;){n=t[0];a=t[1];if(n.x!==a.x||n.y!==a.y){n=null;a=null;break}t.splice(1,1)}for(i=t.length-1;i>0;i--){n=a;a=t[i];if(n){if(n.x!==a.x||n.y!==a.y)break;t.pop()}}}return t.map((function(t){return t.x+","+t.y})).join(" ")}));break;case"polygon":i.points=AnimationHelper.parseAttr(t[n],e[n],(function(t,e){if(1===e){var i,n,a,o,r;o=t.pop();r=t.pop();for(;t.length>1;){n=t[0];a=t[1];if(n.x!==a.x||n.y!==a.y){n=null;a=null;break}t.splice(1,1)}for(i=t.length-1;i>=0;i--){n=a;a=t[i];if(n){if(n.x!==a.x||n.y!==a.y)break;t.splice(i,1)}}t.push(r);t.push(o)}return t.map((function(t){return t.x+","+t.y})).join(" ")}));break;case"d":i[n]=AnimationHelper.parseAttr(t[n],e[n],(function(t){return t.map((function(t){return"string"==typeof t?t:t[0]+","+t[1]})).join(" ")}));break;case"pie":i.d=AnimationHelper.parseAttr(t[n],e[n],(function(t){return AnimationHelper.getPathDescOfPie.apply(AnimationHelper,t)}));break;case"rotate":i.transform=AnimationHelper.parseAttr(t[n],e[n],(function(t){return"rotate("+t.join(" ")+")"}));break;case"x":case"width":case"height":case"rx":case"ry":case"stroke-width":i[n]=AnimationHelper.parseAttr(t[n],e[n],(function(t){return Math.abs(t)}));break;default:i[n]=AnimationHelper.parseAttr(t[n],e[n])}return i};AnimationHelper.animate=function(t,e,i,n,a){void 0===i&&(i=Easing.Swing);void 0===n&&(n=400);void 0===a&&(a=16);asFunction(t);asNumber(n,!1,!0);asNumber(a,!1,!0);var o=0,r=setInterval((function(){Date.now();var s=o/n;s=EasingHelper[Easing[i]](s);t(s);if((o+=a)>=n){clearInterval(r);(s<1||s>1)&&t(1);e&&e()}}),a);return r};AnimationHelper.calcValue=function(t,e){var i=t.from,n=t.diff,a=t.value;isNumber(i)?t.value=0===n?i:i+n*e:isArray(i)&&AnimationHelper.parseArrayAttr(a,i,n,(function(t,i){return"number"==typeof t?t+i*e:t}))};AnimationHelper.parseAttr=function(t,e,i){var n,a,o,r;if(isArray(t)&&isArray(e)){a=e;o=[];r=(n=t).slice();AnimationHelper.parseArrayAttr(o,n,a,(function(t,e){return t===e?0:e-t}))}else{r=n=Number(t);o=(a=Number(e))-n}return{from:n,to:a,value:r,diff:o,getValue:i||function(t,e){return t}}};AnimationHelper.parseArrayAttr=function(t,e,i,n){e.forEach((function(e,a){var o={},r=[],s=i[a];if(isNumber(e)||"string"==typeof e)t[a]=n(e,s);else if(isArray(e)){e.forEach((function(t,i){r[i]=n(e[i],s[i])}));t[a]=r}else{Object.getOwnPropertyNames(e).forEach((function(t){o[t]=n(e[t],s[t])}));t[a]=o}}))};return AnimationHelper}(),EasingHelper=function(){function EasingHelper(){}EasingHelper.Linear=function(t){return t};EasingHelper.Swing=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)};EasingHelper.EaseInQuad=function(t){return t*t};EasingHelper.EaseOutQuad=function(t){return t*(2-t)};EasingHelper.EaseInOutQuad=function(t){return t<.5?2*t*t:(4-2*t)*t-1};EasingHelper.EaseInCubic=function(t){return t*t*t};EasingHelper.EaseOutCubic=function(t){return--t*t*t+1};EasingHelper.EaseInOutCubic=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1};EasingHelper.EaseInQuart=function(t){return t*t*t*t};EasingHelper.EaseOutQuart=function(t){return 1- --t*t*t*t};EasingHelper.EaseInOutQuart=function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t};EasingHelper.EaseInQuint=function(t){return t*t*t*t*t};EasingHelper.EaseOutQuint=function(t){return 1+--t*t*t*t*t};EasingHelper.EaseInOutQuint=function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};EasingHelper.EaseInSine=function(t){return 1-Math.cos(t*(Math.PI/2))};EasingHelper.EaseOutSine=function(t){return Math.sin(t*(Math.PI/2))};EasingHelper.EaseInOutSine=function(t){return-.5*(Math.cos(Math.PI*t)-1)};EasingHelper.EaseInExpo=function(t){return 0==t?0:Math.pow(2,10*(t-1))};EasingHelper.EaseOutExpo=function(t){return 1==t?1:1-Math.pow(2,-10*t)};EasingHelper.EaseInOutExpo=function(t){return t==!!t?t:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))};EasingHelper.EaseInCirc=function(t){return-(Math.sqrt(1-t*t)-1)};EasingHelper.EaseOutCirc=function(t){return Math.sqrt(1-Math.pow(t-1,2))};EasingHelper.EaseInOutCirc=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)};EasingHelper.EaseInBack=function(t){var e=1.70158;return t*t*((e+1)*t-e)};EasingHelper.EaseOutBack=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1};EasingHelper.EaseInOutBack=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)};EasingHelper.EaseInBounce=function(t){return 1-EasingHelper.EaseOutBounce(1-t)};EasingHelper.EaseOutBounce=function(t){var e=7.5625;return t<1/2.75?e*t*t:t<2/2.75?e*(t-=1.5/2.75)*t+.75:t<2.5/2.75?e*(t-=2.25/2.75)*t+.9375:e*(t-=2.625/2.75)*t+.984375};EasingHelper.EaseInOutBounce=function(t){return t<.5?.5*EasingHelper.EaseInBounce(2*t):.5*EasingHelper.EaseOutBounce(2*t-1)+.5};EasingHelper.EaseInElastic=function(t){return t==!!t?t:-Math.pow(2,10*(t-=1))*Math.sin((t-.075)*(2*Math.PI)/.3)};EasingHelper.EaseOutElastic=function(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1};EasingHelper.EaseInOutElastic=function(t){return t==!!t?t:(t*=2)<1?Math.pow(2,10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*-.5:Math.pow(2,-10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*.5+1};return EasingHelper}();_registerModule("wijmo.chart.animation",selfModule); |
/*! | ||
* | ||
* Wijmo Library 5.20242.21 | ||
* Wijmo Library 5.20242.30 | ||
* https://developer.mescius.com/wijmo | ||
@@ -5,0 +5,0 @@ * |
/*! | ||
* | ||
* Wijmo Library 5.20242.21 | ||
* Wijmo Library 5.20242.30 | ||
* https://developer.mescius.com/wijmo | ||
@@ -14,2 +14,2 @@ * | ||
"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};return function(t,e){extendStatics(t,e);function __(){this.constructor=t}t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}(),__importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);e.default=t;return e};Object.defineProperty(exports,"__esModule",{value:!0});var Easing,AnimationMode,wijmo_1=require("@grapecity/wijmo"),wijmo_chart_1=require("@grapecity/wijmo.chart"),selfModule=__importStar(require("@grapecity/wijmo.chart.animation"));function softFinancial(){return wijmo_1._getModule("wijmo.chart.finance")}exports.softFinancial=softFinancial;function softRadar(){return wijmo_1._getModule("wijmo.chart.radar")}exports.softRadar=softRadar;!function(t){t[t.Linear=0]="Linear";t[t.Swing=1]="Swing";t[t.EaseInQuad=2]="EaseInQuad";t[t.EaseOutQuad=3]="EaseOutQuad";t[t.EaseInOutQuad=4]="EaseInOutQuad";t[t.EaseInCubic=5]="EaseInCubic";t[t.EaseOutCubic=6]="EaseOutCubic";t[t.EaseInOutCubic=7]="EaseInOutCubic";t[t.EaseInQuart=8]="EaseInQuart";t[t.EaseOutQuart=9]="EaseOutQuart";t[t.EaseInOutQuart=10]="EaseInOutQuart";t[t.EaseInQuint=11]="EaseInQuint";t[t.EaseOutQuint=12]="EaseOutQuint";t[t.EaseInOutQuint=13]="EaseInOutQuint";t[t.EaseInSine=14]="EaseInSine";t[t.EaseOutSine=15]="EaseOutSine";t[t.EaseInOutSine=16]="EaseInOutSine";t[t.EaseInExpo=17]="EaseInExpo";t[t.EaseOutExpo=18]="EaseOutExpo";t[t.EaseInOutExpo=19]="EaseInOutExpo";t[t.EaseInCirc=20]="EaseInCirc";t[t.EaseOutCirc=21]="EaseOutCirc";t[t.EaseInOutCirc=22]="EaseInOutCirc";t[t.EaseInBack=23]="EaseInBack";t[t.EaseOutBack=24]="EaseOutBack";t[t.EaseInOutBack=25]="EaseInOutBack";t[t.EaseInBounce=26]="EaseInBounce";t[t.EaseOutBounce=27]="EaseOutBounce";t[t.EaseInOutBounce=28]="EaseInOutBounce";t[t.EaseInElastic=29]="EaseInElastic";t[t.EaseOutElastic=30]="EaseOutElastic";t[t.EaseInOutElastic=31]="EaseInOutElastic"}(Easing=exports.Easing||(exports.Easing={}));!function(t){t[t.All=0]="All";t[t.Point=1]="Point";t[t.Series=2]="Series"}(AnimationMode=exports.AnimationMode||(exports.AnimationMode={}));var ChartAnimation=function(){function ChartAnimation(t,e){this._play=!0;this.ended=new wijmo_1.Event;var i=this,n=t.hostElement,a=new wijmo_1.Size(n.offsetWidth,n.offsetHeight);i._chart=t;i._updateEventArgs=[];if(t instanceof wijmo_chart_1.FlexPie)i._animation=new FlexPieAnimation(t,i._updateEventArgs);else{softRadar()&&t instanceof softRadar().FlexRadar?i._animation=new FlexRadarAnimation(t,i._updateEventArgs):t instanceof wijmo_chart_1.FlexChartCore&&(i._animation=new FlexChartAnimation(t,i._updateEventArgs));i._chartType=t.chartType}wijmo_1.assert(void 0!==i._animation,"Animation is not supported");i._initOptions(e);t.beginUpdate();window.setTimeout((function(){t.rendered.addHandler(i._playAnimation,i);t.endUpdate()}),0);i._setCV(t.collectionView);window.addEventListener("resize",(function(t){var e=new wijmo_1.Size(n.offsetWidth,n.offsetHeight);if(!a.equals(e)){i._play=!1;a=e}}))}ChartAnimation.prototype._initOptions=function(t){if(t){t.duration&&(this.duration=t.duration);t.easing&&(this.easing=t.easing);t.animationMode&&(this.animationMode=t.animationMode);void 0!==t.axisAnimation&&(this.axisAnimation=t.axisAnimation)}};ChartAnimation.prototype._setCV=function(t){this._cv=t;this._animation._clearState()};Object.defineProperty(ChartAnimation.prototype,"animationMode",{get:function(){return this._animation.animationMode},set:function(t){(t=wijmo_1.asEnum(t,AnimationMode))!=this.animationMode&&(this._animation.animationMode=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"easing",{get:function(){return this._animation.easing},set:function(t){(t=wijmo_1.asEnum(t,Easing))!=this.easing&&(this._animation.easing=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"duration",{get:function(){return this._animation.duration},set:function(t){(t=wijmo_1.asNumber(t))!=this.duration&&(this._animation.duration=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"axisAnimation",{get:function(){return this._animation.axisAnimation},set:function(t){(t=wijmo_1.asBoolean(t))!=this.axisAnimation&&(this._animation.axisAnimation=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0});ChartAnimation.prototype._playAnimation=function(){var t=this,e=t._chart,i=e.chartType;t._cv!==e.collectionView&&t._setCV(e.collectionView);if(null!=t._chartType&&t._chartType!==i){t._chartType=i;t._animation._clearState()}t._play?t._animation.playAnimation((function(){return t.ended.raise(t,wijmo_1.EventArgs.empty)})):t._play=!0};ChartAnimation.prototype.animate=function(){var t=this._chart;if(t){var e=t.itemsSource;t.beginUpdate();t.itemsSource=null;t.itemsSource=e;t.endUpdate()}};return ChartAnimation}();exports.ChartAnimation=ChartAnimation;var FlexAnimation=function(){function FlexAnimation(t,e){this._axisAnimation=!0;this._chart=t;this._timers=[]}Object.defineProperty(FlexAnimation.prototype,"animationMode",{get:function(){return this._animationMode||AnimationMode.All},set:function(t){if((t=wijmo_1.asEnum(t,AnimationMode,!1))!==this._animationMode){this._clearState();this._animationMode=t}},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"easing",{get:function(){return null==this._easing?Easing.Swing:this._easing},set:function(t){t!==this._easing&&(this._easing=wijmo_1.asEnum(t,Easing,!1))},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"duration",{get:function(){return this._duration||400},set:function(t){t!==this._duration&&(this._duration=wijmo_1.asNumber(t,!1,!0))},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"axisAnimation",{get:function(){return!!this._axisAnimation},set:function(t){t!==this._axisAnimation&&(this._axisAnimation=wijmo_1.asBoolean(t,!1))},enumerable:!0,configurable:!0});FlexAnimation.prototype.playAnimation=function(t){};FlexAnimation.prototype._clearState=function(){this._previousState&&(this._previousState=null);this._currentState&&(this._currentState=null)};FlexAnimation.prototype._setInitState=function(t,e,i){var n=AnimationHelper.parseAttrs(e,i);AnimationHelper.setElementAttr(t,n,0)};FlexAnimation.prototype._getAnimation=function(t,e){t[e]||(t[e]=[]);return t[e]};FlexAnimation.prototype._toggleVisibility=function(t,e){e?AnimationHelper.playAnimation(t,{opacity:0},{opacity:1},null,Easing.Swing,100):t.setAttribute("opacity","0")};FlexAnimation.prototype._toggleDataLabelVisibility=function(t){var e=this._chart.hostElement,i=e&&e.querySelector(".wj-data-labels");i&&this._toggleVisibility(i,t)};FlexAnimation.prototype._playAnimation=function(t,e){var i,n=this,a=this,o=a.duration,r=a.easing,s=t.length;a._toggleDataLabelVisibility(!1);i=a._getDurationAndDelay(t.length,o);if(this._timers&&this._timers.length){this._timers.forEach((function(t){return window.clearInterval(t)}));this._timers.length=0}t.forEach((function(t,o){var l;if(t){l=window.setTimeout((function(){var l;t.forEach((function(t,c){if(t&&t.ele){if(o===s-1&&0===c){var u=t.done;t.done=function(){a._toggleDataLabelVisibility(!0);u&&u();e&&e()}}if(wijmo_1.isArray(t.ele)){l=AnimationHelper.playAnimations(t.ele,t.from,t.to,t.done,r,i.duration);n._timers=n._timers.concat.apply(l)}else{l=AnimationHelper.playAnimation(t.ele,t.from,t.to,t.done,r,i.duration);n._timers.push(l)}}}))}),i.delay*o);n._timers.push(l)}}))};FlexAnimation.prototype._getDurationAndDelay=function(t,e){var i={duration:e,delay:0};if(t>1)if(this._previousState){i.duration=e/t;i.delay=e/t}else{i.duration=.5*e;i.delay=.5*e/(t-1)}return i};return FlexAnimation}(),FlexPieAnimation=function(t){__extends(FlexPieAnimation,t);function FlexPieAnimation(e,i){var n=t.call(this,e,i)||this;e.selectionChanged.addHandler(n._selectionChanged,n);return n}FlexPieAnimation.prototype._selectionChanged=function(){this._isSelectionChanged=!0};FlexPieAnimation.prototype._clearState=function(){t.prototype._clearState.call(this);this._isSelectionChanged=!1};FlexPieAnimation.prototype._getElementRotate=function(t){var e,i=t.getAttribute("transform");if(i&&i.indexOf("rotate")>-1){if(1==(i=(i=i.replace("rotate(","").replace(")","")).indexOf(",")>-1?i.split(",").map((function(t){return+t})):i.split(" ").map((function(t){return+t}))).length){e=this._chart._areas[0].center;i.push(e.x,e.y)}}else i=[0,(e=this._chart._areas[0].center).x,e.y];return i};FlexPieAnimation.prototype._getDurationAndDelay=function(t,e){var i={duration:e,delay:0};if(this.animationMode===AnimationMode.Point&&t>1){i.duration=e/t;i.delay=e/t}return i};FlexPieAnimation.prototype.playAnimation=function(e){t.prototype.playAnimation.call(this,e);var i=[];this._playPieAnimation(i);i.length&&this._playAnimation(i,e)};FlexPieAnimation.prototype._playPieAnimation=function(t){var e=this._chart,i=!0;this._previousState=this._currentState;this._currentState={areas:e._areas,pels:e._pels,rotate:e._pels.length&&this._getElementRotate(e._pels[0].parentNode)};this._previousState&&(i=!1);if(this._isSelectionChanged){e.isAnimated||this._playSelectPieAnimation(t);this._isSelectionChanged=!1}else i?this._playLoadPieAnimation(t):this._playUpdatePieAnimation(t)};FlexPieAnimation.prototype._playSelectPieAnimation=function(t){if(null!=this._previousState){var e,i,n,a=this._chart._pels[0].parentNode,o=this._previousState.rotate,r=this._getElementRotate(a),s=o[0],l=r[0];if(s!==l){s-l>180?r[0]+=360:l-s>180&&(o[0]+=360);e=this._getAnimation(t,0);i={rotate:o};n={rotate:r};this._setInitState(a,i,n);e.push({ele:a,from:i,to:n})}}};FlexPieAnimation.prototype._playUpdatePieAnimation=function(t){var e,i,n,a,o=this._chart,r=this._previousState,s=o._areas,l=o._pels,c=r.areas.length,u=s.length,h=Math.max(u,c),m=this._getAnimation(t,0),p=0;if(0!==u&&0!==c){this._playSelectPieAnimation(t);for(e=0;e<h;e++){i={};if(l[e]&&l[e].childNodes&&l[e].childNodes.length>0){if(e<u&&e<c){n=s[0];0===e&&(p=n.angle);1===c?l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(n.center.x,n.center.y,n.radius,p,2*Math.PI,n.innerRadius||0)):l[e].childNodes[0].setAttribute("d",r.pels[e].childNodes[0].getAttribute("d"))}if(e<u){n=s[e];i.to={pie:[n.center.x,n.center.y,n.radius,n.angle,n.sweep,n.innerRadius||0]};i.ele=l[e].childNodes[0]}else{n=s[0];a=r.pels[e];i.to={pie:[n.center.x,n.center.y,n.radius,p+2*Math.PI,0,n.innerRadius||0]};l[0].parentNode.appendChild(a);i.done=function(t){return function(){t.parentNode.removeChild(t)}}(a);i.ele=a.childNodes[0]}if(e<c){n=r.areas[e];i.from={pie:[n.center.x,n.center.y,n.radius,n.angle,n.sweep,n.innerRadius||0]}}else{l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(n.center.x,n.center.y,n.radius,2*Math.PI+p,0,n.innerRadius||0));n=r.areas[0];i.from={pie:[n.center.x,n.center.y,n.radius,2*Math.PI+p,0,n.innerRadius||0]}}m.push(i)}}}};FlexPieAnimation.prototype._playLoadPieAnimation=function(t){var e=this,i=e._chart,n=e.animationMode,a=i._areas;i._pels.forEach((function(i,o){var r,s=i.childNodes[0],l={},c={};if(s){if(n===AnimationMode.Point){e._parsePathByAngle(a[o],l,c);r=e._getAnimation(t,o)}else{e._parsePathByRadius(a[o],l,c);r=e._getAnimation(t,0)}e._setInitState(s,l,c);r.push({ele:s,from:l,to:c})}}))};FlexPieAnimation.prototype._parsePathByRadius=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,c=t.sweep;n=[o,r,0,l,c,0];a=[o,r,s,l,c,t.innerRadius||0];e.pie=n;i.pie=a};FlexPieAnimation.prototype._parsePathByAngle=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,c=t.sweep,u=t.innerRadius;n=[o,r,s,l,0,u||0];a=[o,r,s,l,c,u||0];e.pie=n;e["stroke-width"]=0;i.pie=a;i["stroke-width"]=1};return FlexPieAnimation}(FlexAnimation),FlexChartAnimation=function(t){__extends(FlexChartAnimation,t);function FlexChartAnimation(e,i){return t.call(this,e,i)||this}FlexChartAnimation.prototype.playAnimation=function(e){t.prototype.playAnimation.call(this,e);var i,n,a,o,r,s,l,c,u,h=!0,m=this._chart,p=softFinancial()&&m instanceof softFinancial().FinancialChart,_=m.series,f=_.length,d=[];this._previousState=this._currentState;this._previousXVal=this._currentXVal;this._currentState=[];this._addStart=0;this._removeStart=0;this._currentXVal=m._xlabels.slice();if(this._previousState&&this._previousState.length){h=!1;r=(s=this._previousState).length;l=this._previousXVal;c=this._currentXVal;l.length>2&&c.length>2&&((i=c.indexOf(l[0]))>0&&i<c.length-2?c[i+1]===l[1]&&c[i+2]===l[2]&&(this._addStart=i):(i=l.indexOf(c[0]))>0&&i<l.length-2&&l[i+1]===c[1]&&l[i+2]===c[2]&&(this._removeStart=i))}for(i=0;i<f;i++){o=null!=(n=_[i])._getChartType()?n._getChartType():m._getChartType();a=this._getChartType(o);this._currentState.push({seriesType:o,ele:n.hostElement});if(p)this._playDefaultAnimation(d,i);else{u=s&&s[i];if("Default"===a){this._playDefaultAnimation(d,i);continue}if(h||u&&u.seriesType!==o||u&&u.ele&&(""==u.ele.innerHTML||0===u.ele.childNodes.length))this._playLoadAnimation(d,i,a);else{this._playUpdateAnimation(d,i,a,n,u&&u.ele||null);if(i===f-1&&i<r-1)for(i++;i<=r-1;i++)this._playUpdateAnimation(d,i,a,null,u.ele)}}}this._adjustAnimations(a,d);d.length&&this._playAnimation(d,e);this.axisAnimation&&!p&&this._playAxesAnimation()};FlexChartAnimation.prototype._playAxesAnimation=function(){var t,e,i,n=this._chart.axes,a=n.length;this._prevAxesStates=this._currAxesStates;this._currAxesStates=[];for(e=0;e<a;e++)(t=n[e]).hostElement&&this._currAxesStates.push({ele:t.hostElement,vals:t._vals,axis:t,maxValue:wijmo_1.isDate(t.actualMax)?t.actualMax.getTime():t.actualMax,minValue:wijmo_1.isDate(t.actualMin)?t.actualMin.getTime():t.actualMin});if(this._prevAxesStates){i=Math.max(this._prevAxesStates.length,this._currAxesStates.length);for(e=0;e<i;e++)this._playAxisAnimation(this._prevAxesStates[e],this._currAxesStates[e])}};FlexChartAnimation.prototype._playAxisAnimation=function(t,e){if(t&&e){var i,n=[],a=[];if(e&&e.maxValue-e.minValue){i=this._parseAxisState(e);this._convertAxisAnimation(n,i.major,e.axis,t.maxValue,t.minValue);this._convertAxisAnimation(n,i.minor,e.axis,t.maxValue,t.minValue)}if(t&&t.maxValue-t.minValue){i=this._parseAxisState(t);this._convertAxisAnimation(a,i.major,t.axis);this._convertAxisAnimation(a,i.minor,t.axis)}n&&a&&this._combineAxisAnimations(n,a);this._playCurrAxisAnimation(n);this._playPrevAxisAnimation(a)}};FlexChartAnimation.prototype._combineAxisAnimations=function(t,e){var i,n,a=this,o=e.length;for(i=o-1;i>=0;i--)(n=e[i]).text&&t.some((function(t){if(t.text&&t.text===n.text){a._combineAxisAnimation(t,n);e.splice(i,1);return!0}}))};FlexChartAnimation.prototype._combineAxisAnimation=function(t,e){var i=this;["label","majorGrid","tick"].forEach((function(n){t[n]&&e[n]&&i._resetExistAxisAttrs(t[n],e[n])}))};FlexChartAnimation.prototype._resetExistAxisAttrs=function(t,e){var i=t.ele,n=e.ele,a={},o={};["x","y","x1","x2","y1","y2"].forEach((function(t){var e=i.getAttribute(t),r=n.getAttribute(t);if(e!==r){a[t]=r;o[t]=e}}));t.calcPos=a;t.elePos=o};FlexChartAnimation.prototype._convertAxisAnimation=function(t,e,i,n,a){var o,r=this,s=i.hostElement,l=i.axisType==wijmo_chart_1.AxisType.Y;e.forEach((function(e,c){var u=i.convert(e.val,n,a);if(!isNaN(u)){o={};e.majorGrid&&(o.majorGrid=r._getAxisAnimationAttrs(e.majorGrid,s,u,l));if(e.label){o.label=r._getAxisAnimationAttrs(e.label,s,u,l);o.text=e.label.innerHTML||e.label.textContent}e.tick&&(o.tick=r._getAxisAnimationAttrs(e.tick,s,u,l));t.push(o)}}))};FlexChartAnimation.prototype._getAxisAnimationAttrs=function(t,e,i,n){var a,o,r;a={ele:t,parent:e,elePos:{},calcPos:{}};if("text"===t.nodeName){o=n?"y":"x";r=Number(t.getAttribute(o));a.elePos[o]=r;a.calcPos[o]=i}else{o=n?"y1":"x1";r=Number(t.getAttribute(o));if(n){a.elePos={y1:r,y2:r};a.calcPos={y1:i,y2:i}}else{a.elePos={x1:r,x2:r};a.calcPos={x1:i,x2:i}}}a.elePos.opacity=1;a.calcPos.opacity=0;return a};FlexChartAnimation.prototype._playCurrAxisAnimation=function(t){var e=this.duration;t&&0!==t.length&&t.forEach((function(t){["majorGrid","label","tick"].forEach((function(i){var n=t[i];if(n){n.parent;var a=n.ele,o=n.elePos,r=n.calcPos;AnimationHelper.playAnimation(a,r,o,null,Easing.Swing,e)}}))}))};FlexChartAnimation.prototype._playPrevAxisAnimation=function(t){var e=this.duration;t&&0!==t.length&&t.forEach((function(t){["majorGrid","label","tick"].forEach((function(i){var n=t[i];if(n){var a=n.parent,o=n.ele,r=n.elePos,s=n.calcPos;a.appendChild(o);AnimationHelper.playAnimation(o,r,s,(function(){o.parentNode===a&&a.removeChild(o)}),Easing.Swing,e)}}))}))};FlexChartAnimation.prototype._parseAxisState=function(t){if(null==t)return null;var e,i,n,a=t.vals,o=t.axis,r=o.axisType==wijmo_chart_1.AxisType.Y,s=t.ele.childNodes,l=0,c=[],u=[];if(a){e=a.major;i=a.minor;n=a.hasLbls}e&&e.forEach((function(t,e){var i,a={},u=!!n[e];c.push(a);a.val=t;i=s[l];if(o.majorGrid&&wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_GRIDLINE)){a.majorGrid=i;i=s[++l]}if(r){if(u&&i&&o.majorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_TICK)){a.tick=i;i=s[++l]}if(u&&i&&(wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_LABEL)||i.querySelector("."+wijmo_chart_1.FlexChart._CSS_LABEL))){a.label=i;l++}}else{if(u&&i&&(wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_LABEL)||i.querySelector("."+wijmo_chart_1.FlexChart._CSS_LABEL))){a.label=i;i=s[++l]}if(u&&i&&o.majorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_TICK)){a.tick=i;l++}}}));i&&i.forEach((function(t,e){var i,n={};u.push(n);n.val=t;i=s[l];if(o.minorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_TICK_MINOR)){n.tick=i;i=s[++l]}if(o.minorGrid&&wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_GRIDLINE_MINOR)){n.majorGrid=i;l++}}));return{major:c,minor:u}};FlexChartAnimation.prototype._playLoadAnimation=function(t,e,i){this["_playLoad"+i+"Animation"](t,e)};FlexChartAnimation.prototype._playUpdateAnimation=function(t,e,i,n,a){null==n||null==a?null==n?this["_play"+i+"RemoveAnimation"](t,a):this["_play"+i+"AddAnimation"](t,n):this["_play"+i+"MoveAnimation"](t,n,a)};FlexChartAnimation.prototype._adjustAnimations=function(t,e){var i,n=e.length;if("Column"===t||"Bar"===t)for(i=n-1;i>=0;i--)null==e[i]&&e.splice(i,1)};FlexChartAnimation.prototype._getChartType=function(t){var e="Default",i=this._chart._isRotated();switch(t){case wijmo_chart_1.ChartType.Scatter:case wijmo_chart_1.ChartType.Bubble:case wijmo_chart_1.ChartType.Candlestick:case wijmo_chart_1.ChartType.HighLowOpenClose:e="Scatter";break;case wijmo_chart_1.ChartType.Column:case wijmo_chart_1.ChartType.Bar:e=i?"Bar":"Column";break;case wijmo_chart_1.ChartType.Line:case wijmo_chart_1.ChartType.LineSymbols:case wijmo_chart_1.ChartType.Area:case wijmo_chart_1.ChartType.Spline:case wijmo_chart_1.ChartType.SplineSymbols:case wijmo_chart_1.ChartType.SplineArea:e="Line";break;default:e="Default"}return e};FlexChartAnimation.prototype._playLoadLineAnimation=function(t,e){var i,n=this,a=n._chart.series[e],o=n.animationMode,r=a.hostElement;if(o===AnimationMode.Point)n._playDefaultAnimation(t,e);else{i=o===AnimationMode.All?n._getAnimation(t,0):n._getAnimation(t,e);[].slice.call(r.childNodes).forEach((function(t){n._setLineRiseDiveAnimation(i,t,!0)}))}};FlexChartAnimation.prototype._setLineRiseDiveAnimation=function(t,e,i){var n,a,o,r,s,l,c,u=this,h=this,m=h._chart,p=e.nodeName,_=[],f=[],d=h._chart._plotRect,A=d.top+d.height,y=d.left,x={},g={};if("g"===p&&e.childNodes)[].slice.call(e.childNodes).forEach((function(e){u._setLineRiseDiveAnimation(t,e,i)}));else{if("polyline"===p||"polygon"===p){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){s=l[r]||l.getItem(r);m.rotated?_.push({x:y,y:s.y}):_.push({x:s.x,y:A});f.push({x:s.x,y:s.y})}x[p]=_;g[p]=f}else if("ellipse"===p||"rect"===p){h._toggleVisibility(e,!1);i&&(c=function(){h._toggleVisibility(e,!0)})}n=i?x:g;a=i?g:x;h._setInitState(e,n,a);t.push({ele:e,from:n,to:a,done:c})}};FlexChartAnimation.prototype._setLineMoveAnimation=function(t,e,i,n,a){if(null!=e&&null!=i){var o,r,s,l,c,u,h,m,p,_=e.nodeName,f=[],d=[],A={},y={};if("polyline"===_||"polygon"===_){p="polygon"===_;s=e.points;u=i.points;o=s.length||s.numberOfItems;l=u.length||u.numberOfItems;m=Math.max(o,l);for(h=0;h<m;h++){if(h<o){r=s[h]||s.getItem(h);f.push({x:r.x,y:r.y})}if(h<l){c=u[h]||u.getItem(h);d.push({x:c.x,y:c.y})}}if(this._addStart){this._adjustStartLinePoints(this._addStart,f,s);o+=this._addStart}else if(this._removeStart){this._adjustStartLinePoints(this._removeStart,d,u);l+=this._removeStart}l>o?this._adjustEndLinePoints(l,o,f,s,p):l<o&&this._adjustEndLinePoints(o,l,d,u,p);A[_]=f;y[_]=d;this._setInitState(n,A,y);t.push({ele:n,from:A,to:y,done:a})}}};FlexChartAnimation.prototype._adjustStartLinePoints=function(t,e,i){for(var n=i[0]||i.getItem(0);t;){e.splice(0,0,{x:n.x,y:n.y});t--}};FlexChartAnimation.prototype._adjustEndLinePoints=function(t,e,i,n,a){var o,r,s;if(a&&(n.length>=3||n.numberOfItems>=3)){r=i.pop();o=i.pop();s=n[n.length-3]||n.getItem(n.numberOfItems-3)}else(n.length>0||n.numberOfItems>0)&&(s=n[n.length-1]||n.getItem(n.numberOfItems-1));for(;t>e&&s;){i.push({x:s.x,y:s.y});e++}if(a&&r&&o){i.push(o);i.push(r)}};FlexChartAnimation.prototype._playLineRemoveAnimation=function(t,e){var i,n=this,a=n._chart.series[0].hostElement.parentNode,o=n._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){n._setLineRiseDiveAnimation(o,t,!1)}));if(o.length){i=o[0].done;o[0].done=function(){e&&e.parentNode===a&&a.removeChild(e);i&&i()}}};FlexChartAnimation.prototype._playLineAddAnimation=function(t,e){var i=this,n=e.hostElement,a=this._getAnimation(t,0);[].slice.call(n.childNodes).forEach((function(t){i._setLineRiseDiveAnimation(a,t,!0)}))};FlexChartAnimation.prototype._playLineMoveAnimation=function(t,e,i){var n,a,o,r,s=this,l=(s._chart,s._getAnimation(t,0)),c=[];n=e.hostElement;a=[].slice.call(i.childNodes);[].slice.call(n.childNodes).forEach((function(t,e){r=t.nodeName;o=a[e];if("g"===r&&t.nodeChilds)[].slice.call(t.nodeChilds).forEach((function(t,e){if(o){c.push(t);s._toggleVisibility(t,!1)}}));else if("polygon"===r||"polyline"===r)s._setLineMoveAnimation(l,o,t,t,0===e?function(){c.forEach((function(t){s._toggleVisibility(t,!0)}));c=null}:null);else if(o){c.push(t);s._toggleVisibility(t,!1)}}))};FlexChartAnimation.prototype._playLoadColumnAnimation=function(t,e){this._playLoadBarAnimation(t,e,!0)};FlexChartAnimation.prototype._playLoadBarAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart.series[e],o=n.animationMode,r=a.hostElement;[].slice.call(r.childNodes).forEach((function(a,r){var s,l=a.nodeName;s=o===AnimationMode.Point?n._getAnimation(t,r):o===AnimationMode.Series?n._getAnimation(t,e):n._getAnimation(t,0);"g"===l?a.childNodes&&[].slice.call(a.childNodes).forEach((function(t,e){n._setLoadBarAnimation(s,t,i)})):n._setLoadBarAnimation(s,a,i)}))};FlexChartAnimation.prototype._setBarAnimation=function(t,e,i,n,a){this._setInitState(e,i,n);t.push({ele:e,from:i,to:n,done:a})};FlexChartAnimation.prototype._setLoadBarAnimation=function(t,e,i,n,a){void 0===n&&(n=!1);var o,r,s=this,l=i?"height":"width",c=i?"y":"x",u=e.getAttribute(l),h=e.getAttribute(c),m=i?"top":"left",p=s._chart._plotRect,_={},f={};_[l]=0;f[l]=Number(u);if(i){_[c]=p[l]+p[m];f[c]=Number(h)}o=n?f:_;r=n?_:f;"g"===e.nodeName?e.childNodes&&[].slice.call(e.childNodes).forEach((function(e){s._setBarAnimation(t,e,o,r,a)})):s._setBarAnimation(t,e,o,r,a)};FlexChartAnimation.prototype._setMoveBarAnimation=function(t,e,i){var n={},a={};if(null!=e&&null!=i){["width","height","x","y","top","left"].forEach((function(t){var o=e.getAttribute(t),r=i.getAttribute(t);if(o!==r){n[t]=Number(o);a[t]=Number(r)}}));this._setInitState(i,n,a);t.push({ele:i,from:n,to:a})}};FlexChartAnimation.prototype._playColumnRemoveAnimation=function(t,e){this._playBarRemoveAnimation(t,e,!0)};FlexChartAnimation.prototype._playColumnAddAnimation=function(t,e){this._playBarAddAnimation(t,e,!0)};FlexChartAnimation.prototype._playColumnMoveAnimation=function(t,e,i){this._playBarMoveAnimation(t,e,i,!0)};FlexChartAnimation.prototype._playBarRemoveAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart.series[0].hostElement.parentNode,o=n._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){n._setLoadBarAnimation(o,t,i,!0)}));o.length&&(o[0].done=function(){e&&e.parentNode===a&&a.removeChild(e)})};FlexChartAnimation.prototype._playBarAddAnimation=function(t,e,i){var n=this;void 0===i&&(i=!1);var a=e.hostElement,o=this._getAnimation(t,2);[].slice.call(a.childNodes).forEach((function(t){n._setLoadBarAnimation(o,t,i,!1)}))};FlexChartAnimation.prototype._playBarMoveAnimation=function(t,e,i,n){void 0===n&&(n=!1);var a,o,r,s,l,c,u,h=this;h._chart;a=e.hostElement;r=[].slice.call(i.childNodes);if(h._addStart){u=0;s=r[0];for(;u<h._addStart;){r.splice(0,0,s);u++}}if(h._removeStart){u=0;s=r[r.length-1];for(;u<h._removeStart;){var m=r.shift();r.push(m);u++}}l=r.length;o=[].slice.call(a.childNodes);c=o.length;o.forEach((function(e,i){var a;if(i<l){s=r[i];if(i<h._addStart){a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1)}else if(i>=l-h._removeStart){a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1);a=h._getAnimation(t,0);h._removeBarAnimation(a,e,s,n)}else{a=h._getAnimation(t,1);h._setMoveBarAnimation(a,s,e)}if(i===c-1&&i<l-1){a=h._getAnimation(t,0);for(i++;i<l;i++){s=r[i];h._removeBarAnimation(a,e,s,n)}}}else{a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1)}}))};FlexChartAnimation.prototype._removeBarAnimation=function(t,e,i,n){var a=e.parentNode;a.appendChild(i);this._setLoadBarAnimation(t,i,n,!0,function(t){return function(){t.parentNode&&t.parentNode===a&&a.removeChild(t)}}(i))};FlexChartAnimation.prototype._playLoadScatterAnimation=function(t,e){var i=this,n=i._chart,a=n.series[e],o=i.animationMode,r=a.hostElement,s=a._xValues||n._xvals;0===s.length&&(s=a._pointIndexes);[].slice.call(r.childNodes).forEach((function(n,a){var r;r=o===AnimationMode.Point?i._getScatterAnimation(t,s[a]):o===AnimationMode.Series?i._getAnimation(t,e):i._getAnimation(t,0);i._setLoadScatterAnimation(r,n,!1)}))};FlexChartAnimation.prototype._setLoadScatterAnimation=function(t,e,i,n){var a=this;void 0===i&&(i=!1);var o,r,s={},l={};if("g"===e.nodeName&&e.childNodes)[].slice.call(e.childNodes).forEach((function(e){a._setLoadScatterAnimation(t,e,i,n)}));else{["rx","ry","stroke-width"].forEach((function(t){var i=e.getAttribute(t);s[t]=0;l[t]=Number(i)}));o=i?l:s;r=i?s:l;this._setInitState(e,o,r);t.push({ele:e,from:o,to:r,done:n})}};FlexChartAnimation.prototype._setUpdateScatterAnimation=function(t,e,i,n){var a={},o={};["cx","cy"].forEach((function(t){var n=e.getAttribute(t),r=i.getAttribute(t);if(n!==r){a[t]=Number(n);o[t]=Number(r)}}));this._setInitState(i,a,o);t.push({ele:i,from:a,to:o,done:n})};FlexChartAnimation.prototype._getScatterAnimation=function(t,e){var i=this._getScatterAnimationIndex(t,e);t[i]||(t[i]=[]);return t[i]};FlexChartAnimation.prototype._getScatterAnimationIndex=function(t,e){var i=this._chart.axisX,n=null==i.min?i.actualMin:i.min,a=null==i.max?i.actualMax:i.max;return Math.ceil((e-n)/((a-n)/20))};FlexChartAnimation.prototype._playScatterRemoveAnimation=function(t,e){var i=this,n=i._chart.series[0].hostElement.parentNode,a=i._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){i._setLoadScatterAnimation(a,t,!0)}));a.length&&(a[0].done=function(){e&&e.parentNode===n&&n.removeChild(e)})};FlexChartAnimation.prototype._playScatterAddAnimation=function(t,e){var i=this,n=e.hostElement,a=this._getAnimation(t,0);[].slice.call(n.childNodes).forEach((function(t){i._setLoadScatterAnimation(a,t,!1)}))};FlexChartAnimation.prototype._playScatterMoveAnimation=function(t,e,i){var n,a,o,r,s,l,c,u=this,h=(u._chart,u._getAnimation(t,0));n=e.hostElement;o=[].slice.call(i.childNodes);if(u._addStart){c=0;r=o[0];for(;c<u._addStart;){o.splice(0,0,r);c++}}if(u._removeStart){c=0;r=o[o.length-1];for(;c<u._removeStart;){var m=o.shift();o.push(m);c++}}s=o.length;a=[].slice.call(n.childNodes);l=a.length;a.forEach((function(t,e){if(e<s){if(e<u._addStart)u._setLoadScatterAnimation(h,t,!1);else if(e>=s-u._removeStart){u._setLoadScatterAnimation(h,t,!1);r=o[e];u._removeScatterAnimation(h,t,r)}else{r=o[e];u._setUpdateScatterAnimation(h,r,t)}if(e===l-1&&e<s-1)for(e++;e<s;e++){r=o[e];u._removeScatterAnimation(h,t,r)}}else u._setLoadScatterAnimation(h,t,!1)}))};FlexChartAnimation.prototype._removeScatterAnimation=function(t,e,i){var n=e.parentNode;n.appendChild(i);this._setLoadScatterAnimation(t,i,!0,function(t){return function(){t.parentNode&&t.parentNode===n&&n.removeChild(t)}}(i))};FlexChartAnimation.prototype._playDefaultAnimation=function(t,e){var i,n,a=this._chart,o=a.series[e].hostElement,r=a._plotRect,s=a._currentRenderEngine,l=o.getAttribute("clip-path"),c="clipPath"+(1e6*Math.random()).toFixed(),u=a.axisX.reversed;s.addClipRect(new wijmo_1.Rect(u?r.right:r.left,r.top,0,r.height),c);o.setAttribute("clip-path","url(#"+c+")");i=a.hostElement.querySelector("#"+c);n=this._getAnimation(t,0);var h={width:0},m={width:r.width};if(u){h.x=r.right;m.x=r.left}n.push({ele:i.querySelector("rect"),from:h,to:m,done:function(){if(o){l?o.setAttribute("clip-path",l):o.removeAttribute("clip-path");i&&i.parentNode&&i.parentNode.removeChild(i)}}})};return FlexChartAnimation}(FlexAnimation),FlexRadarAnimation=function(t){__extends(FlexRadarAnimation,t);function FlexRadarAnimation(e,i){return t.call(this,e,i)||this}FlexRadarAnimation.prototype._getDurationAndDelay=function(e,i){var n=t.prototype._getDurationAndDelay.call(this,e,i);if(this.animationMode===AnimationMode.Point){n.duration=i/e;n.delay=i/e}return n};FlexRadarAnimation.prototype._playAxesAnimation=function(){};FlexRadarAnimation.prototype._getChartType=function(e){var i=t.prototype._getChartType.call(this,e);"Bar"===i&&(i="Column");return i};FlexRadarAnimation.prototype._playLoadLineAnimation=function(t,e){var i,n,a,o=this,r=o._chart,s=o._chart.series[e],l=s._xValues||r._xvals,c=o.animationMode,u=s.hostElement;if(c===AnimationMode.Point){0===l.length&&(l=s._pointIndexes);a=[].slice.call(u.childNodes);n=a.length-u.querySelectorAll("ellipse").length;a.forEach((function(e,i){o._setRadarLinePointAnimation(t,e,i,l,n)}))}else{i=c===AnimationMode.All?o._getAnimation(t,0):o._getAnimation(t,e);[].slice.call(u.childNodes).forEach((function(t){o._setLineRiseDiveAnimation(i,t,!0)}))}};FlexRadarAnimation.prototype._setRadarLinePointAnimation=function(t,e,i,n,a){var o,r,s,l,c,u,h,m=this,p=m._chart,_=e.nodeName,f=[],d=[],A=[],y=[],x=p._center,g=[],E=!1,v={},C={},S=0;if("polyline"===_||"polygon"===_){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){g[h=m._getScatterAnimationIndex(t,n[r])]||(g[h]=[]);g[h].push(r);s=l[r]||l.getItem(r);f.push({x:x.x,y:x.y});d.push({x:s.x,y:s.y})}for(r=0,o=g.length;r<o;r++)if(g[r]){u=m._getAnimation(t,S);A=y.length?y.slice():f.slice();y=A.slice();g[r].forEach((function(t){var e=d[t];y[t]={x:e.x,y:e.y}}));C={};(v={})[_]=A;C[_]=y;if(!E){m._setInitState(e,v,C);E=!0}u.push({ele:e,from:v,to:C,done:c});S++}}else if("ellipse"===_){if((r=i-(a||0))<0)return;u=p._isPolar?m._getScatterAnimation(t,n[r]):m._getScatterAnimation(t,r);m._toggleVisibility(e,!1);c=function(){m._toggleVisibility(e,!0)};u.push({ele:e,from:v,to:C,done:c})}};FlexRadarAnimation.prototype._setLineRiseDiveAnimation=function(t,e,i){var n,a,o,r,s,l,c,u=this,h=u._chart,m=e.nodeName,p=[],_=[],f=h._center,d={},A={};if("polyline"===m||"polygon"===m){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){s=l[r]||l.getItem(r);p.push({x:f.x,y:f.y});_.push({x:s.x,y:s.y})}d[m]=p;A[m]=_}else if("ellipse"===m){u._toggleVisibility(e,!1);i&&(c=function(){u._toggleVisibility(e,!0)})}n=i?d:A;a=i?A:d;u._setInitState(e,n,a);t.push({ele:e,from:n,to:a,done:c})};FlexRadarAnimation.prototype._parsePathByRadius=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,c=t.sweep;n=[o,r,0,l,c,0];a=[o,r,s,l,c,t.innerRadius||0];e.pie=n;i.pie=a};FlexRadarAnimation.prototype._playUpdateAnimation=function(e,i,n,a,o){if("Bar"===n||"Column"===n){if(null==a)return;this._playLoadBarAnimation(e,i,!1)}else t.prototype._playUpdateAnimation.call(this,e,i,n,a,o)};FlexRadarAnimation.prototype._playLoadBarAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart,o=a.series[e],r=a._areas[e],s=n.animationMode,l=o.hostElement;[].slice.call(l.childNodes).forEach((function(i,a){var o,l,c={},u={};o=s===AnimationMode.Point?n._getAnimation(t,a):s===AnimationMode.Series?n._getAnimation(t,e):n._getAnimation(t,0);l=r[a];n._parsePathByRadius(l,c,u);n._setInitState(i,c,u);o.push({ele:i,from:c,to:u})}))};return FlexRadarAnimation}(FlexChartAnimation),AnimationHelper=function(){function AnimationHelper(){}AnimationHelper.playAnimations=function(t,e,i,n,a,o,r){void 0===a&&(a=Easing.Swing);var s=t.length,l=0,c=[];t.forEach((function(t,u){var h=AnimationHelper.playAnimation(t,e[u],i[u],(function(){l===s-1&&n&&n();l++}),a,o,r);c.push(h)}));return c};AnimationHelper.playAnimation=function(t,e,i,n,a,o,r){void 0===a&&(a=Easing.Swing);var s=AnimationHelper.parseAttrs(e,i);return AnimationHelper.animate((function(e){AnimationHelper.setElementAttr(t,s,e)}),n,a,o,r)};AnimationHelper.setElementAttr=function(t,e,i){var n,a;for(a in e){n=e[a];AnimationHelper.calcValue(n,i);t.setAttribute(a,n.getValue(n.value,i))}};AnimationHelper.getPathDescOfPie=function(t,e,i,n,a,o){void 0===o&&(o=0);var r=!1;if(a>=2*Math.PI){r=!0;a=2*Math.PI-.001}var s=new wijmo_1.Point(t,e);s.x+=i*Math.cos(n);s.y+=i*Math.sin(n);var l=n+a,c=new wijmo_1.Point(t,e);c.x+=i*Math.cos(l);c.y+=i*Math.sin(l);if(o){var u=new wijmo_1.Point(t,e);u.x+=o*Math.cos(l);u.y+=o*Math.sin(l);var h=new wijmo_1.Point(t,e);h.x+=o*Math.cos(n);h.y+=o*Math.sin(n)}var m=" 0 0,1 ",p=" 0 0,0 ";if(Math.abs(a)>Math.PI){m=" 0 1,1 ";p=" 0 1,0 "}var _="M "+s.x.toFixed(3)+","+s.y.toFixed(3);_+=" A "+i.toFixed(3)+","+i.toFixed(3)+m;_+=c.x.toFixed(3)+","+c.y.toFixed(3);if(o){_+=r?" M "+u.x.toFixed(3)+","+u.y.toFixed(3):" L "+u.x.toFixed(3)+","+u.y.toFixed(3);_+=" A "+o.toFixed(3)+","+o.toFixed(3)+p;_+=h.x.toFixed(3)+","+h.y.toFixed(3)}else _+=" L "+t.toFixed(3)+","+e.toFixed(3);r||(_+=" z");return _};AnimationHelper.parseAttrs=function(t,e){var i={};for(var n in t)if(null!=e[n])switch(n){case"polyline":i.points=AnimationHelper.parseAttr(t[n],e[n],(function(t,e){if(1===e){for(var i,n,a;t.length>1;){n=t[0];a=t[1];if(n.x!==a.x||n.y!==a.y){n=null;a=null;break}t.splice(1,1)}for(i=t.length-1;i>0;i--){n=a;a=t[i];if(n){if(n.x!==a.x||n.y!==a.y)break;t.pop()}}}return t.map((function(t){return t.x+","+t.y})).join(" ")}));break;case"polygon":i.points=AnimationHelper.parseAttr(t[n],e[n],(function(t,e){if(1===e){var i,n,a,o,r;o=t.pop();r=t.pop();for(;t.length>1;){n=t[0];a=t[1];if(n.x!==a.x||n.y!==a.y){n=null;a=null;break}t.splice(1,1)}for(i=t.length-1;i>=0;i--){n=a;a=t[i];if(n){if(n.x!==a.x||n.y!==a.y)break;t.splice(i,1)}}t.push(r);t.push(o)}return t.map((function(t){return t.x+","+t.y})).join(" ")}));break;case"d":i[n]=AnimationHelper.parseAttr(t[n],e[n],(function(t){return t.map((function(t){return"string"==typeof t?t:t[0]+","+t[1]})).join(" ")}));break;case"pie":i.d=AnimationHelper.parseAttr(t[n],e[n],(function(t){return AnimationHelper.getPathDescOfPie.apply(AnimationHelper,t)}));break;case"rotate":i.transform=AnimationHelper.parseAttr(t[n],e[n],(function(t){return"rotate("+t.join(" ")+")"}));break;case"x":case"width":case"height":case"rx":case"ry":case"stroke-width":i[n]=AnimationHelper.parseAttr(t[n],e[n],(function(t){return Math.abs(t)}));break;default:i[n]=AnimationHelper.parseAttr(t[n],e[n])}return i};AnimationHelper.animate=function(t,e,i,n,a){void 0===i&&(i=Easing.Swing);void 0===n&&(n=400);void 0===a&&(a=16);wijmo_1.asFunction(t);wijmo_1.asNumber(n,!1,!0);wijmo_1.asNumber(a,!1,!0);var o=0,r=setInterval((function(){Date.now();var s=o/n;s=EasingHelper[Easing[i]](s);t(s);if((o+=a)>=n){clearInterval(r);(s<1||s>1)&&t(1);e&&e()}}),a);return r};AnimationHelper.calcValue=function(t,e){var i=t.from,n=t.diff,a=t.value;wijmo_1.isNumber(i)?t.value=0===n?i:i+n*e:wijmo_1.isArray(i)&&AnimationHelper.parseArrayAttr(a,i,n,(function(t,i){return"number"==typeof t?t+i*e:t}))};AnimationHelper.parseAttr=function(t,e,i){var n,a,o,r;if(wijmo_1.isArray(t)&&wijmo_1.isArray(e)){a=e;o=[];r=(n=t).slice();AnimationHelper.parseArrayAttr(o,n,a,(function(t,e){return t===e?0:e-t}))}else{r=n=Number(t);o=(a=Number(e))-n}return{from:n,to:a,value:r,diff:o,getValue:i||function(t,e){return t}}};AnimationHelper.parseArrayAttr=function(t,e,i,n){e.forEach((function(e,a){var o={},r=[],s=i[a];if(wijmo_1.isNumber(e)||"string"==typeof e)t[a]=n(e,s);else if(wijmo_1.isArray(e)){e.forEach((function(t,i){r[i]=n(e[i],s[i])}));t[a]=r}else{Object.getOwnPropertyNames(e).forEach((function(t){o[t]=n(e[t],s[t])}));t[a]=o}}))};return AnimationHelper}(),EasingHelper=function(){function EasingHelper(){}EasingHelper.Linear=function(t){return t};EasingHelper.Swing=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)};EasingHelper.EaseInQuad=function(t){return t*t};EasingHelper.EaseOutQuad=function(t){return t*(2-t)};EasingHelper.EaseInOutQuad=function(t){return t<.5?2*t*t:(4-2*t)*t-1};EasingHelper.EaseInCubic=function(t){return t*t*t};EasingHelper.EaseOutCubic=function(t){return--t*t*t+1};EasingHelper.EaseInOutCubic=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1};EasingHelper.EaseInQuart=function(t){return t*t*t*t};EasingHelper.EaseOutQuart=function(t){return 1- --t*t*t*t};EasingHelper.EaseInOutQuart=function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t};EasingHelper.EaseInQuint=function(t){return t*t*t*t*t};EasingHelper.EaseOutQuint=function(t){return 1+--t*t*t*t*t};EasingHelper.EaseInOutQuint=function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};EasingHelper.EaseInSine=function(t){return 1-Math.cos(t*(Math.PI/2))};EasingHelper.EaseOutSine=function(t){return Math.sin(t*(Math.PI/2))};EasingHelper.EaseInOutSine=function(t){return-.5*(Math.cos(Math.PI*t)-1)};EasingHelper.EaseInExpo=function(t){return 0==t?0:Math.pow(2,10*(t-1))};EasingHelper.EaseOutExpo=function(t){return 1==t?1:1-Math.pow(2,-10*t)};EasingHelper.EaseInOutExpo=function(t){return t==!!t?t:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))};EasingHelper.EaseInCirc=function(t){return-(Math.sqrt(1-t*t)-1)};EasingHelper.EaseOutCirc=function(t){return Math.sqrt(1-Math.pow(t-1,2))};EasingHelper.EaseInOutCirc=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)};EasingHelper.EaseInBack=function(t){var e=1.70158;return t*t*((e+1)*t-e)};EasingHelper.EaseOutBack=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1};EasingHelper.EaseInOutBack=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)};EasingHelper.EaseInBounce=function(t){return 1-EasingHelper.EaseOutBounce(1-t)};EasingHelper.EaseOutBounce=function(t){var e=7.5625;return t<1/2.75?e*t*t:t<2/2.75?e*(t-=1.5/2.75)*t+.75:t<2.5/2.75?e*(t-=2.25/2.75)*t+.9375:e*(t-=2.625/2.75)*t+.984375};EasingHelper.EaseInOutBounce=function(t){return t<.5?.5*EasingHelper.EaseInBounce(2*t):.5*EasingHelper.EaseOutBounce(2*t-1)+.5};EasingHelper.EaseInElastic=function(t){return t==!!t?t:-Math.pow(2,10*(t-=1))*Math.sin((t-.075)*(2*Math.PI)/.3)};EasingHelper.EaseOutElastic=function(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1};EasingHelper.EaseInOutElastic=function(t){return t==!!t?t:(t*=2)<1?Math.pow(2,10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*-.5:Math.pow(2,-10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*.5+1};return EasingHelper}();wijmo_1._registerModule("wijmo.chart.animation",selfModule); | ||
"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};return function(t,e){extendStatics(t,e);function __(){this.constructor=t}t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}(),__importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);e.default=t;return e};Object.defineProperty(exports,"__esModule",{value:!0});var Easing,AnimationMode,wijmo_1=require("@grapecity/wijmo"),wijmo_chart_1=require("@grapecity/wijmo.chart"),selfModule=__importStar(require("@grapecity/wijmo.chart.animation"));function softFinancial(){return wijmo_1._getModule("wijmo.chart.finance")}exports.softFinancial=softFinancial;function softRadar(){return wijmo_1._getModule("wijmo.chart.radar")}exports.softRadar=softRadar;!function(t){t[t.Linear=0]="Linear";t[t.Swing=1]="Swing";t[t.EaseInQuad=2]="EaseInQuad";t[t.EaseOutQuad=3]="EaseOutQuad";t[t.EaseInOutQuad=4]="EaseInOutQuad";t[t.EaseInCubic=5]="EaseInCubic";t[t.EaseOutCubic=6]="EaseOutCubic";t[t.EaseInOutCubic=7]="EaseInOutCubic";t[t.EaseInQuart=8]="EaseInQuart";t[t.EaseOutQuart=9]="EaseOutQuart";t[t.EaseInOutQuart=10]="EaseInOutQuart";t[t.EaseInQuint=11]="EaseInQuint";t[t.EaseOutQuint=12]="EaseOutQuint";t[t.EaseInOutQuint=13]="EaseInOutQuint";t[t.EaseInSine=14]="EaseInSine";t[t.EaseOutSine=15]="EaseOutSine";t[t.EaseInOutSine=16]="EaseInOutSine";t[t.EaseInExpo=17]="EaseInExpo";t[t.EaseOutExpo=18]="EaseOutExpo";t[t.EaseInOutExpo=19]="EaseInOutExpo";t[t.EaseInCirc=20]="EaseInCirc";t[t.EaseOutCirc=21]="EaseOutCirc";t[t.EaseInOutCirc=22]="EaseInOutCirc";t[t.EaseInBack=23]="EaseInBack";t[t.EaseOutBack=24]="EaseOutBack";t[t.EaseInOutBack=25]="EaseInOutBack";t[t.EaseInBounce=26]="EaseInBounce";t[t.EaseOutBounce=27]="EaseOutBounce";t[t.EaseInOutBounce=28]="EaseInOutBounce";t[t.EaseInElastic=29]="EaseInElastic";t[t.EaseOutElastic=30]="EaseOutElastic";t[t.EaseInOutElastic=31]="EaseInOutElastic"}(Easing=exports.Easing||(exports.Easing={}));!function(t){t[t.All=0]="All";t[t.Point=1]="Point";t[t.Series=2]="Series"}(AnimationMode=exports.AnimationMode||(exports.AnimationMode={}));var ChartAnimation=function(){function ChartAnimation(t,e){this._play=!0;this.ended=new wijmo_1.Event;var i=this,n=t.hostElement,a=new wijmo_1.Size(n.offsetWidth,n.offsetHeight);i._chart=t;i._updateEventArgs=[];if(t instanceof wijmo_chart_1.FlexPie)i._animation=new FlexPieAnimation(t,i._updateEventArgs);else{softRadar()&&t instanceof softRadar().FlexRadar?i._animation=new FlexRadarAnimation(t,i._updateEventArgs):t instanceof wijmo_chart_1.FlexChartCore&&(i._animation=new FlexChartAnimation(t,i._updateEventArgs));i._chartType=t.chartType}wijmo_1.assert(void 0!==i._animation,"Animation is not supported");i._initOptions(e);t.beginUpdate();window.setTimeout((function(){t.rendered.addHandler(i._playAnimation,i);t.endUpdate()}),0);i._setCV(t.collectionView);window.addEventListener("resize",(function(t){var e=new wijmo_1.Size(n.offsetWidth,n.offsetHeight);if(!a.equals(e)){i._play=!1;a=e}}))}ChartAnimation.prototype._initOptions=function(t){if(t){t.duration&&(this.duration=t.duration);t.easing&&(this.easing=t.easing);t.animationMode&&(this.animationMode=t.animationMode);void 0!==t.axisAnimation&&(this.axisAnimation=t.axisAnimation)}};ChartAnimation.prototype._setCV=function(t){this._cv=t;this._animation._clearState()};Object.defineProperty(ChartAnimation.prototype,"animationMode",{get:function(){return this._animation.animationMode},set:function(t){(t=wijmo_1.asEnum(t,AnimationMode))!=this.animationMode&&(this._animation.animationMode=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"easing",{get:function(){return this._animation.easing},set:function(t){(t=wijmo_1.asEnum(t,Easing))!=this.easing&&(this._animation.easing=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"duration",{get:function(){return this._animation.duration},set:function(t){(t=wijmo_1.asNumber(t))!=this.duration&&(this._animation.duration=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"axisAnimation",{get:function(){return this._animation.axisAnimation},set:function(t){(t=wijmo_1.asBoolean(t))!=this.axisAnimation&&(this._animation.axisAnimation=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartAnimation.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0});ChartAnimation.prototype._playAnimation=function(){var t=this,e=t._chart,i=e.chartType;t._cv!==e.collectionView&&t._setCV(e.collectionView);if(null!=t._chartType&&t._chartType!==i){t._chartType=i;t._animation._clearState()}t._play?t._animation.playAnimation((function(){return t.ended.raise(t,wijmo_1.EventArgs.empty)})):t._play=!0};ChartAnimation.prototype.animate=function(){var t=this._chart;if(t){var e=t.itemsSource;t.beginUpdate();t.itemsSource=null;t.itemsSource=e;t.endUpdate()}};return ChartAnimation}();exports.ChartAnimation=ChartAnimation;var FlexAnimation=function(){function FlexAnimation(t,e){this._axisAnimation=!0;this._chart=t;this._timers=[]}Object.defineProperty(FlexAnimation.prototype,"animationMode",{get:function(){return this._animationMode||AnimationMode.All},set:function(t){if((t=wijmo_1.asEnum(t,AnimationMode,!1))!==this._animationMode){this._clearState();this._animationMode=t}},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"easing",{get:function(){return null==this._easing?Easing.Swing:this._easing},set:function(t){t!==this._easing&&(this._easing=wijmo_1.asEnum(t,Easing,!1))},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"duration",{get:function(){return this._duration||400},set:function(t){t!==this._duration&&(this._duration=wijmo_1.asNumber(t,!1,!0))},enumerable:!0,configurable:!0});Object.defineProperty(FlexAnimation.prototype,"axisAnimation",{get:function(){return!!this._axisAnimation},set:function(t){t!==this._axisAnimation&&(this._axisAnimation=wijmo_1.asBoolean(t,!1))},enumerable:!0,configurable:!0});FlexAnimation.prototype.playAnimation=function(t){};FlexAnimation.prototype._clearState=function(){this._previousState&&(this._previousState=null);this._currentState&&(this._currentState=null)};FlexAnimation.prototype._setInitState=function(t,e,i){var n=AnimationHelper.parseAttrs(e,i);AnimationHelper.setElementAttr(t,n,0)};FlexAnimation.prototype._getAnimation=function(t,e){t[e]||(t[e]=[]);return t[e]};FlexAnimation.prototype._toggleVisibility=function(t,e){e?AnimationHelper.playAnimation(t,{opacity:0},{opacity:1},null,Easing.Swing,100):t.setAttribute("opacity","0")};FlexAnimation.prototype._toggleDataLabelVisibility=function(t){var e=this._chart.hostElement,i=e&&e.querySelector("."+wijmo_chart_1.DataLabelClsNames.labels);i&&this._toggleVisibility(i,t)};FlexAnimation.prototype._playAnimation=function(t,e){var i,n=this,a=this,o=a.duration,r=a.easing,s=t.length;a._toggleDataLabelVisibility(!1);i=a._getDurationAndDelay(t.length,o);if(this._timers&&this._timers.length){this._timers.forEach((function(t){return window.clearInterval(t)}));this._timers.length=0}t.forEach((function(t,o){var l;if(t){l=window.setTimeout((function(){var l;t.forEach((function(t,c){if(t&&t.ele){if(o===s-1&&0===c){var u=t.done;t.done=function(){a._toggleDataLabelVisibility(!0);u&&u();e&&e()}}if(wijmo_1.isArray(t.ele)){l=AnimationHelper.playAnimations(t.ele,t.from,t.to,t.done,r,i.duration);n._timers=n._timers.concat.apply(l)}else{l=AnimationHelper.playAnimation(t.ele,t.from,t.to,t.done,r,i.duration);n._timers.push(l)}}}))}),i.delay*o);n._timers.push(l)}}))};FlexAnimation.prototype._getDurationAndDelay=function(t,e){var i={duration:e,delay:0};if(t>1)if(this._previousState){i.duration=e/t;i.delay=e/t}else{i.duration=.5*e;i.delay=.5*e/(t-1)}return i};return FlexAnimation}(),FlexPieAnimation=function(t){__extends(FlexPieAnimation,t);function FlexPieAnimation(e,i){var n=t.call(this,e,i)||this;e.selectionChanged.addHandler(n._selectionChanged,n);return n}FlexPieAnimation.prototype._selectionChanged=function(){this._isSelectionChanged=!0};FlexPieAnimation.prototype._clearState=function(){t.prototype._clearState.call(this);this._isSelectionChanged=!1};FlexPieAnimation.prototype._getElementRotate=function(t){var e,i=t.getAttribute("transform");if(i&&i.indexOf("rotate")>-1){if(1==(i=(i=i.replace("rotate(","").replace(")","")).indexOf(",")>-1?i.split(",").map((function(t){return+t})):i.split(" ").map((function(t){return+t}))).length){e=this._chart._areas[0].center;i.push(e.x,e.y)}}else i=[0,(e=this._chart._areas[0].center).x,e.y];return i};FlexPieAnimation.prototype._getDurationAndDelay=function(t,e){var i={duration:e,delay:0};if(this.animationMode===AnimationMode.Point&&t>1){i.duration=e/t;i.delay=e/t}return i};FlexPieAnimation.prototype.playAnimation=function(e){t.prototype.playAnimation.call(this,e);var i=[];this._playPieAnimation(i);i.length&&this._playAnimation(i,e)};FlexPieAnimation.prototype._playPieAnimation=function(t){var e=this._chart,i=!0;this._previousState=this._currentState;this._currentState={areas:e._areas,pels:e._pels,rotate:e._pels.length&&this._getElementRotate(e._pels[0].parentNode)};this._previousState&&(i=!1);if(this._isSelectionChanged){e.isAnimated||this._playSelectPieAnimation(t);this._isSelectionChanged=!1}else i?this._playLoadPieAnimation(t):this._playUpdatePieAnimation(t)};FlexPieAnimation.prototype._playSelectPieAnimation=function(t){if(null!=this._previousState){var e,i,n,a=this._chart._pels[0].parentNode,o=this._previousState.rotate,r=this._getElementRotate(a),s=o[0],l=r[0];if(s!==l){s-l>180?r[0]+=360:l-s>180&&(o[0]+=360);e=this._getAnimation(t,0);i={rotate:o};n={rotate:r};this._setInitState(a,i,n);e.push({ele:a,from:i,to:n})}}};FlexPieAnimation.prototype._playUpdatePieAnimation=function(t){var e,i,n,a,o=this._chart,r=this._previousState,s=o._areas,l=o._pels,c=r.areas.length,u=s.length,h=Math.max(u,c),m=this._getAnimation(t,0),p=0;if(0!==u&&0!==c){this._playSelectPieAnimation(t);for(e=0;e<h;e++){i={};if(l[e]&&l[e].childNodes&&l[e].childNodes.length>0){if(e<u&&e<c){n=s[0];0===e&&(p=n.angle);1===c?l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(n.center.x,n.center.y,n.radius,p,2*Math.PI,n.innerRadius||0)):l[e].childNodes[0].setAttribute("d",r.pels[e].childNodes[0].getAttribute("d"))}if(e<u){n=s[e];i.to={pie:[n.center.x,n.center.y,n.radius,n.angle,n.sweep,n.innerRadius||0]};i.ele=l[e].childNodes[0]}else{n=s[0];a=r.pels[e];i.to={pie:[n.center.x,n.center.y,n.radius,p+2*Math.PI,0,n.innerRadius||0]};l[0].parentNode.appendChild(a);i.done=function(t){return function(){t.parentNode.removeChild(t)}}(a);i.ele=a.childNodes[0]}if(e<c){n=r.areas[e];i.from={pie:[n.center.x,n.center.y,n.radius,n.angle,n.sweep,n.innerRadius||0]}}else{l[e].childNodes[0].setAttribute("d",AnimationHelper.getPathDescOfPie(n.center.x,n.center.y,n.radius,2*Math.PI+p,0,n.innerRadius||0));n=r.areas[0];i.from={pie:[n.center.x,n.center.y,n.radius,2*Math.PI+p,0,n.innerRadius||0]}}m.push(i)}}}};FlexPieAnimation.prototype._playLoadPieAnimation=function(t){var e=this,i=e._chart,n=e.animationMode,a=i._areas;i._pels.forEach((function(i,o){var r,s=i.childNodes[0],l={},c={};if(s){if(n===AnimationMode.Point){e._parsePathByAngle(a[o],l,c);r=e._getAnimation(t,o)}else{e._parsePathByRadius(a[o],l,c);r=e._getAnimation(t,0)}e._setInitState(s,l,c);r.push({ele:s,from:l,to:c})}}))};FlexPieAnimation.prototype._parsePathByRadius=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,c=t.sweep;n=[o,r,0,l,c,0];a=[o,r,s,l,c,t.innerRadius||0];e.pie=n;i.pie=a};FlexPieAnimation.prototype._parsePathByAngle=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,c=t.sweep,u=t.innerRadius;n=[o,r,s,l,0,u||0];a=[o,r,s,l,c,u||0];e.pie=n;e["stroke-width"]=0;i.pie=a;i["stroke-width"]=1};return FlexPieAnimation}(FlexAnimation),FlexChartAnimation=function(t){__extends(FlexChartAnimation,t);function FlexChartAnimation(e,i){return t.call(this,e,i)||this}FlexChartAnimation.prototype.playAnimation=function(e){t.prototype.playAnimation.call(this,e);var i,n,a,o,r,s,l,c,u,h=!0,m=this._chart,p=softFinancial()&&m instanceof softFinancial().FinancialChart,_=m.series,f=_.length,d=[];this._previousState=this._currentState;this._previousXVal=this._currentXVal;this._currentState=[];this._addStart=0;this._removeStart=0;this._currentXVal=m._xlabels.slice();if(this._previousState&&this._previousState.length){h=!1;r=(s=this._previousState).length;l=this._previousXVal;c=this._currentXVal;l.length>2&&c.length>2&&((i=c.indexOf(l[0]))>0&&i<c.length-2?c[i+1]===l[1]&&c[i+2]===l[2]&&(this._addStart=i):(i=l.indexOf(c[0]))>0&&i<l.length-2&&l[i+1]===c[1]&&l[i+2]===c[2]&&(this._removeStart=i))}for(i=0;i<f;i++){o=null!=(n=_[i])._getChartType()?n._getChartType():m._getChartType();a=this._getChartType(o);this._currentState.push({seriesType:o,ele:n.hostElement});if(p)this._playDefaultAnimation(d,i);else{u=s&&s[i];if("Default"===a){this._playDefaultAnimation(d,i);continue}if(h||u&&u.seriesType!==o||u&&u.ele&&(""==u.ele.innerHTML||0===u.ele.childNodes.length))this._playLoadAnimation(d,i,a);else{this._playUpdateAnimation(d,i,a,n,u&&u.ele||null);if(i===f-1&&i<r-1)for(i++;i<=r-1;i++)this._playUpdateAnimation(d,i,a,null,u.ele)}}}this._adjustAnimations(a,d);d.length&&this._playAnimation(d,e);this.axisAnimation&&!p&&this._playAxesAnimation()};FlexChartAnimation.prototype._playAxesAnimation=function(){var t,e,i,n=this._chart.axes,a=n.length;this._prevAxesStates=this._currAxesStates;this._currAxesStates=[];for(e=0;e<a;e++)(t=n[e]).hostElement&&this._currAxesStates.push({ele:t.hostElement,vals:t._vals,axis:t,maxValue:wijmo_1.isDate(t.actualMax)?t.actualMax.getTime():t.actualMax,minValue:wijmo_1.isDate(t.actualMin)?t.actualMin.getTime():t.actualMin});if(this._prevAxesStates){i=Math.max(this._prevAxesStates.length,this._currAxesStates.length);for(e=0;e<i;e++)this._playAxisAnimation(this._prevAxesStates[e],this._currAxesStates[e])}};FlexChartAnimation.prototype._playAxisAnimation=function(t,e){if(t&&e){var i,n=[],a=[];if(e&&e.maxValue-e.minValue){i=this._parseAxisState(e);this._convertAxisAnimation(n,i.major,e.axis,t.maxValue,t.minValue);this._convertAxisAnimation(n,i.minor,e.axis,t.maxValue,t.minValue)}if(t&&t.maxValue-t.minValue){i=this._parseAxisState(t);this._convertAxisAnimation(a,i.major,t.axis);this._convertAxisAnimation(a,i.minor,t.axis)}n&&a&&this._combineAxisAnimations(n,a);this._playCurrAxisAnimation(n);this._playPrevAxisAnimation(a)}};FlexChartAnimation.prototype._combineAxisAnimations=function(t,e){var i,n,a=this,o=e.length;for(i=o-1;i>=0;i--)(n=e[i]).text&&t.some((function(t){if(t.text&&t.text===n.text){a._combineAxisAnimation(t,n);e.splice(i,1);return!0}}))};FlexChartAnimation.prototype._combineAxisAnimation=function(t,e){var i=this;["label","majorGrid","tick"].forEach((function(n){t[n]&&e[n]&&i._resetExistAxisAttrs(t[n],e[n])}))};FlexChartAnimation.prototype._resetExistAxisAttrs=function(t,e){var i=t.ele,n=e.ele,a={},o={};["x","y","x1","x2","y1","y2"].forEach((function(t){var e=i.getAttribute(t),r=n.getAttribute(t);if(e!==r){a[t]=r;o[t]=e}}));t.calcPos=a;t.elePos=o};FlexChartAnimation.prototype._convertAxisAnimation=function(t,e,i,n,a){var o,r=this,s=i.hostElement,l=i.axisType==wijmo_chart_1.AxisType.Y;e.forEach((function(e,c){var u=i.convert(e.val,n,a);if(!isNaN(u)){o={};e.majorGrid&&(o.majorGrid=r._getAxisAnimationAttrs(e.majorGrid,s,u,l));if(e.label){o.label=r._getAxisAnimationAttrs(e.label,s,u,l);o.text=e.label.innerHTML||e.label.textContent}e.tick&&(o.tick=r._getAxisAnimationAttrs(e.tick,s,u,l));t.push(o)}}))};FlexChartAnimation.prototype._getAxisAnimationAttrs=function(t,e,i,n){var a,o,r;a={ele:t,parent:e,elePos:{},calcPos:{}};if("text"===t.nodeName){o=n?"y":"x";r=Number(t.getAttribute(o));a.elePos[o]=r;a.calcPos[o]=i}else{o=n?"y1":"x1";r=Number(t.getAttribute(o));if(n){a.elePos={y1:r,y2:r};a.calcPos={y1:i,y2:i}}else{a.elePos={x1:r,x2:r};a.calcPos={x1:i,x2:i}}}a.elePos.opacity=1;a.calcPos.opacity=0;return a};FlexChartAnimation.prototype._playCurrAxisAnimation=function(t){var e=this.duration;t&&0!==t.length&&t.forEach((function(t){["majorGrid","label","tick"].forEach((function(i){var n=t[i];if(n){n.parent;var a=n.ele,o=n.elePos,r=n.calcPos;AnimationHelper.playAnimation(a,r,o,null,Easing.Swing,e)}}))}))};FlexChartAnimation.prototype._playPrevAxisAnimation=function(t){var e=this.duration;t&&0!==t.length&&t.forEach((function(t){["majorGrid","label","tick"].forEach((function(i){var n=t[i];if(n){var a=n.parent,o=n.ele,r=n.elePos,s=n.calcPos;a.appendChild(o);AnimationHelper.playAnimation(o,r,s,(function(){o.parentNode===a&&a.removeChild(o)}),Easing.Swing,e)}}))}))};FlexChartAnimation.prototype._parseAxisState=function(t){if(null==t)return null;var e,i,n,a=t.vals,o=t.axis,r=o.axisType==wijmo_chart_1.AxisType.Y,s=t.ele.childNodes,l=0,c=[],u=[];if(a){e=a.major;i=a.minor;n=a.hasLbls}e&&e.forEach((function(t,e){var i,a={},u=!!n[e];c.push(a);a.val=t;i=s[l];if(o.majorGrid&&wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_GRIDLINE)){a.majorGrid=i;i=s[++l]}if(r){if(u&&i&&o.majorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_TICK)){a.tick=i;i=s[++l]}if(u&&i&&(wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_LABEL)||i.querySelector("."+wijmo_chart_1.FlexChart._CSS_LABEL))){a.label=i;l++}}else{if(u&&i&&(wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_LABEL)||i.querySelector("."+wijmo_chart_1.FlexChart._CSS_LABEL))){a.label=i;i=s[++l]}if(u&&i&&o.majorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_TICK)){a.tick=i;l++}}}));i&&i.forEach((function(t,e){var i,n={};u.push(n);n.val=t;i=s[l];if(o.minorTickMarks!==wijmo_chart_1.TickMark.None&&wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_TICK_MINOR)){n.tick=i;i=s[++l]}if(o.minorGrid&&wijmo_1.hasClass(i,wijmo_chart_1.FlexChart._CSS_GRIDLINE_MINOR)){n.majorGrid=i;l++}}));return{major:c,minor:u}};FlexChartAnimation.prototype._playLoadAnimation=function(t,e,i){this["_playLoad"+i+"Animation"](t,e)};FlexChartAnimation.prototype._playUpdateAnimation=function(t,e,i,n,a){null==n||null==a?null==n?this["_play"+i+"RemoveAnimation"](t,a):this["_play"+i+"AddAnimation"](t,n):this["_play"+i+"MoveAnimation"](t,n,a)};FlexChartAnimation.prototype._adjustAnimations=function(t,e){var i,n=e.length;if("Column"===t||"Bar"===t)for(i=n-1;i>=0;i--)null==e[i]&&e.splice(i,1)};FlexChartAnimation.prototype._getChartType=function(t){var e="Default",i=this._chart._isRotated();switch(t){case wijmo_chart_1.ChartType.Scatter:case wijmo_chart_1.ChartType.Bubble:case wijmo_chart_1.ChartType.Candlestick:case wijmo_chart_1.ChartType.HighLowOpenClose:e="Scatter";break;case wijmo_chart_1.ChartType.Column:case wijmo_chart_1.ChartType.Bar:e=i?"Bar":"Column";break;case wijmo_chart_1.ChartType.Line:case wijmo_chart_1.ChartType.LineSymbols:case wijmo_chart_1.ChartType.Area:case wijmo_chart_1.ChartType.Spline:case wijmo_chart_1.ChartType.SplineSymbols:case wijmo_chart_1.ChartType.SplineArea:e="Line";break;default:e="Default"}return e};FlexChartAnimation.prototype._playLoadLineAnimation=function(t,e){var i,n=this,a=n._chart.series[e],o=n.animationMode,r=a.hostElement;if(o===AnimationMode.Point)n._playDefaultAnimation(t,e);else{i=o===AnimationMode.All?n._getAnimation(t,0):n._getAnimation(t,e);[].slice.call(r.childNodes).forEach((function(t){n._setLineRiseDiveAnimation(i,t,!0)}))}};FlexChartAnimation.prototype._setLineRiseDiveAnimation=function(t,e,i){var n,a,o,r,s,l,c,u=this,h=this,m=h._chart,p=e.nodeName,_=[],f=[],d=h._chart._plotRect,A=d.top+d.height,y=d.left,x={},g={};if("g"===p&&e.childNodes)[].slice.call(e.childNodes).forEach((function(e){u._setLineRiseDiveAnimation(t,e,i)}));else{if("polyline"===p||"polygon"===p){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){s=l[r]||l.getItem(r);m.rotated?_.push({x:y,y:s.y}):_.push({x:s.x,y:A});f.push({x:s.x,y:s.y})}x[p]=_;g[p]=f}else if("ellipse"===p||"rect"===p){h._toggleVisibility(e,!1);i&&(c=function(){h._toggleVisibility(e,!0)})}n=i?x:g;a=i?g:x;h._setInitState(e,n,a);t.push({ele:e,from:n,to:a,done:c})}};FlexChartAnimation.prototype._setLineMoveAnimation=function(t,e,i,n,a){if(null!=e&&null!=i){var o,r,s,l,c,u,h,m,p,_=e.nodeName,f=[],d=[],A={},y={};if("polyline"===_||"polygon"===_){p="polygon"===_;s=e.points;u=i.points;o=s.length||s.numberOfItems;l=u.length||u.numberOfItems;m=Math.max(o,l);for(h=0;h<m;h++){if(h<o){r=s[h]||s.getItem(h);f.push({x:r.x,y:r.y})}if(h<l){c=u[h]||u.getItem(h);d.push({x:c.x,y:c.y})}}if(this._addStart){this._adjustStartLinePoints(this._addStart,f,s);o+=this._addStart}else if(this._removeStart){this._adjustStartLinePoints(this._removeStart,d,u);l+=this._removeStart}l>o?this._adjustEndLinePoints(l,o,f,s,p):l<o&&this._adjustEndLinePoints(o,l,d,u,p);A[_]=f;y[_]=d;this._setInitState(n,A,y);t.push({ele:n,from:A,to:y,done:a})}}};FlexChartAnimation.prototype._adjustStartLinePoints=function(t,e,i){for(var n=i[0]||i.getItem(0);t;){e.splice(0,0,{x:n.x,y:n.y});t--}};FlexChartAnimation.prototype._adjustEndLinePoints=function(t,e,i,n,a){var o,r,s;if(a&&(n.length>=3||n.numberOfItems>=3)){r=i.pop();o=i.pop();s=n[n.length-3]||n.getItem(n.numberOfItems-3)}else(n.length>0||n.numberOfItems>0)&&(s=n[n.length-1]||n.getItem(n.numberOfItems-1));for(;t>e&&s;){i.push({x:s.x,y:s.y});e++}if(a&&r&&o){i.push(o);i.push(r)}};FlexChartAnimation.prototype._playLineRemoveAnimation=function(t,e){var i,n=this,a=n._chart.series[0].hostElement.parentNode,o=n._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){n._setLineRiseDiveAnimation(o,t,!1)}));if(o.length){i=o[0].done;o[0].done=function(){e&&e.parentNode===a&&a.removeChild(e);i&&i()}}};FlexChartAnimation.prototype._playLineAddAnimation=function(t,e){var i=this,n=e.hostElement,a=this._getAnimation(t,0);[].slice.call(n.childNodes).forEach((function(t){i._setLineRiseDiveAnimation(a,t,!0)}))};FlexChartAnimation.prototype._playLineMoveAnimation=function(t,e,i){var n,a,o,r,s=this,l=(s._chart,s._getAnimation(t,0)),c=[];n=e.hostElement;a=[].slice.call(i.childNodes);[].slice.call(n.childNodes).forEach((function(t,e){r=t.nodeName;o=a[e];if("g"===r&&t.nodeChilds)[].slice.call(t.nodeChilds).forEach((function(t,e){if(o){c.push(t);s._toggleVisibility(t,!1)}}));else if("polygon"===r||"polyline"===r)s._setLineMoveAnimation(l,o,t,t,0===e?function(){c.forEach((function(t){s._toggleVisibility(t,!0)}));c=null}:null);else if(o){c.push(t);s._toggleVisibility(t,!1)}}))};FlexChartAnimation.prototype._playLoadColumnAnimation=function(t,e){this._playLoadBarAnimation(t,e,!0)};FlexChartAnimation.prototype._playLoadBarAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart.series[e],o=n.animationMode,r=a.hostElement;[].slice.call(r.childNodes).forEach((function(a,r){var s,l=a.nodeName;s=o===AnimationMode.Point?n._getAnimation(t,r):o===AnimationMode.Series?n._getAnimation(t,e):n._getAnimation(t,0);"g"===l?a.childNodes&&[].slice.call(a.childNodes).forEach((function(t,e){n._setLoadBarAnimation(s,t,i)})):n._setLoadBarAnimation(s,a,i)}))};FlexChartAnimation.prototype._setBarAnimation=function(t,e,i,n,a){this._setInitState(e,i,n);t.push({ele:e,from:i,to:n,done:a})};FlexChartAnimation.prototype._setLoadBarAnimation=function(t,e,i,n,a){void 0===n&&(n=!1);var o,r,s=this,l=i?"height":"width",c=i?"y":"x",u=e.getAttribute(l),h=e.getAttribute(c),m=i?"top":"left",p=s._chart._plotRect,_={},f={};_[l]=0;f[l]=Number(u);if(i){_[c]=p[l]+p[m];f[c]=Number(h)}o=n?f:_;r=n?_:f;"g"===e.nodeName?e.childNodes&&[].slice.call(e.childNodes).forEach((function(e){s._setBarAnimation(t,e,o,r,a)})):s._setBarAnimation(t,e,o,r,a)};FlexChartAnimation.prototype._setMoveBarAnimation=function(t,e,i){var n={},a={};if(null!=e&&null!=i){["width","height","x","y","top","left"].forEach((function(t){var o=e.getAttribute(t),r=i.getAttribute(t);if(o!==r){n[t]=Number(o);a[t]=Number(r)}}));this._setInitState(i,n,a);t.push({ele:i,from:n,to:a})}};FlexChartAnimation.prototype._playColumnRemoveAnimation=function(t,e){this._playBarRemoveAnimation(t,e,!0)};FlexChartAnimation.prototype._playColumnAddAnimation=function(t,e){this._playBarAddAnimation(t,e,!0)};FlexChartAnimation.prototype._playColumnMoveAnimation=function(t,e,i){this._playBarMoveAnimation(t,e,i,!0)};FlexChartAnimation.prototype._playBarRemoveAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart.series[0].hostElement.parentNode,o=n._getAnimation(t,0);a.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){n._setLoadBarAnimation(o,t,i,!0)}));o.length&&(o[0].done=function(){e&&e.parentNode===a&&a.removeChild(e)})};FlexChartAnimation.prototype._playBarAddAnimation=function(t,e,i){var n=this;void 0===i&&(i=!1);var a=e.hostElement,o=this._getAnimation(t,2);[].slice.call(a.childNodes).forEach((function(t){n._setLoadBarAnimation(o,t,i,!1)}))};FlexChartAnimation.prototype._playBarMoveAnimation=function(t,e,i,n){void 0===n&&(n=!1);var a,o,r,s,l,c,u,h=this;h._chart;a=e.hostElement;r=[].slice.call(i.childNodes);if(h._addStart){u=0;s=r[0];for(;u<h._addStart;){r.splice(0,0,s);u++}}if(h._removeStart){u=0;s=r[r.length-1];for(;u<h._removeStart;){var m=r.shift();r.push(m);u++}}l=r.length;o=[].slice.call(a.childNodes);c=o.length;o.forEach((function(e,i){var a;if(i<l){s=r[i];if(i<h._addStart){a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1)}else if(i>=l-h._removeStart){a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1);a=h._getAnimation(t,0);h._removeBarAnimation(a,e,s,n)}else{a=h._getAnimation(t,1);h._setMoveBarAnimation(a,s,e)}if(i===c-1&&i<l-1){a=h._getAnimation(t,0);for(i++;i<l;i++){s=r[i];h._removeBarAnimation(a,e,s,n)}}}else{a=h._getAnimation(t,2);h._setLoadBarAnimation(a,e,n,!1)}}))};FlexChartAnimation.prototype._removeBarAnimation=function(t,e,i,n){var a=e.parentNode;a.appendChild(i);this._setLoadBarAnimation(t,i,n,!0,function(t){return function(){t.parentNode&&t.parentNode===a&&a.removeChild(t)}}(i))};FlexChartAnimation.prototype._playLoadScatterAnimation=function(t,e){var i=this,n=i._chart,a=n.series[e],o=i.animationMode,r=a.hostElement,s=a._xValues||n._xvals;0===s.length&&(s=a._pointIndexes);[].slice.call(r.childNodes).forEach((function(n,a){var r;r=o===AnimationMode.Point?i._getScatterAnimation(t,s[a]):o===AnimationMode.Series?i._getAnimation(t,e):i._getAnimation(t,0);i._setLoadScatterAnimation(r,n,!1)}))};FlexChartAnimation.prototype._setLoadScatterAnimation=function(t,e,i,n){var a=this;void 0===i&&(i=!1);var o,r,s={},l={};if("g"===e.nodeName&&e.childNodes)[].slice.call(e.childNodes).forEach((function(e){a._setLoadScatterAnimation(t,e,i,n)}));else{["rx","ry","stroke-width"].forEach((function(t){var i=e.getAttribute(t);s[t]=0;l[t]=Number(i)}));o=i?l:s;r=i?s:l;this._setInitState(e,o,r);t.push({ele:e,from:o,to:r,done:n})}};FlexChartAnimation.prototype._setUpdateScatterAnimation=function(t,e,i,n){var a={},o={};["cx","cy"].forEach((function(t){var n=e.getAttribute(t),r=i.getAttribute(t);if(n!==r){a[t]=Number(n);o[t]=Number(r)}}));this._setInitState(i,a,o);t.push({ele:i,from:a,to:o,done:n})};FlexChartAnimation.prototype._getScatterAnimation=function(t,e){var i=this._getScatterAnimationIndex(t,e);t[i]||(t[i]=[]);return t[i]};FlexChartAnimation.prototype._getScatterAnimationIndex=function(t,e){var i=this._chart.axisX,n=null==i.min?i.actualMin:i.min,a=null==i.max?i.actualMax:i.max;return Math.ceil((e-n)/((a-n)/20))};FlexChartAnimation.prototype._playScatterRemoveAnimation=function(t,e){var i=this,n=i._chart.series[0].hostElement.parentNode,a=i._getAnimation(t,0);n.appendChild(e);[].slice.call(e.childNodes).forEach((function(t){i._setLoadScatterAnimation(a,t,!0)}));a.length&&(a[0].done=function(){e&&e.parentNode===n&&n.removeChild(e)})};FlexChartAnimation.prototype._playScatterAddAnimation=function(t,e){var i=this,n=e.hostElement,a=this._getAnimation(t,0);[].slice.call(n.childNodes).forEach((function(t){i._setLoadScatterAnimation(a,t,!1)}))};FlexChartAnimation.prototype._playScatterMoveAnimation=function(t,e,i){var n,a,o,r,s,l,c,u=this,h=(u._chart,u._getAnimation(t,0));n=e.hostElement;o=[].slice.call(i.childNodes);if(u._addStart){c=0;r=o[0];for(;c<u._addStart;){o.splice(0,0,r);c++}}if(u._removeStart){c=0;r=o[o.length-1];for(;c<u._removeStart;){var m=o.shift();o.push(m);c++}}s=o.length;a=[].slice.call(n.childNodes);l=a.length;a.forEach((function(t,e){if(e<s){if(e<u._addStart)u._setLoadScatterAnimation(h,t,!1);else if(e>=s-u._removeStart){u._setLoadScatterAnimation(h,t,!1);r=o[e];u._removeScatterAnimation(h,t,r)}else{r=o[e];u._setUpdateScatterAnimation(h,r,t)}if(e===l-1&&e<s-1)for(e++;e<s;e++){r=o[e];u._removeScatterAnimation(h,t,r)}}else u._setLoadScatterAnimation(h,t,!1)}))};FlexChartAnimation.prototype._removeScatterAnimation=function(t,e,i){var n=e.parentNode;n.appendChild(i);this._setLoadScatterAnimation(t,i,!0,function(t){return function(){t.parentNode&&t.parentNode===n&&n.removeChild(t)}}(i))};FlexChartAnimation.prototype._playDefaultAnimation=function(t,e){var i,n,a=this._chart,o=a.series[e].hostElement,r=a._plotRect,s=a._currentRenderEngine,l=o.getAttribute("clip-path"),c="clipPath"+(1e6*Math.random()).toFixed(),u=a.axisX.reversed;s.addClipRect(new wijmo_1.Rect(u?r.right:r.left,r.top,0,r.height),c);o.setAttribute("clip-path","url(#"+c+")");i=a.hostElement.querySelector("#"+c);n=this._getAnimation(t,0);var h={width:0},m={width:r.width};if(u){h.x=r.right;m.x=r.left}n.push({ele:i.querySelector("rect"),from:h,to:m,done:function(){if(o){l?o.setAttribute("clip-path",l):o.removeAttribute("clip-path");i&&i.parentNode&&i.parentNode.removeChild(i)}}})};return FlexChartAnimation}(FlexAnimation),FlexRadarAnimation=function(t){__extends(FlexRadarAnimation,t);function FlexRadarAnimation(e,i){return t.call(this,e,i)||this}FlexRadarAnimation.prototype._getDurationAndDelay=function(e,i){var n=t.prototype._getDurationAndDelay.call(this,e,i);if(this.animationMode===AnimationMode.Point){n.duration=i/e;n.delay=i/e}return n};FlexRadarAnimation.prototype._playAxesAnimation=function(){};FlexRadarAnimation.prototype._getChartType=function(e){var i=t.prototype._getChartType.call(this,e);"Bar"===i&&(i="Column");return i};FlexRadarAnimation.prototype._playLoadLineAnimation=function(t,e){var i,n,a,o=this,r=o._chart,s=o._chart.series[e],l=s._xValues||r._xvals,c=o.animationMode,u=s.hostElement;if(c===AnimationMode.Point){0===l.length&&(l=s._pointIndexes);a=[].slice.call(u.childNodes);n=a.length-u.querySelectorAll("ellipse").length;a.forEach((function(e,i){o._setRadarLinePointAnimation(t,e,i,l,n)}))}else{i=c===AnimationMode.All?o._getAnimation(t,0):o._getAnimation(t,e);[].slice.call(u.childNodes).forEach((function(t){o._setLineRiseDiveAnimation(i,t,!0)}))}};FlexRadarAnimation.prototype._setRadarLinePointAnimation=function(t,e,i,n,a){var o,r,s,l,c,u,h,m=this,p=m._chart,_=e.nodeName,f=[],d=[],A=[],y=[],x=p._center,g=[],E=!1,v={},C={},S=0;if("polyline"===_||"polygon"===_){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){g[h=m._getScatterAnimationIndex(t,n[r])]||(g[h]=[]);g[h].push(r);s=l[r]||l.getItem(r);f.push({x:x.x,y:x.y});d.push({x:s.x,y:s.y})}for(r=0,o=g.length;r<o;r++)if(g[r]){u=m._getAnimation(t,S);A=y.length?y.slice():f.slice();y=A.slice();g[r].forEach((function(t){var e=d[t];y[t]={x:e.x,y:e.y}}));C={};(v={})[_]=A;C[_]=y;if(!E){m._setInitState(e,v,C);E=!0}u.push({ele:e,from:v,to:C,done:c});S++}}else if("ellipse"===_){if((r=i-(a||0))<0)return;u=p._isPolar?m._getScatterAnimation(t,n[r]):m._getScatterAnimation(t,r);m._toggleVisibility(e,!1);c=function(){m._toggleVisibility(e,!0)};u.push({ele:e,from:v,to:C,done:c})}};FlexRadarAnimation.prototype._setLineRiseDiveAnimation=function(t,e,i){var n,a,o,r,s,l,c,u=this,h=u._chart,m=e.nodeName,p=[],_=[],f=h._center,d={},A={};if("polyline"===m||"polygon"===m){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){s=l[r]||l.getItem(r);p.push({x:f.x,y:f.y});_.push({x:s.x,y:s.y})}d[m]=p;A[m]=_}else if("ellipse"===m){u._toggleVisibility(e,!1);i&&(c=function(){u._toggleVisibility(e,!0)})}n=i?d:A;a=i?A:d;u._setInitState(e,n,a);t.push({ele:e,from:n,to:a,done:c})};FlexRadarAnimation.prototype._parsePathByRadius=function(t,e,i){var n,a,o=t.center.x,r=t.center.y,s=t.radius,l=t.angle,c=t.sweep;n=[o,r,0,l,c,0];a=[o,r,s,l,c,t.innerRadius||0];e.pie=n;i.pie=a};FlexRadarAnimation.prototype._playUpdateAnimation=function(e,i,n,a,o){if("Bar"===n||"Column"===n){if(null==a)return;this._playLoadBarAnimation(e,i,!1)}else t.prototype._playUpdateAnimation.call(this,e,i,n,a,o)};FlexRadarAnimation.prototype._playLoadBarAnimation=function(t,e,i){void 0===i&&(i=!1);var n=this,a=n._chart,o=a.series[e],r=a._areas[e],s=n.animationMode,l=o.hostElement;[].slice.call(l.childNodes).forEach((function(i,a){var o,l,c={},u={};o=s===AnimationMode.Point?n._getAnimation(t,a):s===AnimationMode.Series?n._getAnimation(t,e):n._getAnimation(t,0);l=r[a];n._parsePathByRadius(l,c,u);n._setInitState(i,c,u);o.push({ele:i,from:c,to:u})}))};return FlexRadarAnimation}(FlexChartAnimation),AnimationHelper=function(){function AnimationHelper(){}AnimationHelper.playAnimations=function(t,e,i,n,a,o,r){void 0===a&&(a=Easing.Swing);var s=t.length,l=0,c=[];t.forEach((function(t,u){var h=AnimationHelper.playAnimation(t,e[u],i[u],(function(){l===s-1&&n&&n();l++}),a,o,r);c.push(h)}));return c};AnimationHelper.playAnimation=function(t,e,i,n,a,o,r){void 0===a&&(a=Easing.Swing);var s=AnimationHelper.parseAttrs(e,i);return AnimationHelper.animate((function(e){AnimationHelper.setElementAttr(t,s,e)}),n,a,o,r)};AnimationHelper.setElementAttr=function(t,e,i){var n,a;for(a in e){n=e[a];AnimationHelper.calcValue(n,i);t.setAttribute(a,n.getValue(n.value,i))}};AnimationHelper.getPathDescOfPie=function(t,e,i,n,a,o){void 0===o&&(o=0);var r=!1;if(a>=2*Math.PI){r=!0;a=2*Math.PI-.001}var s=new wijmo_1.Point(t,e);s.x+=i*Math.cos(n);s.y+=i*Math.sin(n);var l=n+a,c=new wijmo_1.Point(t,e);c.x+=i*Math.cos(l);c.y+=i*Math.sin(l);if(o){var u=new wijmo_1.Point(t,e);u.x+=o*Math.cos(l);u.y+=o*Math.sin(l);var h=new wijmo_1.Point(t,e);h.x+=o*Math.cos(n);h.y+=o*Math.sin(n)}var m=" 0 0,1 ",p=" 0 0,0 ";if(Math.abs(a)>Math.PI){m=" 0 1,1 ";p=" 0 1,0 "}var _="M "+s.x.toFixed(3)+","+s.y.toFixed(3);_+=" A "+i.toFixed(3)+","+i.toFixed(3)+m;_+=c.x.toFixed(3)+","+c.y.toFixed(3);if(o){_+=r?" M "+u.x.toFixed(3)+","+u.y.toFixed(3):" L "+u.x.toFixed(3)+","+u.y.toFixed(3);_+=" A "+o.toFixed(3)+","+o.toFixed(3)+p;_+=h.x.toFixed(3)+","+h.y.toFixed(3)}else _+=" L "+t.toFixed(3)+","+e.toFixed(3);r||(_+=" z");return _};AnimationHelper.parseAttrs=function(t,e){var i={};for(var n in t)if(null!=e[n])switch(n){case"polyline":i.points=AnimationHelper.parseAttr(t[n],e[n],(function(t,e){if(1===e){for(var i,n,a;t.length>1;){n=t[0];a=t[1];if(n.x!==a.x||n.y!==a.y){n=null;a=null;break}t.splice(1,1)}for(i=t.length-1;i>0;i--){n=a;a=t[i];if(n){if(n.x!==a.x||n.y!==a.y)break;t.pop()}}}return t.map((function(t){return t.x+","+t.y})).join(" ")}));break;case"polygon":i.points=AnimationHelper.parseAttr(t[n],e[n],(function(t,e){if(1===e){var i,n,a,o,r;o=t.pop();r=t.pop();for(;t.length>1;){n=t[0];a=t[1];if(n.x!==a.x||n.y!==a.y){n=null;a=null;break}t.splice(1,1)}for(i=t.length-1;i>=0;i--){n=a;a=t[i];if(n){if(n.x!==a.x||n.y!==a.y)break;t.splice(i,1)}}t.push(r);t.push(o)}return t.map((function(t){return t.x+","+t.y})).join(" ")}));break;case"d":i[n]=AnimationHelper.parseAttr(t[n],e[n],(function(t){return t.map((function(t){return"string"==typeof t?t:t[0]+","+t[1]})).join(" ")}));break;case"pie":i.d=AnimationHelper.parseAttr(t[n],e[n],(function(t){return AnimationHelper.getPathDescOfPie.apply(AnimationHelper,t)}));break;case"rotate":i.transform=AnimationHelper.parseAttr(t[n],e[n],(function(t){return"rotate("+t.join(" ")+")"}));break;case"x":case"width":case"height":case"rx":case"ry":case"stroke-width":i[n]=AnimationHelper.parseAttr(t[n],e[n],(function(t){return Math.abs(t)}));break;default:i[n]=AnimationHelper.parseAttr(t[n],e[n])}return i};AnimationHelper.animate=function(t,e,i,n,a){void 0===i&&(i=Easing.Swing);void 0===n&&(n=400);void 0===a&&(a=16);wijmo_1.asFunction(t);wijmo_1.asNumber(n,!1,!0);wijmo_1.asNumber(a,!1,!0);var o=0,r=setInterval((function(){Date.now();var s=o/n;s=EasingHelper[Easing[i]](s);t(s);if((o+=a)>=n){clearInterval(r);(s<1||s>1)&&t(1);e&&e()}}),a);return r};AnimationHelper.calcValue=function(t,e){var i=t.from,n=t.diff,a=t.value;wijmo_1.isNumber(i)?t.value=0===n?i:i+n*e:wijmo_1.isArray(i)&&AnimationHelper.parseArrayAttr(a,i,n,(function(t,i){return"number"==typeof t?t+i*e:t}))};AnimationHelper.parseAttr=function(t,e,i){var n,a,o,r;if(wijmo_1.isArray(t)&&wijmo_1.isArray(e)){a=e;o=[];r=(n=t).slice();AnimationHelper.parseArrayAttr(o,n,a,(function(t,e){return t===e?0:e-t}))}else{r=n=Number(t);o=(a=Number(e))-n}return{from:n,to:a,value:r,diff:o,getValue:i||function(t,e){return t}}};AnimationHelper.parseArrayAttr=function(t,e,i,n){e.forEach((function(e,a){var o={},r=[],s=i[a];if(wijmo_1.isNumber(e)||"string"==typeof e)t[a]=n(e,s);else if(wijmo_1.isArray(e)){e.forEach((function(t,i){r[i]=n(e[i],s[i])}));t[a]=r}else{Object.getOwnPropertyNames(e).forEach((function(t){o[t]=n(e[t],s[t])}));t[a]=o}}))};return AnimationHelper}(),EasingHelper=function(){function EasingHelper(){}EasingHelper.Linear=function(t){return t};EasingHelper.Swing=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)};EasingHelper.EaseInQuad=function(t){return t*t};EasingHelper.EaseOutQuad=function(t){return t*(2-t)};EasingHelper.EaseInOutQuad=function(t){return t<.5?2*t*t:(4-2*t)*t-1};EasingHelper.EaseInCubic=function(t){return t*t*t};EasingHelper.EaseOutCubic=function(t){return--t*t*t+1};EasingHelper.EaseInOutCubic=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1};EasingHelper.EaseInQuart=function(t){return t*t*t*t};EasingHelper.EaseOutQuart=function(t){return 1- --t*t*t*t};EasingHelper.EaseInOutQuart=function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t};EasingHelper.EaseInQuint=function(t){return t*t*t*t*t};EasingHelper.EaseOutQuint=function(t){return 1+--t*t*t*t*t};EasingHelper.EaseInOutQuint=function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};EasingHelper.EaseInSine=function(t){return 1-Math.cos(t*(Math.PI/2))};EasingHelper.EaseOutSine=function(t){return Math.sin(t*(Math.PI/2))};EasingHelper.EaseInOutSine=function(t){return-.5*(Math.cos(Math.PI*t)-1)};EasingHelper.EaseInExpo=function(t){return 0==t?0:Math.pow(2,10*(t-1))};EasingHelper.EaseOutExpo=function(t){return 1==t?1:1-Math.pow(2,-10*t)};EasingHelper.EaseInOutExpo=function(t){return t==!!t?t:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))};EasingHelper.EaseInCirc=function(t){return-(Math.sqrt(1-t*t)-1)};EasingHelper.EaseOutCirc=function(t){return Math.sqrt(1-Math.pow(t-1,2))};EasingHelper.EaseInOutCirc=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)};EasingHelper.EaseInBack=function(t){var e=1.70158;return t*t*((e+1)*t-e)};EasingHelper.EaseOutBack=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1};EasingHelper.EaseInOutBack=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)};EasingHelper.EaseInBounce=function(t){return 1-EasingHelper.EaseOutBounce(1-t)};EasingHelper.EaseOutBounce=function(t){var e=7.5625;return t<1/2.75?e*t*t:t<2/2.75?e*(t-=1.5/2.75)*t+.75:t<2.5/2.75?e*(t-=2.25/2.75)*t+.9375:e*(t-=2.625/2.75)*t+.984375};EasingHelper.EaseInOutBounce=function(t){return t<.5?.5*EasingHelper.EaseInBounce(2*t):.5*EasingHelper.EaseOutBounce(2*t-1)+.5};EasingHelper.EaseInElastic=function(t){return t==!!t?t:-Math.pow(2,10*(t-=1))*Math.sin((t-.075)*(2*Math.PI)/.3)};EasingHelper.EaseOutElastic=function(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1};EasingHelper.EaseInOutElastic=function(t){return t==!!t?t:(t*=2)<1?Math.pow(2,10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*-.5:Math.pow(2,-10*(t-=1))*Math.sin((t-.1125)*(2*Math.PI)/.45)*.5+1};return EasingHelper}();wijmo_1._registerModule("wijmo.chart.animation",selfModule); |
{ | ||
"name": "@grapecity/wijmo.chart.animation", | ||
"version": "5.20242.21", | ||
"version": "5.20242.30", | ||
"description": "UI library for pure JS, Angular, React, Vue and more...", | ||
@@ -10,4 +10,4 @@ "author": "MESCIUS inc", | ||
"dependencies": { | ||
"@grapecity/wijmo": "5.20242.21", | ||
"@grapecity/wijmo.chart": "5.20242.21" | ||
"@grapecity/wijmo": "5.20242.30", | ||
"@grapecity/wijmo.chart": "5.20242.30" | ||
}, | ||
@@ -14,0 +14,0 @@ "homepage": "https://developer.mescius.com/wijmo", |
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
206006
0.05%1
Infinity%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated