vislite 0.5.2-alpha.0 → 0.5.2-alpha.2

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 (70) hide show
  1. package/CHANGELOG +7 -1
  2. package/lib/Buffer/index.umd.js +55 -0
  3. package/lib/Buffer/index.umd.min.js +11 -0
  4. package/lib/Canvas/index.umd.js +721 -0
  5. package/lib/Canvas/index.umd.min.js +11 -0
  6. package/lib/Cardinal/index.umd.js +112 -0
  7. package/lib/Cardinal/index.umd.min.js +11 -0
  8. package/lib/Eoap/index.umd.js +53 -0
  9. package/lib/Eoap/index.umd.min.js +11 -0
  10. package/lib/Geometry/index.umd.js +205 -0
  11. package/lib/Geometry/index.umd.min.js +11 -0
  12. package/lib/Hermite/index.umd.js +55 -0
  13. package/lib/Hermite/index.umd.min.js +11 -0
  14. package/lib/Matrix4/index.umd.js +146 -0
  15. package/lib/Matrix4/index.umd.min.js +11 -0
  16. package/lib/Mercator/index.umd.js +39 -0
  17. package/lib/Mercator/index.umd.min.js +11 -0
  18. package/lib/OralCanvas/index.es.js +657 -0
  19. package/lib/OralCanvas/index.es.min.js +11 -0
  20. package/lib/OralWebGL/index.es.js +611 -0
  21. package/lib/OralWebGL/index.es.min.js +11 -0
  22. package/lib/SVG/index.umd.js +540 -0
  23. package/lib/SVG/index.umd.min.js +11 -0
  24. package/lib/Shader/index.umd.js +134 -0
  25. package/lib/Shader/index.umd.min.js +11 -0
  26. package/lib/Texture/index.umd.js +72 -0
  27. package/lib/Texture/index.umd.min.js +11 -0
  28. package/lib/TreeLayout/index.umd.js +430 -0
  29. package/lib/TreeLayout/index.umd.min.js +11 -0
  30. package/lib/WebGL/index.umd.js +684 -0
  31. package/lib/WebGL/index.umd.min.js +11 -0
  32. package/lib/animation/index.umd.js +91 -0
  33. package/lib/animation/index.umd.min.js +11 -0
  34. package/lib/formatColor/index.umd.js +59 -0
  35. package/lib/formatColor/index.umd.min.js +11 -0
  36. package/lib/getLoopColors/index.umd.js +55 -0
  37. package/lib/getLoopColors/index.umd.min.js +11 -0
  38. package/lib/getWebGLContext/index.umd.js +65 -0
  39. package/lib/getWebGLContext/index.umd.min.js +11 -0
  40. package/lib/index.umd.js +2916 -0
  41. package/lib/index.umd.min.js +11 -0
  42. package/lib/move/index.umd.js +27 -0
  43. package/lib/move/index.umd.min.js +11 -0
  44. package/lib/resizeObserver/index.umd.js +48 -0
  45. package/lib/resizeObserver/index.umd.min.js +11 -0
  46. package/lib/rotate/index.umd.js +27 -0
  47. package/lib/rotate/index.umd.min.js +11 -0
  48. package/lib/ruler/index.umd.js +145 -0
  49. package/lib/ruler/index.umd.min.js +11 -0
  50. package/lib/scale/index.umd.js +26 -0
  51. package/lib/scale/index.umd.min.js +11 -0
  52. package/lib/throttle/index.umd.js +70 -0
  53. package/lib/throttle/index.umd.min.js +11 -0
  54. package/lib/viewHandler/index.umd.js +139 -0
  55. package/lib/viewHandler/index.umd.min.js +11 -0
  56. package/package/index.ts +4 -0
  57. package/package/move/index.ts +3 -0
  58. package/package/scale/index.ts +3 -0
  59. package/package.json +1 -1
  60. package/src/common/svg/config.ts +157 -145
  61. package/src/common/svg/gradient.ts +63 -0
  62. package/src/common/svg/index.ts +12 -0
  63. package/src/move.ts +8 -0
  64. package/src/scale.ts +7 -0
  65. package/types/Canvas.d.ts +2 -2
  66. package/types/Gradient.d.ts +2 -2
  67. package/types/SVG.d.ts +23 -0
  68. package/types/index.d.ts +6 -0
  69. package/types/move.d.ts +3 -0
  70. package/types/scale.d.ts +3 -0
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * VISLite JavaScript Library v0.5.2-alpha.2
3
+ * git+https://github.com/oi-contrib/VISLite.git
4
+ *
5
+ * Copyright zxl20070701
6
+ * Released under the MIT license
7
+ * https://zxl20070701.github.io/notebook/home.html
8
+ *
9
+ * Publish Date: Mon Oct 23 2023 22:21:10 GMT+0800 (中国标准时间)
10
+ */
11
+ var t,e;t=this,e=function(){"use strict";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 e(t,e){for(var o in t)e[o]=t[o];return e}"function"==typeof SuppressedError&&SuppressedError;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){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,children:[]};var p=1;return function n(r,s){var d=e.children(r,t);p+=d?d.length:0;for(var _=0;d&&_<d.length;_++)o=e.id(d[_]),i[s].children.push(o),i[o]={data:d[_],pid:s,id:o,isOpen:!0,show:!0,children:[]},n(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,d=0;for(var _ in o[r]?(i[r].left=.5,i[r].top=.5,i[r].show=!0,s=1):function t(e,n){n>d&&(d=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 _=p[n]+1-i[e.id].top((function t(e,o){i[e].top+=_,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[_]&&(i[_].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)}(_,i[_].left,i[_].top));return{node:i,root:r,size:s,deep:d+1}}(t,this.__config,e)},t}(),i=[];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 d=this.__option.height/o.size,_=this.__option.width/(o.deep-1),h=this.__option.y-.5*this.__option.height,f="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*f,o.node[i].top=this.__option.y):(o.node[i].left=this.__option.x+(o.node[i].left-.5)*_*f,o.node[i].top=o.node[i].top*d+h)}else if("TB"==this.__option.direction||"BT"==this.__option.direction)for(var i in d=this.__option.width/o.size,_=this.__option.height/(o.deep-1),h=this.__option.x-.5*this.__option.width,f="TB"==this.__option.direction?1:-1,o.node)if(1==o.deep)o.node[i].left=this.__option.x,o.node[i].top=this.__option.y+.5*this.__option.height*f;else{var l=o.node[i].left;o.node[i].left=o.node[i].top*d+h,o.node[i].top=this.__option.y+(l-.5)*_*f}}else if("circle"==this.__option.type){var u=this.__option.x,c=this.__option.y,a=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=u,o.node[i].top=c;else{var y=r(u,c,a*o.node[i].top,u+(o.node[i].left-.5)*v,c);o.node[i].left=y[0],o.node[i].top=y[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=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));!function(t,e,n){void 0===e&&(e=400),void 0===n&&(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(){o||(o=setInterval(r.tick,13))},tick:function(){var t,e,o,n,p,s,d,_=i;for((i=[]).length=0,e=0;e<_.length;e++)t=(p=_[e]).createTime,o=p.tick,s=p.duration,n=p.callback,o(d=(d=(+(new Date).valueOf()-t.valueOf())/s)>1?1:d),d<1&&p.id?i.push(p):n(d);i.length<=0&&r.stop()},stop:function(){o&&(clearInterval(o),o=null)}};r.timer((function(e){t(e)}),e,n)}((function(o){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)}))},p.prototype.closeNode=function(t){if(this.__preTree)return this.__noOpens[t]=!0,this.doUpdate(),this},p.prototype.openNode=function(t){if(this.__preTree)return this.__noOpens[t]=!1,this.doUpdate(),this},p.prototype.toggleNode=function(t){if(this.__preTree)return this.__noOpens[t]=!this.__noOpens[t],this.doUpdate(),this},p}(n);return p},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_TreeLayout=e();