vislite 0.1.0 → 0.1.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.
- package/CHANGELOG +6 -1
- package/README.md +16 -2
- package/lib/Canvas/index.umd.js +2 -2
- package/lib/Canvas/index.umd.min.js +2 -2
- package/lib/Cardinal/index.umd.js +2 -2
- package/lib/Cardinal/index.umd.min.js +2 -2
- package/lib/Eoap/index.umd.js +2 -2
- package/lib/Eoap/index.umd.min.js +2 -2
- package/lib/Hermite/index.umd.js +2 -2
- package/lib/Hermite/index.umd.min.js +2 -2
- package/lib/Matrix4/index.umd.js +2 -2
- package/lib/Matrix4/index.umd.min.js +2 -2
- package/lib/OralCanvas/index.es.js +2 -2
- package/lib/OralCanvas/index.es.min.js +2 -2
- package/lib/SVG/index.umd.js +2 -2
- package/lib/SVG/index.umd.min.js +2 -2
- package/lib/animation/index.umd.js +2 -2
- package/lib/animation/index.umd.min.js +2 -2
- package/lib/getLoopColors/index.umd.js +2 -2
- package/lib/getLoopColors/index.umd.min.js +2 -2
- package/lib/index.umd.js +2 -2
- package/lib/index.umd.min.js +2 -2
- package/lib/rotate/index.umd.js +2 -2
- package/lib/rotate/index.umd.min.js +2 -2
- package/lib/ruler/index.umd.js +2 -2
- package/lib/ruler/index.umd.min.js +2 -2
- package/miniprogram/ui-canvas/index.js +7 -6
- package/package.json +1 -1
- package/uni-app/ui-canvas.vue +24 -22
package/CHANGELOG
CHANGED
package/README.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
<
|
|
1
|
+
- 开源不易,去 <i>[Github给个Star](https://github.com/oi-contrib/VISLite) </i>吧!
|
|
2
|
+
|
|
3
|
+
<img src='https://oi-contrib.github.io/VISLite/images/logo.png' height='300px'/>
|
|
4
|
+
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://www.npmjs.com/package/vislite?activeTab=versions">
|
|
7
|
+
<img src="https://img.shields.io/npm/dm/vislite.svg" alt="downloads">
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/vislite">
|
|
10
|
+
<img src="https://img.shields.io/npm/v/vislite.svg" alt="Version">
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://github.com/oi-contrib/VISLite" target='_blank'>
|
|
13
|
+
<img alt="GitHub repo stars" src="https://img.shields.io/github/stars/oi-contrib/VISLite?style=social">
|
|
14
|
+
</a>
|
|
15
|
+
</p>
|
|
2
16
|
|
|
3
17
|
# VISLite
|
|
4
18
|
|
|
@@ -6,7 +20,7 @@
|
|
|
6
20
|
|
|
7
21
|
主要提供了跨端的画布和计算,开发人员只需要按照文档的描述就可以非常简单的完成包括Web、uni-app、微信小程序等平台的可视化开发,除了必要的初始化差异,主要的业务代码部分不同端完全一致。
|
|
8
22
|
|
|
9
|
-
##
|
|
23
|
+
## 特点
|
|
10
24
|
|
|
11
25
|
- 灵活的引入方式:包括npm安装后按照```ES Module```或```CommonJS```规范引入或直接使用script标签的```CDN```方式。
|
|
12
26
|
- 按需引入或全局引入:支持源码TS引入、按需JS引入或者全量引入等多种方式。
|
package/lib/Canvas/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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 r(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var e=function(t,i,e,r,n){var o=Math.cos(e),s=Math.sin(e);return[+((r-t)*o-(n-i)*s+t).toFixed(7),+((r-t)*s+(n-i)*o+i).toFixed(7)]},r=function(t,i,e,r,n){return t.beginPath(),t.translate(e,r),t.rotate(n),t.font=i["font-style"]+" "+i["font-weight"]+" "+i["font-size"]+"px "+i["font-family"],t},n=function(t,i,r,n,o,s,h,_){if(o>s){var a=o;o=s,s=a}return h%=2*Math.PI,_>=1.999999*Math.PI||_<=1.999999*-Math.PI?_=2*Math.PI:_%=2*Math.PI,function(t,i,r,n,o,s,h){i<0&&(t+=i,i*=-1);var _,a=[];_=e(0,0,t,o,0),a[0]=_[0],a[1]=_[1],_=e(0,0,i,_[0],_[1]),a[2]=_[0],a[3]=_[1],_=e(0,0,t,s,0),a[4]=_[0],a[5]=_[1],_=e(0,0,i,_[0],_[1]),a[6]=_[0],a[7]=_[1],h(t,t+i,a[0]+r,a[1]+n,a[4]+r,a[5]+n,a[2]+r,a[3]+n,a[6]+r,a[7]+n,.5*(s-o))}(h,_,r,n,o,s,(function(e,h,_,a,l,u,p,f,c,g,y){y<0&&(y=-y),t.beginPath(),t.moveTo(_,a),t.arc(r,n,o,e,h,!1),"round"!=i["arc-end-cap"]?t.lineTo(c,g):t.arc(.5*(p+c),.5*(f+g),y,h-Math.PI,h,!0),t.arc(r,n,s,h,e,!0),"round"!=i["arc-start-cap"]?t.lineTo(_,a):t.arc(.5*(_+l),.5*(a+u),y,e,e-Math.PI,!0)})),"butt"==i["arc-start-cap"]&&t.closePath(),t},o=function(t,i,e,r){return t.beginPath(),t.moveTo(i+r,e),t.arc(i,e,r,0,2*Math.PI),t},s=function(t,i,e,r,n){return t.beginPath(),t.rect(i,e,r,n),t},h=function(){function t(t,i,e){void 0===i&&(i={}),this.__region=null,this.__specialConfig={"font-size":16,"font-family":"sans-serif","font-weight":400,"font-style":"normal","arc-start-cap":"butt","arc-end-cap":"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.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),"lineDash"==t)this.painter.setLineDash&&this.painter.setLineDash(i);else if(t in this.__specialConfig)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,n){return void 0===n&&(n=0),this.__region&&this.__region.fillText(t,i,e,n),this.painter.save(),r(this.painter,this.__specialConfig,i,e,n).fillText(t,0,0),this.painter.restore(),this},t.prototype.strokeText=function(t,i,e,n){return void 0===n&&(n=0),this.__region&&this.__region.strokeText(t,i,e,n),this.painter.save(),r(this.painter,this.__specialConfig,i,e,n||0).strokeText(t,0,0),this.painter.restore(),this},t.prototype.fullText=function(t,i,e,n){return void 0===n&&(n=0),this.__region&&this.__region.fullText(t,i,e,n),this.painter.save(),r(this.painter,this.__specialConfig,i,e,n||0),this.painter.fillText(t,0,0),this.painter.strokeText(t,0,0),this.painter.restore(),this},t.prototype.beginPath=function(){return this.__region&&this.__region.beginPath(),this.painter.beginPath(),this},t.prototype.closePath=function(){return this.__region&&this.__region.closePath(),this.painter.closePath(),this},t.prototype.moveTo=function(t,i){return this.__region&&this.__region.moveTo(t,i),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.painter.lineTo(Math.round(t)+.5,Math.round(i)+.5),this},t.prototype.arc=function(t,i,e,r,n){return this.__region&&this.__region.arc(t,i,e,r,n),this.painter.arc(t,i,e,r,r+n,n<0),this},t.prototype.fill=function(){return this.__region&&this.__region.fill(),this.painter.fill(),this},t.prototype.stroke=function(){return this.__region&&this.__region.stroke(),this.painter.stroke(),this},t.prototype.full=function(){return this.__region&&this.__region.full(),this.painter.fill(),this.painter.stroke(),this},t.prototype.save=function(){return this.__region&&this.__region.save(),this.painter.save(),this},t.prototype.restore=function(){return this.__region&&this.__region.restore(),this.painter.restore(),this},t.prototype.quadraticCurveTo=function(t,i,e,r){return this.__region&&this.__region.quadraticCurveTo(t,i,e,r),this.painter.quadraticCurveTo(t,i,e,r),this},t.prototype.bezierCurveTo=function(t,i,e,r,n,o){return this.__region&&this.__region.bezierCurveTo(t,i,e,r,n,o),this.painter.bezierCurveTo(t,i,e,r,n,o),this},t.prototype.clearRect=function(t,i,e,r){return this.__region&&this.__region.clearRect(t,i,e,r),this.painter.clearRect(t,i,e,r),this},t.prototype.fillArc=function(t,i,e,r,o,s){return this.__region&&this.__region.fillArc(t,i,e,r,o,s),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),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),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),o(this.painter,t,i,e).fill(),this},t.prototype.strokeCircle=function(t,i,e){return this.__region&&this.__region.strokeCircle(t,i,e),o(this.painter,t,i,e).stroke(),this},t.prototype.fullCircle=function(t,i,e){return this.__region&&this.__region.fullCircle(t,i,e),o(this.painter,t,i,e),this.painter.fill(),this.painter.stroke(),this},t.prototype.fillRect=function(t,i,e,r){return this.__region&&this.__region.fillRect(t,i,e,r),s(this.painter,t,i,e,r).fill(),this},t.prototype.strokeRect=function(t,i,e,r){return this.__region&&this.__region.strokeRect(t,i,e,r),s(this.painter,t,i,e,r).stroke(),this},t.prototype.fullRect=function(t,i,e,r){return this.__region&&this.__region.fullRect(t,i,e,r),s(this.painter,t,i,e,r),this.painter.fill(),this.painter.stroke(),this},t}(),_=function(t){function e(i,e){var r=t.call(this,i,{},new h(e,{willReadFrequently:!0}))||this;return r.name="Canvas",r.__regionList={},r.__rgb=[0,0,0],r.__p="r",r.setRegion(""),r}return i(e,t),e.prototype.config=function(t){for(var i in t)this.useConfig(i,t[i]);return this},e.prototype.setRegion=function(t){var i=this;return t?(null==this.__regionList[t]&&(this.__regionList[t]={r:function(){return i.__rgb[0]+=1,i.__p="g","rgb("+i.__rgb[0]+","+i.__rgb[1]+","+i.__rgb[2]+")"},g:function(){return i.__rgb[1]+=1,i.__p="b","rgb("+i.__rgb[0]+","+i.__rgb[1]+","+i.__rgb[2]+")"},b:function(){return i.__rgb[2]+=1,i.__p="r","rgb("+i.__rgb[0]+","+i.__rgb[1]+","+i.__rgb[2]+")"}}[this.__p]()),this.__region.useConfig("fillStyle",this.__regionList[t])&&this.__region.useConfig("strokeStyle",this.__regionList[t])):this.__region.useConfig("fillStyle","#000000")&&this.__region.useConfig("strokeStyle","#000000"),this},e.prototype.getRegion=function(t,i){var e=this;return new Promise((function(r,n){var o=e.__region.painter.getImageData(t-.5,i-.5,1,1),s=o.data,h=function(){for(var t in e.__regionList)if("rgb("+s[0]+","+s[1]+","+s[2]+")"==e.__regionList[t]){r(t);break}r("")};s?h():o.then((function(t){s=t,h()}))}))},e}(h);return function(t){function e(i){if(!i)throw new Error("VISLite Canvas:The mount point requires an HTMLElement type but encountered null.");var e,r,n=i.clientWidth,o=i.clientHeight,s=i;s._vislite_canvas_?(e=s._vislite_canvas_[0],r=s._vislite_canvas_[1]):(e=document.createElement("canvas"),i.appendChild(e),r=document.createElement("canvas"),s._vislite_canvas_=[e,r],i.setAttribute("vislite","inited"));for(var h=0,_=[e,r];h<_.length;h++){var a=_[h];a.style.width=n+"px",a.setAttribute("width",n+""),a.style.height=o+"px",a.setAttribute("height",o+"")}return t.call(this,e,r)||this}return i(e,t),e}(_)},"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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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][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();
|
package/lib/Eoap/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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();
|
package/lib/Hermite/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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();
|
package/lib/Matrix4/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 GMT+0800 (中国标准时间)
|
|
10
10
|
*/
|
|
11
11
|
/******************************************************************************
|
|
12
12
|
Copyright (c) Microsoft Corporation.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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)};var i=function(t,i,e,r,n){var o=Math.cos(e),s=Math.sin(e);return[+((r-t)*o-(n-i)*s+t).toFixed(7),+((r-t)*s+(n-i)*o+i).toFixed(7)]};var e=function(t,i,e,r,n){return t.beginPath(),t.translate(e,r),t.rotate(n),t.font=i["font-style"]+" "+i["font-weight"]+" "+i["font-size"]+"px "+i["font-family"],t},r=function(t,e,r,n,o,s,_,h){if(o>s){var a=o;o=s,s=a}return _%=2*Math.PI,h>=1.999999*Math.PI||h<=1.999999*-Math.PI?h=2*Math.PI:h%=2*Math.PI,function(t,e,r,n,o,s,_){e<0&&(t+=e,e*=-1);var h,a=[];h=i(0,0,t,o,0),a[0]=h[0],a[1]=h[1],h=i(0,0,e,h[0],h[1]),a[2]=h[0],a[3]=h[1],h=i(0,0,t,s,0),a[4]=h[0],a[5]=h[1],h=i(0,0,e,h[0],h[1]),a[6]=h[0],a[7]=h[1],_(t,t+e,a[0]+r,a[1]+n,a[4]+r,a[5]+n,a[2]+r,a[3]+n,a[6]+r,a[7]+n,.5*(s-o))}(_,h,r,n,o,s,(function(i,_,h,a,l,p,u,f,c,g,y){y<0&&(y=-y),t.beginPath(),t.moveTo(h,a),t.arc(r,n,o,i,_,!1),"round"!=e["arc-end-cap"]?t.lineTo(c,g):t.arc(.5*(u+c),.5*(f+g),y,_-Math.PI,_,!0),t.arc(r,n,s,_,i,!0),"round"!=e["arc-start-cap"]?t.lineTo(h,a):t.arc(.5*(h+l),.5*(a+p),y,i,i-Math.PI,!0)})),"butt"==e["arc-start-cap"]&&t.closePath(),t},n=function(t,i,e,r){return t.beginPath(),t.moveTo(i+r,e),t.arc(i,e,r,0,2*Math.PI),t},o=function(t,i,e,r,n){return t.beginPath(),t.rect(i,e,r,n),t},s=function(){function t(t,i,e){void 0===i&&(i={}),this.__region=null,this.__specialConfig={"font-size":16,"font-family":"sans-serif","font-weight":400,"font-style":"normal","arc-start-cap":"butt","arc-end-cap":"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.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),"lineDash"==t)this.painter.setLineDash&&this.painter.setLineDash(i);else if(t in this.__specialConfig)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,r,n){return void 0===n&&(n=0),this.__region&&this.__region.fillText(t,i,r,n),this.painter.save(),e(this.painter,this.__specialConfig,i,r,n).fillText(t,0,0),this.painter.restore(),this},t.prototype.strokeText=function(t,i,r,n){return void 0===n&&(n=0),this.__region&&this.__region.strokeText(t,i,r,n),this.painter.save(),e(this.painter,this.__specialConfig,i,r,n||0).strokeText(t,0,0),this.painter.restore(),this},t.prototype.fullText=function(t,i,r,n){return void 0===n&&(n=0),this.__region&&this.__region.fullText(t,i,r,n),this.painter.save(),e(this.painter,this.__specialConfig,i,r,n||0),this.painter.fillText(t,0,0),this.painter.strokeText(t,0,0),this.painter.restore(),this},t.prototype.beginPath=function(){return this.__region&&this.__region.beginPath(),this.painter.beginPath(),this},t.prototype.closePath=function(){return this.__region&&this.__region.closePath(),this.painter.closePath(),this},t.prototype.moveTo=function(t,i){return this.__region&&this.__region.moveTo(t,i),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.painter.lineTo(Math.round(t)+.5,Math.round(i)+.5),this},t.prototype.arc=function(t,i,e,r,n){return this.__region&&this.__region.arc(t,i,e,r,n),this.painter.arc(t,i,e,r,r+n,n<0),this},t.prototype.fill=function(){return this.__region&&this.__region.fill(),this.painter.fill(),this},t.prototype.stroke=function(){return this.__region&&this.__region.stroke(),this.painter.stroke(),this},t.prototype.full=function(){return this.__region&&this.__region.full(),this.painter.fill(),this.painter.stroke(),this},t.prototype.save=function(){return this.__region&&this.__region.save(),this.painter.save(),this},t.prototype.restore=function(){return this.__region&&this.__region.restore(),this.painter.restore(),this},t.prototype.quadraticCurveTo=function(t,i,e,r){return this.__region&&this.__region.quadraticCurveTo(t,i,e,r),this.painter.quadraticCurveTo(t,i,e,r),this},t.prototype.bezierCurveTo=function(t,i,e,r,n,o){return this.__region&&this.__region.bezierCurveTo(t,i,e,r,n,o),this.painter.bezierCurveTo(t,i,e,r,n,o),this},t.prototype.clearRect=function(t,i,e,r){return this.__region&&this.__region.clearRect(t,i,e,r),this.painter.clearRect(t,i,e,r),this},t.prototype.fillArc=function(t,i,e,n,o,s){return this.__region&&this.__region.fillArc(t,i,e,n,o,s),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),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),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),n(this.painter,t,i,e).fill(),this},t.prototype.strokeCircle=function(t,i,e){return this.__region&&this.__region.strokeCircle(t,i,e),n(this.painter,t,i,e).stroke(),this},t.prototype.fullCircle=function(t,i,e){return this.__region&&this.__region.fullCircle(t,i,e),n(this.painter,t,i,e),this.painter.fill(),this.painter.stroke(),this},t.prototype.fillRect=function(t,i,e,r){return this.__region&&this.__region.fillRect(t,i,e,r),o(this.painter,t,i,e,r).fill(),this},t.prototype.strokeRect=function(t,i,e,r){return this.__region&&this.__region.strokeRect(t,i,e,r),o(this.painter,t,i,e,r).stroke(),this},t.prototype.fullRect=function(t,i,e,r){return this.__region&&this.__region.fullRect(t,i,e,r),o(this.painter,t,i,e,r),this.painter.fill(),this.painter.stroke(),this},t}(),_=function(i){function e(t,e){var r=i.call(this,t,{},new s(e,{willReadFrequently:!0}))||this;return r.name="Canvas",r.__regionList={},r.__rgb=[0,0,0],r.__p="r",r.setRegion(""),r}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 r(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,i),e.prototype.config=function(t){for(var i in t)this.useConfig(i,t[i]);return this},e.prototype.setRegion=function(t){var i=this;return t?(null==this.__regionList[t]&&(this.__regionList[t]={r:function(){return i.__rgb[0]+=1,i.__p="g","rgb("+i.__rgb[0]+","+i.__rgb[1]+","+i.__rgb[2]+")"},g:function(){return i.__rgb[1]+=1,i.__p="b","rgb("+i.__rgb[0]+","+i.__rgb[1]+","+i.__rgb[2]+")"},b:function(){return i.__rgb[2]+=1,i.__p="r","rgb("+i.__rgb[0]+","+i.__rgb[1]+","+i.__rgb[2]+")"}}[this.__p]()),this.__region.useConfig("fillStyle",this.__regionList[t])&&this.__region.useConfig("strokeStyle",this.__regionList[t])):this.__region.useConfig("fillStyle","#000000")&&this.__region.useConfig("strokeStyle","#000000"),this},e.prototype.getRegion=function(t,i){var e=this;return new Promise((function(r,n){var o=e.__region.painter.getImageData(t-.5,i-.5,1,1),s=o.data,_=function(){for(var t in e.__regionList)if("rgb("+s[0]+","+s[1]+","+s[2]+")"==e.__regionList[t]){r(t);break}r("")};s?_():o.then((function(t){s=t,_()}))}))},e}(s);export{_ as default};
|
package/lib/SVG/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 GMT+0800 (中国标准时间)
|
|
10
10
|
*/
|
|
11
11
|
(function (global, factory) {
|
|
12
12
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
package/lib/SVG/index.umd.min.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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)},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 o(t,e){i(t,"stroke",e.strokeStyle),i(t,"fill",e.fillStyle),i(t,"stroke-dasharray",e.lineDash.join(","))}function r(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,o){var r=Math.cos(i),s=Math.sin(i);return[+((n-t)*r-(o-e)*s+t).toFixed(7),+((n-t)*s+(o-e)*r+e).toFixed(7)]},u=function(t,e,i,o,r){if("text"!==t.nodeName.toLowerCase())throw new Error("Need a <text> !");n(t,"dy",{top:.5*e["font-size"],middle:0,bottom:.5*-e["font-size"]}[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["font-size"]+"px","font-family":e["font-family"]}),n(t,"x",i),n(t,"y",o),"number"==typeof r&&n(t,"transform","rotate("+(r%=360)+","+i+","+o+")")},_=function(t,e,i,o){if("circle"!==t.nodeName.toLowerCase())throw new Error("Need a <circle> !");n(t,"cx",e),n(t,"cy",i),n(t,"r",o)},c=function(t,e){if("path"!==t.nodeName.toLowerCase())throw new Error("Need a <path> !");n(t,"d",e)},f=function(t,e,i,o,r){if("rect"!==t.nodeName.toLowerCase())throw new Error("Need a <rect> !");r<0&&(i-=r*=-1),o<0&&(e-=o*=-1),n(t,"x",e),n(t,"y",i),n(t,"width",o),n(t,"height",r)},l=function(t,e,i,o,r,s,u,_){if("path"!==t.nodeName.toLowerCase())throw new Error("Need a <path> !");if(u%=2*Math.PI,r>s){var c=r;r=s,s=c}_>=1.999999*Math.PI||_<=1.999999*-Math.PI?_=1.999999*Math.PI:_%=2*Math.PI,function(t,e,i,n,o,r,s){e<0&&(t+=e,e*=-1);var u,_=[];u=h(0,0,t,o,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,r,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*(r-o))}(u,_,i,o,r,s,(function(i,o,h,u,_,c,f,l,a,p,d){var y=o-i>Math.PI?1:0,E="M"+h+" "+u;d<0&&(d=-d),E+="A"+r+" "+r+" 0 "+y+" 1 "+f+" "+l,"round"==e["arc-end-cap"]?E+="A"+d+" "+d+" 0 1 0 "+a+" "+p:"-round"==e["arc-end-cap"]?E+="A"+d+" "+d+" 0 1 1 "+a+" "+p:E+="L"+a+" "+p,E+="A"+s+" "+s+" 0 "+y+" 0 "+_+" "+c,"round"==e["arc-start-cap"]?E+="A"+d+" "+d+" 0 1 0 "+h+" "+u:"-round"==e["arc-start-cap"]?E+="A"+d+" "+d+" 0 1 1 "+h+" "+u:E+="L"+h+" "+u,"butt"==e["arc-start-cap"]&&(E+="Z"),n(t,"d",E)}))};function a(t,e,i,n,o){var r=Math.cos(i),s=Math.sin(i);return[(n-t)*r-(o-e)*s+t,(n-t)*s+(o-e)*r+e]}var p=function(){function t(t){this.name="SVG",this.__config={fillStyle:"#000",strokeStyle:"#000",lineWidth:1,textAlign:"left",textBaseline:"middle","font-size":16,"font-family":"sans-serif","arc-start-cap":"butt","arc-end-cap":"butt",lineDash:[]},this.__path="",this.__currentPosition=[],this.__svg=t}return t.prototype.config=function(t){if("object"!=typeof t)return this.__config[t];for(var e in t)this.__config[e]=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,r(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,o(this.__useEl,this.__config),this},t.prototype.fillArc=function(t,e,i,n,o,s){return l(this.__useEl,this.__config,t,e,i,n,o,s),r(this.__useEl,this.__config),this},t.prototype.strokeArc=function(t,e,i,n,o,r){return l(this.__useEl,this.__config,t,e,i,n,o,r),s(this.__useEl,this.__config),this},t.prototype.fullArc=function(t,e,i,n,r,s){return l(this.__useEl,this.__config,t,e,i,n,r,s),o(this.__useEl,this.__config),this},t.prototype.fillCircle=function(t,e,i){return _(this.__useEl,t,e,i),r(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),o(this.__useEl,this.__config),this},t.prototype.fillRect=function(t,e,i,n){return f(this.__useEl,t,e,i,n),r(this.__useEl,this.__config),this},t.prototype.strokeRect=function(t,e,i,n){return f(this.__useEl,t,e,i,n),s(this.__useEl,this.__config),this},t.prototype.fullRect=function(t,e,i,n){return f(this.__useEl,t,e,i,n),o(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),r(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),o(this.__useEl,this.__config),this},t.prototype.arc=function(t,e,i,n,o){var r=a(t,e,n,t+i,e),s=a(t,e,n+o,t+i,e);return n=n/Math.PI*180,o=o/Math.PI*180,""==this.__path?this.__path+="M"+r[0]+","+r[1]:r[0]==this.__currentPosition[0]&&r[1]==this.__currentPosition[1]||(this.__path+="L"+r[0]+","+r[1]),this.__path+="A"+i+","+i+" 0 "+(o>180||o<-180?1:0)+","+(o>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,o,r){return this.__path+="C"+t+" "+e+","+i+" "+n+","+o+" "+r,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,o=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.appendChild(o),o.setAttribute("width",i+""),o.setAttribute("height",n+""),o.setAttribute("viewBox","0 0 "+i+" "+n),e.call(this,o)||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}(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_SVG=e();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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();
|
package/lib/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 GMT+0800 (中国标准时间)
|
|
10
10
|
*/
|
|
11
11
|
(function (global, factory) {
|
|
12
12
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
package/lib/index.umd.min.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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 r(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var e=function(t,i,e,r,n){var o=Math.cos(e),s=Math.sin(e);return[+((r-t)*o-(n-i)*s+t).toFixed(7),+((r-t)*s+(n-i)*o+i).toFixed(7)]};function r(t,i,r,n,o,s,h){i<0&&(t+=i,i*=-1);var _,a=[];_=e(0,0,t,o,0),a[0]=_[0],a[1]=_[1],_=e(0,0,i,_[0],_[1]),a[2]=_[0],a[3]=_[1],_=e(0,0,t,s,0),a[4]=_[0],a[5]=_[1],_=e(0,0,i,_[0],_[1]),a[6]=_[0],a[7]=_[1],h(t,t+i,a[0]+r,a[1]+n,a[4]+r,a[5]+n,a[2]+r,a[3]+n,a[6]+r,a[7]+n,.5*(s-o))}var n=function(t,i,e,r,n){return t.beginPath(),t.translate(e,r),t.rotate(n),t.font=i["font-style"]+" "+i["font-weight"]+" "+i["font-size"]+"px "+i["font-family"],t},o=function(t,i,e,n,o,s,h,_){if(o>s){var a=o;o=s,s=a}return h%=2*Math.PI,_>=1.999999*Math.PI||_<=1.999999*-Math.PI?_=2*Math.PI:_%=2*Math.PI,r(h,_,e,n,o,s,(function(r,h,_,a,u,l,c,f,p,g,d){d<0&&(d=-d),t.beginPath(),t.moveTo(_,a),t.arc(e,n,o,r,h,!1),"round"!=i["arc-end-cap"]?t.lineTo(p,g):t.arc(.5*(c+p),.5*(f+g),d,h-Math.PI,h,!0),t.arc(e,n,s,h,r,!0),"round"!=i["arc-start-cap"]?t.lineTo(_,a):t.arc(.5*(_+u),.5*(a+l),d,r,r-Math.PI,!0)})),"butt"==i["arc-start-cap"]&&t.closePath(),t},s=function(t,i,e,r){return t.beginPath(),t.moveTo(i+r,e),t.arc(i,e,r,0,2*Math.PI),t},h=function(t,i,e,r,n){return t.beginPath(),t.rect(i,e,r,n),t},_=function(){function t(t,i,e){void 0===i&&(i={}),this.__region=null,this.__specialConfig={"font-size":16,"font-family":"sans-serif","font-weight":400,"font-style":"normal","arc-start-cap":"butt","arc-end-cap":"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.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),"lineDash"==t)this.painter.setLineDash&&this.painter.setLineDash(i);else if(t in this.__specialConfig)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.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.painter.save(),n(this.painter,this.__specialConfig,i,e,r||0).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.painter.save(),n(this.painter,this.__specialConfig,i,e,r||0),this.painter.fillText(t,0,0),this.painter.strokeText(t,0,0),this.painter.restore(),this},t.prototype.beginPath=function(){return this.__region&&this.__region.beginPath(),this.painter.beginPath(),this},t.prototype.closePath=function(){return this.__region&&this.__region.closePath(),this.painter.closePath(),this},t.prototype.moveTo=function(t,i){return this.__region&&this.__region.moveTo(t,i),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.painter.lineTo(Math.round(t)+.5,Math.round(i)+.5),this},t.prototype.arc=function(t,i,e,r,n){return this.__region&&this.__region.arc(t,i,e,r,n),this.painter.arc(t,i,e,r,r+n,n<0),this},t.prototype.fill=function(){return this.__region&&this.__region.fill(),this.painter.fill(),this},t.prototype.stroke=function(){return this.__region&&this.__region.stroke(),this.painter.stroke(),this},t.prototype.full=function(){return this.__region&&this.__region.full(),this.painter.fill(),this.painter.stroke(),this},t.prototype.save=function(){return this.__region&&this.__region.save(),this.painter.save(),this},t.prototype.restore=function(){return this.__region&&this.__region.restore(),this.painter.restore(),this},t.prototype.quadraticCurveTo=function(t,i,e,r){return this.__region&&this.__region.quadraticCurveTo(t,i,e,r),this.painter.quadraticCurveTo(t,i,e,r),this},t.prototype.bezierCurveTo=function(t,i,e,r,n,o){return this.__region&&this.__region.bezierCurveTo(t,i,e,r,n,o),this.painter.bezierCurveTo(t,i,e,r,n,o),this},t.prototype.clearRect=function(t,i,e,r){return this.__region&&this.__region.clearRect(t,i,e,r),this.painter.clearRect(t,i,e,r),this},t.prototype.fillArc=function(t,i,e,r,n,s){return this.__region&&this.__region.fillArc(t,i,e,r,n,s),o(this.painter,this.__specialConfig,t,i,e,r,n,s).fill(),this},t.prototype.strokeArc=function(t,i,e,r,n,s){return this.__region&&this.__region.strokeArc(t,i,e,r,n,s),o(this.painter,this.__specialConfig,t,i,e,r,n,s).stroke(),this},t.prototype.fullArc=function(t,i,e,r,n,s){return this.__region&&this.__region.fullArc(t,i,e,r,n,s),o(this.painter,this.__specialConfig,t,i,e,r,n,s),this.painter.fill(),this.painter.stroke(),this},t.prototype.fillCircle=function(t,i,e){return this.__region&&this.__region.fillCircle(t,i,e),s(this.painter,t,i,e).fill(),this},t.prototype.strokeCircle=function(t,i,e){return this.__region&&this.__region.strokeCircle(t,i,e),s(this.painter,t,i,e).stroke(),this},t.prototype.fullCircle=function(t,i,e){return this.__region&&this.__region.fullCircle(t,i,e),s(this.painter,t,i,e),this.painter.fill(),this.painter.stroke(),this},t.prototype.fillRect=function(t,i,e,r){return this.__region&&this.__region.fillRect(t,i,e,r),h(this.painter,t,i,e,r).fill(),this},t.prototype.strokeRect=function(t,i,e,r){return this.__region&&this.__region.strokeRect(t,i,e,r),h(this.painter,t,i,e,r).stroke(),this},t.prototype.fullRect=function(t,i,e,r){return this.__region&&this.__region.fullRect(t,i,e,r),h(this.painter,t,i,e,r),this.painter.fill(),this.painter.stroke(),this},t}(),a=function(t){function e(i,e){var r=t.call(this,i,{},new _(e,{willReadFrequently:!0}))||this;return r.name="Canvas",r.__regionList={},r.__rgb=[0,0,0],r.__p="r",r.setRegion(""),r}return i(e,t),e.prototype.config=function(t){for(var i in t)this.useConfig(i,t[i]);return this},e.prototype.setRegion=function(t){var i=this;return t?(null==this.__regionList[t]&&(this.__regionList[t]={r:function(){return i.__rgb[0]+=1,i.__p="g","rgb("+i.__rgb[0]+","+i.__rgb[1]+","+i.__rgb[2]+")"},g:function(){return i.__rgb[1]+=1,i.__p="b","rgb("+i.__rgb[0]+","+i.__rgb[1]+","+i.__rgb[2]+")"},b:function(){return i.__rgb[2]+=1,i.__p="r","rgb("+i.__rgb[0]+","+i.__rgb[1]+","+i.__rgb[2]+")"}}[this.__p]()),this.__region.useConfig("fillStyle",this.__regionList[t])&&this.__region.useConfig("strokeStyle",this.__regionList[t])):this.__region.useConfig("fillStyle","#000000")&&this.__region.useConfig("strokeStyle","#000000"),this},e.prototype.getRegion=function(t,i){var e=this;return new Promise((function(r,n){var o=e.__region.painter.getImageData(t-.5,i-.5,1,1),s=o.data,h=function(){for(var t in e.__regionList)if("rgb("+s[0]+","+s[1]+","+s[2]+")"==e.__regionList[t]){r(t);break}r("")};s?h():o.then((function(t){s=t,h()}))}))},e}(_),u=function(t){function e(i){if(!i)throw new Error("VISLite Canvas:The mount point requires an HTMLElement type but encountered null.");var e,r,n=i.clientWidth,o=i.clientHeight,s=i;s._vislite_canvas_?(e=s._vislite_canvas_[0],r=s._vislite_canvas_[1]):(e=document.createElement("canvas"),i.appendChild(e),r=document.createElement("canvas"),s._vislite_canvas_=[e,r],i.setAttribute("vislite","inited"));for(var h=0,_=[e,r];h<_.length;h++){var a=_[h];a.style.width=n+"px",a.setAttribute("width",n+""),a.style.height=o+"px",a.setAttribute("height",o+"")}return t.call(this,e,r)||this}return i(e,t),e}(a),l=function(){function t(t){void 0===t&&(t=.5),this.name="Hermite",this.__u=t}return t.prototype.setP=function(t,i,e,r,n,o){if(!(t<e))throw new Error("The point x-position should be increamented!");this.__a=t,this.__b=e;var s=this.__u*n,h=this.__u*o;return i/=e-t,r/=e-t,this.__MR=[2*i-2*r+s+h,3*r-3*i-2*s-h,s,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}(),c=function(){function t(t){void 0===t&&(t=0),this.name="Cardinal",this.__t=t}return t.prototype.setP=function(t){this.__HS={x:[],h:[]};var i,e,r=(t[1][1]-t[0][1])/(t[1][0]-t[0][0]);for(this.__HS.x[0]=t[0][0],i=1;i<t.length;i++){if(t[i][0]<=t[i-1][0])throw new Error("The point position should be increamented!");this.__HS.x[i]=t[i][0],e=i<t.length-1?(t[i+1][1]-t[i-1][1])/(t[i+1][0]-t[i-1][0]):(t[i][1]-t[i-1][1])/(t[i][0]-t[i-1][0]),this.__HS.h[i-1]=new l(.5*(1-this.__t)).setP(t[i-1][0],t[i-1][1],t[i][0],t[i][1],r,e),r=e}return this},t.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!")},t}(),f=function(t,i,e,r){var n=Math.cos(t),o=Math.sin(t);return[i*n-e*o,i*o+e*n,r]},p=function(){function t(t,i){void 0===t&&(t=7),void 0===i&&(i=[107,36]),this.name="Eoap",this.__scale=t,this.__center=i}return t.prototype.use=function(t,i){var e,r,n,o,s,h,_=(e=(360-i)/180*Math.PI,r=100*this.__scale,n=0,o=0,s=Math.cos(e),h=Math.sin(e),[o*h+r*s,n,o*s-r*h]);return _=f(t/180*Math.PI,_[0],_[1],_[2]),_=f((90-this.__center[0])/180*Math.PI,_[0],_[1],_[2]),_=function(t,i,e,r){var n=Math.cos(t),o=Math.sin(t);return[i,e*n-r*o,e*o+r*n]}((90-this.__center[1])/180*Math.PI,_[0],_[1],_[2]),[-_[0],_[1],_[2]]},t}(),g=function(t,i){for(var e=[],r=0;r<4;r++)for(var n=0;n<i.length/4;n++)e[4*n+r]=t[r]*i[4*n]+t[r+4]*i[4*n+1]+t[r+8]*i[4*n+2]+t[r+12]*i[4*n+3];return e},d=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,i,e,r){return void 0===r&&(r=0),this.__matrix4=g(function(t,i,e,r){void 0===r&&(r=0);var n=Math.sqrt(i*i+e*e+r*r);return[1,0,0,0,0,1,0,0,0,0,1,0,i*t/n,e*t/n,r*t/n,1]}(t,i,e,r),this.__matrix4),this},t.prototype.rotate=function(t,i,e,r,n,o,s){var h=function(t,i,e,r,n,o){if("number"==typeof t&&"number"==typeof i){if("number"!=typeof e?(e=0,r=t,n=i,o=1):"number"==typeof r&&"number"==typeof n&&"number"==typeof o||(r=t,n=i,o=e,t=0,i=0,e=0),t==r&&i==n&&e==o)throw new Error("It's not a legitimate ray!");var s=Math.sqrt((r-t)*(r-t)+(n-i)*(n-i)),h=0!=s?(n-i)/s:1,_=0!=s?(r-t)/s:0,a=(r-t)*_+(n-i)*h,u=o-e,l=Math.sqrt(a*a+u*u),c=0!=l?u/l:1,f=0!=l?a/l:0;return[[h,c*_,_*f,0,-_,h*c,h*f,0,0,-f,c,0,i*_-t*h,e*f-t*_*c-i*h*c,-t*_*f-i*h*f-e*c,1],[h,-_,0,0,c*_,c*h,-f,0,_*f,h*f,c,0,t,i,e,1]]}throw new Error("a1 and b1 is required!")}(i,e,r,n,o,s);return this.__matrix4=g(g(g(h[1],function(t){var i=Math.sin(t),e=Math.cos(t);return[e,i,0,0,-i,e,0,0,0,0,1,0,0,0,0,1]}(t)),h[0]),this.__matrix4),this},t.prototype.scale=function(t,i,e,r,n,o){return void 0===r&&(r=0),void 0===n&&(n=0),void 0===o&&(o=0),this.__matrix4=g(function(t,i,e,r,n,o){return void 0===r&&(r=0),void 0===n&&(n=0),void 0===o&&(o=0),[t,0,0,0,0,i,0,0,0,0,e,0,r-r*t,n-n*i,o-o*e,1]}(t,i,e,r,n,o),this.__matrix4),this},t.prototype.multiply=function(t,i){return void 0===i&&(i=!1),this.__matrix4=i?g(this.__matrix4,t):g(t,this.__matrix4),this},t.prototype.use=function(t,i,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),g(this.__matrix4,[t,i,e,r])},t.prototype.value=function(){return this.__matrix4},t}();function v(t,i,e,r,n){var o=Math.cos(e),s=Math.sin(e);return[(r-t)*o-(n-i)*s+t,(r-t)*s+(n-i)*o+i]}var y=["href","title","show","type","role","actuate"],b=function(t,i,e){y.indexOf(i)>-1?t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:"+i,e+""):t.setAttribute(i,e+"")},m=b;function w(t,i){b(t,"stroke",i.strokeStyle),b(t,"fill",i.fillStyle),b(t,"stroke-dasharray",i.lineDash.join(","))}function x(t,i){b(t,"fill",i.fillStyle)}function E(t,i){b(t,"stroke",i.strokeStyle),b(t,"fill","none"),b(t,"stroke-dasharray",i.lineDash.join(","))}var C,M=function(t,i,e,r,n){if("text"!==t.nodeName.toLowerCase())throw new Error("Need a <text> !");m(t,"dy",{top:.5*i["font-size"],middle:0,bottom:.5*-i["font-size"]}[i.textBaseline]),function(t,i){for(var e in i)t.style[e]=i[e]}(t,{"text-anchor":{left:"start",right:"end",center:"middle"}[i.textAlign],"dominant-baseline":"central","font-size":i["font-size"]+"px","font-family":i["font-family"]}),m(t,"x",e),m(t,"y",r),"number"==typeof n&&m(t,"transform","rotate("+(n%=360)+","+e+","+r+")")},k=function(t,i,e,r){if("circle"!==t.nodeName.toLowerCase())throw new Error("Need a <circle> !");m(t,"cx",i),m(t,"cy",e),m(t,"r",r)},P=function(t,i){if("path"!==t.nodeName.toLowerCase())throw new Error("Need a <path> !");m(t,"d",i)},T=function(t,i,e,r,n){if("rect"!==t.nodeName.toLowerCase())throw new Error("Need a <rect> !");n<0&&(e-=n*=-1),r<0&&(i-=r*=-1),m(t,"x",i),m(t,"y",e),m(t,"width",r),m(t,"height",n)},S=function(t,i,e,n,o,s,h,_){if("path"!==t.nodeName.toLowerCase())throw new Error("Need a <path> !");if(h%=2*Math.PI,o>s){var a=o;o=s,s=a}_>=1.999999*Math.PI||_<=1.999999*-Math.PI?_=1.999999*Math.PI:_%=2*Math.PI,r(h,_,e,n,o,s,(function(e,r,n,h,_,a,u,l,c,f,p){var g=r-e>Math.PI?1:0,d="M"+n+" "+h;p<0&&(p=-p),d+="A"+o+" "+o+" 0 "+g+" 1 "+u+" "+l,"round"==i["arc-end-cap"]?d+="A"+p+" "+p+" 0 1 0 "+c+" "+f:"-round"==i["arc-end-cap"]?d+="A"+p+" "+p+" 0 1 1 "+c+" "+f:d+="L"+c+" "+f,d+="A"+s+" "+s+" 0 "+g+" 0 "+_+" "+a,"round"==i["arc-start-cap"]?d+="A"+p+" "+p+" 0 1 0 "+n+" "+h:"-round"==i["arc-start-cap"]?d+="A"+p+" "+p+" 0 1 1 "+n+" "+h:d+="L"+n+" "+h,"butt"==i["arc-start-cap"]&&(d+="Z"),m(t,"d",d)}))},A=function(){function t(t){this.name="SVG",this.__config={fillStyle:"#000",strokeStyle:"#000",lineWidth:1,textAlign:"left",textBaseline:"middle","font-size":16,"font-family":"sans-serif","arc-start-cap":"butt","arc-end-cap":"butt",lineDash:[]},this.__path="",this.__currentPosition=[],this.__svg=t}return t.prototype.config=function(t){if("object"!=typeof t)return this.__config[t];for(var i in t)this.__config[i]=t[i];return this},t.prototype.useEl=function(t){return this.__useEl=t,this},t.prototype.getEl=function(){return this.__useEl},t.prototype.appendEl=function(t,i){var e;return i=i||this.__svg,"string"==typeof t&&(e=t,t=document.createElementNS("http://www.w3.org/2000/svg",e)),i.appendChild(t),this.__useEl=t,this},t.prototype.appendBoard=function(t,i){var e=t;if("string"==typeof t&&(e={text:"text",path:"path",arc:"path",circle:"circle",rect:"rect"}[t]||""),""==e)throw new Error("Unsupported drawing method:"+t);return this.appendEl(e,i)},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 y.indexOf(i)>-1&&(i="xlink:"+i),t.getAttribute(i)}(this.__useEl,t);for(var i in t)m(this.__useEl,i,t[i]);return this},t.prototype.fillText=function(t,i,e,r){return void 0===r&&(r=0),M(this.__useEl,this.__config,i,e,r),this.__useEl.textContent=t,x(this.__useEl,this.__config),this},t.prototype.strokeText=function(t,i,e,r){return void 0===r&&(r=0),M(this.__useEl,this.__config,i,e,r),this.__useEl.textContent=t,E(this.__useEl,this.__config),this},t.prototype.fullText=function(t,i,e,r){return void 0===r&&(r=0),M(this.__useEl,this.__config,i,e,r),this.__useEl.textContent=t,w(this.__useEl,this.__config),this},t.prototype.fillArc=function(t,i,e,r,n,o){return S(this.__useEl,this.__config,t,i,e,r,n,o),x(this.__useEl,this.__config),this},t.prototype.strokeArc=function(t,i,e,r,n,o){return S(this.__useEl,this.__config,t,i,e,r,n,o),E(this.__useEl,this.__config),this},t.prototype.fullArc=function(t,i,e,r,n,o){return S(this.__useEl,this.__config,t,i,e,r,n,o),w(this.__useEl,this.__config),this},t.prototype.fillCircle=function(t,i,e){return k(this.__useEl,t,i,e),x(this.__useEl,this.__config),this},t.prototype.strokeCircle=function(t,i,e){return k(this.__useEl,t,i,e),E(this.__useEl,this.__config),this},t.prototype.fullCircle=function(t,i,e){return k(this.__useEl,t,i,e),w(this.__useEl,this.__config),this},t.prototype.fillRect=function(t,i,e,r){return T(this.__useEl,t,i,e,r),x(this.__useEl,this.__config),this},t.prototype.strokeRect=function(t,i,e,r){return T(this.__useEl,t,i,e,r),E(this.__useEl,this.__config),this},t.prototype.fullRect=function(t,i,e,r){return T(this.__useEl,t,i,e,r),w(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,i){return this.__currentPosition=[t,i],this.__path+="M"+t+" "+i,this},t.prototype.lineTo=function(t,i){return this.__currentPosition=[t,i],this.__path+=(""==this.__path?"M":"L")+t+" "+i,this},t.prototype.fill=function(){return P(this.__useEl,this.__path),x(this.__useEl,this.__config),this},t.prototype.stroke=function(){return P(this.__useEl,this.__path),E(this.__useEl,this.__config),this},t.prototype.full=function(){return P(this.__useEl,this.__path),w(this.__useEl,this.__config),this},t.prototype.arc=function(t,i,e,r,n){var o=v(t,i,r,t+e,i),s=v(t,i,r+n,t+e,i);return r=r/Math.PI*180,n=n/Math.PI*180,""==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"+e+","+e+" 0 "+(n>180||n<-180?1:0)+","+(n>0?1:0)+" "+s[0]+","+s[1],this},t.prototype.quadraticCurveTo=function(t,i,e,r){return this.__path+="Q"+t+" "+i+","+e+" "+r,this},t.prototype.bezierCurveTo=function(t,i,e,r,n,o){return this.__path+="C"+t+" "+i+","+e+" "+r+","+n+" "+o,this},t}(),I=function(t){function e(i){if(!i)throw new Error("VISLite SVG :The mount point requires an HTMLElement type but encountered null.");var e=i.clientWidth,r=i.clientHeight,n=document.createElementNS("http://www.w3.org/2000/svg","svg");return i.appendChild(n),n.setAttribute("width",e+""),n.setAttribute("height",r+""),n.setAttribute("viewBox","0 0 "+e+" "+r),t.call(this,n)||this}return i(e,t),e}(A),L=[];return{Canvas:u,Cardinal:c,Eoap:p,getLoopColors:function(t,i){void 0===i&&(i=1);var e=["rgba(84,112,198,"+i+")","rgba(145,204,117,"+i+")","rgba(250,200,88,"+i+")","rgba(238,102,102,"+i+")","rgba(115,192,222,"+i+")","rgba(59,162,114,"+i+")","rgba(252,132,82,"+i+")","rgba(154,96,180,"+i+")","rgba(234,124,204,"+i+")"],r=[];if(t<=e.length)return e;if(t%e.length==0)for(var n=0;n<t/e.length;n++)r=r.concat(e);else{for(var o=1;o<t/e.length;o++)r=r.concat(e);if(t%e.length==1)r=r.concat(e[4]);else for(var s=0;s<t%e.length;s++)r=r.concat(e[s])}return r},Hermite:l,Matrix4:d,rotate:v,SVG:I,animation:function(t,i,e){void 0===i&&(i=400),void 0===e&&(e=function(){});var r={timer:function(t,i,e){if(!t)throw new Error("Tick is required!");var n=(new Date).valueOf()+"_"+(1e3*Math.random()).toFixed(0);return L.push({id:n,createTime:new Date,tick:t,duration:i,callback:e}),r.start(),n},start:function(){C||(C=setInterval(r.tick,13))},tick:function(){var t,i,e,n,o,s,h,_=L;for((L=[]).length=0,i=0;i<_.length;i++)t=(o=_[i]).createTime,e=o.tick,s=o.duration,n=o.callback,e(h=(h=(+(new Date).valueOf()-t.valueOf())/s)>1?1:h),h<1&&o.id?L.push(o):n(h);L.length<=0&&r.stop()},stop:function(){C&&(clearInterval(C),C=null)}},n=r.timer((function(i){t(i)}),i,e);return function(){var t;for(t in L)if(L[t].id==n)return void(L[t].id=void 0)}},ruler:function(t,i,e){if(t<i){var r=i;i=t,t=r}else if(t==i)return[t];var n=function(t){for(var i=t<100&&t>-100?10:.1,e=-1,r=t;10==i?r>=-100&&r<=100:r<=-100||r>=100;)e+=1,r*=i;if(10==i)return Math.pow(10,e);for(var n="0.",o=1;o<e;o++)n+="0";return+(n+"1")}(t-i),o=Math.ceil((t-i)*n/e),s=(o={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}[o]||o)/n,h=Math.floor(i/s)*s,_=[];_.push(h);for(var a=1;_[_.length-1]<t;a++)_.push(h+s*a);return _}}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite=i();
|
package/lib/rotate/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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();
|
package/lib/ruler/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 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.1.
|
|
2
|
+
* VISLite JavaScript Library v0.1.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: Sat
|
|
9
|
+
* Publish Date: Sat May 06 2023 20:11:58 GMT+0800 (中国标准时间)
|
|
10
10
|
*/
|
|
11
11
|
var e,r;e=this,r=function(){"use strict";return function(e,r,t){if(e<r){var f=r;r=e,e=f}else if(e==r)return[e];var n=function(e){for(var r=e<100&&e>-100?10:.1,t=-1,f=e;10==r?f>=-100&&f<=100:f<=-100||f>=100;)t+=1,f*=r;if(10==r)return Math.pow(10,t);for(var n="0.",o=1;o<t;o++)n+="0";return+(n+"1")}(e-r),o=Math.ceil((e-r)*n/t),i=(o={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}[o]||o)/n,u=Math.floor(r/i)*i,a=[];a.push(u);for(var l=1;a[a.length-1]<e;l++)a.push(u+i*l);return a}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_ruler=r();
|
|
@@ -67,14 +67,15 @@ Component({
|
|
|
67
67
|
});
|
|
68
68
|
},
|
|
69
69
|
doit(event, doback) {
|
|
70
|
+
if (doback) {
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this.data.help.instance.getRegion(x, y).then((regionName) => {
|
|
75
|
-
doback(regionName);
|
|
76
|
-
});
|
|
72
|
+
let x = event.touches[0].x;
|
|
73
|
+
let y = event.touches[0].y;
|
|
77
74
|
|
|
75
|
+
this.data.help.instance.getRegion(x, y).then((regionName) => {
|
|
76
|
+
doback(regionName);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
78
79
|
},
|
|
79
80
|
doitstart(event) {
|
|
80
81
|
this.doit(event, this.data.touchstart);
|
package/package.json
CHANGED
package/uni-app/ui-canvas.vue
CHANGED
|
@@ -120,28 +120,30 @@ export default {
|
|
|
120
120
|
});
|
|
121
121
|
},
|
|
122
122
|
doit(event, doback) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
if(doback){
|
|
124
|
+
let doRun = (x, y) => {
|
|
125
|
+
this.help.instance.getRegion(x, y).then((regionName) => {
|
|
126
|
+
doback(regionName);
|
|
127
|
+
});
|
|
128
|
+
};
|
|
128
129
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
130
|
+
// #ifdef MP-ALIPAY
|
|
131
|
+
uni
|
|
132
|
+
.createSelectorQuery()
|
|
133
|
+
.selectViewport()
|
|
134
|
+
.scrollOffset()
|
|
135
|
+
.exec((ret) => {
|
|
136
|
+
let x = event.touches[0].x + ret[0].scrollLeft;
|
|
137
|
+
let y = event.touches[0].y + ret[0].scrollTop;
|
|
138
|
+
doRun(x, y);
|
|
139
|
+
});
|
|
140
|
+
// #endif
|
|
141
|
+
// #ifndef MP-ALIPAY
|
|
142
|
+
let x = event.touches[0].x;
|
|
143
|
+
let y = event.touches[0].y;
|
|
144
|
+
doRun(x, y);
|
|
145
|
+
// #endif
|
|
146
|
+
}
|
|
145
147
|
},
|
|
146
148
|
doitstart(event) {
|
|
147
149
|
this.doit(event, this.touchstart);
|
|
@@ -150,7 +152,7 @@ export default {
|
|
|
150
152
|
};
|
|
151
153
|
</script>
|
|
152
154
|
|
|
153
|
-
<style lang="
|
|
155
|
+
<style lang="css" scoped>
|
|
154
156
|
/* 辅助的区域不应该可以看见 */
|
|
155
157
|
.region {
|
|
156
158
|
position: fixed;
|