vislite 0.5.2 → 0.6.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +18 -18
- package/.eslintrc.js +24 -0
- package/AUTHORS.txt +6 -6
- package/CHANGELOG +15 -1
- package/LICENSE +20 -20
- package/README.md +41 -2
- package/lib/Buffer/index.umd.js +2 -2
- package/lib/Buffer/index.umd.min.js +2 -2
- package/lib/Canvas/index.umd.js +19 -8
- package/lib/Canvas/index.umd.min.js +3 -3
- 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/Geometry/index.umd.js +7 -4
- package/lib/Geometry/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 +14 -8
- package/lib/Matrix4/index.umd.min.js +3 -3
- package/lib/Mercator/index.umd.js +2 -2
- package/lib/Mercator/index.umd.min.js +2 -2
- package/lib/OralCanvas/index.es.js +14 -6
- package/lib/OralCanvas/index.es.min.js +3 -3
- package/lib/OralWebGL/index.es.js +27 -19
- package/lib/OralWebGL/index.es.min.js +3 -3
- package/lib/SVG/index.umd.js +6 -4
- package/lib/SVG/index.umd.min.js +2 -2
- package/lib/Shader/index.umd.js +10 -10
- package/lib/Shader/index.umd.min.js +3 -3
- package/lib/Texture/index.umd.js +4 -3
- package/lib/Texture/index.umd.min.js +2 -2
- package/lib/TreeLayout/index.umd.js +8 -5
- package/lib/TreeLayout/index.umd.min.js +2 -2
- package/lib/WebGL/index.umd.js +27 -19
- package/lib/WebGL/index.umd.min.js +3 -3
- package/lib/animation/index.umd.js +4 -3
- package/lib/animation/index.umd.min.js +2 -2
- package/lib/formatColor/index.umd.js +2 -2
- package/lib/formatColor/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/getWebGLContext/index.umd.js +4 -3
- package/lib/getWebGLContext/index.umd.min.js +2 -2
- package/lib/index.umd.js +73 -34
- package/lib/index.umd.min.js +3 -3
- package/lib/move/index.umd.js +2 -2
- package/lib/move/index.umd.min.js +2 -2
- package/lib/resizeObserver/index.umd.js +4 -3
- package/lib/resizeObserver/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 +14 -2
- package/lib/ruler/index.umd.min.js +3 -3
- package/lib/scale/index.umd.js +2 -2
- package/lib/scale/index.umd.min.js +2 -2
- package/lib/throttle/index.umd.js +2 -2
- package/lib/throttle/index.umd.min.js +2 -2
- package/lib/viewHandler/index.umd.js +4 -4
- package/lib/viewHandler/index.umd.min.js +3 -3
- package/miniprogram/ui-canvas/index.js +107 -107
- package/miniprogram/ui-canvas/index.json +4 -4
- package/miniprogram/ui-canvas/index.wxml +4 -4
- package/miniprogram/ui-canvas/index.wxss +5 -5
- package/package/Buffer/index.ts +2 -2
- package/package/Canvas/index.ts +2 -2
- package/package/Cardinal/index.ts +2 -2
- package/package/Eoap/index.ts +2 -2
- package/package/Geometry/index.ts +2 -2
- package/package/Hermite/index.ts +2 -2
- package/package/Matrix4/index.ts +2 -2
- package/package/Mercator/index.ts +2 -2
- package/package/OralCanvas/index.ts +2 -2
- package/package/OralWebGL/index.ts +2 -2
- package/package/SVG/index.ts +2 -2
- package/package/Shader/index.ts +39 -39
- package/package/Texture/index.ts +2 -2
- package/package/TreeLayout/index.ts +1 -1
- package/package/WebGL/index.ts +2 -2
- package/package/animation/index.ts +2 -2
- package/package/formatColor/index.ts +2 -2
- package/package/getLoopColors/index.ts +2 -2
- package/package/getWebGLContext/index.ts +39 -39
- package/package/index.ts +76 -76
- package/package/move/index.ts +2 -2
- package/package/resizeObserver/index.ts +2 -2
- package/package/rotate/index.ts +2 -2
- package/package/ruler/index.ts +2 -2
- package/package/scale/index.ts +2 -2
- package/package/throttle/index.ts +2 -2
- package/package/viewHandler/index.ts +2 -2
- package/package.json +6 -2
- package/src/Canvas.ts +70 -67
- package/src/Eoap.ts +66 -66
- package/src/Geometry.ts +82 -82
- package/src/Matrix4/index.ts +17 -9
- package/src/Matrix4/move.ts +12 -12
- package/src/Matrix4/rotate.ts +15 -15
- package/src/Matrix4/scale.ts +11 -11
- package/src/Matrix4/transform.ts +64 -64
- package/src/Mercator.ts +27 -27
- package/src/SVG.ts +24 -24
- package/src/WebGL.ts +66 -66
- package/src/animation.ts +98 -98
- package/src/common/assemble.ts +22 -22
- package/src/common/canvas/arc.ts +51 -50
- package/src/common/canvas/config.ts +158 -158
- package/src/common/canvas/gradient.ts +29 -29
- package/src/common/canvas/index.ts +149 -140
- package/src/common/canvas/painter.ts +417 -426
- package/src/common/canvas/texts.ts +18 -18
- package/src/common/geometry/prism-horizontal.ts +35 -33
- package/src/common/geometry/prism-vertical.ts +40 -40
- package/src/common/geometry/sphere-fragment.ts +40 -39
- package/src/common/geometry/tool/circle.ts +11 -11
- package/src/common/mergeOption.ts +6 -6
- package/src/common/setStyle.ts +5 -5
- package/src/common/svg/config.ts +186 -186
- package/src/common/svg/dictionary.ts +1 -1
- package/src/common/svg/gradient.ts +63 -63
- package/src/common/svg/index.ts +356 -356
- package/src/common/svg/tool.ts +44 -44
- package/src/common/tree/index.ts +25 -25
- package/src/common/tree/toInnerTree.ts +57 -56
- package/src/common/tree/toPlainTree.ts +132 -131
- package/src/common/webgl/buffer.ts +79 -79
- package/src/common/webgl/doDraw.ts +108 -108
- package/src/common/webgl/getColorFactory.ts +26 -26
- package/src/common/webgl/getShader.ts +48 -48
- package/src/common/webgl/getTexture.ts +11 -11
- package/src/common/webgl/getWebGLContext.ts +28 -27
- package/src/common/webgl/index.ts +224 -223
- package/src/common/webgl/shader.ts +75 -75
- package/src/common/webgl/texture.ts +97 -96
- package/src/formatColor.ts +44 -44
- package/src/getLoopColors.ts +42 -42
- package/src/interpolation/Cardinal.ts +110 -110
- package/src/interpolation/Hermite.ts +65 -65
- package/src/{TreeLayout/index.ts → layout/TreeLayout.ts} +21 -21
- package/src/move.ts +7 -7
- package/src/resizeObserver.ts +37 -36
- package/src/rotate.ts +7 -7
- package/src/ruler.ts +41 -19
- package/src/scale.ts +6 -6
- package/src/shader/fsColor.c +7 -7
- package/src/shader/fsColors.c +7 -7
- package/src/shader/fsCube.c +8 -8
- package/src/shader/fsImage.c +8 -8
- package/src/shader/vsColor.c +17 -17
- package/src/shader/vsColors.c +13 -13
- package/src/shader/vsCube.c +13 -13
- package/src/shader/vsImage.c +13 -13
- package/src/throttle.ts +52 -51
- package/src/viewHandler.ts +158 -158
- package/types/Buffer.d.ts +23 -23
- package/types/Canvas.d.ts +8 -0
- package/types/CanvasConfig.d.ts +106 -106
- package/types/CanvasOption.d.ts +8 -7
- package/types/CanvasOpts.d.ts +10 -0
- package/types/Cardinal.d.ts +13 -13
- package/types/Geometry.d.ts +40 -40
- package/types/GeometryOption.d.ts +11 -11
- package/types/GeometryResult.d.ts +18 -18
- package/types/Gradient.d.ts +14 -14
- package/types/Hermite.d.ts +18 -18
- package/types/Map.d.ts +9 -9
- package/types/Matrix4.d.ts +5 -0
- package/types/Object3D.d.ts +114 -114
- package/types/SVG.d.ts +238 -238
- package/types/SVGConfig.d.ts +76 -76
- package/types/Scene3D.d.ts +6 -6
- package/types/Shader.d.ts +21 -21
- package/types/Texture.d.ts +16 -16
- package/types/Tree.d.ts +69 -69
- package/types/TreeConfig.d.ts +24 -24
- package/types/TreeLayout.d.ts +54 -54
- package/types/TreeOption.d.ts +48 -48
- package/types/WebGL.d.ts +38 -38
- package/types/WebGLOption.d.ts +7 -7
- package/types/animation.d.ts +6 -6
- package/types/formatColor.d.ts +2 -2
- package/types/getLoopColors.d.ts +2 -2
- package/types/getWebGLContext.d.ts +2 -2
- package/types/index.d.ts +175 -175
- package/types/move.d.ts +2 -2
- package/types/painterConfig.d.ts +2 -2
- package/types/resizeObserver.d.ts +2 -2
- package/types/rotate.d.ts +2 -2
- package/types/ruler.d.ts +7 -7
- package/types/scale.d.ts +2 -2
- package/types/throttle.d.ts +4 -4
- package/types/throttleOption.d.ts +21 -21
- package/types/viewHandler.d.ts +13 -13
- package/uni-app/ui-canvas.vue +239 -206
package/lib/rotate/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.
|
|
2
|
+
* VISLite JavaScript Library v0.6.0-alpha.2
|
|
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:
|
|
9
|
+
* Publish Date: Sun Dec 17 2023 12:58:48 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.
|
|
2
|
+
* VISLite JavaScript Library v0.6.0-alpha.2
|
|
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:
|
|
9
|
+
* Publish Date: Sun Dec 17 2023 12:58:48 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.
|
|
2
|
+
* VISLite JavaScript Library v0.6.0-alpha.2
|
|
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:
|
|
9
|
+
* Publish Date: Sun Dec 17 2023 12:58:48 GMT+0800 (中国标准时间)
|
|
10
10
|
*/
|
|
11
11
|
(function (global, factory) {
|
|
12
12
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -137,6 +137,18 @@
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
+
for (var index = 0; index < rulerArray.length; index++) {
|
|
141
|
+
var valStr = rulerArray[index] + "";
|
|
142
|
+
if (/\./.test(valStr)) {
|
|
143
|
+
if (/9{7,}$/.test(valStr)) {
|
|
144
|
+
valStr = valStr.replace(/9{7,}$/, '');
|
|
145
|
+
rulerArray[index] = +(valStr.substring(0, valStr.length - 1) + ((+valStr[valStr.length - 1]) + 1));
|
|
146
|
+
}
|
|
147
|
+
else if (/0{7,}\d$/.test(valStr)) {
|
|
148
|
+
rulerArray[index] = +(valStr.replace(/0{7,}\d$/, ''));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
140
152
|
return rulerArray;
|
|
141
153
|
}
|
|
142
154
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.
|
|
2
|
+
* VISLite JavaScript Library v0.6.0-alpha.2
|
|
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:
|
|
9
|
+
* Publish Date: Sun Dec 17 2023 12:58:48 GMT+0800 (中国标准时间)
|
|
10
10
|
*/
|
|
11
|
-
var n,
|
|
11
|
+
var n,e;n=this,e=function(){"use strict";return function(n,e,r,t){if(n<e){var i=e;e=n,n=i}else if(n==e)return[n];var f=function(n){for(var e=n<100&&n>-100?10:.1,r=-1,t=n;10==e?t>=-100&&t<=100:t<=-100||t>=100;)r+=1,t*=e;if(10==e)return Math.pow(10,r);for(var i="0.",f=1;f<r;f++)i+="0";return+(i+"1")}(n-e),a=Math.ceil((n-e)*f/r),u=function(r){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}[a+r]||a+r)/f,i=Math.floor(e/t)*t,u=[];u.push(i);for(var o=1;u[u.length-1]<n;o++)u.push(i+t*o);return u},o=u(0),l=function(){for(var n=[],r=o[o.length-1]-t.max,i=0;i<o.length;i++)i+1<o.length&&o[i+1]-r<e||n.push(o[i]-r);return n},h=function(){for(var e=[],r=o[0]-t.min,i=0;i<o.length&&(e[i]=o[i]-r,!(n<=e[i]));i++);return e};if(t){if("max"in t&&"min"in t&&t.max>=n&&t.min<=e){var m=function(){if(o[0]>=t.min&&o[o.length-1]<=t.max)return!0;var n=l();if(n[0]>=t.min&&n[n.length-1]<=t.max)return o=n,!0;var e=h();return e[0]>=t.min&&e[n.length-1]<=t.max?(o=e,!0):void 0};if(m())return o;for(var s=1;s<100;s++){if(o=u(s),m())return o;if(o=u(-s),m())return o}}"max"in t&&t.max>=n?t.max<o[o.length-1]&&(o=l()):"min"in t&&t.min<=e&&t.min>o[0]&&(o=h())}for(var v=0;v<o.length;v++){var g=o[v]+"";/\./.test(g)&&(/9{7,}$/.test(g)?(g=g.replace(/9{7,}$/,""),o[v]=+(g.substring(0,g.length-1)+(+g[g.length-1]+1))):/0{7,}\d$/.test(g)&&(o[v]=+g.replace(/0{7,}\d$/,"")))}return o}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).VISLite_ruler=e();
|
package/lib/scale/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.
|
|
2
|
+
* VISLite JavaScript Library v0.6.0-alpha.2
|
|
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:
|
|
9
|
+
* Publish Date: Sun Dec 17 2023 12:58:48 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.
|
|
2
|
+
* VISLite JavaScript Library v0.6.0-alpha.2
|
|
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:
|
|
9
|
+
* Publish Date: Sun Dec 17 2023 12:58:48 GMT+0800 (中国标准时间)
|
|
10
10
|
*/
|
|
11
11
|
var e,t;e=this,t=function(){"use strict";return function(e,t,n,o,f){return[n*(o-e)+e,n*(f-t)+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_scale=t();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.
|
|
2
|
+
* VISLite JavaScript Library v0.6.0-alpha.2
|
|
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:
|
|
9
|
+
* Publish Date: Sun Dec 17 2023 12:58:48 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.
|
|
2
|
+
* VISLite JavaScript Library v0.6.0-alpha.2
|
|
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:
|
|
9
|
+
* Publish Date: Sun Dec 17 2023 12:58:48 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.
|
|
2
|
+
* VISLite JavaScript Library v0.6.0-alpha.2
|
|
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:
|
|
9
|
+
* Publish Date: Sun Dec 17 2023 12:58:48 GMT+0800 (中国标准时间)
|
|
10
10
|
*/
|
|
11
11
|
(function (global, factory) {
|
|
12
12
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -98,13 +98,13 @@
|
|
|
98
98
|
el.addEventListener("mousedown", function (event) {
|
|
99
99
|
mouseP = mousePosition(el, event);
|
|
100
100
|
});
|
|
101
|
-
el.addEventListener("mouseup", function (
|
|
101
|
+
el.addEventListener("mouseup", function () {
|
|
102
102
|
mouseP = null;
|
|
103
103
|
});
|
|
104
104
|
el.addEventListener("mousemove", function (event) {
|
|
105
105
|
doMove(event);
|
|
106
106
|
});
|
|
107
|
-
el.addEventListener("touchend", function (
|
|
107
|
+
el.addEventListener("touchend", function () {
|
|
108
108
|
mouseP = null;
|
|
109
109
|
});
|
|
110
110
|
el.addEventListener("touchstart", function (event) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.
|
|
2
|
+
* VISLite JavaScript Library v0.6.0-alpha.2
|
|
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:
|
|
9
|
+
* Publish Date: Sun Dec 17 2023 12:58:48 GMT+0800 (中国标准时间)
|
|
10
10
|
*/
|
|
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(
|
|
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(){o=null})),t.addEventListener("mousemove",(function(e){i(e)})),t.addEventListener("touchend",(function(){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();
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
import OralCanvas from "../../lib/OralCanvas/index.es.js";
|
|
2
|
-
|
|
3
|
-
let dpr = wx.getSystemInfoSync().pixelRatio;
|
|
4
|
-
|
|
5
|
-
Component({
|
|
6
|
-
properties: {
|
|
7
|
-
width: {
|
|
8
|
-
type: Number,
|
|
9
|
-
default: 300
|
|
10
|
-
},
|
|
11
|
-
height: {
|
|
12
|
-
type: Number,
|
|
13
|
-
default: 150
|
|
14
|
-
},
|
|
15
|
-
region: {
|
|
16
|
-
type: Boolean,
|
|
17
|
-
default: true
|
|
18
|
-
},
|
|
19
|
-
touchstart: {
|
|
20
|
-
type: Function,
|
|
21
|
-
default: () => { }
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
data: {
|
|
25
|
-
help: {}
|
|
26
|
-
},
|
|
27
|
-
lifetimes: {
|
|
28
|
-
ready() {
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
methods: {
|
|
33
|
-
fetch() {
|
|
34
|
-
return new Promise((resolve, reject) => {
|
|
35
|
-
|
|
36
|
-
let getCanvasContext = (idName, doback) => {
|
|
37
|
-
if (idName != 'region' || this.data.region) {
|
|
38
|
-
const query = wx.createSelectorQuery().in(this);
|
|
39
|
-
query.select('#' + idName)
|
|
40
|
-
.fields({ node: true, size: true })
|
|
41
|
-
.exec((res) => {
|
|
42
|
-
const canvas = res[0].node;
|
|
43
|
-
const ctx = canvas.getContext('2d');
|
|
44
|
-
|
|
45
|
-
canvas.width = res[0].width * (idName == "region" ? 1 : dpr);
|
|
46
|
-
canvas.height = res[0].height * (idName == "region" ? 1 : dpr);
|
|
47
|
-
|
|
48
|
-
if (idName != "region") {
|
|
49
|
-
ctx.scale(dpr, dpr);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
doback(ctx);
|
|
53
|
-
});
|
|
54
|
-
} else {
|
|
55
|
-
doback(null);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
getCanvasContext("painter", painter => {
|
|
60
|
-
getCanvasContext("region", region => {
|
|
61
|
-
this.data.help.instance = new OralCanvas({
|
|
62
|
-
getContext() {
|
|
63
|
-
return painter;
|
|
64
|
-
}
|
|
65
|
-
}, this.data.region ? {
|
|
66
|
-
getContext() {
|
|
67
|
-
return region;
|
|
68
|
-
}
|
|
69
|
-
} : null);
|
|
70
|
-
|
|
71
|
-
this.data.help.instance.toDataURL = () => {
|
|
72
|
-
return new Promise((resolveUrl) => {
|
|
73
|
-
wx.canvasToTempFilePath({
|
|
74
|
-
canvasId: "painter",
|
|
75
|
-
success: function (e) {
|
|
76
|
-
resolveUrl(e.tempFilePath);
|
|
77
|
-
},
|
|
78
|
-
}, this);
|
|
79
|
-
})
|
|
80
|
-
};
|
|
81
|
-
resolve(this.data.help.instance);
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
doit(event, doback) {
|
|
88
|
-
let x = event.touches[0].x;
|
|
89
|
-
let y = event.touches[0].y;
|
|
90
|
-
|
|
91
|
-
this.data.help.instance.getRegion(x, y).then((regionName) => {
|
|
92
|
-
// 兼容旧语法
|
|
93
|
-
if (doback) doback(regionName);
|
|
94
|
-
|
|
95
|
-
this.triggerEvent('dotouchstart', {
|
|
96
|
-
name: regionName,
|
|
97
|
-
x: x,
|
|
98
|
-
y: y
|
|
99
|
-
})
|
|
100
|
-
});
|
|
101
|
-
},
|
|
102
|
-
doitstart(event) {
|
|
103
|
-
this.doit(event, this.data.touchstart);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
});
|
|
1
|
+
import OralCanvas from "../../lib/OralCanvas/index.es.js";
|
|
2
|
+
|
|
3
|
+
let dpr = wx.getSystemInfoSync().pixelRatio;
|
|
4
|
+
|
|
5
|
+
Component({
|
|
6
|
+
properties: {
|
|
7
|
+
width: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: 300
|
|
10
|
+
},
|
|
11
|
+
height: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 150
|
|
14
|
+
},
|
|
15
|
+
region: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: true
|
|
18
|
+
},
|
|
19
|
+
touchstart: {
|
|
20
|
+
type: Function,
|
|
21
|
+
default: () => { }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
data: {
|
|
25
|
+
help: {}
|
|
26
|
+
},
|
|
27
|
+
lifetimes: {
|
|
28
|
+
ready() {
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
fetch() {
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
|
|
36
|
+
let getCanvasContext = (idName, doback) => {
|
|
37
|
+
if (idName != 'region' || this.data.region) {
|
|
38
|
+
const query = wx.createSelectorQuery().in(this);
|
|
39
|
+
query.select('#' + idName)
|
|
40
|
+
.fields({ node: true, size: true })
|
|
41
|
+
.exec((res) => {
|
|
42
|
+
const canvas = res[0].node;
|
|
43
|
+
const ctx = canvas.getContext('2d');
|
|
44
|
+
|
|
45
|
+
canvas.width = res[0].width * (idName == "region" ? 1 : dpr);
|
|
46
|
+
canvas.height = res[0].height * (idName == "region" ? 1 : dpr);
|
|
47
|
+
|
|
48
|
+
if (idName != "region") {
|
|
49
|
+
ctx.scale(dpr, dpr);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
doback(ctx);
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
doback(null);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
getCanvasContext("painter", painter => {
|
|
60
|
+
getCanvasContext("region", region => {
|
|
61
|
+
this.data.help.instance = new OralCanvas({
|
|
62
|
+
getContext() {
|
|
63
|
+
return painter;
|
|
64
|
+
}
|
|
65
|
+
}, this.data.region ? {
|
|
66
|
+
getContext() {
|
|
67
|
+
return region;
|
|
68
|
+
}
|
|
69
|
+
} : null);
|
|
70
|
+
|
|
71
|
+
this.data.help.instance.toDataURL = () => {
|
|
72
|
+
return new Promise((resolveUrl) => {
|
|
73
|
+
wx.canvasToTempFilePath({
|
|
74
|
+
canvasId: "painter",
|
|
75
|
+
success: function (e) {
|
|
76
|
+
resolveUrl(e.tempFilePath);
|
|
77
|
+
},
|
|
78
|
+
}, this);
|
|
79
|
+
})
|
|
80
|
+
};
|
|
81
|
+
resolve(this.data.help.instance);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
doit(event, doback) {
|
|
88
|
+
let x = event.touches[0].x;
|
|
89
|
+
let y = event.touches[0].y;
|
|
90
|
+
|
|
91
|
+
this.data.help.instance.getRegion(x, y).then((regionName) => {
|
|
92
|
+
// 兼容旧语法
|
|
93
|
+
if (doback) doback(regionName);
|
|
94
|
+
|
|
95
|
+
this.triggerEvent('dotouchstart', {
|
|
96
|
+
name: regionName,
|
|
97
|
+
x: x,
|
|
98
|
+
y: y
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
doitstart(event) {
|
|
103
|
+
this.doit(event, this.data.touchstart);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"usingComponents": {},
|
|
3
|
-
"component": true
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"usingComponents": {},
|
|
3
|
+
"component": true
|
|
4
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<view>
|
|
2
|
-
<canvas type="2d" id="painter" style='width:{{width}}px;height:{{height}}px;' bindtouchstart="doitstart"></canvas>
|
|
3
|
-
<canvas wx:if="{{region}}" type="2d" id="region" style='width:{{width}}px;height:{{height}}px;' class="region"></canvas>
|
|
4
|
-
</view>
|
|
1
|
+
<view>
|
|
2
|
+
<canvas type="2d" id="painter" style='width:{{width}}px;height:{{height}}px;' bindtouchstart="doitstart"></canvas>
|
|
3
|
+
<canvas wx:if="{{region}}" type="2d" id="region" style='width:{{width}}px;height:{{height}}px;' class="region"></canvas>
|
|
4
|
+
</view>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 辅助的区域不应该可以看见 */
|
|
2
|
-
.region {
|
|
3
|
-
position: fixed;
|
|
4
|
-
left: 50000px;
|
|
5
|
-
}
|
|
1
|
+
/* 辅助的区域不应该可以看见 */
|
|
2
|
+
.region {
|
|
3
|
+
position: fixed;
|
|
4
|
+
left: 50000px;
|
|
5
|
+
}
|
package/package/Buffer/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Buffer from '../../src/common/webgl/buffer'
|
|
2
|
-
|
|
1
|
+
import Buffer from '../../src/common/webgl/buffer'
|
|
2
|
+
|
|
3
3
|
export default Buffer
|
package/package/Canvas/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Canvas from "../../src/Canvas"
|
|
2
|
-
|
|
1
|
+
import Canvas from "../../src/Canvas"
|
|
2
|
+
|
|
3
3
|
export default Canvas
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Cardinal from "../../src/interpolation/Cardinal"
|
|
2
|
-
|
|
1
|
+
import Cardinal from "../../src/interpolation/Cardinal"
|
|
2
|
+
|
|
3
3
|
export default Cardinal
|
package/package/Eoap/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Eoap from "../../src/Eoap"
|
|
2
|
-
|
|
1
|
+
import Eoap from "../../src/Eoap"
|
|
2
|
+
|
|
3
3
|
export default Eoap
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Geometry from "../../src/Geometry"
|
|
2
|
-
|
|
1
|
+
import Geometry from "../../src/Geometry"
|
|
2
|
+
|
|
3
3
|
export default Geometry
|
package/package/Hermite/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Hermite from "../../src/interpolation/Hermite"
|
|
2
|
-
|
|
1
|
+
import Hermite from "../../src/interpolation/Hermite"
|
|
2
|
+
|
|
3
3
|
export default Hermite
|
package/package/Matrix4/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Matrix4 from "../../src/Matrix4/index"
|
|
2
|
-
|
|
1
|
+
import Matrix4 from "../../src/Matrix4/index"
|
|
2
|
+
|
|
3
3
|
export default Matrix4
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Mercator from "../../src/Mercator"
|
|
2
|
-
|
|
1
|
+
import Mercator from "../../src/Mercator"
|
|
2
|
+
|
|
3
3
|
export default Mercator
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import _Canvas from "../../src/common/canvas/index"
|
|
2
|
-
|
|
1
|
+
import _Canvas from "../../src/common/canvas/index"
|
|
2
|
+
|
|
3
3
|
export default _Canvas
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import _WebGL from "../../src/common/webgl/index"
|
|
2
|
-
|
|
1
|
+
import _WebGL from "../../src/common/webgl/index"
|
|
2
|
+
|
|
3
3
|
export default _WebGL
|
package/package/SVG/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import SVG from "../../src/SVG"
|
|
2
|
-
|
|
1
|
+
import SVG from "../../src/SVG"
|
|
2
|
+
|
|
3
3
|
export default SVG
|
package/package/Shader/index.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import type ShaderType from '../../types/Shader'
|
|
2
|
-
|
|
3
|
-
import OralShader from '../../src/common/webgl/shader'
|
|
4
|
-
|
|
5
|
-
import vsColor from '../../src/shader/vsColor.c'
|
|
6
|
-
import vsColors from '../../src/shader/vsColors.c'
|
|
7
|
-
import vsImage from '../../src/shader/vsImage.c'
|
|
8
|
-
import vsCube from '../../src/shader/vsCube.c'
|
|
9
|
-
|
|
10
|
-
import fsColor from '../../src/shader/fsColor.c'
|
|
11
|
-
import fsColors from '../../src/shader/fsColors.c'
|
|
12
|
-
import fsImage from '../../src/shader/fsImage.c'
|
|
13
|
-
import fsCube from '../../src/shader/fsCube.c'
|
|
14
|
-
|
|
15
|
-
class Shader extends OralShader implements ShaderType {
|
|
16
|
-
|
|
17
|
-
compile(vshaderSource: string, fshaderSource: string): this
|
|
18
|
-
compile(shaderName: string): this
|
|
19
|
-
compile(arg1: string, arg2?: string) {
|
|
20
|
-
if (arg2) {
|
|
21
|
-
super.compile(arg1, arg2)
|
|
22
|
-
} else {
|
|
23
|
-
super.compile({
|
|
24
|
-
"color": vsColor,
|
|
25
|
-
"colors": vsColors,
|
|
26
|
-
"image": vsImage,
|
|
27
|
-
"cube": vsCube
|
|
28
|
-
}[arg1], {
|
|
29
|
-
"color": fsColor,
|
|
30
|
-
"colors": fsColors,
|
|
31
|
-
"image": fsImage,
|
|
32
|
-
"cube": fsCube
|
|
33
|
-
}[arg1])
|
|
34
|
-
}
|
|
35
|
-
return this
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
1
|
+
import type ShaderType from '../../types/Shader'
|
|
2
|
+
|
|
3
|
+
import OralShader from '../../src/common/webgl/shader'
|
|
4
|
+
|
|
5
|
+
import vsColor from '../../src/shader/vsColor.c'
|
|
6
|
+
import vsColors from '../../src/shader/vsColors.c'
|
|
7
|
+
import vsImage from '../../src/shader/vsImage.c'
|
|
8
|
+
import vsCube from '../../src/shader/vsCube.c'
|
|
9
|
+
|
|
10
|
+
import fsColor from '../../src/shader/fsColor.c'
|
|
11
|
+
import fsColors from '../../src/shader/fsColors.c'
|
|
12
|
+
import fsImage from '../../src/shader/fsImage.c'
|
|
13
|
+
import fsCube from '../../src/shader/fsCube.c'
|
|
14
|
+
|
|
15
|
+
class Shader extends OralShader implements ShaderType {
|
|
16
|
+
|
|
17
|
+
compile(vshaderSource: string, fshaderSource: string): this
|
|
18
|
+
compile(shaderName: string): this
|
|
19
|
+
compile(arg1: string, arg2?: string) {
|
|
20
|
+
if (arg2) {
|
|
21
|
+
super.compile(arg1, arg2)
|
|
22
|
+
} else {
|
|
23
|
+
super.compile({
|
|
24
|
+
"color": vsColor,
|
|
25
|
+
"colors": vsColors,
|
|
26
|
+
"image": vsImage,
|
|
27
|
+
"cube": vsCube
|
|
28
|
+
}[arg1], {
|
|
29
|
+
"color": fsColor,
|
|
30
|
+
"colors": fsColors,
|
|
31
|
+
"image": fsImage,
|
|
32
|
+
"cube": fsCube
|
|
33
|
+
}[arg1])
|
|
34
|
+
}
|
|
35
|
+
return this
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
40
|
export default Shader
|
package/package/Texture/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Texture from '../../src/common/webgl/texture'
|
|
2
|
-
|
|
1
|
+
import Texture from '../../src/common/webgl/texture'
|
|
2
|
+
|
|
3
3
|
export default Texture
|
package/package/WebGL/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import WebGL from "../../src/WebGL"
|
|
2
|
-
|
|
1
|
+
import WebGL from "../../src/WebGL"
|
|
2
|
+
|
|
3
3
|
export default WebGL
|