vislite 1.9.0-alpha.2 → 1.9.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 (184) hide show
  1. package/AUTHORS.txt +6 -6
  2. package/CHANGELOG +3 -2
  3. package/LICENSE +20 -20
  4. package/README.md +1 -1
  5. package/lib/BarLayout/index.es.js +121 -121
  6. package/lib/BarLayout/index.es.min.js +2 -2
  7. package/lib/Buffer/index.es.js +1 -1
  8. package/lib/Buffer/index.es.min.js +1 -1
  9. package/lib/Canvas/index.es.js +1 -1
  10. package/lib/Canvas/index.es.min.js +1 -1
  11. package/lib/Cardinal/index.es.js +1 -1
  12. package/lib/Cardinal/index.es.min.js +1 -1
  13. package/lib/Eoap/index.es.js +1 -1
  14. package/lib/Eoap/index.es.min.js +1 -1
  15. package/lib/Hermite/index.es.js +1 -1
  16. package/lib/Hermite/index.es.min.js +1 -1
  17. package/lib/MapCoordinate/index.es.js +1 -1
  18. package/lib/MapCoordinate/index.es.min.js +1 -1
  19. package/lib/Matrix4/index.es.js +1 -1
  20. package/lib/Matrix4/index.es.min.js +1 -1
  21. package/lib/Mercator/index.es.js +1 -1
  22. package/lib/Mercator/index.es.min.js +1 -1
  23. package/lib/PieLayout/index.es.js +121 -121
  24. package/lib/PieLayout/index.es.min.js +2 -2
  25. package/lib/RawCanvas/index.es.js +1 -1
  26. package/lib/RawCanvas/index.es.min.js +1 -1
  27. package/lib/SVG/index.es.js +1 -1
  28. package/lib/SVG/index.es.min.js +1 -1
  29. package/lib/Shader/index.es.js +1 -1
  30. package/lib/Shader/index.es.min.js +1 -1
  31. package/lib/Texture/index.es.js +1 -1
  32. package/lib/Texture/index.es.min.js +1 -1
  33. package/lib/TreeLayout/index.es.js +121 -121
  34. package/lib/TreeLayout/index.es.min.js +2 -2
  35. package/lib/animation/index.es.js +121 -121
  36. package/lib/animation/index.es.min.js +2 -2
  37. package/lib/assemble/index.es.js +1 -1
  38. package/lib/assemble/index.es.min.js +1 -1
  39. package/lib/getLoopColors/index.es.js +1 -1
  40. package/lib/getLoopColors/index.es.min.js +1 -1
  41. package/lib/getWebGLContext/index.es.js +1 -1
  42. package/lib/getWebGLContext/index.es.min.js +1 -1
  43. package/lib/index.umd.js +171 -171
  44. package/lib/index.umd.min.js +3 -3
  45. package/lib/initOption/index.es.js +1 -1
  46. package/lib/initOption/index.es.min.js +1 -1
  47. package/lib/mergeOption/index.es.js +1 -1
  48. package/lib/mergeOption/index.es.min.js +1 -1
  49. package/lib/move/index.es.js +1 -1
  50. package/lib/move/index.es.min.js +1 -1
  51. package/lib/rotate/index.es.js +1 -1
  52. package/lib/rotate/index.es.min.js +1 -1
  53. package/lib/ruler/index.es.js +1 -1
  54. package/lib/ruler/index.es.min.js +1 -1
  55. package/lib/scale/index.es.js +1 -1
  56. package/lib/scale/index.es.min.js +1 -1
  57. package/lib/throttle/index.es.js +51 -51
  58. package/lib/throttle/index.es.min.js +2 -2
  59. package/minialipay/ui-canvas/drawImage.js +35 -35
  60. package/minialipay/ui-canvas/index.acss +4 -4
  61. package/minialipay/ui-canvas/index.axml +3 -3
  62. package/minialipay/ui-canvas/index.d.ts +1 -1
  63. package/minialipay/ui-canvas/index.js +100 -100
  64. package/minialipay/ui-canvas/index.json +6 -6
  65. package/miniprogram/ui-canvas/drawImage.js +35 -35
  66. package/miniprogram/ui-canvas/index.js +125 -125
  67. package/miniprogram/ui-canvas/index.json +4 -4
  68. package/miniprogram/ui-canvas/index.wxml +4 -4
  69. package/miniprogram/ui-canvas/index.wxss +5 -5
  70. package/package/BarLayout/index.ts +2 -2
  71. package/package/Buffer/index.ts +2 -2
  72. package/package/Canvas/index.ts +2 -2
  73. package/package/Cardinal/index.ts +2 -2
  74. package/package/Eoap/index.ts +2 -2
  75. package/package/Hermite/index.ts +2 -2
  76. package/package/MapCoordinate/index.ts +2 -2
  77. package/package/Matrix4/index.ts +2 -2
  78. package/package/Mercator/index.ts +2 -2
  79. package/package/PieLayout/index.ts +2 -2
  80. package/package/RawCanvas/index.ts +2 -2
  81. package/package/SVG/index.ts +2 -2
  82. package/package/Shader/index.ts +2 -2
  83. package/package/Texture/index.ts +2 -2
  84. package/package/TreeLayout/index.ts +2 -2
  85. package/package/animation/index.ts +5 -5
  86. package/package/assemble/index.ts +2 -2
  87. package/package/getLoopColors/index.ts +2 -2
  88. package/package/getWebGLContext/index.ts +40 -40
  89. package/package/index.ts +84 -84
  90. package/package/initOption/index.ts +2 -2
  91. package/package/mergeOption/index.ts +2 -2
  92. package/package/move/index.ts +2 -2
  93. package/package/rotate/index.ts +2 -2
  94. package/package/ruler/index.ts +2 -2
  95. package/package/scale/index.ts +2 -2
  96. package/package/throttle/index.ts +2 -2
  97. package/package.json +75 -75
  98. package/src/Canvas.ts +89 -89
  99. package/src/Eoap.ts +66 -66
  100. package/src/Matrix4/index.ts +84 -84
  101. package/src/Matrix4/move.ts +12 -12
  102. package/src/Matrix4/rotate.ts +15 -15
  103. package/src/Matrix4/scale.ts +11 -11
  104. package/src/Matrix4/transform.ts +64 -64
  105. package/src/Mercator.ts +27 -27
  106. package/src/SVG.ts +55 -55
  107. package/src/common/assemble.ts +22 -22
  108. package/src/common/canvas/arc.ts +51 -51
  109. package/src/common/canvas/config.ts +176 -176
  110. package/src/common/canvas/default.ts +64 -64
  111. package/src/common/canvas/gradient.ts +31 -31
  112. package/src/common/canvas/index.ts +189 -189
  113. package/src/common/canvas/texts.ts +18 -18
  114. package/src/common/map/getBoundary.ts +15 -15
  115. package/src/common/map/tool.ts +29 -29
  116. package/src/common/option.ts +29 -29
  117. package/src/common/setStyle.ts +5 -5
  118. package/src/common/svg/config.ts +213 -213
  119. package/src/common/svg/default.ts +29 -29
  120. package/src/common/svg/gradient.ts +53 -53
  121. package/src/common/svg/index.ts +420 -420
  122. package/src/common/svg/tool.ts +51 -51
  123. package/src/common/tree/index.ts +25 -25
  124. package/src/common/tree/toInnerTree.ts +61 -61
  125. package/src/common/tree/toPlainTree.ts +135 -135
  126. package/src/common/type.ts +26 -26
  127. package/src/common/webgl/buffer.ts +79 -79
  128. package/src/common/webgl/getWebGLContext.ts +45 -45
  129. package/src/common/webgl/shader.ts +75 -75
  130. package/src/common/webgl/texture.ts +98 -98
  131. package/src/coordinate/MapCoordinate.ts +80 -80
  132. package/src/getLoopColors.ts +42 -42
  133. package/src/interpolation/Cardinal.ts +110 -110
  134. package/src/interpolation/Hermite.ts +65 -65
  135. package/src/layout/BarLayout.ts +249 -249
  136. package/src/layout/TreeLayout.ts +200 -200
  137. package/src/move.ts +7 -7
  138. package/src/rotate.ts +7 -7
  139. package/src/ruler.ts +209 -209
  140. package/src/scale.ts +6 -6
  141. package/types/Bar.d.ts +91 -91
  142. package/types/BarConfig.d.ts +4 -4
  143. package/types/BarLayout.d.ts +48 -48
  144. package/types/BarOption.d.ts +31 -31
  145. package/types/Buffer.d.ts +23 -23
  146. package/types/Canvas.d.ts +375 -375
  147. package/types/CanvasConfig.d.ts +88 -88
  148. package/types/CanvasOption.d.ts +13 -13
  149. package/types/CanvasOpts.d.ts +9 -9
  150. package/types/Cardinal.d.ts +13 -13
  151. package/types/Gradient.d.ts +14 -14
  152. package/types/Hermite.d.ts +18 -18
  153. package/types/Map.d.ts +9 -9
  154. package/types/MapConfig.d.ts +27 -27
  155. package/types/MapCoordinate.d.ts +22 -22
  156. package/types/Matrix4.d.ts +47 -47
  157. package/types/Pie.d.ts +73 -73
  158. package/types/PieConfig.d.ts +26 -26
  159. package/types/PieLayout.d.ts +40 -40
  160. package/types/PieOption.d.ts +21 -21
  161. package/types/SVG.d.ts +278 -278
  162. package/types/SVGConfig.d.ts +71 -71
  163. package/types/Shader.d.ts +16 -16
  164. package/types/Texture.d.ts +16 -16
  165. package/types/Tree.d.ts +74 -74
  166. package/types/TreeConfig.d.ts +36 -36
  167. package/types/TreeLayout.d.ts +59 -59
  168. package/types/TreeOption.d.ts +48 -48
  169. package/types/animation.d.ts +11 -11
  170. package/types/assemble.d.ts +5 -5
  171. package/types/getLoopColors.d.ts +5 -5
  172. package/types/getWebGLContext.d.ts +7 -7
  173. package/types/index.d.ts +196 -196
  174. package/types/move.d.ts +5 -5
  175. package/types/option.d.ts +12 -12
  176. package/types/painterConfig.d.ts +4 -4
  177. package/types/rotate.d.ts +5 -5
  178. package/types/ruler.d.ts +10 -10
  179. package/types/scale.d.ts +5 -5
  180. package/types/throttle.d.ts +5 -5
  181. package/types/ui-canvas.d.ts +4 -4
  182. package/types/uni-canvas.d.ts +3 -3
  183. package/uni-app/drawImage.js +19 -19
  184. package/uni-app/ui-canvas.vue +295 -295
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * TreeLayout of VISLite JavaScript Library v1.9.0-alpha.2
2
+ * TreeLayout of VISLite JavaScript Library v1.9.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  /******************************************************************************
@@ -188,129 +188,129 @@ var Tree = (function () {
188
188
  }());
189
189
 
190
190
  /*!
191
- * animation of OIPage v1.8.0-alpha.1
191
+ * animation of OIPage v1.8.0
192
192
  * git+https://github.com/oi-contrib/OIPage.git
193
193
  */
194
194
 
195
- //当前正在运动的动画的tick函数堆栈
196
- var $timers = [];
197
- //唯一定时器的定时间隔
198
- var $interval = 13;
199
- //定时器ID
200
- var $timerId;
201
-
202
- /**
203
- * 动画轮播
204
- * @param {function} doback 轮询函数,有一个形参deep,0-1,表示执行进度
205
- * @param {number} duration 动画时长,可选
206
- * @param {function} callback 动画结束回调,可选,有一个形参deep,0-1,表示执行进度
207
- *
208
- * @returns {object} 返回一个对象,包含一个stop方法,用于在动画结束前结束动画
209
- */
210
- function animation(doback, duration, callback) {
211
- if (arguments.length < 2) duration = 400;
212
- if (arguments.length < 3) callback = function () { };
213
-
214
- var clock = {
215
- //把tick函数推入堆栈
216
- "timer": function (tick, duration, callback) {
217
- if (!tick) {
218
- throw new Error('Tick is required!');
219
- }
220
- var id = new Date().valueOf() + "_" + (Math.random() * 1000).toFixed(0);
221
- $timers.push({
222
- "id": id,
223
- "createTime": new Date(),
224
- "tick": tick,
225
- "duration": duration,
226
- "callback": callback
227
- });
228
- clock.start();
229
- return id;
230
- },
231
-
232
- //开启唯一的定时器timerId
233
- "start": function () {
234
- if (!$timerId) {
235
- try {
236
- if (globalThis && globalThis.requestAnimationFrame) {
237
- $timerId = globalThis.requestAnimationFrame(function step() {
238
- clock.tick();
239
- if ($timerId) $timerId = globalThis.requestAnimationFrame(step);
240
- });
241
- } else {
242
- $timerId = setInterval(clock.tick, $interval);
243
- }
244
- } catch (e) {
245
- $timerId = setInterval(clock.tick, $interval);
246
- }
247
- }
248
- },
249
-
250
- //被定时器调用,遍历timers堆栈
251
- "tick": function () {
252
- var createTime, flag, tick, callback, timer, duration, passTime, timers = $timers;
253
-
254
- $timers = [];
255
- $timers.length = 0;
256
-
257
- for (flag = 0; flag < timers.length; flag++) {
258
- //初始化数据
259
- timer = timers[flag];
260
- createTime = timer.createTime;
261
- tick = timer.tick;
262
- duration = timer.duration;
263
- callback = timer.callback;
264
-
265
- //执行
266
- passTime = (+new Date().valueOf() - createTime.valueOf()) / duration;
267
- passTime = passTime > 1 ? 1 : passTime;
268
- tick(passTime);
269
- if (passTime < 1 && timer.id) {
270
- //动画没有结束再添加
271
- $timers.push(timer);
272
- } else {
273
- callback(passTime);
274
- }
275
- }
276
- if ($timers.length <= 0) {
277
- clock.stop();
278
- }
279
- },
280
-
281
- //停止定时器,重置timerId=null
282
- "stop": function () {
283
- if ($timerId) {
284
- try {
285
- if (globalThis && globalThis.requestAnimationFrame) globalThis.cancelAnimationFrame($timerId);
286
- else clearInterval($timerId);
287
- } catch (e) {
288
- clearInterval($timerId);
289
- }
290
- $timerId = null;
291
- }
292
- }
293
- };
294
-
295
- var id = clock.timer(function (deep) {
296
- //其中deep为0-1,表示改变的程度
297
- doback(deep);
298
- }, duration, callback);
299
-
300
- return {
301
- // 一个函数
302
- // 用于在动画结束前结束动画
303
- stop: function () {
304
- var i;
305
- for (i in $timers) {
306
- if ($timers[i].id == id) {
307
- $timers[i].id = void 0;
308
- return;
309
- }
310
- }
311
- }
312
- };
313
-
195
+ //当前正在运动的动画的tick函数堆栈
196
+ var $timers = [];
197
+ //唯一定时器的定时间隔
198
+ var $interval = 13;
199
+ //定时器ID
200
+ var $timerId;
201
+
202
+ /**
203
+ * 动画轮播
204
+ * @param {function} doback 轮询函数,有一个形参deep,0-1,表示执行进度
205
+ * @param {number} duration 动画时长,可选
206
+ * @param {function} callback 动画结束回调,可选,有一个形参deep,0-1,表示执行进度
207
+ *
208
+ * @returns {object} 返回一个对象,包含一个stop方法,用于在动画结束前结束动画
209
+ */
210
+ function animation(doback, duration, callback) {
211
+ if (arguments.length < 2) duration = 400;
212
+ if (arguments.length < 3) callback = function () { };
213
+
214
+ var clock = {
215
+ //把tick函数推入堆栈
216
+ "timer": function (tick, duration, callback) {
217
+ if (!tick) {
218
+ throw new Error('Tick is required!');
219
+ }
220
+ var id = new Date().valueOf() + "_" + (Math.random() * 1000).toFixed(0);
221
+ $timers.push({
222
+ "id": id,
223
+ "createTime": new Date(),
224
+ "tick": tick,
225
+ "duration": duration,
226
+ "callback": callback
227
+ });
228
+ clock.start();
229
+ return id;
230
+ },
231
+
232
+ //开启唯一的定时器timerId
233
+ "start": function () {
234
+ if (!$timerId) {
235
+ try {
236
+ if (globalThis && globalThis.requestAnimationFrame) {
237
+ $timerId = globalThis.requestAnimationFrame(function step() {
238
+ clock.tick();
239
+ if ($timerId) $timerId = globalThis.requestAnimationFrame(step);
240
+ });
241
+ } else {
242
+ $timerId = setInterval(clock.tick, $interval);
243
+ }
244
+ } catch (e) {
245
+ $timerId = setInterval(clock.tick, $interval);
246
+ }
247
+ }
248
+ },
249
+
250
+ //被定时器调用,遍历timers堆栈
251
+ "tick": function () {
252
+ var createTime, flag, tick, callback, timer, duration, passTime, timers = $timers;
253
+
254
+ $timers = [];
255
+ $timers.length = 0;
256
+
257
+ for (flag = 0; flag < timers.length; flag++) {
258
+ //初始化数据
259
+ timer = timers[flag];
260
+ createTime = timer.createTime;
261
+ tick = timer.tick;
262
+ duration = timer.duration;
263
+ callback = timer.callback;
264
+
265
+ //执行
266
+ passTime = (+new Date().valueOf() - createTime.valueOf()) / duration;
267
+ passTime = passTime > 1 ? 1 : passTime;
268
+ tick(passTime);
269
+ if (passTime < 1 && timer.id) {
270
+ //动画没有结束再添加
271
+ $timers.push(timer);
272
+ } else {
273
+ callback(passTime);
274
+ }
275
+ }
276
+ if ($timers.length <= 0) {
277
+ clock.stop();
278
+ }
279
+ },
280
+
281
+ //停止定时器,重置timerId=null
282
+ "stop": function () {
283
+ if ($timerId) {
284
+ try {
285
+ if (globalThis && globalThis.requestAnimationFrame) globalThis.cancelAnimationFrame($timerId);
286
+ else clearInterval($timerId);
287
+ } catch (e) {
288
+ clearInterval($timerId);
289
+ }
290
+ $timerId = null;
291
+ }
292
+ }
293
+ };
294
+
295
+ var id = clock.timer(function (deep) {
296
+ //其中deep为0-1,表示改变的程度
297
+ doback(deep);
298
+ }, duration, callback);
299
+
300
+ return {
301
+ // 一个函数
302
+ // 用于在动画结束前结束动画
303
+ stop: function () {
304
+ var i;
305
+ for (i in $timers) {
306
+ if ($timers[i].id == id) {
307
+ $timers[i].id = void 0;
308
+ return;
309
+ }
310
+ }
311
+ }
312
+ };
313
+
314
314
  }
315
315
 
316
316
  function rotate (cx, cy, deg, x, y) {
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * TreeLayout of VISLite JavaScript Library v1.9.0-alpha.2
2
+ * TreeLayout of VISLite JavaScript Library v1.9.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},t(e,o)};"function"==typeof SuppressedError&&SuppressedError;function e(t,e){for(var o in t)e[o]=t[o];return e}var o,n=function(){function t(t){void 0===t&&(t={}),this.name="Tree",this.__config=e(t,{root:function(t){return t},children:function(t){return t.children},id:function(t){return t.name}})}return t.prototype.use=function(t,e){return void 0===e&&(e={}),function(t,e,o){void 0===o&&(o={});var n=function(t,e){var o,n,i={},r=e.root(t);o=n=e.id(r),i[o]={data:r,pid:null,id:o,isOpen:!0,show:!0,deg:0,children:[]};var p=1;return function n(r,s){var h=e.children(r,t);p+=h?h.length:0;for(var d=0;h&&d<h.length;d++)o=e.id(h[d]),i[s].children.push(o),i[o]={data:h[d],pid:s,id:o,isOpen:!0,show:!0,deg:0,children:[]},n(h[d],o)}(r,o),{rid:n,value:i,num:p}}(t,e),i=n.value,r=n.rid;if(1==n.num)return i[r].left=.5,i[r].top=.5,i[r].show=!0,{deep:1,node:i,root:r,size:1};var p=[],s=0,h=0;for(var d in o[r]?(i[r].left=.5,i[r].top=.5,i[r].show=!0,s=1):function t(e,n){n>h&&(h=n);var r=0;if(!o[e.id])for(r=0;r<e.children.length;r++)t(i[e.children[r]],n+1);if(i[e.id].left=n+.5,0==r?(null==p[n]&&(p[n]=-.5),null==p[n-1]&&(p[n-1]=-.5),i[e.id].top=p[n]+1,p[n]+1+.5*(i[e.pid].children.length-1)-1<p[n-1]&&(i[e.id].top=p[n-1]+1-.5*(i[e.pid].children.length-1))):i[e.id].top=.5*(i[e.children[0]].top+i[e.children[r-1]].top),i[e.id].top<=p[n])var d=p[n]+1-i[e.id].top((function t(e,o){i[e].top+=d,p[o]<i[e].top&&(p[o]=i[e].top);for(var n=0;n<i[e].children.length;n++)t(i[e].children[n],o+1)}))(e.id,n);p[n]=i[e.id].top,i[e.id].top+.5>s&&(s=i[e.id].top+.5)}(i[r],0),o)o[d]&&(i[d].isOpen=!1,function t(e,o,n){for(var r=0;r<i[e].children.length;r++)i[i[e].children[r]].left=o,i[i[e].children[r]].top=n,i[i[e].children[r]].show=!1,t(i[e].children[r],o,n)}(d,i[d].left,i[d].top));return{node:i,root:r,size:s,deep:h+1}}(t,this.__config,e)},t}(),i=[];
6
6
  /*!
7
- * animation of OIPage v1.8.0-alpha.1
7
+ * animation of OIPage v1.8.0
8
8
  * git+https://github.com/oi-contrib/OIPage.git
9
9
  */function r(t,e,o,n,i){var r=Math.cos(o),p=Math.sin(o);return[(n-t)*r-(i-e)*p+t,(n-t)*p+(i-e)*r+e]}var p=function(n){function p(){var t=null!==n&&n.apply(this,arguments)||this;return t.name="TreeLayout",t.__option={offsetX:0,offsetY:0,duration:500,type:"plain",direction:"LR",x:100,y:100,width:100,height:100,radius:100},t.__noOpens={},t}return function(e,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}(p,n),p.prototype.setOption=function(t){return e(t,this.__option),this},p.prototype.use=function(t,e){void 0===e&&(e={});var o=n.prototype.use.call(this,t,e);if(0!=this.__option.offsetX||0!=this.__option.offsetY)for(var i in o.node)if(!o.node[i].show){var p=0,s=i;do{s=o.node[s].pid,p++}while(!o.node[s].show);o.node[i].left+=this.__option.offsetX*p,o.node[i].top+=this.__option.offsetY*p}if("rect"==this.__option.type){if("LR"==this.__option.direction||"RL"==this.__option.direction){var h=this.__option.height/o.size,d=this.__option.width/(o.deep-1),_=this.__option.y-.5*this.__option.height,l="LR"==this.__option.direction?1:-1;for(var i in o.node)1==o.deep?(o.node[i].left=this.__option.x+.5*this.__option.width*l,o.node[i].top=this.__option.y):(o.node[i].left=this.__option.x+(o.node[i].left-.5)*d*l,o.node[i].top=o.node[i].top*h+_)}else if("TB"==this.__option.direction||"BT"==this.__option.direction){h=this.__option.width/o.size,d=this.__option.height/(o.deep-1),_=this.__option.x-.5*this.__option.width,l="TB"==this.__option.direction?1:-1;for(var i in o.node)if(o.node[i].deg="TB"==this.__option.direction?.5*Math.PI:-.5*Math.PI,1==o.deep)o.node[i].left=this.__option.x,o.node[i].top=this.__option.y+.5*this.__option.height*l;else{var a=o.node[i].left;o.node[i].left=o.node[i].top*h+_,o.node[i].top=this.__option.y+(a-.5)*d*l}}}else if("circle"==this.__option.type){var f=this.__option.x,c=this.__option.y,u=2*Math.PI/o.size,v=this.__option.radius/(o.deep-1);for(var i in o.node)if(.5==o.node[i].left)o.node[i].left=f,o.node[i].top=c;else{var T=r(f,c,u*o.node[i].top,f+(o.node[i].left-.5)*v,c);o.node[i].deg=u*o.node[i].top,o.node[i].left=T[0],o.node[i].top=T[1]}}return o},p.prototype.bind=function(t,e,o){return void 0===o&&(o={}),this.__rback=e,this.__oralTree=t,this.__noOpens=o,this.__preTree=this.use(this.__oralTree,this.__noOpens),this.__rback(this.__preTree),this},p.prototype.unbind=function(){return this.__rback=function(){return null},this.__oralTree=null,this.__preTree=null,this.__noOpens={},this},p.prototype.doUpdate=function(){var t=this,e=this.use(this.__oralTree,this.__noOpens),n=JSON.parse(JSON.stringify(e));return function(t,e,n){arguments.length<2&&(e=400),arguments.length<3&&(n=function(){});var r={timer:function(t,e,o){if(!t)throw new Error("Tick is required!");var n=(new Date).valueOf()+"_"+(1e3*Math.random()).toFixed(0);return i.push({id:n,createTime:new Date,tick:t,duration:e,callback:o}),r.start(),n},start:function(){if(!o)try{o=globalThis&&globalThis.requestAnimationFrame?globalThis.requestAnimationFrame((function t(){r.tick(),o&&(o=globalThis.requestAnimationFrame(t))})):setInterval(r.tick,13)}catch(t){o=setInterval(r.tick,13)}},tick:function(){var t,e,o,n,p,s,h,d=i;for((i=[]).length=0,e=0;e<d.length;e++)t=(p=d[e]).createTime,o=p.tick,s=p.duration,n=p.callback,o(h=(h=(+(new Date).valueOf()-t.valueOf())/s)>1?1:h),h<1&&p.id?i.push(p):n(h);i.length<=0&&r.stop()},stop:function(){if(o){try{globalThis&&globalThis.requestAnimationFrame?globalThis.cancelAnimationFrame(o):clearInterval(o)}catch(t){clearInterval(o)}o=null}}},p=r.timer((function(e){t(e)}),e,n)}((function(o){if(t.__preTree)for(var i in n.node)(e.node[i].show||t.__preTree.node[i].show)&&(n.node[i].show=!0,n.node[i].left=t.__preTree.node[i].left+(e.node[i].left-t.__preTree.node[i].left)*o,n.node[i].top=t.__preTree.node[i].top+(e.node[i].top-t.__preTree.node[i].top)*o);t.__rback(n)}),this.__option.duration,(function(){t.__preTree=e,t.__rback(t.__preTree)})),this},p.prototype.closeNode=function(t){return this.__preTree?(this.__noOpens[t]=!0,this.doUpdate(),this):this},p.prototype.openNode=function(t){return this.__preTree?(this.__noOpens[t]=!1,this.doUpdate(),this):this},p.prototype.toggleNode=function(t){return this.__preTree?(this.__noOpens[t]=!this.__noOpens[t],this.doUpdate(),this):this},p}(n);export{p as default};
@@ -1,131 +1,131 @@
1
1
  /*!
2
- * animation of VISLite JavaScript Library v1.9.0-alpha.2
2
+ * animation of VISLite JavaScript Library v1.9.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  /*!
6
- * animation of OIPage v1.8.0-alpha.1
6
+ * animation of OIPage v1.8.0
7
7
  * git+https://github.com/oi-contrib/OIPage.git
8
8
  */
9
9
 
10
- //当前正在运动的动画的tick函数堆栈
11
- var $timers = [];
12
- //唯一定时器的定时间隔
13
- var $interval = 13;
14
- //定时器ID
15
- var $timerId;
16
-
17
- /**
18
- * 动画轮播
19
- * @param {function} doback 轮询函数,有一个形参deep,0-1,表示执行进度
20
- * @param {number} duration 动画时长,可选
21
- * @param {function} callback 动画结束回调,可选,有一个形参deep,0-1,表示执行进度
22
- *
23
- * @returns {object} 返回一个对象,包含一个stop方法,用于在动画结束前结束动画
24
- */
25
- function animation(doback, duration, callback) {
26
- if (arguments.length < 2) duration = 400;
27
- if (arguments.length < 3) callback = function () { };
28
-
29
- var clock = {
30
- //把tick函数推入堆栈
31
- "timer": function (tick, duration, callback) {
32
- if (!tick) {
33
- throw new Error('Tick is required!');
34
- }
35
- var id = new Date().valueOf() + "_" + (Math.random() * 1000).toFixed(0);
36
- $timers.push({
37
- "id": id,
38
- "createTime": new Date(),
39
- "tick": tick,
40
- "duration": duration,
41
- "callback": callback
42
- });
43
- clock.start();
44
- return id;
45
- },
46
-
47
- //开启唯一的定时器timerId
48
- "start": function () {
49
- if (!$timerId) {
50
- try {
51
- if (globalThis && globalThis.requestAnimationFrame) {
52
- $timerId = globalThis.requestAnimationFrame(function step() {
53
- clock.tick();
54
- if ($timerId) $timerId = globalThis.requestAnimationFrame(step);
55
- });
56
- } else {
57
- $timerId = setInterval(clock.tick, $interval);
58
- }
59
- } catch (e) {
60
- $timerId = setInterval(clock.tick, $interval);
61
- }
62
- }
63
- },
64
-
65
- //被定时器调用,遍历timers堆栈
66
- "tick": function () {
67
- var createTime, flag, tick, callback, timer, duration, passTime, timers = $timers;
68
-
69
- $timers = [];
70
- $timers.length = 0;
71
-
72
- for (flag = 0; flag < timers.length; flag++) {
73
- //初始化数据
74
- timer = timers[flag];
75
- createTime = timer.createTime;
76
- tick = timer.tick;
77
- duration = timer.duration;
78
- callback = timer.callback;
79
-
80
- //执行
81
- passTime = (+new Date().valueOf() - createTime.valueOf()) / duration;
82
- passTime = passTime > 1 ? 1 : passTime;
83
- tick(passTime);
84
- if (passTime < 1 && timer.id) {
85
- //动画没有结束再添加
86
- $timers.push(timer);
87
- } else {
88
- callback(passTime);
89
- }
90
- }
91
- if ($timers.length <= 0) {
92
- clock.stop();
93
- }
94
- },
95
-
96
- //停止定时器,重置timerId=null
97
- "stop": function () {
98
- if ($timerId) {
99
- try {
100
- if (globalThis && globalThis.requestAnimationFrame) globalThis.cancelAnimationFrame($timerId);
101
- else clearInterval($timerId);
102
- } catch (e) {
103
- clearInterval($timerId);
104
- }
105
- $timerId = null;
106
- }
107
- }
108
- };
109
-
110
- var id = clock.timer(function (deep) {
111
- //其中deep为0-1,表示改变的程度
112
- doback(deep);
113
- }, duration, callback);
114
-
115
- return {
116
- // 一个函数
117
- // 用于在动画结束前结束动画
118
- stop: function () {
119
- var i;
120
- for (i in $timers) {
121
- if ($timers[i].id == id) {
122
- $timers[i].id = void 0;
123
- return;
124
- }
125
- }
126
- }
127
- };
128
-
10
+ //当前正在运动的动画的tick函数堆栈
11
+ var $timers = [];
12
+ //唯一定时器的定时间隔
13
+ var $interval = 13;
14
+ //定时器ID
15
+ var $timerId;
16
+
17
+ /**
18
+ * 动画轮播
19
+ * @param {function} doback 轮询函数,有一个形参deep,0-1,表示执行进度
20
+ * @param {number} duration 动画时长,可选
21
+ * @param {function} callback 动画结束回调,可选,有一个形参deep,0-1,表示执行进度
22
+ *
23
+ * @returns {object} 返回一个对象,包含一个stop方法,用于在动画结束前结束动画
24
+ */
25
+ function animation(doback, duration, callback) {
26
+ if (arguments.length < 2) duration = 400;
27
+ if (arguments.length < 3) callback = function () { };
28
+
29
+ var clock = {
30
+ //把tick函数推入堆栈
31
+ "timer": function (tick, duration, callback) {
32
+ if (!tick) {
33
+ throw new Error('Tick is required!');
34
+ }
35
+ var id = new Date().valueOf() + "_" + (Math.random() * 1000).toFixed(0);
36
+ $timers.push({
37
+ "id": id,
38
+ "createTime": new Date(),
39
+ "tick": tick,
40
+ "duration": duration,
41
+ "callback": callback
42
+ });
43
+ clock.start();
44
+ return id;
45
+ },
46
+
47
+ //开启唯一的定时器timerId
48
+ "start": function () {
49
+ if (!$timerId) {
50
+ try {
51
+ if (globalThis && globalThis.requestAnimationFrame) {
52
+ $timerId = globalThis.requestAnimationFrame(function step() {
53
+ clock.tick();
54
+ if ($timerId) $timerId = globalThis.requestAnimationFrame(step);
55
+ });
56
+ } else {
57
+ $timerId = setInterval(clock.tick, $interval);
58
+ }
59
+ } catch (e) {
60
+ $timerId = setInterval(clock.tick, $interval);
61
+ }
62
+ }
63
+ },
64
+
65
+ //被定时器调用,遍历timers堆栈
66
+ "tick": function () {
67
+ var createTime, flag, tick, callback, timer, duration, passTime, timers = $timers;
68
+
69
+ $timers = [];
70
+ $timers.length = 0;
71
+
72
+ for (flag = 0; flag < timers.length; flag++) {
73
+ //初始化数据
74
+ timer = timers[flag];
75
+ createTime = timer.createTime;
76
+ tick = timer.tick;
77
+ duration = timer.duration;
78
+ callback = timer.callback;
79
+
80
+ //执行
81
+ passTime = (+new Date().valueOf() - createTime.valueOf()) / duration;
82
+ passTime = passTime > 1 ? 1 : passTime;
83
+ tick(passTime);
84
+ if (passTime < 1 && timer.id) {
85
+ //动画没有结束再添加
86
+ $timers.push(timer);
87
+ } else {
88
+ callback(passTime);
89
+ }
90
+ }
91
+ if ($timers.length <= 0) {
92
+ clock.stop();
93
+ }
94
+ },
95
+
96
+ //停止定时器,重置timerId=null
97
+ "stop": function () {
98
+ if ($timerId) {
99
+ try {
100
+ if (globalThis && globalThis.requestAnimationFrame) globalThis.cancelAnimationFrame($timerId);
101
+ else clearInterval($timerId);
102
+ } catch (e) {
103
+ clearInterval($timerId);
104
+ }
105
+ $timerId = null;
106
+ }
107
+ }
108
+ };
109
+
110
+ var id = clock.timer(function (deep) {
111
+ //其中deep为0-1,表示改变的程度
112
+ doback(deep);
113
+ }, duration, callback);
114
+
115
+ return {
116
+ // 一个函数
117
+ // 用于在动画结束前结束动画
118
+ stop: function () {
119
+ var i;
120
+ for (i in $timers) {
121
+ if ($timers[i].id == id) {
122
+ $timers[i].id = void 0;
123
+ return;
124
+ }
125
+ }
126
+ }
127
+ };
128
+
129
129
  }
130
130
 
131
131
  function index (doback, duration, callback) {
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * animation of VISLite JavaScript Library v1.9.0-alpha.2
2
+ * animation of VISLite JavaScript Library v1.9.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  /*!
6
- * animation of OIPage v1.8.0-alpha.1
6
+ * animation of OIPage v1.8.0
7
7
  * git+https://github.com/oi-contrib/OIPage.git
8
8
  */
9
9
  var t,e=[],i=13;function n(n,a,r){return function(n,a,r){arguments.length<2&&(a=400),arguments.length<3&&(r=function(){});var o={timer:function(t,i,n){if(!t)throw new Error("Tick is required!");var a=(new Date).valueOf()+"_"+(1e3*Math.random()).toFixed(0);return e.push({id:a,createTime:new Date,tick:t,duration:i,callback:n}),o.start(),a},start:function(){if(!t)try{t=globalThis&&globalThis.requestAnimationFrame?globalThis.requestAnimationFrame((function e(){o.tick(),t&&(t=globalThis.requestAnimationFrame(e))})):setInterval(o.tick,i)}catch(e){t=setInterval(o.tick,i)}},tick:function(){var t,i,n,a,r,l,c,u=e;for((e=[]).length=0,i=0;i<u.length;i++)t=(r=u[i]).createTime,n=r.tick,l=r.duration,a=r.callback,n(c=(c=(+(new Date).valueOf()-t.valueOf())/l)>1?1:c),c<1&&r.id?e.push(r):a(c);e.length<=0&&o.stop()},stop:function(){if(t){try{globalThis&&globalThis.requestAnimationFrame?globalThis.cancelAnimationFrame(t):clearInterval(t)}catch(e){clearInterval(t)}t=null}}},l=o.timer((function(t){n(t)}),a,r);return{stop:function(){var t;for(t in e)if(e[t].id==l)return void(e[t].id=void 0)}}}(n,a||400,r||function(){}).stop}export{n as default};
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * assemble of VISLite JavaScript Library v1.9.0-alpha.2
2
+ * assemble of VISLite JavaScript Library v1.9.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  function assemble (begin, end, step, count) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * assemble of VISLite JavaScript Library v1.9.0-alpha.2
2
+ * assemble of VISLite JavaScript Library v1.9.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  function r(r,t,e,f){for(var n=[],o=0;o<f;o++)n[o]=r;return function(){for(var o=0;o<f;o++){if(n[o]+e<t){n[o]=+(n[o]+e).toFixed(7);break}o<f-1&&(n[o]=r)}return n}}export{r as default};
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * getLoopColors of VISLite JavaScript Library v1.9.0-alpha.2
2
+ * getLoopColors of VISLite JavaScript Library v1.9.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  function getLoopColors (num, alpha, colorsFactory) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * getLoopColors of VISLite JavaScript Library v1.9.0-alpha.2
2
+ * getLoopColors of VISLite JavaScript Library v1.9.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  function r(r,a,g){void 0===a&&(a=1);var t=g?g(a):["rgba(84,112,198,"+a+")","rgba(145,204,117,"+a+")","rgba(250,200,88,"+a+")","rgba(238,102,102,"+a+")","rgba(115,192,222,"+a+")","rgba(59,162,114,"+a+")","rgba(252,132,82,"+a+")","rgba(154,96,180,"+a+")","rgba(234,124,204,"+a+")"],e=[];if(r<=t.length)return t;if(r%t.length==0)for(var n=0;n<r/t.length;n++)e=e.concat(t);else{for(var o=1;o<r/t.length;o++)e=e.concat(t);if(r%t.length==1)e=e.concat(t[4]);else for(var b=0;b<r%t.length;b++)e=e.concat(t[b])}return e}export{r as default};
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * getWebGLContext of VISLite JavaScript Library v1.9.0-alpha.2
2
+ * getWebGLContext of VISLite JavaScript Library v1.9.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  function getWebGLContext (canvas, scale, opts, mode) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * getWebGLContext of VISLite JavaScript Library v1.9.0-alpha.2
2
+ * getWebGLContext of VISLite JavaScript Library v1.9.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  var e=function(e,t,i){if(void 0===t&&(t=1),!e)throw new Error("VISLite getWebGLContext:The mount point requires an HTMLElement type but encountered null.");var n,r=e.clientWidth,a=e.clientHeight,o=e;return o._vislite_canvas_?n=o._vislite_canvas_:(n=document.createElement("canvas"),e.appendChild(n),o._vislite_canvas_=n,e.setAttribute("vislite","WebGL")),n.style.width=r+"px",n.setAttribute("width",r+""),n.style.height=a+"px",n.setAttribute("height",a+""),function(e,t,i,n){void 0===i&&(i={}),void 0===n&&(n="scaleToFill");for(var r=["experimental-webgl","webkit-3d","moz-webgl"],a=e.getContext("webgl",i),o=0;o<r.length;o++){try{a=e.getContext(r[o],i)}catch(e){}if(a)break}if(!a)throw new Error("Non canvas or browser does not support webgl.");var l=a.canvas.width,s=a.canvas.height,c=t,v=t;"aspectFit"==n?l>s?c*=s/l:s>l&&(v*=l/s):"aspectFill"==n&&(l>s?v*=l/s:s>l&&(c*=s/l));var h=l*c,u=s*v;return a.viewport(.5*(l-h),.5*(s-u),h,u),a.depthFunc(a.LEQUAL),a.enable(a.DEPTH_TEST),a}(n,t,{},i)};export{e as default};