vislite 0.4.1-beta.3 → 0.4.1

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 (51) hide show
  1. package/lib/Buffer/index.umd.js +2 -2
  2. package/lib/Buffer/index.umd.min.js +2 -2
  3. package/lib/Canvas/index.umd.js +2 -2
  4. package/lib/Canvas/index.umd.min.js +2 -2
  5. package/lib/Cardinal/index.umd.js +2 -2
  6. package/lib/Cardinal/index.umd.min.js +2 -2
  7. package/lib/Eoap/index.umd.js +2 -2
  8. package/lib/Eoap/index.umd.min.js +2 -2
  9. package/lib/Hermite/index.umd.js +2 -2
  10. package/lib/Hermite/index.umd.min.js +2 -2
  11. package/lib/Matrix4/index.umd.js +2 -2
  12. package/lib/Matrix4/index.umd.min.js +2 -2
  13. package/lib/Mercator/index.umd.js +2 -2
  14. package/lib/Mercator/index.umd.min.js +2 -2
  15. package/lib/OralCanvas/index.es.js +2 -2
  16. package/lib/OralCanvas/index.es.min.js +2 -2
  17. package/lib/OralWebGL/index.es.js +2 -2
  18. package/lib/OralWebGL/index.es.min.js +2 -2
  19. package/lib/SVG/index.umd.js +2 -2
  20. package/lib/SVG/index.umd.min.js +2 -2
  21. package/lib/Shader/index.umd.js +2 -2
  22. package/lib/Shader/index.umd.min.js +2 -2
  23. package/lib/Texture/index.umd.js +2 -2
  24. package/lib/Texture/index.umd.min.js +2 -2
  25. package/lib/TreeLayout/index.umd.js +2 -2
  26. package/lib/TreeLayout/index.umd.min.js +2 -2
  27. package/lib/WebGL/index.umd.js +2 -2
  28. package/lib/WebGL/index.umd.min.js +2 -2
  29. package/lib/animation/index.umd.js +2 -2
  30. package/lib/animation/index.umd.min.js +2 -2
  31. package/lib/formatColor/index.umd.js +2 -2
  32. package/lib/formatColor/index.umd.min.js +2 -2
  33. package/lib/getLoopColors/index.umd.js +2 -2
  34. package/lib/getLoopColors/index.umd.min.js +2 -2
  35. package/lib/getWebGLContext/index.umd.js +2 -2
  36. package/lib/getWebGLContext/index.umd.min.js +2 -2
  37. package/lib/index.umd.js +2 -2
  38. package/lib/index.umd.min.js +2 -2
  39. package/lib/resizeObserver/index.umd.js +2 -2
  40. package/lib/resizeObserver/index.umd.min.js +2 -2
  41. package/lib/rotate/index.umd.js +2 -2
  42. package/lib/rotate/index.umd.min.js +2 -2
  43. package/lib/ruler/index.umd.js +2 -2
  44. package/lib/ruler/index.umd.min.js +2 -2
  45. package/lib/throttle/index.umd.js +2 -2
  46. package/lib/throttle/index.umd.min.js +2 -2
  47. package/lib/viewHandler/index.umd.js +2 -2
  48. package/lib/viewHandler/index.umd.min.js +2 -2
  49. package/package.json +1 -2
  50. package/types/Tree.d.ts +1 -1
  51. package/types/ruler.d.ts +1 -1
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,e;t=this,e=function(){"use strict";return function(){function t(t,e){void 0===e&&(e=!1),this.__painter=t,this.__isElement=e,this.__buffer=function(t){return t.createBuffer()}(t),this.__type=e?t.ELEMENT_ARRAY_BUFFER:t.ARRAY_BUFFER}return t.prototype.use=function(){return this.__painter.bindBuffer(this.__type,this.__buffer),this},t.prototype.write=function(t){return function(t,e,i,n){var r=i?t.ELEMENT_ARRAY_BUFFER:t.ARRAY_BUFFER;t.bufferData(r,e,n)}(this.__painter,t,this.__isElement,this.__painter.STATIC_DRAW),this.__fsize=t.BYTES_PER_ELEMENT,this},t.prototype.divide=function(t,e,i,n){return void 0===n&&(n=0),function(t,e,i,n,r,_,f){t.vertexAttribPointer(e,i,n,f,r,_),t.enableVertexAttribArray(e)}(this.__painter,t,e,this.__painter.FLOAT,i*this.__fsize,n*this.__fsize,!1),this},t}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_Buffer=e();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,i;t=this,i=function(){"use strict";var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};function i(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}"function"==typeof SuppressedError&&SuppressedError;var e=function(t,i,e,n,r){var o=Math.cos(e),s=Math.sin(e);return[+((n-t)*o-(r-i)*s+t).toFixed(7),+((n-t)*s+(r-i)*o+i).toFixed(7)]},n=function(t,i,e,n,r){return t.beginPath(),t.translate(e,n),t.rotate(r),t.font=i.fontStyle+" "+i.fontWeight+" "+i.fontSize+"px "+i.fontFamily,t},r=function(t,i,n,r,o,s,a,_){if(o>s){var h=o;o=s,s=h}return a%=2*Math.PI,_>=1.999999*Math.PI||_<=1.999999*-Math.PI?_=2*Math.PI:_%=2*Math.PI,function(t,i,n,r,o,s,a){i<0&&(t+=i,i*=-1);var _,h=[];_=e(0,0,t,o,0),h[0]=_[0],h[1]=_[1],_=e(0,0,i,_[0],_[1]),h[2]=_[0],h[3]=_[1],_=e(0,0,t,s,0),h[4]=_[0],h[5]=_[1],_=e(0,0,i,_[0],_[1]),h[6]=_[0],h[7]=_[1],a(t,t+i,h[0]+n,h[1]+r,h[4]+n,h[5]+r,h[2]+n,h[3]+r,h[6]+n,h[7]+r,.5*(s-o))}(a,_,n,r,o,s,(function(e,a,_,h,l,p,u,f,c,g,y){y<0&&(y=-y),t.beginPath(),t.moveTo(_,h),t.arc(n,r,o,e,a,!1),"round"==i.arcEndCap?t.arc(.5*(u+c),.5*(f+g),y,a-Math.PI,a,!0):"-round"==i.arcEndCap?t.arc(.5*(u+c),.5*(f+g),y,a-Math.PI,a,!1):t.lineTo(c,g),t.arc(n,r,s,a,e,!0),"round"==i.arcStartCap?t.arc(.5*(_+l),.5*(h+p),y,e,e-Math.PI,!0):"-round"==i.arcStartCap?t.arc(.5*(_+l),.5*(h+p),y,e,e-Math.PI,!1):t.lineTo(_,h)})),"butt"==i.arcStartCap&&t.closePath(),t},o=function(t,i,e,n){return t.beginPath(),t.moveTo(i+n,e),t.arc(i,e,n,0,2*Math.PI),t},s=function(t,i,e,n,r){return t.beginPath(),t.rect(i,e,n,r),t};function a(t,i,e,n,r){for(var o=0,s="",a=0;a<i.length;a++)t.measureText(s+i[a]).width>e||/\n$/.test(s)?(r(s,((o+=1)-.5)*n),s=i[a]):a==i.length-1?(o+=1,r(s+i[a],(o-.5)*n)):s+=i[a];return o*n}var _=function(){function t(t,i,e,n){void 0===i&&(i={}),void 0===n&&(n=!1),this.__region=null,this.__onlyRegion=!1,this.__specialConfig={fontSize:16,fontFamily:"sans-serif",fontWeight:400,fontStyle:"normal",arcStartCap:"butt",arcEndCap:"butt"},this.__initConfig={fillStyle:"black",strokeStyle:"black",lineWidth:1,textAlign:"left",textBaseline:"middle",lineDash:[],shadowBlur:0,shadowColor:"black"},this.painter=t.getContext("2d",i),this.__region=e,this.__isPainter=n,this.painter.textBaseline="middle",this.painter.textAlign="left"}return t.prototype.useConfig=function(t,i){if(this.__region&&["fillStyle","strokeStyle","shadowBlur","shadowColor"].indexOf(t)<0&&this.__region.useConfig(t,i),this.__isPainter&&this.__onlyRegion)return this;if("lineDash"==t)this.painter.setLineDash&&this.painter.setLineDash(i);else if(t in this.__specialConfig)"fontSize"==t&&(i=Math.round(i)),this.__specialConfig[t]=i;else{if(!(t in this.__initConfig))throw new Error("Illegal configuration item of painter : "+t+" !");this.painter[t]=i}return this},t.prototype.fillText=function(t,i,e,r){return void 0===r&&(r=0),this.__region&&this.__region.fillText(t,i,e,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),n(this.painter,this.__specialConfig,i,e,r).fillText(t,0,0),this.painter.restore()),this},t.prototype.strokeText=function(t,i,e,r){return void 0===r&&(r=0),this.__region&&this.__region.strokeText(t,i,e,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),n(this.painter,this.__specialConfig,i,e,r).strokeText(t,0,0),this.painter.restore()),this},t.prototype.fullText=function(t,i,e,r){return void 0===r&&(r=0),this.__region&&this.__region.fullText(t,i,e,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),n(this.painter,this.__specialConfig,i,e,r),this.painter.fillText(t,0,0),this.painter.strokeText(t,0,0),this.painter.restore()),this},t.prototype.fillTexts=function(t,i,e,r,o,s){var _=this;void 0===o&&(o=1.2),void 0===s&&(s=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,e,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),n(this.painter,this.__specialConfig,i,e,s);var l=a(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){_.painter.fillText(t,0,i)}));return this.painter.restore(),l},t.prototype.strokeTexts=function(t,i,e,r,o,s){var _=this;void 0===o&&(o=1.2),void 0===s&&(s=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,e,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),n(this.painter,this.__specialConfig,i,e,s);var l=a(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){_.painter.strokeText(t,0,i)}));return this.painter.restore(),l},t.prototype.fullTexts=function(t,i,e,r,o,s){var _=this;void 0===o&&(o=1.2),void 0===s&&(s=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,e,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),n(this.painter,this.__specialConfig,i,e,s);var l=a(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){_.painter.fillText(t,0,i),_.painter.strokeText(t,0,i)}));return this.painter.restore(),l},t.prototype.beginPath=function(){return this.__region&&this.__region.beginPath(),this.__isPainter&&this.__onlyRegion||this.painter.beginPath(),this},t.prototype.closePath=function(){return this.__region&&this.__region.closePath(),this.__isPainter&&this.__onlyRegion||this.painter.closePath(),this},t.prototype.moveTo=function(t,i){return this.__region&&this.__region.moveTo(t,i),this.__isPainter&&this.__onlyRegion||this.painter.moveTo(Math.round(t)+.5,Math.round(i)+.5),this},t.prototype.lineTo=function(t,i){return this.__region&&this.__region.lineTo(t,i),this.__isPainter&&this.__onlyRegion||this.painter.lineTo(Math.round(t)+.5,Math.round(i)+.5),this},t.prototype.arc=function(t,i,e,n,r){return this.__region&&this.__region.arc(t,i,e,n,r),this.__isPainter&&this.__onlyRegion||this.painter.arc(t,i,e,n,n+r,r<0),this},t.prototype.fill=function(){return this.__region&&this.__region.fill(),this.__isPainter&&this.__onlyRegion||this.painter.fill(),this},t.prototype.stroke=function(){return this.__region&&this.__region.stroke(),this.__isPainter&&this.__onlyRegion||this.painter.stroke(),this},t.prototype.full=function(){return this.__region&&this.__region.full(),this.__isPainter&&this.__onlyRegion||(this.painter.fill(),this.painter.stroke()),this},t.prototype.save=function(){return this.__region&&this.__region.save(),this.__isPainter&&this.__onlyRegion||this.painter.save(),this},t.prototype.restore=function(){return this.__region&&this.__region.restore(),this.__isPainter&&this.__onlyRegion||this.painter.restore(),this},t.prototype.clip=function(){return this.__region&&this.__region.clip(),this.__isPainter&&this.__onlyRegion||this.painter.clip(),this},t.prototype.quadraticCurveTo=function(t,i,e,n){return this.__region&&this.__region.quadraticCurveTo(t,i,e,n),this.__isPainter&&this.__onlyRegion||this.painter.quadraticCurveTo(t,i,e,n),this},t.prototype.bezierCurveTo=function(t,i,e,n,r,o){return this.__region&&this.__region.bezierCurveTo(t,i,e,n,r,o),this.__isPainter&&this.__onlyRegion||this.painter.bezierCurveTo(t,i,e,n,r,o),this},t.prototype.clearRect=function(t,i,e,n){return this.__region&&this.__region.clearRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||this.painter.clearRect(t,i,e,n),this},t.prototype.fillArc=function(t,i,e,n,o,s){return this.__region&&this.__region.fillArc(t,i,e,n,o,s),this.__isPainter&&this.__onlyRegion||r(this.painter,this.__specialConfig,t,i,e,n,o,s).fill(),this},t.prototype.strokeArc=function(t,i,e,n,o,s){return this.__region&&this.__region.strokeArc(t,i,e,n,o,s),this.__isPainter&&this.__onlyRegion||r(this.painter,this.__specialConfig,t,i,e,n,o,s).stroke(),this},t.prototype.fullArc=function(t,i,e,n,o,s){return this.__region&&this.__region.fullArc(t,i,e,n,o,s),this.__isPainter&&this.__onlyRegion||(r(this.painter,this.__specialConfig,t,i,e,n,o,s),this.painter.fill(),this.painter.stroke()),this},t.prototype.fillCircle=function(t,i,e){return this.__region&&this.__region.fillCircle(t,i,e),this.__isPainter&&this.__onlyRegion||o(this.painter,t,i,e).fill(),this},t.prototype.strokeCircle=function(t,i,e){return this.__region&&this.__region.strokeCircle(t,i,e),this.__isPainter&&this.__onlyRegion||o(this.painter,t,i,e).stroke(),this},t.prototype.fullCircle=function(t,i,e){return this.__region&&this.__region.fullCircle(t,i,e),this.__isPainter&&this.__onlyRegion||(o(this.painter,t,i,e),this.painter.fill(),this.painter.stroke()),this},t.prototype.fillRect=function(t,i,e,n){return this.__region&&this.__region.fillRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||s(this.painter,t,i,e,n).fill(),this},t.prototype.strokeRect=function(t,i,e,n){return this.__region&&this.__region.strokeRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||s(this.painter,t,i,e,n).stroke(),this},t.prototype.fullRect=function(t,i,e,n){return this.__region&&this.__region.fullRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||(s(this.painter,t,i,e,n),this.painter.fill(),this.painter.stroke()),this},t.prototype.draw=function(){},t}(),h={"font-size":"fontSize","font-family":"fontFamily","font-weight":"fontWeight","font-style":"fontStyle","arc-start-cap":"arcStartCap","arc-end-cap":"arcEndCap"},l=function(t){function e(i,e){var n=t.call(this,i,{},e?new _(e,{willReadFrequently:!0}):null,!0)||this;return n.name="Canvas",n.__regionList={},n.__regionAssemble=function(t,i,e,n){for(var r=[],o=0;o<n;o++)r[o]=t;return function(){for(var o=0;o<n;o++){if(r[o]+e<i){r[o]=+(r[o]+e).toFixed(7);break}o<n-1&&(r[o]=t)}return r}}(0,255,10,3),n.setRegion(""),n}return i(e,t),e.prototype.config=function(t){for(var i in t){var e=h[i]||i;this.useConfig(e,t[i])}return this},e.prototype.onlyRegion=function(t){return this.__onlyRegion=t,this},e.prototype.setRegion=function(t){if(this.__region)if(t){if(null==this.__regionList[t]){var i=this.__regionAssemble();this.__regionList[t]="rgb("+i[0]+","+i[1]+","+i[2]+")"}this.__region.useConfig("fillStyle",this.__regionList[t])&&this.__region.useConfig("strokeStyle",this.__regionList[t])}else this.__region.useConfig("fillStyle","#000000")&&this.__region.useConfig("strokeStyle","#000000");return this},e.prototype.getRegion=function(t,i){var e=this;return new Promise((function(n,r){var o=e.__region?e.__region.painter.getImageData(t-.5,i-.5,1,1):{data:[0,0,0,0]},s=o.data,a=function(){if(e.__region)for(var t in e.__regionList)if("rgb("+s[0]+","+s[1]+","+s[2]+")"==e.__regionList[t]){n(t);break}n("")};s?a():o.then((function(t){s=t,a()}))}))},e.prototype.textWidth=function(t){this.painter.save(),n(this.painter,this.__specialConfig,0,0,0);var i=this.painter.measureText(t+"").width;return this.painter.restore(),i},e.prototype.getContext=function(t){return void 0===t&&(t=!1),t?this.__region?this.__region.painter:null:this.painter},e.prototype.createLinearGradient=function(t,i,e,n){return function(t,i,e,n,r){var o=t.createLinearGradient(i,e,n,r),s={value:function(){return o},setColor:function(t,i){return o.addColorStop(t,i),s}};return s}(this.painter,t,i,e,n)},e.prototype.createRadialGradient=function(t,i,e){return function(t,i,e,n){var r=t.createRadialGradient(i,e,0,i,e,n),o={value:function(){return r},setColor:function(t,i){return r.addColorStop(t,i),o}};return o}(this.painter,t,i,e)},e.prototype.getColor=function(t,i){var e=this.painter.getImageData(t-.5,i-.5,1,1).data;return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},e}(_);return function(t){function e(i,e){void 0===e&&(e={});var n=this;if(!i)throw new Error("VISLite Canvas:The mount point requires an HTMLElement type but encountered null.");e=function(t,i){for(var e in t)i[e]=t[e];return i}(e,{region:!0});var r,o,s=i.clientWidth,a=i.clientHeight,_=i;_._vislite_canvas_?(r=_._vislite_canvas_[0],o=_._vislite_canvas_[1]):(r=document.createElement("canvas"),i.appendChild(r),e.region&&(o=document.createElement("canvas")),_._vislite_canvas_=[r,o],i.setAttribute("vislite","Canvas"));for(var h=0,l=[r,o];h<l.length;h++){var p=l[h];p&&(p.style.width=s+"px",p.setAttribute("width",s+""),p.style.height=a+"px",p.setAttribute("height",a+""))}return(n=t.call(this,r,o)||this).__canvas=r,n}return i(e,t),e.prototype.toDataURL=function(){var t=this;return new Promise((function(i){i(t.__canvas.toDataURL())}))},e}(l)},"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_Canvas=i();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,i;t=this,i=function(){"use strict";var t=function(){function t(t){void 0===t&&(t=.5),this.name="Hermite",this.__u=t}return t.prototype.setP=function(t,i,_,h,s,e){if(!(t<_))throw new Error("The point x-position should be increamented!");this.__a=t,this.__b=_;var n=this.__u*s,o=this.__u*e;return i/=_-t,h/=_-t,this.__MR=[2*i-2*h+n+o,3*h-3*i-2*n-o,n,i],this},t.prototype.use=function(t){if(this.__MR){var i=(t-this.__a)/(this.__b-this.__a),_=i*i;return(i*_*this.__MR[0]+_*this.__MR[1]+i*this.__MR[2]+this.__MR[3])*(this.__b-this.__a)}throw new Error("You shoud first set the position!")},t}();return function(){function i(t){void 0===t&&(t=0),this.name="Cardinal",this.__t=t}return i.prototype.setP=function(i){this.__HS={x:[],h:[]};var _,h,s=(i[1][1]-i[0][1])/(i[1][0]-i[0][0]);for(this.__HS.x[0]=i[0][0],_=1;_<i.length;_++){if(i[_][0]<=i[_-1][0])throw new Error("The point position should be increamented!");this.__HS.x[_]=i[_][0],h=_<i.length-1?i[_+1][1]>i[_][1]&&i[_-1][1]>i[_][1]||i[_+1][1]<i[_][1]&&i[_-1][1]<i[_][1]||i[_+1][1]==i[_][1]||i[_-1][1]==i[_][1]?0:(i[_+1][1]-i[_-1][1])/(i[_+1][0]-i[_-1][0]):(i[_][1]-i[_-1][1])/(i[_][0]-i[_-1][0]),this.__HS.h[_-1]=new t(.5*(1-this.__t)).setP(i[_-1][0],i[_-1][1],i[_][0],i[_][1],s,h),s=h}return this},i.prototype.use=function(t){if(this.__HS){for(this.__i=-1;this.__i+1<this.__HS.x.length&&(t>this.__HS.x[this.__i+1]||-1==this.__i&&t>=this.__HS.x[this.__i+1]);)this.__i+=1;return this.__i<0?this.__HS.h[0].use(this.__HS.x[0]):this.__i>=this.__HS.h.length?this.__HS.h[this.__HS.h.length-1].use(this.__HS.x[this.__HS.x.length-1]):this.__HS.h[this.__i].use(t)}throw new Error("You shoud first set the position!")},i}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_Cardinal=i();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,e;t=this,e=function(){"use strict";var t=function(t,e,n,i){var o=Math.cos(t),a=Math.sin(t);return[e*o-n*a,e*a+n*o,i]};return function(){function e(t,e){void 0===t&&(t=7),void 0===e&&(e=[107,36]),this.name="Eoap",this.__scale=t,this.__center=e}return e.prototype.use=function(e,n){var i,o,a,s,r,h,u=(i=(360-n)/180*Math.PI,o=100*this.__scale,a=0,s=0,r=Math.cos(i),h=Math.sin(i),[s*h+o*r,a,s*r-o*h]);return u=t(e/180*Math.PI,u[0],u[1],u[2]),u=t((90-this.__center[0])/180*Math.PI,u[0],u[1],u[2]),u=function(t,e,n,i){var o=Math.cos(t),a=Math.sin(t);return[e,n*o-i*a,n*a+i*o]}((90-this.__center[1])/180*Math.PI,u[0],u[1],u[2]),[-u[0],u[1],u[2]]},e}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_Eoap=e();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,i;t=this,i=function(){"use strict";return function(){function t(t){void 0===t&&(t=.5),this.name="Hermite",this.__u=t}return t.prototype.setP=function(t,i,e,o,s,_){if(!(t<e))throw new Error("The point x-position should be increamented!");this.__a=t,this.__b=e;var n=this.__u*s,r=this.__u*_;return i/=e-t,o/=e-t,this.__MR=[2*i-2*o+n+r,3*o-3*i-2*n-r,n,i],this},t.prototype.use=function(t){if(this.__MR){var i=(t-this.__a)/(this.__b-this.__a),e=i*i;return(i*e*this.__MR[0]+e*this.__MR[1]+i*this.__MR[2]+this.__MR[3])*(this.__b-this.__a)}throw new Error("You shoud first set the position!")},t}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_Hermite=i();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,r;t=this,r=function(){"use strict";var t=function(t,r){for(var i=[],e=0;e<4;e++)for(var o=0;o<r.length/4;o++)i[4*o+e]=t[e]*r[4*o]+t[e+4]*r[4*o+1]+t[e+8]*r[4*o+2]+t[e+12]*r[4*o+3];return i};return function(){function r(t){void 0===t&&(t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.name="Matrix4",this.__matrix4=t}return r.prototype.move=function(r,i,e,o){return void 0===o&&(o=0),this.__matrix4=t(function(t,r,i,e){void 0===e&&(e=0);var o=Math.sqrt(r*r+i*i+e*e);return[1,0,0,0,0,1,0,0,0,0,1,0,r*t/o,i*t/o,e*t/o,1]}(r,i,e,o),this.__matrix4),this},r.prototype.rotate=function(r,i,e,o,n,u,a){var f=function(t,r,i,e,o,n){if("number"==typeof t&&"number"==typeof r){if("number"!=typeof i?(i=0,e=t,o=r,n=1):"number"==typeof e&&"number"==typeof o&&"number"==typeof n||(e=t,o=r,n=i,t=0,r=0,i=0),t==e&&r==o&&i==n)throw new Error("It's not a legitimate ray!");var u=Math.sqrt((e-t)*(e-t)+(o-r)*(o-r)),a=0!=u?(o-r)/u:1,f=0!=u?(e-t)/u:0,s=(e-t)*f+(o-r)*a,h=n-i,m=Math.sqrt(s*s+h*h),p=0!=m?h/m:1,_=0!=m?s/m:0;return[[a,p*f,f*_,0,-f,a*p,a*_,0,0,-_,p,0,r*f-t*a,i*_-t*f*p-r*a*p,-t*f*_-r*a*_-i*p,1],[a,-f,0,0,p*f,p*a,-_,0,f*_,a*_,p,0,t,r,i,1]]}throw new Error("a1 and b1 is required!")}(i,e,o,n,u,a);return this.__matrix4=t(t(t(f[1],function(t){var r=Math.sin(t),i=Math.cos(t);return[i,r,0,0,-r,i,0,0,0,0,1,0,0,0,0,1]}(r)),f[0]),this.__matrix4),this},r.prototype.scale=function(r,i,e,o,n,u){return void 0===o&&(o=0),void 0===n&&(n=0),void 0===u&&(u=0),this.__matrix4=t(function(t,r,i,e,o,n){return void 0===e&&(e=0),void 0===o&&(o=0),void 0===n&&(n=0),[t,0,0,0,0,r,0,0,0,0,i,0,e-e*t,o-o*r,n-n*i,1]}(r,i,e,o,n,u),this.__matrix4),this},r.prototype.multiply=function(r,i){return void 0===i&&(i=!1),this.__matrix4=i?t(this.__matrix4,r):t(r,this.__matrix4),this},r.prototype.use=function(r,i,e,o){return void 0===e&&(e=0),void 0===o&&(o=1),t(this.__matrix4,[r,i,e,o])},r.prototype.value=function(){return this.__matrix4},r}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_Matrix4=r();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var e,t;e=this,t=function(){"use strict";return function(e,t){void 0===e&&(e=7),void 0===t&&(t=[107,36]),this.name="Mercator";var o=100*e*Math.PI/180,i=o*t[0],n=-1*o*t[1];this.use=function(e,t){return[.8*(o*e-i),-1*o*t-n]}}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_Mercator=t();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  /******************************************************************************
12
12
  Copyright (c) Microsoft Corporation.
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};"function"==typeof SuppressedError&&SuppressedError;var i=function(t,i,e,n,r){var o=Math.cos(e),s=Math.sin(e);return[+((n-t)*o-(r-i)*s+t).toFixed(7),+((n-t)*s+(r-i)*o+i).toFixed(7)]};var e=function(t,i,e,n,r){return t.beginPath(),t.translate(e,n),t.rotate(r),t.font=i.fontStyle+" "+i.fontWeight+" "+i.fontSize+"px "+i.fontFamily,t},n=function(t,e,n,r,o,s,_,a){if(o>s){var h=o;o=s,s=h}return _%=2*Math.PI,a>=1.999999*Math.PI||a<=1.999999*-Math.PI?a=2*Math.PI:a%=2*Math.PI,function(t,e,n,r,o,s,_){e<0&&(t+=e,e*=-1);var a,h=[];a=i(0,0,t,o,0),h[0]=a[0],h[1]=a[1],a=i(0,0,e,a[0],a[1]),h[2]=a[0],h[3]=a[1],a=i(0,0,t,s,0),h[4]=a[0],h[5]=a[1],a=i(0,0,e,a[0],a[1]),h[6]=a[0],h[7]=a[1],_(t,t+e,h[0]+n,h[1]+r,h[4]+n,h[5]+r,h[2]+n,h[3]+r,h[6]+n,h[7]+r,.5*(s-o))}(_,a,n,r,o,s,(function(i,_,a,h,l,p,f,u,g,c,y){y<0&&(y=-y),t.beginPath(),t.moveTo(a,h),t.arc(n,r,o,i,_,!1),"round"==e.arcEndCap?t.arc(.5*(f+g),.5*(u+c),y,_-Math.PI,_,!0):"-round"==e.arcEndCap?t.arc(.5*(f+g),.5*(u+c),y,_-Math.PI,_,!1):t.lineTo(g,c),t.arc(n,r,s,_,i,!0),"round"==e.arcStartCap?t.arc(.5*(a+l),.5*(h+p),y,i,i-Math.PI,!0):"-round"==e.arcStartCap?t.arc(.5*(a+l),.5*(h+p),y,i,i-Math.PI,!1):t.lineTo(a,h)})),"butt"==e.arcStartCap&&t.closePath(),t},r=function(t,i,e,n){return t.beginPath(),t.moveTo(i+n,e),t.arc(i,e,n,0,2*Math.PI),t},o=function(t,i,e,n,r){return t.beginPath(),t.rect(i,e,n,r),t};function s(t,i,e,n,r){for(var o=0,s="",_=0;_<i.length;_++)t.measureText(s+i[_]).width>e||/\n$/.test(s)?(r(s,((o+=1)-.5)*n),s=i[_]):_==i.length-1?(o+=1,r(s+i[_],(o-.5)*n)):s+=i[_];return o*n}var _=function(){function t(t,i,e,n){void 0===i&&(i={}),void 0===n&&(n=!1),this.__region=null,this.__onlyRegion=!1,this.__specialConfig={fontSize:16,fontFamily:"sans-serif",fontWeight:400,fontStyle:"normal",arcStartCap:"butt",arcEndCap:"butt"},this.__initConfig={fillStyle:"black",strokeStyle:"black",lineWidth:1,textAlign:"left",textBaseline:"middle",lineDash:[],shadowBlur:0,shadowColor:"black"},this.painter=t.getContext("2d",i),this.__region=e,this.__isPainter=n,this.painter.textBaseline="middle",this.painter.textAlign="left"}return t.prototype.useConfig=function(t,i){if(this.__region&&["fillStyle","strokeStyle","shadowBlur","shadowColor"].indexOf(t)<0&&this.__region.useConfig(t,i),this.__isPainter&&this.__onlyRegion)return this;if("lineDash"==t)this.painter.setLineDash&&this.painter.setLineDash(i);else if(t in this.__specialConfig)"fontSize"==t&&(i=Math.round(i)),this.__specialConfig[t]=i;else{if(!(t in this.__initConfig))throw new Error("Illegal configuration item of painter : "+t+" !");this.painter[t]=i}return this},t.prototype.fillText=function(t,i,n,r){return void 0===r&&(r=0),this.__region&&this.__region.fillText(t,i,n,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),e(this.painter,this.__specialConfig,i,n,r).fillText(t,0,0),this.painter.restore()),this},t.prototype.strokeText=function(t,i,n,r){return void 0===r&&(r=0),this.__region&&this.__region.strokeText(t,i,n,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),e(this.painter,this.__specialConfig,i,n,r).strokeText(t,0,0),this.painter.restore()),this},t.prototype.fullText=function(t,i,n,r){return void 0===r&&(r=0),this.__region&&this.__region.fullText(t,i,n,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),e(this.painter,this.__specialConfig,i,n,r),this.painter.fillText(t,0,0),this.painter.strokeText(t,0,0),this.painter.restore()),this},t.prototype.fillTexts=function(t,i,n,r,o,_){var a=this;void 0===o&&(o=1.2),void 0===_&&(_=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,n,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),e(this.painter,this.__specialConfig,i,n,_);var l=s(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){a.painter.fillText(t,0,i)}));return this.painter.restore(),l},t.prototype.strokeTexts=function(t,i,n,r,o,_){var a=this;void 0===o&&(o=1.2),void 0===_&&(_=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,n,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),e(this.painter,this.__specialConfig,i,n,_);var l=s(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){a.painter.strokeText(t,0,i)}));return this.painter.restore(),l},t.prototype.fullTexts=function(t,i,n,r,o,_){var a=this;void 0===o&&(o=1.2),void 0===_&&(_=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,n,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),e(this.painter,this.__specialConfig,i,n,_);var l=s(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){a.painter.fillText(t,0,i),a.painter.strokeText(t,0,i)}));return this.painter.restore(),l},t.prototype.beginPath=function(){return this.__region&&this.__region.beginPath(),this.__isPainter&&this.__onlyRegion||this.painter.beginPath(),this},t.prototype.closePath=function(){return this.__region&&this.__region.closePath(),this.__isPainter&&this.__onlyRegion||this.painter.closePath(),this},t.prototype.moveTo=function(t,i){return this.__region&&this.__region.moveTo(t,i),this.__isPainter&&this.__onlyRegion||this.painter.moveTo(Math.round(t)+.5,Math.round(i)+.5),this},t.prototype.lineTo=function(t,i){return this.__region&&this.__region.lineTo(t,i),this.__isPainter&&this.__onlyRegion||this.painter.lineTo(Math.round(t)+.5,Math.round(i)+.5),this},t.prototype.arc=function(t,i,e,n,r){return this.__region&&this.__region.arc(t,i,e,n,r),this.__isPainter&&this.__onlyRegion||this.painter.arc(t,i,e,n,n+r,r<0),this},t.prototype.fill=function(){return this.__region&&this.__region.fill(),this.__isPainter&&this.__onlyRegion||this.painter.fill(),this},t.prototype.stroke=function(){return this.__region&&this.__region.stroke(),this.__isPainter&&this.__onlyRegion||this.painter.stroke(),this},t.prototype.full=function(){return this.__region&&this.__region.full(),this.__isPainter&&this.__onlyRegion||(this.painter.fill(),this.painter.stroke()),this},t.prototype.save=function(){return this.__region&&this.__region.save(),this.__isPainter&&this.__onlyRegion||this.painter.save(),this},t.prototype.restore=function(){return this.__region&&this.__region.restore(),this.__isPainter&&this.__onlyRegion||this.painter.restore(),this},t.prototype.clip=function(){return this.__region&&this.__region.clip(),this.__isPainter&&this.__onlyRegion||this.painter.clip(),this},t.prototype.quadraticCurveTo=function(t,i,e,n){return this.__region&&this.__region.quadraticCurveTo(t,i,e,n),this.__isPainter&&this.__onlyRegion||this.painter.quadraticCurveTo(t,i,e,n),this},t.prototype.bezierCurveTo=function(t,i,e,n,r,o){return this.__region&&this.__region.bezierCurveTo(t,i,e,n,r,o),this.__isPainter&&this.__onlyRegion||this.painter.bezierCurveTo(t,i,e,n,r,o),this},t.prototype.clearRect=function(t,i,e,n){return this.__region&&this.__region.clearRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||this.painter.clearRect(t,i,e,n),this},t.prototype.fillArc=function(t,i,e,r,o,s){return this.__region&&this.__region.fillArc(t,i,e,r,o,s),this.__isPainter&&this.__onlyRegion||n(this.painter,this.__specialConfig,t,i,e,r,o,s).fill(),this},t.prototype.strokeArc=function(t,i,e,r,o,s){return this.__region&&this.__region.strokeArc(t,i,e,r,o,s),this.__isPainter&&this.__onlyRegion||n(this.painter,this.__specialConfig,t,i,e,r,o,s).stroke(),this},t.prototype.fullArc=function(t,i,e,r,o,s){return this.__region&&this.__region.fullArc(t,i,e,r,o,s),this.__isPainter&&this.__onlyRegion||(n(this.painter,this.__specialConfig,t,i,e,r,o,s),this.painter.fill(),this.painter.stroke()),this},t.prototype.fillCircle=function(t,i,e){return this.__region&&this.__region.fillCircle(t,i,e),this.__isPainter&&this.__onlyRegion||r(this.painter,t,i,e).fill(),this},t.prototype.strokeCircle=function(t,i,e){return this.__region&&this.__region.strokeCircle(t,i,e),this.__isPainter&&this.__onlyRegion||r(this.painter,t,i,e).stroke(),this},t.prototype.fullCircle=function(t,i,e){return this.__region&&this.__region.fullCircle(t,i,e),this.__isPainter&&this.__onlyRegion||(r(this.painter,t,i,e),this.painter.fill(),this.painter.stroke()),this},t.prototype.fillRect=function(t,i,e,n){return this.__region&&this.__region.fillRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||o(this.painter,t,i,e,n).fill(),this},t.prototype.strokeRect=function(t,i,e,n){return this.__region&&this.__region.strokeRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||o(this.painter,t,i,e,n).stroke(),this},t.prototype.fullRect=function(t,i,e,n){return this.__region&&this.__region.fullRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||(o(this.painter,t,i,e,n),this.painter.fill(),this.painter.stroke()),this},t.prototype.draw=function(){},t}();var a={"font-size":"fontSize","font-family":"fontFamily","font-weight":"fontWeight","font-style":"fontStyle","arc-start-cap":"arcStartCap","arc-end-cap":"arcEndCap"},h=function(i){function n(t,e){var n=i.call(this,t,{},e?new _(e,{willReadFrequently:!0}):null,!0)||this;return n.name="Canvas",n.__regionList={},n.__regionAssemble=function(t,i,e,n){for(var r=[],o=0;o<n;o++)r[o]=t;return function(){for(var o=0;o<n;o++){if(r[o]+e<i){r[o]=+(r[o]+e).toFixed(7);break}o<n-1&&(r[o]=t)}return r}}(0,255,10,3),n.setRegion(""),n}return function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(n,i),n.prototype.config=function(t){for(var i in t){var e=a[i]||i;this.useConfig(e,t[i])}return this},n.prototype.onlyRegion=function(t){return this.__onlyRegion=t,this},n.prototype.setRegion=function(t){if(this.__region)if(t){if(null==this.__regionList[t]){var i=this.__regionAssemble();this.__regionList[t]="rgb("+i[0]+","+i[1]+","+i[2]+")"}this.__region.useConfig("fillStyle",this.__regionList[t])&&this.__region.useConfig("strokeStyle",this.__regionList[t])}else this.__region.useConfig("fillStyle","#000000")&&this.__region.useConfig("strokeStyle","#000000");return this},n.prototype.getRegion=function(t,i){var e=this;return new Promise((function(n,r){var o=e.__region?e.__region.painter.getImageData(t-.5,i-.5,1,1):{data:[0,0,0,0]},s=o.data,_=function(){if(e.__region)for(var t in e.__regionList)if("rgb("+s[0]+","+s[1]+","+s[2]+")"==e.__regionList[t]){n(t);break}n("")};s?_():o.then((function(t){s=t,_()}))}))},n.prototype.textWidth=function(t){this.painter.save(),e(this.painter,this.__specialConfig,0,0,0);var i=this.painter.measureText(t+"").width;return this.painter.restore(),i},n.prototype.getContext=function(t){return void 0===t&&(t=!1),t?this.__region?this.__region.painter:null:this.painter},n.prototype.createLinearGradient=function(t,i,e,n){return function(t,i,e,n,r){var o=t.createLinearGradient(i,e,n,r),s={value:function(){return o},setColor:function(t,i){return o.addColorStop(t,i),s}};return s}(this.painter,t,i,e,n)},n.prototype.createRadialGradient=function(t,i,e){return function(t,i,e,n){var r=t.createRadialGradient(i,e,0,i,e,n),o={value:function(){return r},setColor:function(t,i){return r.addColorStop(t,i),o}};return o}(this.painter,t,i,e)},n.prototype.getColor=function(t,i){var e=this.painter.getImageData(t-.5,i-.5,1,1).data;return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},n}(_);export{h as default};
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  /******************************************************************************
12
12
  Copyright (c) Microsoft Corporation.
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  function r(r,t,e){if(e||2===arguments.length)for(var i,o=0,n=t.length;o<n;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return r.concat(i||Array.prototype.slice.call(t))}function t(r,t,e){void 0===e&&(e={});for(var i=["webgl","experimental-webgl","webkit-3d","moz-webgl"],o=null,n=0;n<i.length;n++){try{o=r.getContext(i[n],e)}catch(r){}if(o)break}if(!o)throw new Error("Non canvas or browser does not support webgl.");var a=o.canvas.width,_=o.canvas.height,s=a*t,m=_*t;return o.viewport(.5*(a-s),.5*(_-m),s,m),o.depthFunc(o.LEQUAL),o.enable(o.DEPTH_TEST),o}function e(r){var t=r.drawingBufferWidth,e=r.drawingBufferHeight,i=new Uint8Array(4*t*e);return r.readPixels(0,0,t,e,r.RGBA,r.UNSIGNED_BYTE,i),function(r,o){return"rgba("+i[4*((o=e-o)*t+r)]+","+i[4*(o*t+r)+1]+","+i[4*(o*t+r)+2]+","+i[4*(o*t+r)+3]+")"}}"function"==typeof SuppressedError&&SuppressedError;var i=function(r,t){for(var e=[],i=0;i<4;i++)for(var o=0;o<t.length/4;o++)e[4*o+i]=r[i]*t[4*o]+r[i+4]*t[4*o+1]+r[i+8]*t[4*o+2]+r[i+12]*t[4*o+3];return e},o=function(){function r(r){void 0===r&&(r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.name="Matrix4",this.__matrix4=r}return r.prototype.move=function(r,t,e,o){return void 0===o&&(o=0),this.__matrix4=i(function(r,t,e,i){void 0===i&&(i=0);var o=Math.sqrt(t*t+e*e+i*i);return[1,0,0,0,0,1,0,0,0,0,1,0,t*r/o,e*r/o,i*r/o,1]}(r,t,e,o),this.__matrix4),this},r.prototype.rotate=function(r,t,e,o,n,a,_){var s=function(r,t,e,i,o,n){if("number"==typeof r&&"number"==typeof t){if("number"!=typeof e?(e=0,i=r,o=t,n=1):"number"==typeof i&&"number"==typeof o&&"number"==typeof n||(i=r,o=t,n=e,r=0,t=0,e=0),r==i&&t==o&&e==n)throw new Error("It's not a legitimate ray!");var a=Math.sqrt((i-r)*(i-r)+(o-t)*(o-t)),_=0!=a?(o-t)/a:1,s=0!=a?(i-r)/a:0,m=(i-r)*s+(o-t)*_,u=n-e,p=Math.sqrt(m*m+u*u),l=0!=p?u/p:1,c=0!=p?m/p:0;return[[_,l*s,s*c,0,-s,_*l,_*c,0,0,-c,l,0,t*s-r*_,e*c-r*s*l-t*_*l,-r*s*c-t*_*c-e*l,1],[_,-s,0,0,l*s,l*_,-c,0,s*c,_*c,l,0,r,t,e,1]]}throw new Error("a1 and b1 is required!")}(t,e,o,n,a,_);return this.__matrix4=i(i(i(s[1],function(r){var t=Math.sin(r),e=Math.cos(r);return[e,t,0,0,-t,e,0,0,0,0,1,0,0,0,0,1]}(r)),s[0]),this.__matrix4),this},r.prototype.scale=function(r,t,e,o,n,a){return void 0===o&&(o=0),void 0===n&&(n=0),void 0===a&&(a=0),this.__matrix4=i(function(r,t,e,i,o,n){return void 0===i&&(i=0),void 0===o&&(o=0),void 0===n&&(n=0),[r,0,0,0,0,t,0,0,0,0,e,0,i-i*r,o-o*t,n-n*e,1]}(r,t,e,o,n,a),this.__matrix4),this},r.prototype.multiply=function(r,t){return void 0===t&&(t=!1),this.__matrix4=t?i(this.__matrix4,r):i(r,this.__matrix4),this},r.prototype.use=function(r,t,e,o){return void 0===e&&(e=0),void 0===o&&(o=1),i(this.__matrix4,[r,t,e,o])},r.prototype.value=function(){return this.__matrix4},r}(),n=function(){function r(r,t){void 0===t&&(t=!1),this.__painter=r,this.__isElement=t,this.__buffer=function(r){return r.createBuffer()}(r),this.__type=t?r.ELEMENT_ARRAY_BUFFER:r.ARRAY_BUFFER}return r.prototype.use=function(){return this.__painter.bindBuffer(this.__type,this.__buffer),this},r.prototype.write=function(r){return function(r,t,e,i){var o=e?r.ELEMENT_ARRAY_BUFFER:r.ARRAY_BUFFER;r.bufferData(o,t,i)}(this.__painter,r,this.__isElement,this.__painter.STATIC_DRAW),this.__fsize=r.BYTES_PER_ELEMENT,this},r.prototype.divide=function(r,t,e,i){return void 0===i&&(i=0),function(r,t,e,i,o,n,a){r.vertexAttribPointer(t,e,i,a,o,n),r.enableVertexAttribArray(t)}(this.__painter,r,t,this.__painter.FLOAT,e*this.__fsize,i*this.__fsize,!1),this},r}(),a=function(){function r(r,t,e){void 0===e&&(e=0),this.__painter=r,this.__type={"2d":r.TEXTURE_2D,cube:r.TEXTURE_CUBE_MAP}[t],this.__texture=function(r,t,e){var i=r.createTexture();return r.activeTexture(r["TEXTURE"+e]),r.bindTexture(t,i),i}(r,this.__type,e),r.texParameteri(this.__type,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(this.__type,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(this.__type,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(this.__type,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)}return r.prototype.useImage=function(r){return function(r,t,e,i,o,n){r.texImage2D(t,e,i,i,o,n)}(this.__painter,this.__type,0,this.__painter.RGBA,this.__painter.UNSIGNED_BYTE,r),this},r.prototype.useCube=function(r,t,e){return function(r,t,e,i,o,n,a,_,s){for(var m,u=[r.TEXTURE_CUBE_MAP_POSITIVE_X,r.TEXTURE_CUBE_MAP_NEGATIVE_X,r.TEXTURE_CUBE_MAP_POSITIVE_Y,r.TEXTURE_CUBE_MAP_NEGATIVE_Y,r.TEXTURE_CUBE_MAP_POSITIVE_Z,r.TEXTURE_CUBE_MAP_NEGATIVE_Z],p=0;p<u.length;p++)n[p]&&(m=u[p],r.texImage2D(m,e,i,a,_,0,i,o,null),r.bindTexture(t,s),r.texImage2D(m,e,i,i,o,n[p]));r.generateMipmap(t)}(this.__painter,this.__type,0,this.__painter.RGBA,this.__painter.UNSIGNED_BYTE,r,t,e,this.__texture),this},r}(),_={};function s(r,t,e){var i=r+"-"+e;return _[i]||(_[i]=new a(t,e)),_[i]}var m=function(r,t,e){var i=r.createShader(t);if(null==i)throw new Error("Unable to create shader!");if(r.shaderSource(i,e),r.compileShader(i),!r.getShaderParameter(i,r.COMPILE_STATUS))throw new Error("Failed to compile shader:"+r.getShaderInfoLog(i));return i},u=function(){function r(r){this.__painter=r}return r.prototype.use=function(){return this.__painter.useProgram(this.program),this},r.prototype.compile=function(r,t){return this.program=function(r,t,e){var i=m(r,r.VERTEX_SHADER,t),o=m(r,r.FRAGMENT_SHADER,e),n=r.createProgram();if(r.attachShader(n,i),r.attachShader(n,o),r.linkProgram(n),!r.getProgramParameter(n,r.LINK_STATUS))throw new Error("Failed to link program: "+r.getProgramInfoLog(n));return n}(this.__painter,r,t),this},r}(),p="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n\r\n // 把原生的WebGL使用的左手坐标系变成了右手坐标系\r\n temp.z = -1.0 * temp.z;\r\n\r\n // 表示眼睛距离vec4(0.0,0.0,1.0)的距离\r\n float dist = 4.0;\r\n\r\n // 使用投影直接计算\r\n // 为保证纹理和相对位置正确\r\n // x、y、z的改变满足线性变换\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n}",l="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec4 a_color;\r\nvarying vec4 v_color;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_color = a_color;\r\n}",c="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec2 a_textcoord;\r\nvarying vec2 v_textcoord;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_textcoord = a_textcoord;\r\n}",h="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec4 a_normal;\r\nvarying vec3 v_normal;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_normal = normalize(vec3(a_normal));\r\n}",g="precision mediump float;\r\n\r\nuniform vec4 u_color;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = u_color;\r\n}",f="precision mediump float;\r\n\r\nvarying vec4 v_color;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = v_color;\r\n}",v="precision mediump float;\r\n\r\nuniform sampler2D u_sampler;\r\nvarying vec2 v_textcoord;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = texture2D(u_sampler, v_textcoord);\r\n}",d="precision mediump float;\r\n\r\nvarying vec3 v_normal;\r\nuniform samplerCube u_texture;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = textureCube(u_texture, normalize(v_normal));\r\n}",y={};function E(r,t,e,i,o){var a=function(r,t,e){var i,o,n=r+(e.material.color?"1":"0")+(e.material.colors?"1":"0")+(e.material.image?"1":"0")+(e.material.cube?"1":"0");if(y[n])return y[n].use();var a=(i={},i[r+"1000"]=p,i[r+"0100"]=l,i[r+"0010"]=c,i[r+"0001"]=h,i)[n].replace(/uniform +mat4 +u_matrix;/,"\n uniform mat4 u_matrix_world;\n uniform mat4 u_matrix_mesh;\n uniform mat4 u_matrix_proporion;").replace(/u_matrix +\* +a_position/,"u_matrix_proporion * u_matrix_world * u_matrix_mesh * a_position"),_=(o={},o[r+"1000"]=g,o[r+"0100"]=f,o[r+"0010"]=v,o[r+"0001"]=d,o)[n],s=new u(t).compile(a,_).use();return y[n]=s,s}(r,t,e);if(new n(t).use().write(e.geometry.attributes.position.array).divide(t.getAttribLocation(a.program,"a_position"),e.geometry.attributes.position.itemSize,e.geometry.attributes.position.itemSize,0),t.uniformMatrix4fv(t.getUniformLocation(a.program,"u_matrix_world"),!1,o.matrix),t.uniformMatrix4fv(t.getUniformLocation(a.program,"u_matrix_proporion"),!1,o.proporion),t.uniformMatrix4fv(t.getUniformLocation(a.program,"u_matrix_mesh"),!1,i.matrix),e.geometry.attributes.normal&&new n(t).use().write(e.geometry.attributes.normal.array).divide(t.getAttribLocation(a.program,"a_normal"),e.geometry.attributes.normal.itemSize,e.geometry.attributes.normal.itemSize,0),"color"in e.material&&t.uniform4f(t.getUniformLocation(a.program,"u_color"),e.material.color.r,e.material.color.g,e.material.color.b,e.material.color.alpha),"colors"in e.material)new n(t).use().write(e.material.colors.array).divide(t.getAttribLocation(a.program,"a_color"),e.material.colors.itemSize,e.material.colors.itemSize,0);else if("cube"in e.material){var _=e.material.cube.right.image.value.width;t.uniform1i(t.getUniformLocation(a.program,"u_texture"),0),s(r,t,"cube").useCube([e.material.cube.right.image.value,e.material.cube.left.image.value,e.material.cube.top.image.value,e.material.cube.bottom.image.value,e.material.cube.far.image.value,e.material.cube.near.image.value],_,_)}else"image"in e.material&&(t.uniform1i(t.getUniformLocation(a.program,"u_sampler"),0),new n(t).use().write(e.geometry.attributes.uv.array).divide(t.getAttribLocation(a.program,"a_textcoord"),e.geometry.attributes.uv.itemSize,2,0),s(r,t,"2d").useImage(e.material.image.value));e.geometry.index?(new n(t,!0).use().write(e.geometry.index.array),t.drawElements(t[e.geometry.type],e.geometry.index.count,t.UNSIGNED_BYTE,0)):t.drawArrays(t[e.geometry.type],0,e.geometry.attributes.position.count)}var x=!1,b=function(){function i(r,e){this.name="WebGL",this.__getColor=function(r,t){return"rgba(0,0,0,1)"},this.__regionList={},this.__regionAssemble=function(r,t,e,i){for(var o=[],n=0;n<i;n++)o[n]=r;return function(){for(var n=0;n<i;n++){if(o[n]+e<t){o[n]=+(o[n]+e).toFixed(7);break}n<i-1&&(o[n]=r)}return o}}(0,1,.2,3),this.__regionName="",this.__regionColor=[0,0,0,1],this.__scene={children:[],matrix:new o([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,10])},this.__unique=(new Date).valueOf(),this.painter=t(r,10),e&&(this.__regionPainter=t(e,10,{}));var i=this.painter.canvas.width/this.painter.canvas.height,n=1,a=1;i>1?n=1/i:a=i;var _=Math.min(n,a);this.__proporion=[n,0,0,0,0,a,0,0,0,0,_,0,0,0,0,1]}return i.prototype.matrix=function(r){return new o(r)},i.prototype.getMatrix=function(){return this.__scene.matrix},i.prototype.getObject3D=function(){return this.__scene.children},i.prototype.review=function(r){void 0===r&&(r=!1),r?this.__regionPainter&&(this.__regionPainter.clearColor(1,1,1,1),this.__regionPainter.clear(this.__regionPainter.COLOR_BUFFER_BIT)):(this.painter.clearColor(1,1,1,1),this.painter.clear(this.painter.COLOR_BUFFER_BIT));for(var t=0;t<this.__scene.children.length;t++)this.draw(this.__scene.children[t],r);return this},i.prototype.draw=function(r,t){void 0===t&&(t=!1),t||(x=!0);var i={matrix:r.matrix.value()},o={matrix:this.__scene.matrix.value(),proporion:this.__proporion};this.setRegion(r.region);for(var n=0;n<r.mesh.length;n++)t?this.__regionPainter&&(E("painter"+this.__unique,this.__regionPainter,{geometry:r.mesh[n].geometry,material:{color:{r:this.__regionColor[0],g:this.__regionColor[1],b:this.__regionColor[2],alpha:this.__regionColor[3]}}},i,o),this.__getColor=e(this.__regionPainter)):E("region"+this.__unique,this.painter,r.mesh[n],i,o)},i.prototype.render=function(r){"matrix"in r||(r.matrix=new o),"region"in r||(r.region="");for(var t=0;t<r.mesh.length;t++){var e=r.mesh[t];e.geometry.attributes.normal&&Array.isArray(e.geometry.attributes.normal.array)&&(e.geometry.attributes.normal.array=new Float32Array(e.geometry.attributes.normal.array)),e.geometry.attributes.position&&Array.isArray(e.geometry.attributes.position.array)&&(e.geometry.attributes.position.array=new Float32Array(e.geometry.attributes.position.array)),e.geometry.attributes.uv&&Array.isArray(e.geometry.attributes.uv.array)&&(e.geometry.attributes.uv.array=new Float32Array(e.geometry.attributes.uv.array)),e.geometry.index&&Array.isArray(e.geometry.index.array)&&(e.geometry.index.array=new Uint8Array(e.geometry.index.array)),e.material.colors&&Array.isArray(e.material.colors.array)&&(e.material.colors.array=new Float32Array(e.material.colors.array))}this.__scene.children.push(r),this.draw(r)},i.prototype.setRegion=function(t){return this.__regionName=t+"",t?(null==this.__regionList[t]&&(this.__regionList[t]=r(r([],this.__regionAssemble(),!0),[1],!1)),this.__regionColor=this.__regionList[t]):this.__regionColor=[0,0,0,1],this},i.prototype.getRegion=function(r,t){var e=this;return x&&this.review(!0),x=!1,new Promise((function(i,o){var n=e.__getColor(r,t);for(var a in e.__regionList){var _=e.__regionList[a];if("rgba("+255*_[0]+","+255*_[1]+","+255*_[2]+","+255*_[3]+")"==n){i(a);break}}i("")}))},i}();export{b as default};
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,e;t=this,e=function(){"use strict";var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};"function"==typeof SuppressedError&&SuppressedError;var e=["href","title","show","type","role","actuate"],i=function(t,i,n){e.indexOf(i)>-1?t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:"+i,n+""):t.setAttribute(i,n+"")},n=i;function r(t,e){i(t,"stroke",e.strokeStyle),i(t,"fill",e.fillStyle),i(t,"stroke-dasharray",e.lineDash.join(","))}function o(t,e){i(t,"fill",e.fillStyle)}function s(t,e){i(t,"stroke",e.strokeStyle),i(t,"fill","none"),i(t,"stroke-dasharray",e.lineDash.join(","))}var h=function(t,e,i,n,r){var o=Math.cos(i),s=Math.sin(i);return[+((n-t)*o-(r-e)*s+t).toFixed(7),+((n-t)*s+(r-e)*o+e).toFixed(7)]},u=function(t,e,i,r,o){if("text"!==t.nodeName.toLowerCase())throw new Error("Need a <text> !");n(t,"dy",{top:.5*e.fontSize,middle:0,bottom:.5*-e.fontSize}[e.textBaseline]),function(t,e){for(var i in e)t.style[i]=e[i]}(t,{"text-anchor":{left:"start",right:"end",center:"middle"}[e.textAlign],"dominant-baseline":"central","font-size":e.fontSize+"px","font-family":e.fontFamily}),n(t,"x",i),n(t,"y",r),"number"==typeof o&&n(t,"transform","rotate("+(o%=360)+","+i+","+r+")")},_=function(t,e,i,r){if("circle"!==t.nodeName.toLowerCase())throw new Error("Need a <circle> !");n(t,"cx",e),n(t,"cy",i),n(t,"r",r)},c=function(t,e){if("path"!==t.nodeName.toLowerCase())throw new Error("Need a <path> !");n(t,"d",e)},a=function(t,e,i,r,o){if("rect"!==t.nodeName.toLowerCase())throw new Error("Need a <rect> !");o<0&&(i-=o*=-1),r<0&&(e-=r*=-1),n(t,"x",e),n(t,"y",i),n(t,"width",r),n(t,"height",o)},f=function(t,e,i,r,o,s,u,_){if("path"!==t.nodeName.toLowerCase())throw new Error("Need a <path> !");if(u=u/180*Math.PI,_=_/180*Math.PI,u%=2*Math.PI,o>s){var c=o;o=s,s=c}_>=1.999999*Math.PI||_<=1.999999*-Math.PI?_=1.999999*Math.PI:_%=2*Math.PI,function(t,e,i,n,r,o,s){e<0&&(t+=e,e*=-1);var u,_=[];u=h(0,0,t,r,0),_[0]=u[0],_[1]=u[1],u=h(0,0,e,u[0],u[1]),_[2]=u[0],_[3]=u[1],u=h(0,0,t,o,0),_[4]=u[0],_[5]=u[1],u=h(0,0,e,u[0],u[1]),_[6]=u[0],_[7]=u[1],s(t,t+e,_[0]+i,_[1]+n,_[4]+i,_[5]+n,_[2]+i,_[3]+n,_[6]+i,_[7]+n,.5*(o-r))}(u,_,i,r,o,s,(function(i,r,h,u,_,c,a,f,l,p,d){var y=r-i>Math.PI?1:0,E="M"+h+" "+u;d<0&&(d=-d),E+="A"+o+" "+o+" 0 "+y+" 1 "+a+" "+f,"round"==e.arcEndCap?E+="A"+d+" "+d+" 0 1 0 "+l+" "+p:"-round"==e.arcEndCap?E+="A"+d+" "+d+" 0 1 1 "+l+" "+p:E+="L"+l+" "+p,E+="A"+s+" "+s+" 0 "+y+" 0 "+_+" "+c,"round"==e.arcStartCap?E+="A"+d+" "+d+" 0 1 0 "+h+" "+u:"-round"==e.arcStartCap?E+="A"+d+" "+d+" 0 1 1 "+h+" "+u:E+="L"+h+" "+u,"butt"==e.arcStartCap&&(E+="Z"),n(t,"d",E)}))};function l(t,e,i,n,r){var o=Math.cos(i),s=Math.sin(i);return[(n-t)*o-(r-e)*s+t,(n-t)*s+(r-e)*o+e]}var p={"font-size":"fontSize","font-family":"fontFamily","arc-start-cap":"arcStartCap","arc-end-cap":"arcEndCap"},d=function(){function t(t){this.name="SVG",this.__config={fillStyle:"#000",strokeStyle:"#000",lineWidth:1,textAlign:"left",textBaseline:"middle",fontSize:50,fontFamily:"sans-serif",arcStartCap:"butt",arcEndCap:"butt",lineDash:[]},this.__path="",this.__currentPosition=[],this.__svg=t}return t.prototype.config=function(t){if("object"!=typeof t)return this.__config[p[t]||t];for(var e in t){var i=p[e]||e;this.__config[i]=t[e]}return this},t.prototype.useEl=function(t){return this.__useEl=t,this},t.prototype.getEl=function(){return this.__useEl},t.prototype.appendEl=function(t,e){var i;return e=e||this.__svg,"string"==typeof t&&(i=t,t=document.createElementNS("http://www.w3.org/2000/svg",i)),e.appendChild(t),this.__useEl=t,this},t.prototype.appendBoard=function(t,e){var i=t;if("string"==typeof t&&(i={text:"text",path:"path",arc:"path",circle:"circle",rect:"rect"}[t]||""),""==i)throw new Error("Unsupported drawing method:"+t);return this.appendEl(i,e)},t.prototype.remove=function(){if(!this.__useEl)throw new Error("Currently, no node can be deleted.");return this.__useEl.parentNode.removeChild(this.__useEl),this},t.prototype.attr=function(t){if(!this.__useEl)throw new Error("Currently, no node can be modified or viewed.");if("object"!=typeof t)return function(t,i){return e.indexOf(i)>-1&&(i="xlink:"+i),t.getAttribute(i)}(this.__useEl,t);for(var i in t)n(this.__useEl,i,t[i]);return this},t.prototype.fillText=function(t,e,i,n){return void 0===n&&(n=0),u(this.__useEl,this.__config,e,i,n),this.__useEl.textContent=t,o(this.__useEl,this.__config),this},t.prototype.strokeText=function(t,e,i,n){return void 0===n&&(n=0),u(this.__useEl,this.__config,e,i,n),this.__useEl.textContent=t,s(this.__useEl,this.__config),this},t.prototype.fullText=function(t,e,i,n){return void 0===n&&(n=0),u(this.__useEl,this.__config,e,i,n),this.__useEl.textContent=t,r(this.__useEl,this.__config),this},t.prototype.fillArc=function(t,e,i,n,r,s){return f(this.__useEl,this.__config,t,e,i,n,r,s),o(this.__useEl,this.__config),this},t.prototype.strokeArc=function(t,e,i,n,r,o){return f(this.__useEl,this.__config,t,e,i,n,r,o),s(this.__useEl,this.__config),this},t.prototype.fullArc=function(t,e,i,n,o,s){return f(this.__useEl,this.__config,t,e,i,n,o,s),r(this.__useEl,this.__config),this},t.prototype.fillCircle=function(t,e,i){return _(this.__useEl,t,e,i),o(this.__useEl,this.__config),this},t.prototype.strokeCircle=function(t,e,i){return _(this.__useEl,t,e,i),s(this.__useEl,this.__config),this},t.prototype.fullCircle=function(t,e,i){return _(this.__useEl,t,e,i),r(this.__useEl,this.__config),this},t.prototype.fillRect=function(t,e,i,n){return a(this.__useEl,t,e,i,n),o(this.__useEl,this.__config),this},t.prototype.strokeRect=function(t,e,i,n){return a(this.__useEl,t,e,i,n),s(this.__useEl,this.__config),this},t.prototype.fullRect=function(t,e,i,n){return a(this.__useEl,t,e,i,n),r(this.__useEl,this.__config),this},t.prototype.beginPath=function(){return this.__currentPosition=[],this.__path="",this},t.prototype.closePath=function(){return this.__path+="Z",this},t.prototype.moveTo=function(t,e){return this.__currentPosition=[t,e],this.__path+="M"+t+" "+e,this},t.prototype.lineTo=function(t,e){return this.__currentPosition=[t,e],this.__path+=(""==this.__path?"M":"L")+t+" "+e,this},t.prototype.fill=function(){return c(this.__useEl,this.__path),o(this.__useEl,this.__config),this},t.prototype.stroke=function(){return c(this.__useEl,this.__path),s(this.__useEl,this.__config),this},t.prototype.full=function(){return c(this.__useEl,this.__path),r(this.__useEl,this.__config),this},t.prototype.arc=function(t,e,i,n,r){var o=l(t,e,n/180*Math.PI,t+i,e),s=l(t,e,(n+r)/180*Math.PI,t+i,e);return""==this.__path?this.__path+="M"+o[0]+","+o[1]:o[0]==this.__currentPosition[0]&&o[1]==this.__currentPosition[1]||(this.__path+="L"+o[0]+","+o[1]),this.__path+="A"+i+","+i+" 0 "+(r>180||r<-180?1:0)+","+(r>0?1:0)+" "+s[0]+","+s[1],this},t.prototype.quadraticCurveTo=function(t,e,i,n){return this.__path+="Q"+t+" "+e+","+i+" "+n,this},t.prototype.bezierCurveTo=function(t,e,i,n,r,o){return this.__path+="C"+t+" "+e+","+i+" "+n+","+r+" "+o,this},t}();return function(e){function i(t){if(!t)throw new Error("VISLite SVG:The mount point requires an HTMLElement type but encountered null.");var i=t.clientWidth,n=t.clientHeight,r=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.appendChild(r),r.setAttribute("width",i+""),r.setAttribute("height",n+""),r.setAttribute("viewBox","0 0 "+i+" "+n),e.call(this,r)||this}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}(i,e),i}(d)},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_SVG=e();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var r,t;r=this,t=function(){"use strict";var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])},r(t,n)};"function"==typeof SuppressedError&&SuppressedError;var t=function(r,t,n){var e=r.createShader(t);if(null==e)throw new Error("Unable to create shader!");if(r.shaderSource(e,n),r.compileShader(e),!r.getShaderParameter(e,r.COMPILE_STATUS))throw new Error("Failed to compile shader:"+r.getShaderInfoLog(e));return e},n=function(){function r(r){this.__painter=r}return r.prototype.use=function(){return this.__painter.useProgram(this.program),this},r.prototype.compile=function(r,n){return this.program=function(r,n,e){var o=t(r,r.VERTEX_SHADER,n),i=t(r,r.FRAGMENT_SHADER,e),a=r.createProgram();if(r.attachShader(a,o),r.attachShader(a,i),r.linkProgram(a),!r.getProgramParameter(a,r.LINK_STATUS))throw new Error("Failed to link program: "+r.getProgramInfoLog(a));return a}(this.__painter,r,n),this},r}(),e=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(n,t),n.prototype.compile=function(r,n){return n?t.prototype.compile.call(this,r,n):t.prototype.compile.call(this,{color:"attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n\r\n // 把原生的WebGL使用的左手坐标系变成了右手坐标系\r\n temp.z = -1.0 * temp.z;\r\n\r\n // 表示眼睛距离vec4(0.0,0.0,1.0)的距离\r\n float dist = 4.0;\r\n\r\n // 使用投影直接计算\r\n // 为保证纹理和相对位置正确\r\n // x、y、z的改变满足线性变换\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n}",colors:"attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec4 a_color;\r\nvarying vec4 v_color;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_color = a_color;\r\n}",image:"attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec2 a_textcoord;\r\nvarying vec2 v_textcoord;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_textcoord = a_textcoord;\r\n}",cube:"attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec4 a_normal;\r\nvarying vec3 v_normal;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_normal = normalize(vec3(a_normal));\r\n}"}[r],{color:"precision mediump float;\r\n\r\nuniform vec4 u_color;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = u_color;\r\n}",colors:"precision mediump float;\r\n\r\nvarying vec4 v_color;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = v_color;\r\n}",image:"precision mediump float;\r\n\r\nuniform sampler2D u_sampler;\r\nvarying vec2 v_textcoord;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = texture2D(u_sampler, v_textcoord);\r\n}",cube:"precision mediump float;\r\n\r\nvarying vec3 v_normal;\r\nuniform samplerCube u_texture;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = textureCube(u_texture, normalize(v_normal));\r\n}"}[r]),this},n}(n);return e},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(r="undefined"!=typeof globalThis?globalThis:r||self).VISLite_Shader=t();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var e,t;e=this,t=function(){"use strict";return function(){function e(e,t,_){void 0===_&&(_=0),this.__painter=e,this.__type={"2d":e.TEXTURE_2D,cube:e.TEXTURE_CUBE_MAP}[t],this.__texture=function(e,t,_){var E=e.createTexture();return e.activeTexture(e["TEXTURE"+_]),e.bindTexture(t,E),E}(e,this.__type,_),e.texParameteri(this.__type,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(this.__type,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(this.__type,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(this.__type,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}return e.prototype.useImage=function(e){return function(e,t,_,E,i,T){e.texImage2D(t,_,E,E,i,T)}(this.__painter,this.__type,0,this.__painter.RGBA,this.__painter.UNSIGNED_BYTE,e),this},e.prototype.useCube=function(e,t,_){return function(e,t,_,E,i,T,r,n,u){for(var a,s=[e.TEXTURE_CUBE_MAP_POSITIVE_X,e.TEXTURE_CUBE_MAP_NEGATIVE_X,e.TEXTURE_CUBE_MAP_POSITIVE_Y,e.TEXTURE_CUBE_MAP_NEGATIVE_Y,e.TEXTURE_CUBE_MAP_POSITIVE_Z,e.TEXTURE_CUBE_MAP_NEGATIVE_Z],p=0;p<s.length;p++)T[p]&&(a=s[p],e.texImage2D(a,_,E,r,n,0,E,i,null),e.bindTexture(t,u),e.texImage2D(a,_,E,E,i,T[p]));e.generateMipmap(t)}(this.__painter,this.__type,0,this.__painter.RGBA,this.__painter.UNSIGNED_BYTE,e,t,_,this.__texture),this},e}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_Texture=t();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
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){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){return this.__rback=e,this.__oralTree=t,this.__preTree=this.use(this.__oralTree),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();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,r;t=this,r=function(){"use strict";var t=function(r,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])},t(r,e)};function r(t,r,e){if(e||2===arguments.length)for(var i,n=0,o=r.length;n<o;n++)!i&&n in r||(i||(i=Array.prototype.slice.call(r,0,n)),i[n]=r[n]);return t.concat(i||Array.prototype.slice.call(r))}function e(t,r,e){void 0===e&&(e={});for(var i=["webgl","experimental-webgl","webkit-3d","moz-webgl"],n=null,o=0;o<i.length;o++){try{n=t.getContext(i[o],e)}catch(t){}if(n)break}if(!n)throw new Error("Non canvas or browser does not support webgl.");var a=n.canvas.width,s=n.canvas.height,_=a*r,u=s*r;return n.viewport(.5*(a-_),.5*(s-u),_,u),n.depthFunc(n.LEQUAL),n.enable(n.DEPTH_TEST),n}function i(t){var r=t.drawingBufferWidth,e=t.drawingBufferHeight,i=new Uint8Array(4*r*e);return t.readPixels(0,0,r,e,t.RGBA,t.UNSIGNED_BYTE,i),function(t,n){return"rgba("+i[4*((n=e-n)*r+t)]+","+i[4*(n*r+t)+1]+","+i[4*(n*r+t)+2]+","+i[4*(n*r+t)+3]+")"}}"function"==typeof SuppressedError&&SuppressedError;var n=function(t,r){for(var e=[],i=0;i<4;i++)for(var n=0;n<r.length/4;n++)e[4*n+i]=t[i]*r[4*n]+t[i+4]*r[4*n+1]+t[i+8]*r[4*n+2]+t[i+12]*r[4*n+3];return e},o=function(){function t(t){void 0===t&&(t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.name="Matrix4",this.__matrix4=t}return t.prototype.move=function(t,r,e,i){return void 0===i&&(i=0),this.__matrix4=n(function(t,r,e,i){void 0===i&&(i=0);var n=Math.sqrt(r*r+e*e+i*i);return[1,0,0,0,0,1,0,0,0,0,1,0,r*t/n,e*t/n,i*t/n,1]}(t,r,e,i),this.__matrix4),this},t.prototype.rotate=function(t,r,e,i,o,a,s){var _=function(t,r,e,i,n,o){if("number"==typeof t&&"number"==typeof r){if("number"!=typeof e?(e=0,i=t,n=r,o=1):"number"==typeof i&&"number"==typeof n&&"number"==typeof o||(i=t,n=r,o=e,t=0,r=0,e=0),t==i&&r==n&&e==o)throw new Error("It's not a legitimate ray!");var a=Math.sqrt((i-t)*(i-t)+(n-r)*(n-r)),s=0!=a?(n-r)/a:1,_=0!=a?(i-t)/a:0,u=(i-t)*_+(n-r)*s,m=o-e,p=Math.sqrt(u*u+m*m),l=0!=p?m/p:1,c=0!=p?u/p:0;return[[s,l*_,_*c,0,-_,s*l,s*c,0,0,-c,l,0,r*_-t*s,e*c-t*_*l-r*s*l,-t*_*c-r*s*c-e*l,1],[s,-_,0,0,l*_,l*s,-c,0,_*c,s*c,l,0,t,r,e,1]]}throw new Error("a1 and b1 is required!")}(r,e,i,o,a,s);return this.__matrix4=n(n(n(_[1],function(t){var r=Math.sin(t),e=Math.cos(t);return[e,r,0,0,-r,e,0,0,0,0,1,0,0,0,0,1]}(t)),_[0]),this.__matrix4),this},t.prototype.scale=function(t,r,e,i,o,a){return void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0),this.__matrix4=n(function(t,r,e,i,n,o){return void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=0),[t,0,0,0,0,r,0,0,0,0,e,0,i-i*t,n-n*r,o-o*e,1]}(t,r,e,i,o,a),this.__matrix4),this},t.prototype.multiply=function(t,r){return void 0===r&&(r=!1),this.__matrix4=r?n(this.__matrix4,t):n(t,this.__matrix4),this},t.prototype.use=function(t,r,e,i){return void 0===e&&(e=0),void 0===i&&(i=1),n(this.__matrix4,[t,r,e,i])},t.prototype.value=function(){return this.__matrix4},t}(),a=function(){function t(t,r){void 0===r&&(r=!1),this.__painter=t,this.__isElement=r,this.__buffer=function(t){return t.createBuffer()}(t),this.__type=r?t.ELEMENT_ARRAY_BUFFER:t.ARRAY_BUFFER}return t.prototype.use=function(){return this.__painter.bindBuffer(this.__type,this.__buffer),this},t.prototype.write=function(t){return function(t,r,e,i){var n=e?t.ELEMENT_ARRAY_BUFFER:t.ARRAY_BUFFER;t.bufferData(n,r,i)}(this.__painter,t,this.__isElement,this.__painter.STATIC_DRAW),this.__fsize=t.BYTES_PER_ELEMENT,this},t.prototype.divide=function(t,r,e,i){return void 0===i&&(i=0),function(t,r,e,i,n,o,a){t.vertexAttribPointer(r,e,i,a,n,o),t.enableVertexAttribArray(r)}(this.__painter,t,r,this.__painter.FLOAT,e*this.__fsize,i*this.__fsize,!1),this},t}(),s=function(){function t(t,r,e){void 0===e&&(e=0),this.__painter=t,this.__type={"2d":t.TEXTURE_2D,cube:t.TEXTURE_CUBE_MAP}[r],this.__texture=function(t,r,e){var i=t.createTexture();return t.activeTexture(t["TEXTURE"+e]),t.bindTexture(r,i),i}(t,this.__type,e),t.texParameteri(this.__type,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(this.__type,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(this.__type,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(this.__type,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}return t.prototype.useImage=function(t){return function(t,r,e,i,n,o){t.texImage2D(r,e,i,i,n,o)}(this.__painter,this.__type,0,this.__painter.RGBA,this.__painter.UNSIGNED_BYTE,t),this},t.prototype.useCube=function(t,r,e){return function(t,r,e,i,n,o,a,s,_){for(var u,m=[t.TEXTURE_CUBE_MAP_POSITIVE_X,t.TEXTURE_CUBE_MAP_NEGATIVE_X,t.TEXTURE_CUBE_MAP_POSITIVE_Y,t.TEXTURE_CUBE_MAP_NEGATIVE_Y,t.TEXTURE_CUBE_MAP_POSITIVE_Z,t.TEXTURE_CUBE_MAP_NEGATIVE_Z],p=0;p<m.length;p++)o[p]&&(u=m[p],t.texImage2D(u,e,i,a,s,0,i,n,null),t.bindTexture(r,_),t.texImage2D(u,e,i,i,n,o[p]));t.generateMipmap(r)}(this.__painter,this.__type,0,this.__painter.RGBA,this.__painter.UNSIGNED_BYTE,t,r,e,this.__texture),this},t}(),_={};function u(t,r,e){var i=t+"-"+e;return _[i]||(_[i]=new s(r,e)),_[i]}var m=function(t,r,e){var i=t.createShader(r);if(null==i)throw new Error("Unable to create shader!");if(t.shaderSource(i,e),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS))throw new Error("Failed to compile shader:"+t.getShaderInfoLog(i));return i},p=function(){function t(t){this.__painter=t}return t.prototype.use=function(){return this.__painter.useProgram(this.program),this},t.prototype.compile=function(t,r){return this.program=function(t,r,e){var i=m(t,t.VERTEX_SHADER,r),n=m(t,t.FRAGMENT_SHADER,e),o=t.createProgram();if(t.attachShader(o,i),t.attachShader(o,n),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS))throw new Error("Failed to link program: "+t.getProgramInfoLog(o));return o}(this.__painter,t,r),this},t}(),l="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n\r\n // 把原生的WebGL使用的左手坐标系变成了右手坐标系\r\n temp.z = -1.0 * temp.z;\r\n\r\n // 表示眼睛距离vec4(0.0,0.0,1.0)的距离\r\n float dist = 4.0;\r\n\r\n // 使用投影直接计算\r\n // 为保证纹理和相对位置正确\r\n // x、y、z的改变满足线性变换\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n}",c="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec4 a_color;\r\nvarying vec4 v_color;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_color = a_color;\r\n}",h="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec2 a_textcoord;\r\nvarying vec2 v_textcoord;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_textcoord = a_textcoord;\r\n}",g="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec4 a_normal;\r\nvarying vec3 v_normal;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_normal = normalize(vec3(a_normal));\r\n}",f="precision mediump float;\r\n\r\nuniform vec4 u_color;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = u_color;\r\n}",v="precision mediump float;\r\n\r\nvarying vec4 v_color;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = v_color;\r\n}",d="precision mediump float;\r\n\r\nuniform sampler2D u_sampler;\r\nvarying vec2 v_textcoord;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = texture2D(u_sampler, v_textcoord);\r\n}",y="precision mediump float;\r\n\r\nvarying vec3 v_normal;\r\nuniform samplerCube u_texture;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = textureCube(u_texture, normalize(v_normal));\r\n}",E={};function b(t,r,e,i,n){var o=function(t,r,e){var i,n,o=t+(e.material.color?"1":"0")+(e.material.colors?"1":"0")+(e.material.image?"1":"0")+(e.material.cube?"1":"0");if(E[o])return E[o].use();var a=(i={},i[t+"1000"]=l,i[t+"0100"]=c,i[t+"0010"]=h,i[t+"0001"]=g,i)[o].replace(/uniform +mat4 +u_matrix;/,"\n uniform mat4 u_matrix_world;\n uniform mat4 u_matrix_mesh;\n uniform mat4 u_matrix_proporion;").replace(/u_matrix +\* +a_position/,"u_matrix_proporion * u_matrix_world * u_matrix_mesh * a_position"),s=(n={},n[t+"1000"]=f,n[t+"0100"]=v,n[t+"0010"]=d,n[t+"0001"]=y,n)[o],_=new p(r).compile(a,s).use();return E[o]=_,_}(t,r,e);if(new a(r).use().write(e.geometry.attributes.position.array).divide(r.getAttribLocation(o.program,"a_position"),e.geometry.attributes.position.itemSize,e.geometry.attributes.position.itemSize,0),r.uniformMatrix4fv(r.getUniformLocation(o.program,"u_matrix_world"),!1,n.matrix),r.uniformMatrix4fv(r.getUniformLocation(o.program,"u_matrix_proporion"),!1,n.proporion),r.uniformMatrix4fv(r.getUniformLocation(o.program,"u_matrix_mesh"),!1,i.matrix),e.geometry.attributes.normal&&new a(r).use().write(e.geometry.attributes.normal.array).divide(r.getAttribLocation(o.program,"a_normal"),e.geometry.attributes.normal.itemSize,e.geometry.attributes.normal.itemSize,0),"color"in e.material&&r.uniform4f(r.getUniformLocation(o.program,"u_color"),e.material.color.r,e.material.color.g,e.material.color.b,e.material.color.alpha),"colors"in e.material)new a(r).use().write(e.material.colors.array).divide(r.getAttribLocation(o.program,"a_color"),e.material.colors.itemSize,e.material.colors.itemSize,0);else if("cube"in e.material){var s=e.material.cube.right.image.value.width;r.uniform1i(r.getUniformLocation(o.program,"u_texture"),0),u(t,r,"cube").useCube([e.material.cube.right.image.value,e.material.cube.left.image.value,e.material.cube.top.image.value,e.material.cube.bottom.image.value,e.material.cube.far.image.value,e.material.cube.near.image.value],s,s)}else"image"in e.material&&(r.uniform1i(r.getUniformLocation(o.program,"u_sampler"),0),new a(r).use().write(e.geometry.attributes.uv.array).divide(r.getAttribLocation(o.program,"a_textcoord"),e.geometry.attributes.uv.itemSize,2,0),u(t,r,"2d").useImage(e.material.image.value));e.geometry.index?(new a(r,!0).use().write(e.geometry.index.array),r.drawElements(r[e.geometry.type],e.geometry.index.count,r.UNSIGNED_BYTE,0)):r.drawArrays(r[e.geometry.type],0,e.geometry.attributes.position.count)}var x=!1,w=function(){function t(t,r){this.name="WebGL",this.__getColor=function(t,r){return"rgba(0,0,0,1)"},this.__regionList={},this.__regionAssemble=function(t,r,e,i){for(var n=[],o=0;o<i;o++)n[o]=t;return function(){for(var o=0;o<i;o++){if(n[o]+e<r){n[o]=+(n[o]+e).toFixed(7);break}o<i-1&&(n[o]=t)}return n}}(0,1,.2,3),this.__regionName="",this.__regionColor=[0,0,0,1],this.__scene={children:[],matrix:new o([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,10])},this.__unique=(new Date).valueOf(),this.painter=e(t,10),r&&(this.__regionPainter=e(r,10,{}));var i=this.painter.canvas.width/this.painter.canvas.height,n=1,a=1;i>1?n=1/i:a=i;var s=Math.min(n,a);this.__proporion=[n,0,0,0,0,a,0,0,0,0,s,0,0,0,0,1]}return t.prototype.matrix=function(t){return new o(t)},t.prototype.getMatrix=function(){return this.__scene.matrix},t.prototype.getObject3D=function(){return this.__scene.children},t.prototype.review=function(t){void 0===t&&(t=!1),t?this.__regionPainter&&(this.__regionPainter.clearColor(1,1,1,1),this.__regionPainter.clear(this.__regionPainter.COLOR_BUFFER_BIT)):(this.painter.clearColor(1,1,1,1),this.painter.clear(this.painter.COLOR_BUFFER_BIT));for(var r=0;r<this.__scene.children.length;r++)this.draw(this.__scene.children[r],t);return this},t.prototype.draw=function(t,r){void 0===r&&(r=!1),r||(x=!0);var e={matrix:t.matrix.value()},n={matrix:this.__scene.matrix.value(),proporion:this.__proporion};this.setRegion(t.region);for(var o=0;o<t.mesh.length;o++)r?this.__regionPainter&&(b("painter"+this.__unique,this.__regionPainter,{geometry:t.mesh[o].geometry,material:{color:{r:this.__regionColor[0],g:this.__regionColor[1],b:this.__regionColor[2],alpha:this.__regionColor[3]}}},e,n),this.__getColor=i(this.__regionPainter)):b("region"+this.__unique,this.painter,t.mesh[o],e,n)},t.prototype.render=function(t){"matrix"in t||(t.matrix=new o),"region"in t||(t.region="");for(var r=0;r<t.mesh.length;r++){var e=t.mesh[r];e.geometry.attributes.normal&&Array.isArray(e.geometry.attributes.normal.array)&&(e.geometry.attributes.normal.array=new Float32Array(e.geometry.attributes.normal.array)),e.geometry.attributes.position&&Array.isArray(e.geometry.attributes.position.array)&&(e.geometry.attributes.position.array=new Float32Array(e.geometry.attributes.position.array)),e.geometry.attributes.uv&&Array.isArray(e.geometry.attributes.uv.array)&&(e.geometry.attributes.uv.array=new Float32Array(e.geometry.attributes.uv.array)),e.geometry.index&&Array.isArray(e.geometry.index.array)&&(e.geometry.index.array=new Uint8Array(e.geometry.index.array)),e.material.colors&&Array.isArray(e.material.colors.array)&&(e.material.colors.array=new Float32Array(e.material.colors.array))}this.__scene.children.push(t),this.draw(t)},t.prototype.setRegion=function(t){return this.__regionName=t+"",t?(null==this.__regionList[t]&&(this.__regionList[t]=r(r([],this.__regionAssemble(),!0),[1],!1)),this.__regionColor=this.__regionList[t]):this.__regionColor=[0,0,0,1],this},t.prototype.getRegion=function(t,r){var e=this;return x&&this.review(!0),x=!1,new Promise((function(i,n){var o=e.__getColor(t,r);for(var a in e.__regionList){var s=e.__regionList[a];if("rgba("+255*s[0]+","+255*s[1]+","+255*s[2]+","+255*s[3]+")"==o){i(a);break}}i("")}))},t}();return function(r){function e(t,e){if(void 0===e&&(e={}),!t)throw new Error("VISLite WebGL:The mount point requires an HTMLElement type but encountered null.");e=function(t,r){for(var e in t)r[e]=t[e];return r}(e,{region:!0});var i,n,o=t.clientWidth,a=t.clientHeight,s=t;s._vislite_canvas_?(i=s._vislite_canvas_[0],n=s._vislite_canvas_[1]):(e.region&&(n=document.createElement("canvas"),t.appendChild(n),n.style.position="absolute",n.style.zIndex="-1",n.style.opacity="0"),i=document.createElement("canvas"),t.appendChild(i),s._vislite_canvas_=[i,n],t.setAttribute("vislite","WebGL"));for(var _=0,u=[i,n];_<u.length;_++){var m=u[_];m&&(m.style.width=o+"px",m.setAttribute("width",o+""),m.style.height=a+"px",m.setAttribute("height",a+""))}return r.call(this,i,n)||this}return function(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,r),e}(w)},"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_WebGL=r();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var e,t;e=this,t=function(){"use strict";var e,t=[];return function(i,n,r){void 0===n&&(n=400),void 0===r&&(r=function(){});var o={timer:function(e,i,n){if(!e)throw new Error("Tick is required!");var r=(new Date).valueOf()+"_"+(1e3*Math.random()).toFixed(0);return t.push({id:r,createTime:new Date,tick:e,duration:i,callback:n}),o.start(),r},start:function(){e||(e=setInterval(o.tick,13))},tick:function(){var e,i,n,r,a,u,f,c=t;for((t=[]).length=0,i=0;i<c.length;i++)e=(a=c[i]).createTime,n=a.tick,u=a.duration,r=a.callback,n(f=(f=(+(new Date).valueOf()-e.valueOf())/u)>1?1:f),f<1&&a.id?t.push(a):r(f);t.length<=0&&o.stop()},stop:function(){e&&(clearInterval(e),e=null)}},a=o.timer((function(e){i(e)}),n,r);return function(){var e;for(e in t)if(t[e].id==a)return void(t[e].id=void 0)}}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_animation=t();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var e,t;e=this,t=function(){"use strict";var e=function(e){var t=e.toString(16);return 1==t.length?"0"+t:t};return function(t,o){var c=document.getElementsByTagName("head")[0];c.style.color=t;for(var n=(document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(c,null):c.currentStyle).getPropertyValue("color").replace(/rgba?\(/,"").replace(")","").split(","),r=0;r<n.length;r++)n[r]=+n[r];switch(n.push(1),o){case"3d":return[n[0]/255,n[1]/255,n[2]/255,n[3]];case"rgba":return"rgba(".concat(n[0],", ").concat(n[1],", ").concat(n[2],", ").concat(n[3],")");case"rgb":return"rgb(".concat(n[0],", ").concat(n[1],", ").concat(n[2],")");case"hexAlpha":return"#".concat(e(n[0])).concat(e(n[1])).concat(e(n[2])).concat(e(+(255*n[3]).toFixed(0)));case"hex":return"#".concat(e(n[0])).concat(e(n[1])).concat(e(n[2]))}throw new Error("Unsupported color format: "+o)}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_formatColor=t();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var e,t;e=this,t=function(){"use strict";return function(e,t){void 0===t&&(t=1);var r=["rgba(84,112,198,"+t+")","rgba(145,204,117,"+t+")","rgba(250,200,88,"+t+")","rgba(238,102,102,"+t+")","rgba(115,192,222,"+t+")","rgba(59,162,114,"+t+")","rgba(252,132,82,"+t+")","rgba(154,96,180,"+t+")","rgba(234,124,204,"+t+")"],n=[];if(e<=r.length)return r;if(e%r.length==0)for(var o=0;o<e/r.length;o++)n=n.concat(r);else{for(var a=1;a<e/r.length;a++)n=n.concat(r);if(e%r.length==1)n=n.concat(r[4]);else for(var f=0;f<e%r.length;f++)n=n.concat(r[f])}return n}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_getLoopColors=t();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var e,t;e=this,t=function(){"use strict";return function(e,t){if(void 0===t&&(t=1),!e)throw new Error("VISLite getWebGLContext:The mount point requires an HTMLElement type but encountered null.");var n,i=e.clientWidth,o=e.clientHeight,r=e;return r._vislite_canvas_?n=r._vislite_canvas_:(n=document.createElement("canvas"),e.appendChild(n),r._vislite_canvas_=n,e.setAttribute("vislite","WebGL")),n.style.width=i+"px",n.setAttribute("width",i+""),n.style.height=o+"px",n.setAttribute("height",o+""),function(e,t,n){void 0===n&&(n={});for(var i=["webgl","experimental-webgl","webkit-3d","moz-webgl"],o=null,r=0;r<i.length;r++){try{o=e.getContext(i[r],n)}catch(e){}if(o)break}if(!o)throw new Error("Non canvas or browser does not support webgl.");var l=o.canvas.width,a=o.canvas.height,s=l*t,u=a*t;return o.viewport(.5*(l-s),.5*(a-u),s,u),o.depthFunc(o.LEQUAL),o.enable(o.DEPTH_TEST),o}(n,t)}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_getWebGLContext=t();
package/lib/index.umd.js CHANGED
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,e;t=this,e=function(){"use strict";var t=function(){function t(t){void 0===t&&(t=.5),this.name="Hermite",this.__u=t}return t.prototype.setP=function(t,e,i,r,n,o){if(!(t<i))throw new Error("The point x-position should be increamented!");this.__a=t,this.__b=i;var s=this.__u*n,a=this.__u*o;return e/=i-t,r/=i-t,this.__MR=[2*e-2*r+s+a,3*r-3*e-2*s-a,s,e],this},t.prototype.use=function(t){if(this.__MR){var e=(t-this.__a)/(this.__b-this.__a),i=e*e;return(e*i*this.__MR[0]+i*this.__MR[1]+e*this.__MR[2]+this.__MR[3])*(this.__b-this.__a)}throw new Error("You shoud first set the position!")},t}(),e=function(){function e(t){void 0===t&&(t=0),this.name="Cardinal",this.__t=t}return e.prototype.setP=function(e){this.__HS={x:[],h:[]};var i,r,n=(e[1][1]-e[0][1])/(e[1][0]-e[0][0]);for(this.__HS.x[0]=e[0][0],i=1;i<e.length;i++){if(e[i][0]<=e[i-1][0])throw new Error("The point position should be increamented!");this.__HS.x[i]=e[i][0],r=i<e.length-1?e[i+1][1]>e[i][1]&&e[i-1][1]>e[i][1]||e[i+1][1]<e[i][1]&&e[i-1][1]<e[i][1]||e[i+1][1]==e[i][1]||e[i-1][1]==e[i][1]?0:(e[i+1][1]-e[i-1][1])/(e[i+1][0]-e[i-1][0]):(e[i][1]-e[i-1][1])/(e[i][0]-e[i-1][0]),this.__HS.h[i-1]=new t(.5*(1-this.__t)).setP(e[i-1][0],e[i-1][1],e[i][0],e[i][1],n,r),n=r}return this},e.prototype.use=function(t){if(this.__HS){for(this.__i=-1;this.__i+1<this.__HS.x.length&&(t>this.__HS.x[this.__i+1]||-1==this.__i&&t>=this.__HS.x[this.__i+1]);)this.__i+=1;return this.__i<0?this.__HS.h[0].use(this.__HS.x[0]):this.__i>=this.__HS.h.length?this.__HS.h[this.__HS.h.length-1].use(this.__HS.x[this.__HS.x.length-1]):this.__HS.h[this.__i].use(t)}throw new Error("You shoud first set the position!")},e}(),i=function(t,e){for(var i=[],r=0;r<4;r++)for(var n=0;n<e.length/4;n++)i[4*n+r]=t[r]*e[4*n]+t[r+4]*e[4*n+1]+t[r+8]*e[4*n+2]+t[r+12]*e[4*n+3];return i},r=function(){function t(t){void 0===t&&(t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.name="Matrix4",this.__matrix4=t}return t.prototype.move=function(t,e,r,n){return void 0===n&&(n=0),this.__matrix4=i(function(t,e,i,r){void 0===r&&(r=0);var n=Math.sqrt(e*e+i*i+r*r);return[1,0,0,0,0,1,0,0,0,0,1,0,e*t/n,i*t/n,r*t/n,1]}(t,e,r,n),this.__matrix4),this},t.prototype.rotate=function(t,e,r,n,o,s,a){var _=function(t,e,i,r,n,o){if("number"==typeof t&&"number"==typeof e){if("number"!=typeof i?(i=0,r=t,n=e,o=1):"number"==typeof r&&"number"==typeof n&&"number"==typeof o||(r=t,n=e,o=i,t=0,e=0,i=0),t==r&&e==n&&i==o)throw new Error("It's not a legitimate ray!");var s=Math.sqrt((r-t)*(r-t)+(n-e)*(n-e)),a=0!=s?(n-e)/s:1,_=0!=s?(r-t)/s:0,h=(r-t)*_+(n-e)*a,u=o-i,l=Math.sqrt(h*h+u*u),p=0!=l?u/l:1,c=0!=l?h/l:0;return[[a,p*_,_*c,0,-_,a*p,a*c,0,0,-c,p,0,e*_-t*a,i*c-t*_*p-e*a*p,-t*_*c-e*a*c-i*p,1],[a,-_,0,0,p*_,p*a,-c,0,_*c,a*c,p,0,t,e,i,1]]}throw new Error("a1 and b1 is required!")}(e,r,n,o,s,a);return this.__matrix4=i(i(i(_[1],function(t){var e=Math.sin(t),i=Math.cos(t);return[i,e,0,0,-e,i,0,0,0,0,1,0,0,0,0,1]}(t)),_[0]),this.__matrix4),this},t.prototype.scale=function(t,e,r,n,o,s){return void 0===n&&(n=0),void 0===o&&(o=0),void 0===s&&(s=0),this.__matrix4=i(function(t,e,i,r,n,o){return void 0===r&&(r=0),void 0===n&&(n=0),void 0===o&&(o=0),[t,0,0,0,0,e,0,0,0,0,i,0,r-r*t,n-n*e,o-o*i,1]}(t,e,r,n,o,s),this.__matrix4),this},t.prototype.multiply=function(t,e){return void 0===e&&(e=!1),this.__matrix4=e?i(this.__matrix4,t):i(t,this.__matrix4),this},t.prototype.use=function(t,e,r,n){return void 0===r&&(r=0),void 0===n&&(n=1),i(this.__matrix4,[t,e,r,n])},t.prototype.value=function(){return this.__matrix4},t}();function n(t,e,i,r,n){var o=Math.cos(i),s=Math.sin(i);return[(r-t)*o-(n-e)*s+t,(r-t)*s+(n-e)*o+e]}var o,s=function(t){var e=t.toString(16);return 1==e.length?"0"+e:e},a=[];function _(t,e,i){void 0===e&&(e=400),void 0===i&&(i=function(){});var r={timer:function(t,e,i){if(!t)throw new Error("Tick is required!");var n=(new Date).valueOf()+"_"+(1e3*Math.random()).toFixed(0);return a.push({id:n,createTime:new Date,tick:t,duration:e,callback:i}),r.start(),n},start:function(){o||(o=setInterval(r.tick,13))},tick:function(){var t,e,i,n,o,s,_,h=a;for((a=[]).length=0,e=0;e<h.length;e++)t=(o=h[e]).createTime,i=o.tick,s=o.duration,n=o.callback,i(_=(_=(+(new Date).valueOf()-t.valueOf())/s)>1?1:_),_<1&&o.id?a.push(o):n(_);a.length<=0&&r.stop()},stop:function(){o&&(clearInterval(o),o=null)}},n=r.timer((function(e){t(e)}),e,i);return function(){var t;for(t in a)if(a[t].id==n)return void(a[t].id=void 0)}}var h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},h(t,e)};function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function l(t,e,i){if(i||2===arguments.length)for(var r,n=0,o=e.length;n<o;n++)!r&&n in e||(r||(r=Array.prototype.slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var p=["href","title","show","type","role","actuate"],c=function(t,e,i){p.indexOf(e)>-1?t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:"+e,i+""):t.setAttribute(e,i+"")},f=c;function d(t,e){c(t,"stroke",e.strokeStyle),c(t,"fill",e.fillStyle),c(t,"stroke-dasharray",e.lineDash.join(","))}function g(t,e){c(t,"fill",e.fillStyle)}function m(t,e){c(t,"stroke",e.strokeStyle),c(t,"fill","none"),c(t,"stroke-dasharray",e.lineDash.join(","))}var v=function(t,e,i,r,n){var o=Math.cos(i),s=Math.sin(i);return[+((r-t)*o-(n-e)*s+t).toFixed(7),+((r-t)*s+(n-e)*o+e).toFixed(7)]};function y(t,e,i,r,n,o,s){e<0&&(t+=e,e*=-1);var a,_=[];a=v(0,0,t,n,0),_[0]=a[0],_[1]=a[1],a=v(0,0,e,a[0],a[1]),_[2]=a[0],_[3]=a[1],a=v(0,0,t,o,0),_[4]=a[0],_[5]=a[1],a=v(0,0,e,a[0],a[1]),_[6]=a[0],_[7]=a[1],s(t,t+e,_[0]+i,_[1]+r,_[4]+i,_[5]+r,_[2]+i,_[3]+r,_[6]+i,_[7]+r,.5*(o-n))}var x=function(t,e,i,r,n){if("text"!==t.nodeName.toLowerCase())throw new Error("Need a <text> !");f(t,"dy",{top:.5*e.fontSize,middle:0,bottom:.5*-e.fontSize}[e.textBaseline]),function(t,e){for(var i in e)t.style[i]=e[i]}(t,{"text-anchor":{left:"start",right:"end",center:"middle"}[e.textAlign],"dominant-baseline":"central","font-size":e.fontSize+"px","font-family":e.fontFamily}),f(t,"x",i),f(t,"y",r),"number"==typeof n&&f(t,"transform","rotate("+(n%=360)+","+i+","+r+")")},E=function(t,e,i,r){if("circle"!==t.nodeName.toLowerCase())throw new Error("Need a <circle> !");f(t,"cx",e),f(t,"cy",i),f(t,"r",r)},b=function(t,e){if("path"!==t.nodeName.toLowerCase())throw new Error("Need a <path> !");f(t,"d",e)},w=function(t,e,i,r,n){if("rect"!==t.nodeName.toLowerCase())throw new Error("Need a <rect> !");n<0&&(i-=n*=-1),r<0&&(e-=r*=-1),f(t,"x",e),f(t,"y",i),f(t,"width",r),f(t,"height",n)},T=function(t,e,i,r,n,o,s,a){if("path"!==t.nodeName.toLowerCase())throw new Error("Need a <path> !");if(s=s/180*Math.PI,a=a/180*Math.PI,s%=2*Math.PI,n>o){var _=n;n=o,o=_}a>=1.999999*Math.PI||a<=1.999999*-Math.PI?a=1.999999*Math.PI:a%=2*Math.PI,y(s,a,i,r,n,o,(function(i,r,s,a,_,h,u,l,p,c,d){var g=r-i>Math.PI?1:0,m="M"+s+" "+a;d<0&&(d=-d),m+="A"+n+" "+n+" 0 "+g+" 1 "+u+" "+l,"round"==e.arcEndCap?m+="A"+d+" "+d+" 0 1 0 "+p+" "+c:"-round"==e.arcEndCap?m+="A"+d+" "+d+" 0 1 1 "+p+" "+c:m+="L"+p+" "+c,m+="A"+o+" "+o+" 0 "+g+" 0 "+_+" "+h,"round"==e.arcStartCap?m+="A"+d+" "+d+" 0 1 0 "+s+" "+a:"-round"==e.arcStartCap?m+="A"+d+" "+d+" 0 1 1 "+s+" "+a:m+="L"+s+" "+a,"butt"==e.arcStartCap&&(m+="Z"),f(t,"d",m)}))},C={"font-size":"fontSize","font-family":"fontFamily","arc-start-cap":"arcStartCap","arc-end-cap":"arcEndCap"},P=function(){function t(t){this.name="SVG",this.__config={fillStyle:"#000",strokeStyle:"#000",lineWidth:1,textAlign:"left",textBaseline:"middle",fontSize:50,fontFamily:"sans-serif",arcStartCap:"butt",arcEndCap:"butt",lineDash:[]},this.__path="",this.__currentPosition=[],this.__svg=t}return t.prototype.config=function(t){if("object"!=typeof t)return this.__config[C[t]||t];for(var e in t){var i=C[e]||e;this.__config[i]=t[e]}return this},t.prototype.useEl=function(t){return this.__useEl=t,this},t.prototype.getEl=function(){return this.__useEl},t.prototype.appendEl=function(t,e){var i;return e=e||this.__svg,"string"==typeof t&&(i=t,t=document.createElementNS("http://www.w3.org/2000/svg",i)),e.appendChild(t),this.__useEl=t,this},t.prototype.appendBoard=function(t,e){var i=t;if("string"==typeof t&&(i={text:"text",path:"path",arc:"path",circle:"circle",rect:"rect"}[t]||""),""==i)throw new Error("Unsupported drawing method:"+t);return this.appendEl(i,e)},t.prototype.remove=function(){if(!this.__useEl)throw new Error("Currently, no node can be deleted.");return this.__useEl.parentNode.removeChild(this.__useEl),this},t.prototype.attr=function(t){if(!this.__useEl)throw new Error("Currently, no node can be modified or viewed.");if("object"!=typeof t)return function(t,e){return p.indexOf(e)>-1&&(e="xlink:"+e),t.getAttribute(e)}(this.__useEl,t);for(var e in t)f(this.__useEl,e,t[e]);return this},t.prototype.fillText=function(t,e,i,r){return void 0===r&&(r=0),x(this.__useEl,this.__config,e,i,r),this.__useEl.textContent=t,g(this.__useEl,this.__config),this},t.prototype.strokeText=function(t,e,i,r){return void 0===r&&(r=0),x(this.__useEl,this.__config,e,i,r),this.__useEl.textContent=t,m(this.__useEl,this.__config),this},t.prototype.fullText=function(t,e,i,r){return void 0===r&&(r=0),x(this.__useEl,this.__config,e,i,r),this.__useEl.textContent=t,d(this.__useEl,this.__config),this},t.prototype.fillArc=function(t,e,i,r,n,o){return T(this.__useEl,this.__config,t,e,i,r,n,o),g(this.__useEl,this.__config),this},t.prototype.strokeArc=function(t,e,i,r,n,o){return T(this.__useEl,this.__config,t,e,i,r,n,o),m(this.__useEl,this.__config),this},t.prototype.fullArc=function(t,e,i,r,n,o){return T(this.__useEl,this.__config,t,e,i,r,n,o),d(this.__useEl,this.__config),this},t.prototype.fillCircle=function(t,e,i){return E(this.__useEl,t,e,i),g(this.__useEl,this.__config),this},t.prototype.strokeCircle=function(t,e,i){return E(this.__useEl,t,e,i),m(this.__useEl,this.__config),this},t.prototype.fullCircle=function(t,e,i){return E(this.__useEl,t,e,i),d(this.__useEl,this.__config),this},t.prototype.fillRect=function(t,e,i,r){return w(this.__useEl,t,e,i,r),g(this.__useEl,this.__config),this},t.prototype.strokeRect=function(t,e,i,r){return w(this.__useEl,t,e,i,r),m(this.__useEl,this.__config),this},t.prototype.fullRect=function(t,e,i,r){return w(this.__useEl,t,e,i,r),d(this.__useEl,this.__config),this},t.prototype.beginPath=function(){return this.__currentPosition=[],this.__path="",this},t.prototype.closePath=function(){return this.__path+="Z",this},t.prototype.moveTo=function(t,e){return this.__currentPosition=[t,e],this.__path+="M"+t+" "+e,this},t.prototype.lineTo=function(t,e){return this.__currentPosition=[t,e],this.__path+=(""==this.__path?"M":"L")+t+" "+e,this},t.prototype.fill=function(){return b(this.__useEl,this.__path),g(this.__useEl,this.__config),this},t.prototype.stroke=function(){return b(this.__useEl,this.__path),m(this.__useEl,this.__config),this},t.prototype.full=function(){return b(this.__useEl,this.__path),d(this.__useEl,this.__config),this},t.prototype.arc=function(t,e,i,r,o){var s=n(t,e,r/180*Math.PI,t+i,e),a=n(t,e,(r+o)/180*Math.PI,t+i,e);return""==this.__path?this.__path+="M"+s[0]+","+s[1]:s[0]==this.__currentPosition[0]&&s[1]==this.__currentPosition[1]||(this.__path+="L"+s[0]+","+s[1]),this.__path+="A"+i+","+i+" 0 "+(o>180||o<-180?1:0)+","+(o>0?1:0)+" "+a[0]+","+a[1],this},t.prototype.quadraticCurveTo=function(t,e,i,r){return this.__path+="Q"+t+" "+e+","+i+" "+r,this},t.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this.__path+="C"+t+" "+e+","+i+" "+r+","+n+" "+o,this},t}(),R=function(t){function e(e){if(!e)throw new Error("VISLite SVG:The mount point requires an HTMLElement type but encountered null.");var i=e.clientWidth,r=e.clientHeight,n=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.appendChild(n),n.setAttribute("width",i+""),n.setAttribute("height",r+""),n.setAttribute("viewBox","0 0 "+i+" "+r),t.call(this,n)||this}return u(e,t),e}(P),S=function(t,e,i,r,n){return t.beginPath(),t.translate(i,r),t.rotate(n),t.font=e.fontStyle+" "+e.fontWeight+" "+e.fontSize+"px "+e.fontFamily,t},A=function(t,e,i,r,n,o,s,a){if(n>o){var _=n;n=o,o=_}return s%=2*Math.PI,a>=1.999999*Math.PI||a<=1.999999*-Math.PI?a=2*Math.PI:a%=2*Math.PI,y(s,a,i,r,n,o,(function(s,a,_,h,u,l,p,c,f,d,g){g<0&&(g=-g),t.beginPath(),t.moveTo(_,h),t.arc(i,r,n,s,a,!1),"round"==e.arcEndCap?t.arc(.5*(p+f),.5*(c+d),g,a-Math.PI,a,!0):"-round"==e.arcEndCap?t.arc(.5*(p+f),.5*(c+d),g,a-Math.PI,a,!1):t.lineTo(f,d),t.arc(i,r,o,a,s,!0),"round"==e.arcStartCap?t.arc(.5*(_+u),.5*(h+l),g,s,s-Math.PI,!0):"-round"==e.arcStartCap?t.arc(.5*(_+u),.5*(h+l),g,s,s-Math.PI,!1):t.lineTo(_,h)})),"butt"==e.arcStartCap&&t.closePath(),t},M=function(t,e,i,r){return t.beginPath(),t.moveTo(e+r,i),t.arc(e,i,r,0,2*Math.PI),t},L=function(t,e,i,r,n){return t.beginPath(),t.rect(e,i,r,n),t};function k(t,e,i,r,n){for(var o=0,s="",a=0;a<e.length;a++)t.measureText(s+e[a]).width>i||/\n$/.test(s)?(n(s,((o+=1)-.5)*r),s=e[a]):a==e.length-1?(o+=1,n(s+e[a],(o-.5)*r)):s+=e[a];return o*r}var I=function(){function t(t,e,i,r){void 0===e&&(e={}),void 0===r&&(r=!1),this.__region=null,this.__onlyRegion=!1,this.__specialConfig={fontSize:16,fontFamily:"sans-serif",fontWeight:400,fontStyle:"normal",arcStartCap:"butt",arcEndCap:"butt"},this.__initConfig={fillStyle:"black",strokeStyle:"black",lineWidth:1,textAlign:"left",textBaseline:"middle",lineDash:[],shadowBlur:0,shadowColor:"black"},this.painter=t.getContext("2d",e),this.__region=i,this.__isPainter=r,this.painter.textBaseline="middle",this.painter.textAlign="left"}return t.prototype.useConfig=function(t,e){if(this.__region&&["fillStyle","strokeStyle","shadowBlur","shadowColor"].indexOf(t)<0&&this.__region.useConfig(t,e),this.__isPainter&&this.__onlyRegion)return this;if("lineDash"==t)this.painter.setLineDash&&this.painter.setLineDash(e);else if(t in this.__specialConfig)"fontSize"==t&&(e=Math.round(e)),this.__specialConfig[t]=e;else{if(!(t in this.__initConfig))throw new Error("Illegal configuration item of painter : "+t+" !");this.painter[t]=e}return this},t.prototype.fillText=function(t,e,i,r){return void 0===r&&(r=0),this.__region&&this.__region.fillText(t,e,i,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),S(this.painter,this.__specialConfig,e,i,r).fillText(t,0,0),this.painter.restore()),this},t.prototype.strokeText=function(t,e,i,r){return void 0===r&&(r=0),this.__region&&this.__region.strokeText(t,e,i,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),S(this.painter,this.__specialConfig,e,i,r).strokeText(t,0,0),this.painter.restore()),this},t.prototype.fullText=function(t,e,i,r){return void 0===r&&(r=0),this.__region&&this.__region.fullText(t,e,i,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),S(this.painter,this.__specialConfig,e,i,r),this.painter.fillText(t,0,0),this.painter.strokeText(t,0,0),this.painter.restore()),this},t.prototype.fillTexts=function(t,e,i,r,n,o){var s=this;void 0===n&&(n=1.2),void 0===o&&(o=0);var a=0;if(this.__region&&(a=this.__region.fillTexts(t,e,i,r,n)),this.__isPainter&&this.__onlyRegion)return a;this.painter.save(),S(this.painter,this.__specialConfig,e,i,o);var _=k(this.painter,t,r,this.__specialConfig.fontSize*n,(function(t,e){s.painter.fillText(t,0,e)}));return this.painter.restore(),_},t.prototype.strokeTexts=function(t,e,i,r,n,o){var s=this;void 0===n&&(n=1.2),void 0===o&&(o=0);var a=0;if(this.__region&&(a=this.__region.fillTexts(t,e,i,r,n)),this.__isPainter&&this.__onlyRegion)return a;this.painter.save(),S(this.painter,this.__specialConfig,e,i,o);var _=k(this.painter,t,r,this.__specialConfig.fontSize*n,(function(t,e){s.painter.strokeText(t,0,e)}));return this.painter.restore(),_},t.prototype.fullTexts=function(t,e,i,r,n,o){var s=this;void 0===n&&(n=1.2),void 0===o&&(o=0);var a=0;if(this.__region&&(a=this.__region.fillTexts(t,e,i,r,n)),this.__isPainter&&this.__onlyRegion)return a;this.painter.save(),S(this.painter,this.__specialConfig,e,i,o);var _=k(this.painter,t,r,this.__specialConfig.fontSize*n,(function(t,e){s.painter.fillText(t,0,e),s.painter.strokeText(t,0,e)}));return this.painter.restore(),_},t.prototype.beginPath=function(){return this.__region&&this.__region.beginPath(),this.__isPainter&&this.__onlyRegion||this.painter.beginPath(),this},t.prototype.closePath=function(){return this.__region&&this.__region.closePath(),this.__isPainter&&this.__onlyRegion||this.painter.closePath(),this},t.prototype.moveTo=function(t,e){return this.__region&&this.__region.moveTo(t,e),this.__isPainter&&this.__onlyRegion||this.painter.moveTo(Math.round(t)+.5,Math.round(e)+.5),this},t.prototype.lineTo=function(t,e){return this.__region&&this.__region.lineTo(t,e),this.__isPainter&&this.__onlyRegion||this.painter.lineTo(Math.round(t)+.5,Math.round(e)+.5),this},t.prototype.arc=function(t,e,i,r,n){return this.__region&&this.__region.arc(t,e,i,r,n),this.__isPainter&&this.__onlyRegion||this.painter.arc(t,e,i,r,r+n,n<0),this},t.prototype.fill=function(){return this.__region&&this.__region.fill(),this.__isPainter&&this.__onlyRegion||this.painter.fill(),this},t.prototype.stroke=function(){return this.__region&&this.__region.stroke(),this.__isPainter&&this.__onlyRegion||this.painter.stroke(),this},t.prototype.full=function(){return this.__region&&this.__region.full(),this.__isPainter&&this.__onlyRegion||(this.painter.fill(),this.painter.stroke()),this},t.prototype.save=function(){return this.__region&&this.__region.save(),this.__isPainter&&this.__onlyRegion||this.painter.save(),this},t.prototype.restore=function(){return this.__region&&this.__region.restore(),this.__isPainter&&this.__onlyRegion||this.painter.restore(),this},t.prototype.clip=function(){return this.__region&&this.__region.clip(),this.__isPainter&&this.__onlyRegion||this.painter.clip(),this},t.prototype.quadraticCurveTo=function(t,e,i,r){return this.__region&&this.__region.quadraticCurveTo(t,e,i,r),this.__isPainter&&this.__onlyRegion||this.painter.quadraticCurveTo(t,e,i,r),this},t.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this.__region&&this.__region.bezierCurveTo(t,e,i,r,n,o),this.__isPainter&&this.__onlyRegion||this.painter.bezierCurveTo(t,e,i,r,n,o),this},t.prototype.clearRect=function(t,e,i,r){return this.__region&&this.__region.clearRect(t,e,i,r),this.__isPainter&&this.__onlyRegion||this.painter.clearRect(t,e,i,r),this},t.prototype.fillArc=function(t,e,i,r,n,o){return this.__region&&this.__region.fillArc(t,e,i,r,n,o),this.__isPainter&&this.__onlyRegion||A(this.painter,this.__specialConfig,t,e,i,r,n,o).fill(),this},t.prototype.strokeArc=function(t,e,i,r,n,o){return this.__region&&this.__region.strokeArc(t,e,i,r,n,o),this.__isPainter&&this.__onlyRegion||A(this.painter,this.__specialConfig,t,e,i,r,n,o).stroke(),this},t.prototype.fullArc=function(t,e,i,r,n,o){return this.__region&&this.__region.fullArc(t,e,i,r,n,o),this.__isPainter&&this.__onlyRegion||(A(this.painter,this.__specialConfig,t,e,i,r,n,o),this.painter.fill(),this.painter.stroke()),this},t.prototype.fillCircle=function(t,e,i){return this.__region&&this.__region.fillCircle(t,e,i),this.__isPainter&&this.__onlyRegion||M(this.painter,t,e,i).fill(),this},t.prototype.strokeCircle=function(t,e,i){return this.__region&&this.__region.strokeCircle(t,e,i),this.__isPainter&&this.__onlyRegion||M(this.painter,t,e,i).stroke(),this},t.prototype.fullCircle=function(t,e,i){return this.__region&&this.__region.fullCircle(t,e,i),this.__isPainter&&this.__onlyRegion||(M(this.painter,t,e,i),this.painter.fill(),this.painter.stroke()),this},t.prototype.fillRect=function(t,e,i,r){return this.__region&&this.__region.fillRect(t,e,i,r),this.__isPainter&&this.__onlyRegion||L(this.painter,t,e,i,r).fill(),this},t.prototype.strokeRect=function(t,e,i,r){return this.__region&&this.__region.strokeRect(t,e,i,r),this.__isPainter&&this.__onlyRegion||L(this.painter,t,e,i,r).stroke(),this},t.prototype.fullRect=function(t,e,i,r){return this.__region&&this.__region.fullRect(t,e,i,r),this.__isPainter&&this.__onlyRegion||(L(this.painter,t,e,i,r),this.painter.fill(),this.painter.stroke()),this},t.prototype.draw=function(){},t}();function z(t,e,i,r){for(var n=[],o=0;o<r;o++)n[o]=t;return function(){for(var o=0;o<r;o++){if(n[o]+i<e){n[o]=+(n[o]+i).toFixed(7);break}o<r-1&&(n[o]=t)}return n}}var U={"font-size":"fontSize","font-family":"fontFamily","font-weight":"fontWeight","font-style":"fontStyle","arc-start-cap":"arcStartCap","arc-end-cap":"arcEndCap"},N=function(t){function e(e,i){var r=t.call(this,e,{},i?new I(i,{willReadFrequently:!0}):null,!0)||this;return r.name="Canvas",r.__regionList={},r.__regionAssemble=z(0,255,10,3),r.setRegion(""),r}return u(e,t),e.prototype.config=function(t){for(var e in t){var i=U[e]||e;this.useConfig(i,t[e])}return this},e.prototype.onlyRegion=function(t){return this.__onlyRegion=t,this},e.prototype.setRegion=function(t){if(this.__region)if(t){if(null==this.__regionList[t]){var e=this.__regionAssemble();this.__regionList[t]="rgb("+e[0]+","+e[1]+","+e[2]+")"}this.__region.useConfig("fillStyle",this.__regionList[t])&&this.__region.useConfig("strokeStyle",this.__regionList[t])}else this.__region.useConfig("fillStyle","#000000")&&this.__region.useConfig("strokeStyle","#000000");return this},e.prototype.getRegion=function(t,e){var i=this;return new Promise((function(r,n){var o=i.__region?i.__region.painter.getImageData(t-.5,e-.5,1,1):{data:[0,0,0,0]},s=o.data,a=function(){if(i.__region)for(var t in i.__regionList)if("rgb("+s[0]+","+s[1]+","+s[2]+")"==i.__regionList[t]){r(t);break}r("")};s?a():o.then((function(t){s=t,a()}))}))},e.prototype.textWidth=function(t){this.painter.save(),S(this.painter,this.__specialConfig,0,0,0);var e=this.painter.measureText(t+"").width;return this.painter.restore(),e},e.prototype.getContext=function(t){return void 0===t&&(t=!1),t?this.__region?this.__region.painter:null:this.painter},e.prototype.createLinearGradient=function(t,e,i,r){return function(t,e,i,r,n){var o=t.createLinearGradient(e,i,r,n),s={value:function(){return o},setColor:function(t,e){return o.addColorStop(t,e),s}};return s}(this.painter,t,e,i,r)},e.prototype.createRadialGradient=function(t,e,i){return function(t,e,i,r){var n=t.createRadialGradient(e,i,0,e,i,r),o={value:function(){return n},setColor:function(t,e){return n.addColorStop(t,e),o}};return o}(this.painter,t,e,i)},e.prototype.getColor=function(t,e){var i=this.painter.getImageData(t-.5,e-.5,1,1).data;return"rgba("+i[0]+","+i[1]+","+i[2]+","+i[3]+")"},e}(I);function B(t,e){for(var i in t)e[i]=t[i];return e}var O=function(t){function e(e,i){void 0===i&&(i={});var r=this;if(!e)throw new Error("VISLite Canvas:The mount point requires an HTMLElement type but encountered null.");i=B(i,{region:!0});var n,o,s=e.clientWidth,a=e.clientHeight,_=e;_._vislite_canvas_?(n=_._vislite_canvas_[0],o=_._vislite_canvas_[1]):(n=document.createElement("canvas"),e.appendChild(n),i.region&&(o=document.createElement("canvas")),_._vislite_canvas_=[n,o],e.setAttribute("vislite","Canvas"));for(var h=0,u=[n,o];h<u.length;h++){var l=u[h];l&&(l.style.width=s+"px",l.setAttribute("width",s+""),l.style.height=a+"px",l.setAttribute("height",a+""))}return(r=t.call(this,n,o)||this).__canvas=n,r}return u(e,t),e.prototype.toDataURL=function(){var t=this;return new Promise((function(e){e(t.__canvas.toDataURL())}))},e}(N);function F(t,e,i){void 0===i&&(i={});for(var r=["webgl","experimental-webgl","webkit-3d","moz-webgl"],n=null,o=0;o<r.length;o++){try{n=t.getContext(r[o],i)}catch(t){}if(n)break}if(!n)throw new Error("Non canvas or browser does not support webgl.");var s=n.canvas.width,a=n.canvas.height,_=s*e,h=a*e;return n.viewport(.5*(s-_),.5*(a-h),_,h),n.depthFunc(n.LEQUAL),n.enable(n.DEPTH_TEST),n}function D(t){var e=t.drawingBufferWidth,i=t.drawingBufferHeight,r=new Uint8Array(4*e*i);return t.readPixels(0,0,e,i,t.RGBA,t.UNSIGNED_BYTE,r),function(t,n){return"rgba("+r[4*((n=i-n)*e+t)]+","+r[4*(n*e+t)+1]+","+r[4*(n*e+t)+2]+","+r[4*(n*e+t)+3]+")"}}var H=function(){function t(t,e){void 0===e&&(e=!1),this.__painter=t,this.__isElement=e,this.__buffer=function(t){return t.createBuffer()}(t),this.__type=e?t.ELEMENT_ARRAY_BUFFER:t.ARRAY_BUFFER}return t.prototype.use=function(){return this.__painter.bindBuffer(this.__type,this.__buffer),this},t.prototype.write=function(t){return function(t,e,i,r){var n=i?t.ELEMENT_ARRAY_BUFFER:t.ARRAY_BUFFER;t.bufferData(n,e,r)}(this.__painter,t,this.__isElement,this.__painter.STATIC_DRAW),this.__fsize=t.BYTES_PER_ELEMENT,this},t.prototype.divide=function(t,e,i,r){return void 0===r&&(r=0),function(t,e,i,r,n,o,s){t.vertexAttribPointer(e,i,r,s,n,o),t.enableVertexAttribArray(e)}(this.__painter,t,e,this.__painter.FLOAT,i*this.__fsize,r*this.__fsize,!1),this},t}(),G=function(){function t(t,e,i){void 0===i&&(i=0),this.__painter=t,this.__type={"2d":t.TEXTURE_2D,cube:t.TEXTURE_CUBE_MAP}[e],this.__texture=function(t,e,i){var r=t.createTexture();return t.activeTexture(t["TEXTURE"+i]),t.bindTexture(e,r),r}(t,this.__type,i),t.texParameteri(this.__type,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(this.__type,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(this.__type,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(this.__type,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}return t.prototype.useImage=function(t){return function(t,e,i,r,n,o){t.texImage2D(e,i,r,r,n,o)}(this.__painter,this.__type,0,this.__painter.RGBA,this.__painter.UNSIGNED_BYTE,t),this},t.prototype.useCube=function(t,e,i){return function(t,e,i,r,n,o,s,a,_){for(var h,u=[t.TEXTURE_CUBE_MAP_POSITIVE_X,t.TEXTURE_CUBE_MAP_NEGATIVE_X,t.TEXTURE_CUBE_MAP_POSITIVE_Y,t.TEXTURE_CUBE_MAP_NEGATIVE_Y,t.TEXTURE_CUBE_MAP_POSITIVE_Z,t.TEXTURE_CUBE_MAP_NEGATIVE_Z],l=0;l<u.length;l++)o[l]&&(h=u[l],t.texImage2D(h,i,r,s,a,0,r,n,null),t.bindTexture(e,_),t.texImage2D(h,i,r,r,n,o[l]));t.generateMipmap(e)}(this.__painter,this.__type,0,this.__painter.RGBA,this.__painter.UNSIGNED_BYTE,t,e,i,this.__texture),this},t}(),W={};function V(t,e,i){var r=t+"-"+i;return W[r]||(W[r]=new G(e,i)),W[r]}var X=function(t,e,i){var r=t.createShader(e);if(null==r)throw new Error("Unable to create shader!");if(t.shaderSource(r,i),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))throw new Error("Failed to compile shader:"+t.getShaderInfoLog(r));return r},q=function(){function t(t){this.__painter=t}return t.prototype.use=function(){return this.__painter.useProgram(this.program),this},t.prototype.compile=function(t,e){return this.program=function(t,e,i){var r=X(t,t.VERTEX_SHADER,e),n=X(t,t.FRAGMENT_SHADER,i),o=t.createProgram();if(t.attachShader(o,r),t.attachShader(o,n),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS))throw new Error("Failed to link program: "+t.getProgramInfoLog(o));return o}(this.__painter,t,e),this},t}(),Y="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n\r\n // 把原生的WebGL使用的左手坐标系变成了右手坐标系\r\n temp.z = -1.0 * temp.z;\r\n\r\n // 表示眼睛距离vec4(0.0,0.0,1.0)的距离\r\n float dist = 4.0;\r\n\r\n // 使用投影直接计算\r\n // 为保证纹理和相对位置正确\r\n // x、y、z的改变满足线性变换\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n}",j="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec4 a_color;\r\nvarying vec4 v_color;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_color = a_color;\r\n}",Z="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec2 a_textcoord;\r\nvarying vec2 v_textcoord;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_textcoord = a_textcoord;\r\n}",J="attribute vec4 a_position;\r\nuniform mat4 u_matrix;\r\nattribute vec4 a_normal;\r\nvarying vec3 v_normal;\r\n\r\nvoid main()\r\n{\r\n vec4 temp = u_matrix * a_position;\r\n temp.z = -1.0 * temp.z;\r\n float dist = 4.0;\r\n gl_Position = vec4((dist + 1.0) * temp.x, (dist + 1.0) * temp.y, dist * (dist + temp.z) + 1.0 - dist * dist, temp.w * 2.0 * (dist + temp.z));\r\n\r\n v_normal = normalize(vec3(a_normal));\r\n}",Q="precision mediump float;\r\n\r\nuniform vec4 u_color;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = u_color;\r\n}",K="precision mediump float;\r\n\r\nvarying vec4 v_color;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = v_color;\r\n}",$="precision mediump float;\r\n\r\nuniform sampler2D u_sampler;\r\nvarying vec2 v_textcoord;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = texture2D(u_sampler, v_textcoord);\r\n}",tt="precision mediump float;\r\n\r\nvarying vec3 v_normal;\r\nuniform samplerCube u_texture;\r\n\r\nvoid main()\r\n{\r\n gl_FragColor = textureCube(u_texture, normalize(v_normal));\r\n}",et={};function it(t,e,i,r,n){var o=function(t,e,i){var r,n,o=t+(i.material.color?"1":"0")+(i.material.colors?"1":"0")+(i.material.image?"1":"0")+(i.material.cube?"1":"0");if(et[o])return et[o].use();var s=(r={},r[t+"1000"]=Y,r[t+"0100"]=j,r[t+"0010"]=Z,r[t+"0001"]=J,r)[o].replace(/uniform +mat4 +u_matrix;/,"\n uniform mat4 u_matrix_world;\n uniform mat4 u_matrix_mesh;\n uniform mat4 u_matrix_proporion;").replace(/u_matrix +\* +a_position/,"u_matrix_proporion * u_matrix_world * u_matrix_mesh * a_position"),a=(n={},n[t+"1000"]=Q,n[t+"0100"]=K,n[t+"0010"]=$,n[t+"0001"]=tt,n)[o],_=new q(e).compile(s,a).use();return et[o]=_,_}(t,e,i);if(new H(e).use().write(i.geometry.attributes.position.array).divide(e.getAttribLocation(o.program,"a_position"),i.geometry.attributes.position.itemSize,i.geometry.attributes.position.itemSize,0),e.uniformMatrix4fv(e.getUniformLocation(o.program,"u_matrix_world"),!1,n.matrix),e.uniformMatrix4fv(e.getUniformLocation(o.program,"u_matrix_proporion"),!1,n.proporion),e.uniformMatrix4fv(e.getUniformLocation(o.program,"u_matrix_mesh"),!1,r.matrix),i.geometry.attributes.normal&&new H(e).use().write(i.geometry.attributes.normal.array).divide(e.getAttribLocation(o.program,"a_normal"),i.geometry.attributes.normal.itemSize,i.geometry.attributes.normal.itemSize,0),"color"in i.material&&e.uniform4f(e.getUniformLocation(o.program,"u_color"),i.material.color.r,i.material.color.g,i.material.color.b,i.material.color.alpha),"colors"in i.material)new H(e).use().write(i.material.colors.array).divide(e.getAttribLocation(o.program,"a_color"),i.material.colors.itemSize,i.material.colors.itemSize,0);else if("cube"in i.material){var s=i.material.cube.right.image.value.width;e.uniform1i(e.getUniformLocation(o.program,"u_texture"),0),V(t,e,"cube").useCube([i.material.cube.right.image.value,i.material.cube.left.image.value,i.material.cube.top.image.value,i.material.cube.bottom.image.value,i.material.cube.far.image.value,i.material.cube.near.image.value],s,s)}else"image"in i.material&&(e.uniform1i(e.getUniformLocation(o.program,"u_sampler"),0),new H(e).use().write(i.geometry.attributes.uv.array).divide(e.getAttribLocation(o.program,"a_textcoord"),i.geometry.attributes.uv.itemSize,2,0),V(t,e,"2d").useImage(i.material.image.value));i.geometry.index?(new H(e,!0).use().write(i.geometry.index.array),e.drawElements(e[i.geometry.type],i.geometry.index.count,e.UNSIGNED_BYTE,0)):e.drawArrays(e[i.geometry.type],0,i.geometry.attributes.position.count)}var rt,nt=!1,ot=function(){function t(t,e){this.name="WebGL",this.__getColor=function(t,e){return"rgba(0,0,0,1)"},this.__regionList={},this.__regionAssemble=z(0,1,.2,3),this.__regionName="",this.__regionColor=[0,0,0,1],this.__scene={children:[],matrix:new r([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,10])},this.__unique=(new Date).valueOf(),this.painter=F(t,10),e&&(this.__regionPainter=F(e,10,{}));var i=this.painter.canvas.width/this.painter.canvas.height,n=1,o=1;i>1?n=1/i:o=i;var s=Math.min(n,o);this.__proporion=[n,0,0,0,0,o,0,0,0,0,s,0,0,0,0,1]}return t.prototype.matrix=function(t){return new r(t)},t.prototype.getMatrix=function(){return this.__scene.matrix},t.prototype.getObject3D=function(){return this.__scene.children},t.prototype.review=function(t){void 0===t&&(t=!1),t?this.__regionPainter&&(this.__regionPainter.clearColor(1,1,1,1),this.__regionPainter.clear(this.__regionPainter.COLOR_BUFFER_BIT)):(this.painter.clearColor(1,1,1,1),this.painter.clear(this.painter.COLOR_BUFFER_BIT));for(var e=0;e<this.__scene.children.length;e++)this.draw(this.__scene.children[e],t);return this},t.prototype.draw=function(t,e){void 0===e&&(e=!1),e||(nt=!0);var i={matrix:t.matrix.value()},r={matrix:this.__scene.matrix.value(),proporion:this.__proporion};this.setRegion(t.region);for(var n=0;n<t.mesh.length;n++)e?this.__regionPainter&&(it("painter"+this.__unique,this.__regionPainter,{geometry:t.mesh[n].geometry,material:{color:{r:this.__regionColor[0],g:this.__regionColor[1],b:this.__regionColor[2],alpha:this.__regionColor[3]}}},i,r),this.__getColor=D(this.__regionPainter)):it("region"+this.__unique,this.painter,t.mesh[n],i,r)},t.prototype.render=function(t){"matrix"in t||(t.matrix=new r),"region"in t||(t.region="");for(var e=0;e<t.mesh.length;e++){var i=t.mesh[e];i.geometry.attributes.normal&&Array.isArray(i.geometry.attributes.normal.array)&&(i.geometry.attributes.normal.array=new Float32Array(i.geometry.attributes.normal.array)),i.geometry.attributes.position&&Array.isArray(i.geometry.attributes.position.array)&&(i.geometry.attributes.position.array=new Float32Array(i.geometry.attributes.position.array)),i.geometry.attributes.uv&&Array.isArray(i.geometry.attributes.uv.array)&&(i.geometry.attributes.uv.array=new Float32Array(i.geometry.attributes.uv.array)),i.geometry.index&&Array.isArray(i.geometry.index.array)&&(i.geometry.index.array=new Uint8Array(i.geometry.index.array)),i.material.colors&&Array.isArray(i.material.colors.array)&&(i.material.colors.array=new Float32Array(i.material.colors.array))}this.__scene.children.push(t),this.draw(t)},t.prototype.setRegion=function(t){return this.__regionName=t+"",t?(null==this.__regionList[t]&&(this.__regionList[t]=l(l([],this.__regionAssemble(),!0),[1],!1)),this.__regionColor=this.__regionList[t]):this.__regionColor=[0,0,0,1],this},t.prototype.getRegion=function(t,e){var i=this;return nt&&this.review(!0),nt=!1,new Promise((function(r,n){var o=i.__getColor(t,e);for(var s in i.__regionList){var a=i.__regionList[s];if("rgba("+255*a[0]+","+255*a[1]+","+255*a[2]+","+255*a[3]+")"==o){r(s);break}}r("")}))},t}(),st=function(t){function e(e,i){if(void 0===i&&(i={}),!e)throw new Error("VISLite WebGL:The mount point requires an HTMLElement type but encountered null.");i=B(i,{region:!0});var r,n,o=e.clientWidth,s=e.clientHeight,a=e;a._vislite_canvas_?(r=a._vislite_canvas_[0],n=a._vislite_canvas_[1]):(i.region&&(n=document.createElement("canvas"),e.appendChild(n),n.style.position="absolute",n.style.zIndex="-1",n.style.opacity="0"),r=document.createElement("canvas"),e.appendChild(r),a._vislite_canvas_=[r,n],e.setAttribute("vislite","WebGL"));for(var _=0,h=[r,n];_<h.length;_++){var u=h[_];u&&(u.style.width=o+"px",u.setAttribute("width",o+""),u.style.height=s+"px",u.setAttribute("height",s+""))}return t.call(this,r,n)||this}return u(e,t),e}(ot),at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.compile=function(e,i){return i?t.prototype.compile.call(this,e,i):t.prototype.compile.call(this,{color:Y,colors:j,image:Z,cube:J}[e],{color:Q,colors:K,image:$,cube:tt}[e]),this},e}(q),_t=function(t,e,i,r){var n=Math.cos(t),o=Math.sin(t);return[e*n-i*o,e*o+i*n,r]},ht=function(){function t(t,e){void 0===t&&(t=7),void 0===e&&(e=[107,36]),this.name="Eoap",this.__scale=t,this.__center=e}return t.prototype.use=function(t,e){var i,r,n,o,s,a,_=(i=(360-e)/180*Math.PI,r=100*this.__scale,n=0,o=0,s=Math.cos(i),a=Math.sin(i),[o*a+r*s,n,o*s-r*a]);return _=_t(t/180*Math.PI,_[0],_[1],_[2]),_=_t((90-this.__center[0])/180*Math.PI,_[0],_[1],_[2]),_=function(t,e,i,r){var n=Math.cos(t),o=Math.sin(t);return[e,i*n-r*o,i*o+r*n]}((90-this.__center[1])/180*Math.PI,_[0],_[1],_[2]),[-_[0],_[1],_[2]]},t}(),ut=function(t,e){void 0===t&&(t=7),void 0===e&&(e=[107,36]),this.name="Mercator";var i=100*t*Math.PI/180,r=i*e[0],n=-1*i*e[1];this.use=function(t,e){return[.8*(i*t-r),-1*i*e-n]}},lt=function(t,e){var i=t.getBoundingClientRect();return{x:e.clientX-i.left,y:e.clientY-i.top}},pt={},ct=0,ft=function(){function t(t){void 0===t&&(t={}),this.name="Tree",this.__config=B(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,i){var r=function(t,e){var i,r,n={},o=e.root(t);i=r=e.id(o),n[i]={data:o,pid:null,id:i,isOpen:!0,show:!0,children:[]};var s=1;return function r(o,a){var _=e.children(o,t);s+=_?_.length:0;for(var h=0;_&&h<_.length;h++)i=e.id(_[h]),n[a].children.push(i),n[i]={data:_[h],pid:a,id:i,isOpen:!0,show:!0,children:[]},r(_[h],i)}(o,i),{rid:r,value:n,num:s}}(t,e),n=r.value,o=r.rid;if(1==r.num)return n[o].left=.5,n[o].top=.5,n[o].show=!0,{deep:1,node:n,root:o,size:1};var s=[],a=0,_=0;for(var h in i[o]?(n[o].left=.5,n[o].top=.5,n[o].show=!0,a=1):function t(e,r){r>_&&(_=r);var o=0;if(!i[e.id])for(o=0;o<e.children.length;o++)t(n[e.children[o]],r+1);if(n[e.id].left=r+.5,0==o?(null==s[r]&&(s[r]=-.5),null==s[r-1]&&(s[r-1]=-.5),n[e.id].top=s[r]+1,s[r]+1+.5*(n[e.pid].children.length-1)-1<s[r-1]&&(n[e.id].top=s[r-1]+1-.5*(n[e.pid].children.length-1))):n[e.id].top=.5*(n[e.children[0]].top+n[e.children[o-1]].top),n[e.id].top<=s[r])var h=s[r]+1-n[e.id].top((function t(e,i){n[e].top+=h,s[i]<n[e].top&&(s[i]=n[e].top);for(var r=0;r<n[e].children.length;r++)t(n[e].children[r],i+1)}))(e.id,r);s[r]=n[e.id].top,n[e.id].top+.5>a&&(a=n[e.id].top+.5)}(n[o],0),i)i[h]&&(n[h].isOpen=!1,function t(e,i,r){for(var o=0;o<n[e].children.length;o++)n[n[e].children[o]].left=i,n[n[e].children[o]].top=r,n[n[e].children[o]].show=!1,t(n[e].children[o],i,r)}(h,n[h].left,n[h].top));return{node:n,root:o,size:a,deep:_+1}}(t,this.__config,e)},t}(),dt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="TreeLayout",e.__option={offsetX:0,offsetY:0,duration:500,type:"plain",direction:"LR",x:100,y:100,width:100,height:100,radius:100},e.__noOpens={},e}return u(e,t),e.prototype.setOption=function(t){return B(t,this.__option),this},e.prototype.use=function(e,i){var r=t.prototype.use.call(this,e,i);if(0!=this.__option.offsetX||0!=this.__option.offsetY)for(var o in r.node)if(!r.node[o].show){var s=0,a=o;do{a=r.node[a].pid,s++}while(!r.node[a].show);r.node[o].left+=this.__option.offsetX*s,r.node[o].top+=this.__option.offsetY*s}if("rect"==this.__option.type){if("LR"==this.__option.direction||"RL"==this.__option.direction){var _=this.__option.height/r.size,h=this.__option.width/(r.deep-1),u=this.__option.y-.5*this.__option.height,l="LR"==this.__option.direction?1:-1;for(var o in r.node)1==r.deep?(r.node[o].left=this.__option.x+.5*this.__option.width*l,r.node[o].top=this.__option.y):(r.node[o].left=this.__option.x+(r.node[o].left-.5)*h*l,r.node[o].top=r.node[o].top*_+u)}else if("TB"==this.__option.direction||"BT"==this.__option.direction)for(var o in _=this.__option.width/r.size,h=this.__option.height/(r.deep-1),u=this.__option.x-.5*this.__option.width,l="TB"==this.__option.direction?1:-1,r.node)if(1==r.deep)r.node[o].left=this.__option.x,r.node[o].top=this.__option.y+.5*this.__option.height*l;else{var p=r.node[o].left;r.node[o].left=r.node[o].top*_+u,r.node[o].top=this.__option.y+(p-.5)*h*l}}else if("circle"==this.__option.type){var c=this.__option.x,f=this.__option.y,d=2*Math.PI/r.size,g=this.__option.radius/(r.deep-1);for(var o in r.node)if(.5==r.node[o].left)r.node[o].left=c,r.node[o].top=f;else{var m=n(c,f,d*r.node[o].top,c+(r.node[o].left-.5)*g,f);r.node[o].left=m[0],r.node[o].top=m[1]}}return r},e.prototype.bind=function(t,e){return this.__rback=e,this.__oralTree=t,this.__preTree=this.use(this.__oralTree),this.__rback(this.__preTree),this},e.prototype.unbind=function(){return this.__rback=null,this.__oralTree=null,this.__preTree=null,this.__noOpens={},this},e.prototype.doUpdate=function(){var t=this,e=this.use(this.__oralTree,this.__noOpens),i=JSON.parse(JSON.stringify(e));_((function(r){for(var n in i.node)(e.node[n].show||t.__preTree.node[n].show)&&(i.node[n].show=!0,i.node[n].left=t.__preTree.node[n].left+(e.node[n].left-t.__preTree.node[n].left)*r,i.node[n].top=t.__preTree.node[n].top+(e.node[n].top-t.__preTree.node[n].top)*r);t.__rback(i)}),this.__option.duration,(function(){t.__preTree=e,t.__rback(t.__preTree)}))},e.prototype.closeNode=function(t){if(this.__preTree)return this.__noOpens[t]=!0,this.doUpdate(),this},e.prototype.openNode=function(t){if(this.__preTree)return this.__noOpens[t]=!1,this.doUpdate(),this},e.prototype.toggleNode=function(t){if(this.__preTree)return this.__noOpens[t]=!this.__noOpens[t],this.doUpdate(),this},e}(ft),gt={Cardinal:e,Hermite:t,Matrix4:r,rotate:n,getLoopColors:function(t,e){void 0===e&&(e=1);var i=["rgba(84,112,198,"+e+")","rgba(145,204,117,"+e+")","rgba(250,200,88,"+e+")","rgba(238,102,102,"+e+")","rgba(115,192,222,"+e+")","rgba(59,162,114,"+e+")","rgba(252,132,82,"+e+")","rgba(154,96,180,"+e+")","rgba(234,124,204,"+e+")"],r=[];if(t<=i.length)return i;if(t%i.length==0)for(var n=0;n<t/i.length;n++)r=r.concat(i);else{for(var o=1;o<t/i.length;o++)r=r.concat(i);if(t%i.length==1)r=r.concat(i[4]);else for(var s=0;s<t%i.length;s++)r=r.concat(i[s])}return r},formatColor:function(t,e){var i=document.getElementsByTagName("head")[0];i.style.color=t;for(var r=(document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(i,null):i.currentStyle).getPropertyValue("color").replace(/rgba?\(/,"").replace(")","").split(","),n=0;n<r.length;n++)r[n]=+r[n];switch(r.push(1),e){case"3d":return[r[0]/255,r[1]/255,r[2]/255,r[3]];case"rgba":return"rgba(".concat(r[0],", ").concat(r[1],", ").concat(r[2],", ").concat(r[3],")");case"rgb":return"rgb(".concat(r[0],", ").concat(r[1],", ").concat(r[2],")");case"hexAlpha":return"#".concat(s(r[0])).concat(s(r[1])).concat(s(r[2])).concat(s(+(255*r[3]).toFixed(0)));case"hex":return"#".concat(s(r[0])).concat(s(r[1])).concat(s(r[2]))}throw new Error("Unsupported color format: "+e)},animation:_,ruler:function(t,e,i,r){if(t<e){var n=e;e=t,t=n}else if(t==e)return[t];var o=function(t){for(var e=t<100&&t>-100?10:.1,i=-1,r=t;10==e?r>=-100&&r<=100:r<=-100||r>=100;)i+=1,r*=e;if(10==e)return Math.pow(10,i);for(var n="0.",o=1;o<i;o++)n+="0";return+(n+"1")}(t-e),s=Math.ceil((t-e)*o/i),a=function(i){var r=({3:2,4:5,6:5,7:5,8:10,9:10,11:10,12:10,13:15,14:15,16:15,17:15,18:20,19:20,21:20,22:20,23:25,24:25,26:25,27:25}[s+i]||s+i)/o,n=Math.floor(e/r)*r,a=[];a.push(n);for(var _=1;a[a.length-1]<t;_++)a.push(n+r*_);return a},_=a(0),h=function(){for(var t=[],i=_[_.length-1]-r.max,n=0;n<_.length;n++)n+1<_.length&&_[n+1]-i<e||t.push(_[n]-i);return t},u=function(){for(var e=[],i=_[0]-r.min,n=0;n<_.length&&(e[n]=_[n]-i,!(t<=e[n]));n++);return e};if(r){if("max"in r&&"min"in r&&r.max>=t&&r.min<=e){var l=function(){if(_[0]>=r.min&&_[_.length-1]<=r.max)return!0;var t=h();if(t[0]>=r.min&&t[t.length-1]<=r.max)return _=t,!0;var e=u();return e[0]>=r.min&&e[t.length-1]<=r.max?(_=e,!0):void 0};if(l())return _;for(var p=1;p<100;p++){if(_=a(p),l())return _;if(_=a(-p),l())return _}}"max"in r&&r.max>=t?r.max<_[_.length-1]&&(_=h()):"min"in r&&r.min<=e&&r.min>_[0]&&(_=u())}return _},SVG:R,Canvas:O,WebGL:st,getWebGLContext:function(t,e){if(void 0===e&&(e=1),!t)throw new Error("VISLite getWebGLContext:The mount point requires an HTMLElement type but encountered null.");var i,r=t.clientWidth,n=t.clientHeight,o=t;return o._vislite_canvas_?i=o._vislite_canvas_:(i=document.createElement("canvas"),t.appendChild(i),o._vislite_canvas_=i,t.setAttribute("vislite","WebGL")),i.style.width=r+"px",i.setAttribute("width",r+""),i.style.height=n+"px",i.setAttribute("height",n+""),F(i,e)},Shader:at,Texture:G,Buffer:H,Eoap:ht,Mercator:ut,viewHandler:function(t){var e=document.getElementsByTagName("body")[0];e.addEventListener("keydown",(function(e){var i=function(t){return{37:"left",38:"up",39:"right",40:"down"}[t.keyCode||t.which]}(e);"up"==i?t({type:"lookUp",normal:[],value:.1,event:e}):"down"==i?t({type:"lookDown",normal:[],value:.1,event:e}):"left"==i?t({type:"lookLeft",normal:[],value:.1,event:e}):"right"==i&&t({type:"lookRight",normal:[],value:.1,event:e})}));var i=null,r=function(r){if(null==i)t({type:"hover",normal:[],value:0,event:r});else{var n=lt(e,r),o=[n.x-i.x,n.y-i.y],s=[o[1],o[0],0];if(0==s[0]&&0==s[1])return;t({type:"rotate",normal:s,value:.01*(Math.abs(n.x-i.x)+Math.abs(n.y-i.y)),event:r}),i=n}};e.addEventListener("mousedown",(function(t){i=lt(e,t)})),e.addEventListener("mouseup",(function(t){i=null})),e.addEventListener("mousemove",(function(t){r(t)})),e.addEventListener("touchend",(function(t){i=null})),e.addEventListener("touchstart",(function(t){i=lt(e,t)})),e.addEventListener("touchmove",(function(t){r(t.touches[0])}));var n=function(e,i){0!=e&&t({type:"scale",value:e<0?.899:1.101,normal:[],event:i})};e.addEventListener("mousewheel",(function(t){n(t.wheelDelta,t)})),window.addEventListener&&window.addEventListener("DOMMouseScroll",(function(t){n(-1*t.detail,t)}),!1)},resizeObserver:function(t,e){try{return rt||(rt=new ResizeObserver((function(t){for(var e=0,i=t;e<i.length;e++){var r=i[e];pt[r.target._resize_observer_]()}}))),ct++,t._resize_observer_=ct,pt[ct]=e,rt.observe(t),function(){rt&&(rt.unobserve(t),delete pt[t._resize_observer_])}}catch(t){e(),console.error("ResizeObserver undefined!")}},throttle:function(t,e){void 0===e&&(e={}),e=B(e,{time:200,keep:!1,opportunity:"end"});var i,r=!1,n=!1,o=!1;return function(){var s=this;if(i=arguments,r)n=!0,o=!0;else{"end"!=e.opportunity&&t.apply(s,i),r=!0;var a=setInterval((function(){n?e.keep||t.apply(s,i):("begin"!=e.opportunity&&(o||"end"==e.opportunity)&&t.apply(s,i),r=!1,o=!1,clearInterval(a)),n=!1}),e.time)}}},TreeLayout:dt};return gt},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite=e();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var e,r;e=this,r=function(){"use strict";var e,r={},n=0;return function(o,t){try{return e||(e=new ResizeObserver((function(e){for(var n=0,o=e;n<o.length;n++){var t=o[n];r[t.target._resize_observer_]()}}))),n++,o._resize_observer_=n,r[n]=t,e.observe(o),function(){e&&(e.unobserve(o),delete r[o._resize_observer_])}}catch(e){t(),console.error("ResizeObserver undefined!")}}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_resizeObserver=r();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var e,t;e=this,t=function(){"use strict";return function(e,t,n,o,i){var f=Math.cos(n),d=Math.sin(n);return[(o-e)*f-(i-t)*d+e,(o-e)*d+(i-t)*f+t]}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_rotate=t();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var n,r;n=this,r=function(){"use strict";return function(n,r,e,t){if(n<r){var i=r;r=n,n=i}else if(n==r)return[n];var f=function(n){for(var r=n<100&&n>-100?10:.1,e=-1,t=n;10==r?t>=-100&&t<=100:t<=-100||t>=100;)e+=1,t*=r;if(10==r)return Math.pow(10,e);for(var i="0.",f=1;f<e;f++)i+="0";return+(i+"1")}(n-r),u=Math.ceil((n-r)*f/e),o=function(e){var t=({3:2,4:5,6:5,7:5,8:10,9:10,11:10,12:10,13:15,14:15,16:15,17:15,18:20,19:20,21:20,22:20,23:25,24:25,26:25,27:25}[u+e]||u+e)/f,i=Math.floor(r/t)*t,o=[];o.push(i);for(var a=1;o[o.length-1]<n;a++)o.push(i+t*a);return o},a=o(0),m=function(){for(var n=[],e=a[a.length-1]-t.max,i=0;i<a.length;i++)i+1<a.length&&a[i+1]-e<r||n.push(a[i]-e);return n},l=function(){for(var r=[],e=a[0]-t.min,i=0;i<a.length&&(r[i]=a[i]-e,!(n<=r[i]));i++);return r};if(t){if("max"in t&&"min"in t&&t.max>=n&&t.min<=r){var h=function(){if(a[0]>=t.min&&a[a.length-1]<=t.max)return!0;var n=m();if(n[0]>=t.min&&n[n.length-1]<=t.max)return a=n,!0;var r=l();return r[0]>=t.min&&r[n.length-1]<=t.max?(a=r,!0):void 0};if(h())return a;for(var v=1;v<100;v++){if(a=o(v),h())return a;if(a=o(-v),h())return a}}"max"in t&&t.max>=n?t.max<a[a.length-1]&&(a=m()):"min"in t&&t.min<=r&&t.min>a[0]&&(a=l())}return a}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).VISLite_ruler=r();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var e,t;e=this,t=function(){"use strict";return function(e,t){void 0===t&&(t={}),t=function(e,t){for(var n in e)t[n]=e[n];return t}(t,{time:200,keep:!1,opportunity:"end"});var n,o=!1,i=!1,r=!1;return function(){var p=this;if(n=arguments,o)i=!0,r=!0;else{"end"!=t.opportunity&&e.apply(p,n),o=!0;var f=setInterval((function(){i?t.keep||e.apply(p,n):("begin"!=t.opportunity&&(r||"end"==t.opportunity)&&e.apply(p,n),o=!1,r=!1,clearInterval(f)),i=!1}),t.time)}}}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_throttle=t();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1-beta.3
2
+ * VISLite JavaScript Library v0.4.1
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
8
  *
9
- * Publish Date: Fri Sep 01 2023 00:05:31 GMT+0800 (中国标准时间)
9
+ * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var e,n;e=this,n=function(){"use strict";var e=function(e,n){var t=e.getBoundingClientRect();return{x:n.clientX-t.left,y:n.clientY-t.top}};return function(n){var t=document.getElementsByTagName("body")[0];t.addEventListener("keydown",(function(e){var t=function(e){return{37:"left",38:"up",39:"right",40:"down"}[e.keyCode||e.which]}(e);"up"==t?n({type:"lookUp",normal:[],value:.1,event:e}):"down"==t?n({type:"lookDown",normal:[],value:.1,event:e}):"left"==t?n({type:"lookLeft",normal:[],value:.1,event:e}):"right"==t&&n({type:"lookRight",normal:[],value:.1,event:e})}));var o=null,i=function(i){if(null==o)n({type:"hover",normal:[],value:0,event:i});else{var u=e(t,i),l=[u.x-o.x,u.y-o.y],a=[l[1],l[0],0];if(0==a[0]&&0==a[1])return;n({type:"rotate",normal:a,value:.01*(Math.abs(u.x-o.x)+Math.abs(u.y-o.y)),event:i}),o=u}};t.addEventListener("mousedown",(function(n){o=e(t,n)})),t.addEventListener("mouseup",(function(e){o=null})),t.addEventListener("mousemove",(function(e){i(e)})),t.addEventListener("touchend",(function(e){o=null})),t.addEventListener("touchstart",(function(n){o=e(t,n)})),t.addEventListener("touchmove",(function(e){i(e.touches[0])}));var u=function(e,t){0!=e&&n({type:"scale",value:e<0?.899:1.101,normal:[],event:t})};t.addEventListener("mousewheel",(function(e){u(e.wheelDelta,e)})),window.addEventListener&&window.addEventListener("DOMMouseScroll",(function(e){u(-1*e.detail,e)}),!1)}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_viewHandler=n();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vislite",
3
- "version": "0.4.1-beta.3",
3
+ "version": "0.4.1",
4
4
  "description": "灵活、快速、简单的数据可视化交互式跨端前端库",
5
5
  "main": "./lib/index.umd.min.js",
6
6
  "typings": "./types/index.d.ts",
@@ -9,7 +9,6 @@
9
9
  "scripts": {
10
10
  "dev": "webpack serve --config ./build/webpack.config.js",
11
11
  "build": "devby --delete ./lib && node ./build/pkg.js",
12
- "server": "devby -s 30000",
13
12
  "test": "karma start ./build/karma.config.js"
14
13
  },
15
14
  "miniprogram": ".",
package/types/Tree.d.ts CHANGED
@@ -9,7 +9,7 @@ export interface TreeResultType {
9
9
  [id: string]: {
10
10
 
11
11
  /**
12
- * 当前结点的孩子结点id
12
+ * 当前结点的孩子的结点id集合
13
13
  */
14
14
  children: Array<string>
15
15
 
package/types/ruler.d.ts CHANGED
@@ -4,5 +4,5 @@ export interface rulerOptionType {
4
4
  }
5
5
 
6
6
  export default interface rulerType {
7
- (maxValue: number, minValue: number, num: number, option: rulerOptionType): number[]
7
+ (maxValue: number, minValue: number, num: number, option?: rulerOptionType): number[]
8
8
  }