@mescius/wijmo.chart.animation 5.20232.939

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es5-esm.js ADDED
@@ -0,0 +1,14 @@
1
+ /*!
2
+ *
3
+ * Wijmo Library 5.20232.939
4
+ * https://developer.mescius.com/wijmo
5
+ *
6
+ * Copyright(c) MESCIUS inc. All rights reserved.
7
+ *
8
+ * Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
9
+ * us.sales@mescius.com
10
+ * https://developer.mescius.com/wijmo/licensing
11
+ *
12
+ */
13
+
14
+ 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"@mescius/wijmo";import{ChartType,FlexChart,TickMark,AxisType,FlexPie,FlexChartCore}from"@mescius/wijmo.chart";import*as selfModule from"@mescius/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);
package/index.d.ts ADDED
@@ -0,0 +1,172 @@
1
+ /*!
2
+ *
3
+ * Wijmo Library 5.20232.939
4
+ * https://developer.mescius.com/wijmo
5
+ *
6
+ * Copyright(c) MESCIUS inc. All rights reserved.
7
+ *
8
+ * Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
9
+ * us.sales@mescius.com
10
+ * https://developer.mescius.com/wijmo/licensing
11
+ *
12
+ */
13
+ /**
14
+ * {@module wijmo.chart.animation}
15
+ * Defines the {@link ChartAnimation} for {@link FlexChart}, {@link FinancialChart} and {@link FlexPie}.
16
+ */
17
+ /**
18
+ *
19
+ */
20
+ export declare var ___keepComment: any;
21
+ import { Event, EventArgs } from '@grapecity/wijmo';
22
+ import { FlexChartBase } from '@grapecity/wijmo.chart';
23
+ import * as mFinancial from '@grapecity/wijmo.chart.finance';
24
+ import * as mRadar from '@grapecity/wijmo.chart.radar';
25
+ import * as selfModule from '@grapecity/wijmo.chart.animation';
26
+ export declare function softFinancial(): typeof mFinancial;
27
+ export declare function softRadar(): typeof mRadar;
28
+ /**
29
+ * Specifies the rate of change of a parameter over time.
30
+ */
31
+ export declare enum Easing {
32
+ /** Simple linear tweening, no easing and no acceleration. */
33
+ Linear = 0,
34
+ /** Easing equation for a swing easing */
35
+ Swing = 1,
36
+ /** Easing equation for a quadratic easing in, accelerating from zero velocity. */
37
+ EaseInQuad = 2,
38
+ /** Easing equation for a quadratic easing out, decelerating to zero velocity. */
39
+ EaseOutQuad = 3,
40
+ /** Easing equation for a quadratic easing in and out, acceleration until halfway, then deceleration. */
41
+ EaseInOutQuad = 4,
42
+ /** Easing equation for a cubic easing in - accelerating from zero velocity. */
43
+ EaseInCubic = 5,
44
+ /** Easing equation for a cubic easing out - decelerating to zero velocity. */
45
+ EaseOutCubic = 6,
46
+ /** Easing equation for a cubic easing in and out - acceleration until halfway, then deceleration. */
47
+ EaseInOutCubic = 7,
48
+ /** Easing equation for a quartic easing in - accelerating from zero velocity. */
49
+ EaseInQuart = 8,
50
+ /** Easing equation for a quartic easing out - decelerating to zero velocity. */
51
+ EaseOutQuart = 9,
52
+ /** Easing equation for a quartic easing in and out - acceleration until halfway, then deceleration. */
53
+ EaseInOutQuart = 10,
54
+ /** Easing equation for a quintic easing in - accelerating from zero velocity. */
55
+ EaseInQuint = 11,
56
+ /** Easing equation for a quintic easing out - decelerating to zero velocity. */
57
+ EaseOutQuint = 12,
58
+ /** Easing equation for a quintic easing in and out - acceleration until halfway, then deceleration. */
59
+ EaseInOutQuint = 13,
60
+ /** Easing equation for a sinusoidal easing in - accelerating from zero velocity. */
61
+ EaseInSine = 14,
62
+ /** Easing equation for a sinusoidal easing out - decelerating to zero velocity. */
63
+ EaseOutSine = 15,
64
+ /** Easing equation for a sinusoidal easing in and out - acceleration until halfway, then deceleration. */
65
+ EaseInOutSine = 16,
66
+ /** Easing equation for an exponential easing in - accelerating from zero velocity. */
67
+ EaseInExpo = 17,
68
+ /** Easing equation for an exponential easing out - decelerating to zero velocity. */
69
+ EaseOutExpo = 18,
70
+ /** Easing equation for an exponential easing in and out - acceleration until halfway, then deceleration. */
71
+ EaseInOutExpo = 19,
72
+ /** Easing equation for a circular easing in - accelerating from zero velocity. */
73
+ EaseInCirc = 20,
74
+ /** Easing equation for a circular easing out - decelerating to zero velocity. */
75
+ EaseOutCirc = 21,
76
+ /** Easing equation for a circular easing in and out - acceleration until halfway, then deceleration. */
77
+ EaseInOutCirc = 22,
78
+ /** Easing equation for a back easing in - accelerating from zero velocity. */
79
+ EaseInBack = 23,
80
+ /** Easing equation for a back easing out - decelerating to zero velocity. */
81
+ EaseOutBack = 24,
82
+ /** Easing equation for a back easing in and out - acceleration until halfway, then deceleration. */
83
+ EaseInOutBack = 25,
84
+ /** Easing equation for a bounce easing in - accelerating from zero velocity. */
85
+ EaseInBounce = 26,
86
+ /** Easing equation for a bounce easing out - decelerating to zero velocity. */
87
+ EaseOutBounce = 27,
88
+ /** Easing equation for a bounce easing in and out - acceleration until halfway, then deceleration. */
89
+ EaseInOutBounce = 28,
90
+ /** Easing equation for an elastic easing in - accelerating from zero velocity. */
91
+ EaseInElastic = 29,
92
+ /** Easing equation for an elastic easing out - decelerating to zero velocity. */
93
+ EaseOutElastic = 30,
94
+ /** Easing equation for an elastic easing in and out - acceleration until halfway, then deceleration. */
95
+ EaseInOutElastic = 31
96
+ }
97
+ /**
98
+ * Specifies the animation mode whether chart should animate one point at a time,
99
+ * series by series, or all at once.
100
+ */
101
+ export declare enum AnimationMode {
102
+ /** All points and series are animated at once. */
103
+ All = 0,
104
+ /**
105
+ * Animation is performed point by point. Multiple series are animated
106
+ * simultaneously at the same time.
107
+ */
108
+ Point = 1,
109
+ /**
110
+ * Animation is performed series by series.
111
+ * Entire series is animated at once, following the same animation as the "All"
112
+ * option, but just one series at a time.
113
+ */
114
+ Series = 2
115
+ }
116
+ /**
117
+ * Represents the animation for {@link FlexChart}, {@link FinancialChart} and {@link FlexPie}.
118
+ *
119
+ * The {@link ChartAnimation} provides built-in animation while loading and updating
120
+ * the chart.
121
+ * The animation can be configured by the user through several properties that
122
+ * include duration, easing function, animation mode.
123
+ */
124
+ export declare class ChartAnimation {
125
+ private _chart;
126
+ private _animation;
127
+ private _cv;
128
+ private _updateEventArgs;
129
+ private _chartType;
130
+ private _play;
131
+ /**
132
+ * Initializes a new instance of the {@link ChartAnimation} class.
133
+ *
134
+ * @param chart A chart to which the {@link ChartAnimation} is attached.
135
+ * @param options A JavaScript object containing initialization data for
136
+ * {@link ChartAnimation}.
137
+ */
138
+ constructor(chart: FlexChartBase, options?: any);
139
+ private _initOptions;
140
+ private _setCV;
141
+ /**
142
+ * Occurs after the animation ends.
143
+ */
144
+ readonly ended: Event<ChartAnimation, EventArgs>;
145
+ /**
146
+ * Gets or sets whether the plot points animate one at a time, series by series,
147
+ * or all at once.
148
+ * The whole animation is still completed within the duration.
149
+ */
150
+ animationMode: AnimationMode;
151
+ /**
152
+ * Gets or sets the easing function applied to the animation.
153
+ */
154
+ easing: Easing;
155
+ /**
156
+ * Gets or sets the length of entire animation in milliseconds.
157
+ */
158
+ duration: number;
159
+ /**
160
+ * Gets or sets a value indicating whether animation is applied to the axis.
161
+ */
162
+ axisAnimation: boolean;
163
+ /**
164
+ * Gets the animated chart instance.
165
+ */
166
+ readonly chart: FlexChartBase;
167
+ private _playAnimation;
168
+ /**
169
+ * Performs the animation.
170
+ */
171
+ animate(): void;
172
+ }
package/index.js ADDED
@@ -0,0 +1,14 @@
1
+ /*!
2
+ *
3
+ * Wijmo Library 5.20232.939
4
+ * https://developer.mescius.com/wijmo
5
+ *
6
+ * Copyright(c) MESCIUS inc. All rights reserved.
7
+ *
8
+ * Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
9
+ * us.sales@mescius.com
10
+ * https://developer.mescius.com/wijmo/licensing
11
+ *
12
+ */
13
+
14
+ "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("@mescius/wijmo"),wijmo_chart_1=require("@mescius/wijmo.chart"),selfModule=__importStar(require("@mescius/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,g={},x={};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})}g[p]=_;x[p]=f}else if("ellipse"===p||"rect"===p){h._toggleVisibility(e,!1);i&&(c=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: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=[],g=p._center,x=[],E=!1,v={},C={},S=0;if("polyline"===_||"polygon"===_){o=(l=e.points).length||l.numberOfItems;for(r=0;r<o;r++){x[h=m._getScatterAnimationIndex(t,n[r])]||(x[h]=[]);x[h].push(r);s=l[r]||l.getItem(r);f.push({x:g.x,y:g.y});d.push({x:s.x,y:s.y})}for(r=0,o=x.length;r<o;r++)if(x[r]){u=m._getAnimation(t,S);A=y.length?y.slice():f.slice();y=A.slice();x[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);
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@mescius/wijmo.chart.animation",
3
+ "version": "5.20232.939",
4
+ "description": "UI library for pure JS, Angular, React, Vue and more...",
5
+ "author": "MESCIUS inc",
6
+ "license": "Commercial",
7
+ "main": "./index.js",
8
+ "types": "./index.d.ts",
9
+ "dependencies": {
10
+ "@mescius/wijmo": "5.20232.939",
11
+ "@mescius/wijmo.chart": "5.20232.939"
12
+ },
13
+ "homepage": "https://developer.mescius.com/wijmo",
14
+ "bugs": {
15
+ "url": "https://developer.mescius.com/forums/wijmo"
16
+ },
17
+ "keywords": [
18
+ "control",
19
+ "component",
20
+ "ui",
21
+ "control library",
22
+ "component library",
23
+ "ui library",
24
+ "control-library",
25
+ "component-library",
26
+ "ui-library",
27
+ "grid",
28
+ "data grid",
29
+ "data-grid",
30
+ "datagrid",
31
+ "angular grid",
32
+ "react grid",
33
+ "vue grid",
34
+ "angular-grid",
35
+ "react-grid",
36
+ "vue-grid"
37
+ ],
38
+ "module": "./es5-esm.js",
39
+ "esm5": "./es5-esm.js",
40
+ "wj-esm5": "./es5-esm.js",
41
+ "es2015Cjs": "./es2015-commonjs.js",
42
+ "wj-es2015Cjs": "./es2015-commonjs.js",
43
+ "esm2015": "./es2015-esm.js",
44
+ "wj-esm2015": "./es2015-esm.js"
45
+ }