vislite 1.4.0-alpha.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG +307 -307
  2. package/lib/BarLayout/index.es.js +437 -437
  3. package/lib/BarLayout/index.es.min.js +2 -2
  4. package/lib/Buffer/index.es.js +35 -35
  5. package/lib/Buffer/index.es.min.js +1 -1
  6. package/lib/Canvas/index.es.js +774 -774
  7. package/lib/Canvas/index.es.min.js +1 -1
  8. package/lib/Cardinal/index.es.js +90 -90
  9. package/lib/Cardinal/index.es.min.js +1 -1
  10. package/lib/Eoap/index.es.js +33 -33
  11. package/lib/Eoap/index.es.min.js +1 -1
  12. package/lib/Hermite/index.es.js +35 -35
  13. package/lib/Hermite/index.es.min.js +1 -1
  14. package/lib/MapCoordinate/index.es.js +199 -199
  15. package/lib/MapCoordinate/index.es.min.js +1 -1
  16. package/lib/Matrix4/index.es.js +124 -124
  17. package/lib/Matrix4/index.es.min.js +1 -1
  18. package/lib/Mercator/index.es.js +19 -19
  19. package/lib/Mercator/index.es.min.js +1 -1
  20. package/lib/PieLayout/index.es.js +213 -213
  21. package/lib/PieLayout/index.es.min.js +2 -2
  22. package/lib/RawCanvas/index.es.js +704 -704
  23. package/lib/RawCanvas/index.es.min.js +1 -1
  24. package/lib/SVG/index.es.js +514 -514
  25. package/lib/SVG/index.es.min.js +1 -1
  26. package/lib/Shader/index.es.js +35 -35
  27. package/lib/Shader/index.es.min.js +1 -1
  28. package/lib/Texture/index.es.js +53 -53
  29. package/lib/Texture/index.es.min.js +1 -1
  30. package/lib/TreeLayout/index.es.js +397 -397
  31. package/lib/TreeLayout/index.es.min.js +2 -2
  32. package/lib/animation/index.es.js +110 -106
  33. package/lib/animation/index.es.min.js +3 -3
  34. package/lib/assemble/index.es.js +17 -17
  35. package/lib/assemble/index.es.min.js +1 -1
  36. package/lib/getLoopColors/index.es.js +35 -35
  37. package/lib/getLoopColors/index.es.min.js +1 -1
  38. package/lib/getWebGLContext/index.es.js +62 -62
  39. package/lib/getWebGLContext/index.es.min.js +1 -1
  40. package/lib/index.umd.js +2795 -2791
  41. package/lib/index.umd.min.js +5 -5
  42. package/lib/initOption/index.es.js +6 -6
  43. package/lib/initOption/index.es.min.js +1 -1
  44. package/lib/mergeOption/index.es.js +34 -34
  45. package/lib/mergeOption/index.es.min.js +1 -1
  46. package/lib/move/index.es.js +7 -7
  47. package/lib/move/index.es.min.js +1 -1
  48. package/lib/rotate/index.es.js +7 -7
  49. package/lib/rotate/index.es.min.js +1 -1
  50. package/lib/ruler/index.es.js +137 -137
  51. package/lib/ruler/index.es.min.js +1 -1
  52. package/lib/scale/index.es.js +6 -6
  53. package/lib/scale/index.es.min.js +1 -1
  54. package/lib/throttle/index.es.js +51 -51
  55. package/lib/throttle/index.es.min.js +2 -2
  56. package/package/BarLayout/index.ts +2 -2
  57. package/package/PieLayout/index.ts +2 -2
  58. package/package/animation/index.ts +6 -3
  59. package/package/index.ts +84 -84
  60. package/package/throttle/index.ts +2 -2
  61. package/package.json +75 -75
  62. package/src/SVG.ts +55 -55
  63. package/src/common/canvas/gradient.ts +31 -31
  64. package/src/common/svg/default.ts +29 -29
  65. package/src/common/svg/gradient.ts +53 -53
  66. package/src/common/svg/index.ts +332 -332
  67. package/src/common/tree/toPlainTree.ts +135 -135
  68. package/src/common/webgl/texture.ts +98 -98
  69. package/src/layout/BarLayout.ts +248 -248
  70. package/src/layout/PieLayout.ts +141 -141
  71. package/src/layout/TreeLayout.ts +197 -197
  72. package/types/Bar.d.ts +91 -91
  73. package/types/BarConfig.d.ts +4 -4
  74. package/types/BarLayout.d.ts +48 -48
  75. package/types/BarOption.d.ts +31 -31
  76. package/types/Pie.d.ts +73 -73
  77. package/types/PieConfig.d.ts +26 -26
  78. package/types/PieLayout.d.ts +40 -40
  79. package/types/PieOption.d.ts +21 -21
  80. package/types/SVG.d.ts +247 -247
  81. package/types/animation.d.ts +11 -5
  82. package/types/index.d.ts +195 -195
  83. package/types/throttle.d.ts +5 -5
@@ -1,234 +1,234 @@
1
1
  /*!
2
- * PieLayout of VISLite JavaScript Library v1.4.0-alpha.0
2
+ * PieLayout of VISLite JavaScript Library v1.4.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
- function initOption(setOption, defaultOption) {
6
- for (var key in setOption) {
7
- defaultOption[key] = setOption[key];
8
- }
9
- return defaultOption;
5
+ function initOption(setOption, defaultOption) {
6
+ for (var key in setOption) {
7
+ defaultOption[key] = setOption[key];
8
+ }
9
+ return defaultOption;
10
10
  }
11
11
 
12
- function rotate (cx, cy, deg, x, y) {
13
- var cos = Math.cos(deg), sin = Math.sin(deg);
14
- return [
15
- (x - cx) * cos - (y - cy) * sin + cx,
16
- (x - cx) * sin + (y - cy) * cos + cy
17
- ];
12
+ function rotate (cx, cy, deg, x, y) {
13
+ var cos = Math.cos(deg), sin = Math.sin(deg);
14
+ return [
15
+ (x - cx) * cos - (y - cy) * sin + cx,
16
+ (x - cx) * sin + (y - cy) * cos + cy
17
+ ];
18
18
  }
19
19
 
20
20
  /*!
21
- * animation of OIPage v1.2.0
21
+ * animation of OIPage v1.3.0
22
22
  * git+https://github.com/oi-contrib/OIPage.git
23
23
  */
24
24
 
25
- //当前正在运动的动画的tick函数堆栈
26
- var $timers = [];
27
- //唯一定时器的定时间隔
28
- var $interval = 13;
29
- //定时器ID
30
- var $timerId;
31
-
32
- /**
33
- * 动画轮播
34
- * @param {function} doback 轮询函数,有一个形参deep,0-1,表示执行进度
35
- * @param {number} duration 动画时长,可选
36
- * @param {function} callback 动画结束回调,可选,有一个形参deep,0-1,表示执行进度
37
- *
38
- * @returns {function} 返回一个函数,调用该函数,可以提前结束动画
39
- */
40
- function animation(doback, duration, callback) {
41
- if (arguments.length < 2) duration = 400;
42
- if (arguments.length < 3) callback = function () { };
43
-
44
- var clock = {
45
- //把tick函数推入堆栈
46
- "timer": function (tick, duration, callback) {
47
- if (!tick) {
48
- throw new Error('Tick is required!');
49
- }
50
- var id = new Date().valueOf() + "_" + (Math.random() * 1000).toFixed(0);
51
- $timers.push({
52
- "id": id,
53
- "createTime": new Date(),
54
- "tick": tick,
55
- "duration": duration,
56
- "callback": callback
57
- });
58
- clock.start();
59
- return id;
60
- },
61
-
62
- //开启唯一的定时器timerId
63
- "start": function () {
64
- if (!$timerId) {
65
- $timerId = setInterval(clock.tick, $interval);
66
- }
67
- },
68
-
69
- //被定时器调用,遍历timers堆栈
70
- "tick": function () {
71
- var createTime, flag, tick, callback, timer, duration, passTime, timers = $timers;
72
-
73
- $timers = [];
74
- $timers.length = 0;
75
-
76
- for (flag = 0; flag < timers.length; flag++) {
77
- //初始化数据
78
- timer = timers[flag];
79
- createTime = timer.createTime;
80
- tick = timer.tick;
81
- duration = timer.duration;
82
- callback = timer.callback;
83
-
84
- //执行
85
- passTime = (+new Date().valueOf() - createTime.valueOf()) / duration;
86
- passTime = passTime > 1 ? 1 : passTime;
87
- tick(passTime);
88
- if (passTime < 1 && timer.id) {
89
- //动画没有结束再添加
90
- $timers.push(timer);
91
- } else {
92
- callback(passTime);
93
- }
94
- }
95
- if ($timers.length <= 0) {
96
- clock.stop();
97
- }
98
- },
99
-
100
- //停止定时器,重置timerId=null
101
- "stop": function () {
102
- if ($timerId) {
103
- clearInterval($timerId);
104
- $timerId = null;
105
- }
106
- }
107
- };
108
-
109
- var id = clock.timer(function (deep) {
110
- //其中deep为0-1,表示改变的程度
111
- doback(deep);
112
- }, duration, callback);
113
-
114
- return {
115
- // 一个函数
116
- // 用于在动画结束前结束动画
117
- stop: function () {
118
- var i;
119
- for (i in $timers) {
120
- if ($timers[i].id == id) {
121
- $timers[i].id = void 0;
122
- return;
123
- }
124
- }
125
- }
126
- };
127
-
128
- }
25
+ //当前正在运动的动画的tick函数堆栈
26
+ var $timers = [];
27
+ //唯一定时器的定时间隔
28
+ var $interval = 13;
29
+ //定时器ID
30
+ var $timerId;
129
31
 
130
- var PieLayout = (function () {
131
- function PieLayout(config) {
132
- if (config === void 0) { config = {}; }
133
- this.name = 'PieLayout';
134
- this.__option = {
135
- cx: 200,
136
- cy: 200,
137
- radius: [50, 100],
138
- duration: 200,
139
- };
140
- this.__hoverIndex = -1;
141
- this.__config = initOption(config, {
142
- name: function (pieData, initPie) { return pieData.name; },
143
- value: function (pieData, initPie) { return pieData.value; }
144
- });
145
- }
146
- PieLayout.prototype.setOption = function (option) {
147
- initOption(option, this.__option);
148
- return this;
149
- };
150
- PieLayout.prototype.use = function (initPie, hoverIndex) {
151
- if (hoverIndex === void 0) { hoverIndex = -1; }
152
- var pie = {
153
- count: initPie.length,
154
- cx: this.__option.cx,
155
- cy: this.__option.cy,
156
- radius: this.__option.radius,
157
- hoverIndex: hoverIndex,
158
- node: []
159
- };
160
- var totalValue = 0, names = [], values = [];
161
- for (var i = 0; i < initPie.length; i++) {
162
- names[i] = this.__config.name(initPie[i], initPie);
163
- values[i] = this.__config.value(initPie[i], initPie);
164
- totalValue += values[i];
165
- }
166
- var beginDeg = Math.PI * -0.5, currenDeg;
167
- for (var i = 0; i < initPie.length; i++) {
168
- currenDeg = values[i] / totalValue * Math.PI * 2;
169
- var radius = [this.__option.radius[0], this.__option.radius[1] * (1 + (hoverIndex === i ? 0.05 : 0))];
170
- var pdeg = beginDeg + currenDeg * 0.5, pradius = Math.max(this.__option.radius[0], this.__option.radius[1]);
171
- var p0 = rotate(pie.cx, pie.cy, pdeg, pie.cx + pradius, pie.cy);
172
- var p1 = rotate(pie.cx, pie.cy, pdeg, pie.cx + pradius + 15, pie.cy);
173
- var pflag = p0[0] > pie.cx ? 1 : -1;
174
- var p2 = [p1[0] + pflag * 20, p1[1]];
175
- var p3 = [p1[0] + pflag * 25, p1[1]];
176
- pie.node[i] = {
177
- value: values[i],
178
- name: names[i],
179
- beginDeg: beginDeg,
180
- deg: currenDeg,
181
- isHover: hoverIndex === i,
182
- radius: radius,
183
- label: {
184
- line: [p0, p1, p2],
185
- position: p3,
186
- align: pflag === -1 ? "right" : "left"
32
+ /**
33
+ * 动画轮播
34
+ * @param {function} doback 轮询函数,有一个形参deep,0-1,表示执行进度
35
+ * @param {number} duration 动画时长,可选
36
+ * @param {function} callback 动画结束回调,可选,有一个形参deep,0-1,表示执行进度
37
+ *
38
+ * @returns {function} 返回一个函数,调用该函数,可以提前结束动画
39
+ */
40
+ function animation(doback, duration, callback) {
41
+ if (arguments.length < 2) duration = 400;
42
+ if (arguments.length < 3) callback = function () { };
43
+
44
+ var clock = {
45
+ //把tick函数推入堆栈
46
+ "timer": function (tick, duration, callback) {
47
+ if (!tick) {
48
+ throw new Error('Tick is required!');
49
+ }
50
+ var id = new Date().valueOf() + "_" + (Math.random() * 1000).toFixed(0);
51
+ $timers.push({
52
+ "id": id,
53
+ "createTime": new Date(),
54
+ "tick": tick,
55
+ "duration": duration,
56
+ "callback": callback
57
+ });
58
+ clock.start();
59
+ return id;
60
+ },
61
+
62
+ //开启唯一的定时器timerId
63
+ "start": function () {
64
+ if (!$timerId) {
65
+ $timerId = setInterval(clock.tick, $interval);
66
+ }
67
+ },
68
+
69
+ //被定时器调用,遍历timers堆栈
70
+ "tick": function () {
71
+ var createTime, flag, tick, callback, timer, duration, passTime, timers = $timers;
72
+
73
+ $timers = [];
74
+ $timers.length = 0;
75
+
76
+ for (flag = 0; flag < timers.length; flag++) {
77
+ //初始化数据
78
+ timer = timers[flag];
79
+ createTime = timer.createTime;
80
+ tick = timer.tick;
81
+ duration = timer.duration;
82
+ callback = timer.callback;
83
+
84
+ //执行
85
+ passTime = (+new Date().valueOf() - createTime.valueOf()) / duration;
86
+ passTime = passTime > 1 ? 1 : passTime;
87
+ tick(passTime);
88
+ if (passTime < 1 && timer.id) {
89
+ //动画没有结束再添加
90
+ $timers.push(timer);
91
+ } else {
92
+ callback(passTime);
187
93
  }
188
- };
189
- beginDeg += currenDeg;
94
+ }
95
+ if ($timers.length <= 0) {
96
+ clock.stop();
97
+ }
98
+ },
99
+
100
+ //停止定时器,重置timerId=null
101
+ "stop": function () {
102
+ if ($timerId) {
103
+ clearInterval($timerId);
104
+ $timerId = null;
105
+ }
190
106
  }
191
- return pie;
192
- };
193
- PieLayout.prototype.bind = function (initPie, renderBack) {
194
- this.__rback = renderBack;
195
- this.__oralPie = initPie;
196
- this.__prePie = this.use(this.__oralPie, this.__hoverIndex);
197
- this.__rback(this.__prePie);
198
- return this;
199
- };
200
- PieLayout.prototype.unbind = function () {
201
- this.__rback = function () { return null; };
202
- this.__oralPie = null;
203
- this.__prePie = null;
204
- this.__hoverIndex = -1;
205
- return this;
206
- };
207
- PieLayout.prototype.setHover = function (index) {
208
- if (!this.__prePie || this.__hoverIndex === index)
209
- return this;
210
- this.__hoverIndex = index;
211
- this.doUpdate();
212
- return this;
213
107
  };
214
- PieLayout.prototype.doUpdate = function () {
215
- var _this = this;
216
- var newPie = this.use(this.__oralPie, this.__hoverIndex);
217
- var cachePie = JSON.parse(JSON.stringify(newPie));
218
- animation(function (deep) {
219
- if (_this.__prePie) {
220
- for (var i = 0; i < cachePie.count; i++) {
221
- cachePie.node[i].radius[1] = _this.__prePie.node[i].radius[1] + (newPie.node[i].radius[1] - _this.__prePie.node[i].radius[1]) * deep;
108
+
109
+ var id = clock.timer(function (deep) {
110
+ //其中deep为0-1,表示改变的程度
111
+ doback(deep);
112
+ }, duration, callback);
113
+
114
+ return {
115
+ // 一个函数
116
+ // 用于在动画结束前结束动画
117
+ stop: function () {
118
+ var i;
119
+ for (i in $timers) {
120
+ if ($timers[i].id == id) {
121
+ $timers[i].id = void 0;
122
+ return;
222
123
  }
223
124
  }
224
- _this.__rback(cachePie);
225
- }, this.__option.duration, function () {
226
- _this.__prePie = newPie;
227
- _this.__rback(_this.__prePie);
228
- });
229
- return this;
125
+ }
230
126
  };
231
- return PieLayout;
127
+
128
+ }
129
+
130
+ var PieLayout = (function () {
131
+ function PieLayout(config) {
132
+ if (config === void 0) { config = {}; }
133
+ this.name = 'PieLayout';
134
+ this.__option = {
135
+ cx: 200,
136
+ cy: 200,
137
+ radius: [50, 100],
138
+ duration: 200,
139
+ };
140
+ this.__hoverIndex = -1;
141
+ this.__config = initOption(config, {
142
+ name: function (pieData, initPie) { return pieData.name; },
143
+ value: function (pieData, initPie) { return pieData.value; }
144
+ });
145
+ }
146
+ PieLayout.prototype.setOption = function (option) {
147
+ initOption(option, this.__option);
148
+ return this;
149
+ };
150
+ PieLayout.prototype.use = function (initPie, hoverIndex) {
151
+ if (hoverIndex === void 0) { hoverIndex = -1; }
152
+ var pie = {
153
+ count: initPie.length,
154
+ cx: this.__option.cx,
155
+ cy: this.__option.cy,
156
+ radius: this.__option.radius,
157
+ hoverIndex: hoverIndex,
158
+ node: []
159
+ };
160
+ var totalValue = 0, names = [], values = [];
161
+ for (var i = 0; i < initPie.length; i++) {
162
+ names[i] = this.__config.name(initPie[i], initPie);
163
+ values[i] = this.__config.value(initPie[i], initPie);
164
+ totalValue += values[i];
165
+ }
166
+ var beginDeg = Math.PI * -0.5, currenDeg;
167
+ for (var i = 0; i < initPie.length; i++) {
168
+ currenDeg = values[i] / totalValue * Math.PI * 2;
169
+ var radius = [this.__option.radius[0], this.__option.radius[1] * (1 + (hoverIndex === i ? 0.05 : 0))];
170
+ var pdeg = beginDeg + currenDeg * 0.5, pradius = Math.max(this.__option.radius[0], this.__option.radius[1]);
171
+ var p0 = rotate(pie.cx, pie.cy, pdeg, pie.cx + pradius, pie.cy);
172
+ var p1 = rotate(pie.cx, pie.cy, pdeg, pie.cx + pradius + 15, pie.cy);
173
+ var pflag = p0[0] > pie.cx ? 1 : -1;
174
+ var p2 = [p1[0] + pflag * 20, p1[1]];
175
+ var p3 = [p1[0] + pflag * 25, p1[1]];
176
+ pie.node[i] = {
177
+ value: values[i],
178
+ name: names[i],
179
+ beginDeg: beginDeg,
180
+ deg: currenDeg,
181
+ isHover: hoverIndex === i,
182
+ radius: radius,
183
+ label: {
184
+ line: [p0, p1, p2],
185
+ position: p3,
186
+ align: pflag === -1 ? "right" : "left"
187
+ }
188
+ };
189
+ beginDeg += currenDeg;
190
+ }
191
+ return pie;
192
+ };
193
+ PieLayout.prototype.bind = function (initPie, renderBack) {
194
+ this.__rback = renderBack;
195
+ this.__oralPie = initPie;
196
+ this.__prePie = this.use(this.__oralPie, this.__hoverIndex);
197
+ this.__rback(this.__prePie);
198
+ return this;
199
+ };
200
+ PieLayout.prototype.unbind = function () {
201
+ this.__rback = function () { return null; };
202
+ this.__oralPie = null;
203
+ this.__prePie = null;
204
+ this.__hoverIndex = -1;
205
+ return this;
206
+ };
207
+ PieLayout.prototype.setHover = function (index) {
208
+ if (!this.__prePie || this.__hoverIndex === index)
209
+ return this;
210
+ this.__hoverIndex = index;
211
+ this.doUpdate();
212
+ return this;
213
+ };
214
+ PieLayout.prototype.doUpdate = function () {
215
+ var _this = this;
216
+ var newPie = this.use(this.__oralPie, this.__hoverIndex);
217
+ var cachePie = JSON.parse(JSON.stringify(newPie));
218
+ animation(function (deep) {
219
+ if (_this.__prePie) {
220
+ for (var i = 0; i < cachePie.count; i++) {
221
+ cachePie.node[i].radius[1] = _this.__prePie.node[i].radius[1] + (newPie.node[i].radius[1] - _this.__prePie.node[i].radius[1]) * deep;
222
+ }
223
+ }
224
+ _this.__rback(cachePie);
225
+ }, this.__option.duration, function () {
226
+ _this.__prePie = newPie;
227
+ _this.__rback(_this.__prePie);
228
+ });
229
+ return this;
230
+ };
231
+ return PieLayout;
232
232
  }());
233
233
 
234
234
  export { PieLayout as default };
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * PieLayout of VISLite JavaScript Library v1.4.0-alpha.0
2
+ * PieLayout of VISLite JavaScript Library v1.4.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  function t(t,i){for(var n in t)i[n]=t[n];return i}function i(t,i,n,e,r){var o=Math.cos(n),a=Math.sin(n);return[(e-t)*o-(r-i)*a+t,(e-t)*a+(r-i)*o+i]}
6
6
  /*!
7
- * animation of OIPage v1.2.0
7
+ * animation of OIPage v1.3.0
8
8
  * git+https://github.com/oi-contrib/OIPage.git
9
9
  */var n,e=[];var r=function(){function r(i){void 0===i&&(i={}),this.name="PieLayout",this.__option={cx:200,cy:200,radius:[50,100],duration:200},this.__hoverIndex=-1,this.__config=t(i,{name:function(t,i){return t.name},value:function(t,i){return t.value}})}return r.prototype.setOption=function(i){return t(i,this.__option),this},r.prototype.use=function(t,n){void 0===n&&(n=-1);for(var e={count:t.length,cx:this.__option.cx,cy:this.__option.cy,radius:this.__option.radius,hoverIndex:n,node:[]},r=0,o=[],a=[],_=0;_<t.length;_++)o[_]=this.__config.name(t[_],t),a[_]=this.__config.value(t[_],t),r+=a[_];var s,u=-.5*Math.PI;for(_=0;_<t.length;_++){s=a[_]/r*Math.PI*2;var h=[this.__option.radius[0],this.__option.radius[1]*(1+(n===_?.05:0))],c=u+.5*s,d=Math.max(this.__option.radius[0],this.__option.radius[1]),p=i(e.cx,e.cy,c,e.cx+d,e.cy),l=i(e.cx,e.cy,c,e.cx+d+15,e.cy),f=p[0]>e.cx?1:-1,v=[l[0]+20*f,l[1]],x=[l[0]+25*f,l[1]];e.node[_]={value:a[_],name:o[_],beginDeg:u,deg:s,isHover:n===_,radius:h,label:{line:[p,l,v],position:x,align:-1===f?"right":"left"}},u+=s}return e},r.prototype.bind=function(t,i){return this.__rback=i,this.__oralPie=t,this.__prePie=this.use(this.__oralPie,this.__hoverIndex),this.__rback(this.__prePie),this},r.prototype.unbind=function(){return this.__rback=function(){return null},this.__oralPie=null,this.__prePie=null,this.__hoverIndex=-1,this},r.prototype.setHover=function(t){return this.__prePie&&this.__hoverIndex!==t?(this.__hoverIndex=t,this.doUpdate(),this):this},r.prototype.doUpdate=function(){var t=this,i=this.use(this.__oralPie,this.__hoverIndex),r=JSON.parse(JSON.stringify(i));return function(t,i,r){arguments.length<2&&(i=400),arguments.length<3&&(r=function(){});var o={timer:function(t,i,n){if(!t)throw new Error("Tick is required!");var r=(new Date).valueOf()+"_"+(1e3*Math.random()).toFixed(0);return e.push({id:r,createTime:new Date,tick:t,duration:i,callback:n}),o.start(),r},start:function(){n||(n=setInterval(o.tick,13))},tick:function(){var t,i,n,r,a,_,s,u=e;for((e=[]).length=0,i=0;i<u.length;i++)t=(a=u[i]).createTime,n=a.tick,_=a.duration,r=a.callback,n(s=(s=(+(new Date).valueOf()-t.valueOf())/_)>1?1:s),s<1&&a.id?e.push(a):r(s);e.length<=0&&o.stop()},stop:function(){n&&(clearInterval(n),n=null)}},a=o.timer((function(i){t(i)}),i,r)}((function(n){if(t.__prePie)for(var e=0;e<r.count;e++)r.node[e].radius[1]=t.__prePie.node[e].radius[1]+(i.node[e].radius[1]-t.__prePie.node[e].radius[1])*n;t.__rback(r)}),this.__option.duration,(function(){t.__prePie=i,t.__rback(t.__prePie)})),this},r}();export{r as default};