vislite 0.5.0 → 0.5.2-alpha.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 +137 -132
- package/lib/Buffer/index.umd.js +36 -36
- package/lib/Buffer/index.umd.min.js +2 -2
- package/lib/Canvas/index.umd.js +650 -650
- package/lib/Canvas/index.umd.min.js +2 -2
- package/lib/Cardinal/index.umd.js +91 -91
- package/lib/Cardinal/index.umd.min.js +2 -2
- package/lib/Eoap/index.umd.js +34 -34
- package/lib/Eoap/index.umd.min.js +2 -2
- package/lib/Geometry/index.umd.js +142 -142
- package/lib/Geometry/index.umd.min.js +2 -2
- package/lib/Hermite/index.umd.js +36 -36
- package/lib/Hermite/index.umd.min.js +2 -2
- package/lib/Matrix4/index.umd.js +119 -119
- package/lib/Matrix4/index.umd.min.js +2 -2
- package/lib/Mercator/index.umd.js +20 -20
- package/lib/Mercator/index.umd.min.js +2 -2
- package/lib/OralCanvas/index.es.js +598 -598
- package/lib/OralCanvas/index.es.min.js +2 -2
- package/lib/OralWebGL/index.es.js +524 -524
- package/lib/OralWebGL/index.es.min.js +2 -2
- package/lib/SVG/index.umd.js +406 -406
- package/lib/SVG/index.umd.min.js +2 -2
- package/lib/Shader/index.umd.js +61 -61
- package/lib/Shader/index.umd.min.js +2 -2
- package/lib/Texture/index.umd.js +53 -53
- package/lib/Texture/index.umd.min.js +2 -2
- package/lib/TreeLayout/index.umd.js +363 -363
- package/lib/TreeLayout/index.umd.min.js +2 -2
- package/lib/WebGL/index.umd.js +571 -571
- package/lib/WebGL/index.umd.min.js +2 -2
- package/lib/animation/index.umd.js +72 -72
- package/lib/animation/index.umd.min.js +2 -2
- package/lib/formatColor/index.umd.js +40 -40
- package/lib/formatColor/index.umd.min.js +2 -2
- package/lib/getLoopColors/index.umd.js +36 -36
- package/lib/getLoopColors/index.umd.min.js +2 -2
- package/lib/getWebGLContext/index.umd.js +44 -44
- package/lib/getWebGLContext/index.umd.min.js +2 -2
- package/lib/index.umd.js +2647 -2647
- package/lib/index.umd.min.js +2 -2
- package/lib/resizeObserver/index.umd.js +29 -29
- package/lib/resizeObserver/index.umd.min.js +2 -2
- package/lib/rotate/index.umd.js +8 -8
- package/lib/rotate/index.umd.min.js +2 -2
- package/lib/ruler/index.umd.js +126 -126
- package/lib/ruler/index.umd.min.js +2 -2
- package/lib/throttle/index.umd.js +49 -49
- package/lib/throttle/index.umd.min.js +2 -2
- package/lib/viewHandler/index.umd.js +120 -120
- package/lib/viewHandler/index.umd.min.js +2 -2
- package/package/Geometry/index.ts +2 -2
- package/package/index.ts +72 -72
- package/package.json +66 -66
- package/src/Eoap.ts +66 -66
- package/src/Geometry.ts +82 -82
- package/src/Matrix4/index.ts +76 -76
- package/src/Mercator.ts +27 -27
- package/src/TreeLayout/index.ts +186 -186
- package/src/common/geometry/prism-horizontal.ts +33 -33
- package/src/common/geometry/prism-vertical.ts +40 -40
- package/src/common/geometry/sphere-fragment.ts +39 -39
- package/src/common/geometry/tool/circle.ts +11 -11
- package/src/common/svg/index.ts +344 -344
- package/src/rotate.ts +7 -7
- package/types/CanvasConfig.d.ts +106 -106
- package/types/Geometry.d.ts +40 -40
- package/types/GeometryOption.d.ts +11 -11
- package/types/GeometryResult.d.ts +18 -18
- package/types/Map.d.ts +9 -9
- package/types/Matrix4.d.ts +42 -42
- package/types/SVG.d.ts +215 -215
- package/types/TreeLayout.d.ts +54 -54
- package/types/index.d.ts +169 -169
- package/types/rotate.d.ts +2 -2
- package/uni-app/ui-canvas.vue +206 -202
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.5.
|
|
2
|
+
* VISLite JavaScript Library v0.5.2-alpha.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:
|
|
9
|
+
* Publish Date: Thu Oct 12 2023 15:44:35 GMT+0800 (China Standard Time)
|
|
10
10
|
*/
|
|
11
11
|
(function (global, factory) {
|
|
12
12
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -14,55 +14,55 @@
|
|
|
14
14
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.VISLite_throttle = factory());
|
|
15
15
|
})(this, (function () { 'use strict';
|
|
16
16
|
|
|
17
|
-
function mergeOption (option, defaultOption) {
|
|
18
|
-
for (var key in option) {
|
|
19
|
-
defaultOption[key] = option[key];
|
|
20
|
-
}
|
|
21
|
-
return defaultOption;
|
|
17
|
+
function mergeOption (option, defaultOption) {
|
|
18
|
+
for (var key in option) {
|
|
19
|
+
defaultOption[key] = option[key];
|
|
20
|
+
}
|
|
21
|
+
return defaultOption;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
function throttle (callback, option) {
|
|
25
|
-
if (option === void 0) { option = {}; }
|
|
26
|
-
option = mergeOption(option, {
|
|
27
|
-
time: 200,
|
|
28
|
-
keep: false,
|
|
29
|
-
opportunity: "end"
|
|
30
|
-
});
|
|
31
|
-
var hadInterval = false;
|
|
32
|
-
var hadClick = false;
|
|
33
|
-
var oneClick = false;
|
|
34
|
-
var arg;
|
|
35
|
-
return function () {
|
|
36
|
-
var _this = this;
|
|
37
|
-
arg = arguments;
|
|
38
|
-
if (!hadInterval) {
|
|
39
|
-
if (option.opportunity != 'end') {
|
|
40
|
-
callback.apply(_this, arg);
|
|
41
|
-
}
|
|
42
|
-
hadInterval = true;
|
|
43
|
-
var interval_1 = setInterval(function () {
|
|
44
|
-
if (hadClick) {
|
|
45
|
-
if (!option.keep) {
|
|
46
|
-
callback.apply(_this, arg);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
if (option.opportunity != 'begin') {
|
|
51
|
-
if (oneClick || option.opportunity == 'end')
|
|
52
|
-
callback.apply(_this, arg);
|
|
53
|
-
}
|
|
54
|
-
hadInterval = false;
|
|
55
|
-
oneClick = false;
|
|
56
|
-
clearInterval(interval_1);
|
|
57
|
-
}
|
|
58
|
-
hadClick = false;
|
|
59
|
-
}, option.time);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
hadClick = true;
|
|
63
|
-
oneClick = true;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
24
|
+
function throttle (callback, option) {
|
|
25
|
+
if (option === void 0) { option = {}; }
|
|
26
|
+
option = mergeOption(option, {
|
|
27
|
+
time: 200,
|
|
28
|
+
keep: false,
|
|
29
|
+
opportunity: "end"
|
|
30
|
+
});
|
|
31
|
+
var hadInterval = false;
|
|
32
|
+
var hadClick = false;
|
|
33
|
+
var oneClick = false;
|
|
34
|
+
var arg;
|
|
35
|
+
return function () {
|
|
36
|
+
var _this = this;
|
|
37
|
+
arg = arguments;
|
|
38
|
+
if (!hadInterval) {
|
|
39
|
+
if (option.opportunity != 'end') {
|
|
40
|
+
callback.apply(_this, arg);
|
|
41
|
+
}
|
|
42
|
+
hadInterval = true;
|
|
43
|
+
var interval_1 = setInterval(function () {
|
|
44
|
+
if (hadClick) {
|
|
45
|
+
if (!option.keep) {
|
|
46
|
+
callback.apply(_this, arg);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
if (option.opportunity != 'begin') {
|
|
51
|
+
if (oneClick || option.opportunity == 'end')
|
|
52
|
+
callback.apply(_this, arg);
|
|
53
|
+
}
|
|
54
|
+
hadInterval = false;
|
|
55
|
+
oneClick = false;
|
|
56
|
+
clearInterval(interval_1);
|
|
57
|
+
}
|
|
58
|
+
hadClick = false;
|
|
59
|
+
}, option.time);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
hadClick = true;
|
|
63
|
+
oneClick = true;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
return throttle;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.5.
|
|
2
|
+
* VISLite JavaScript Library v0.5.2-alpha.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:
|
|
9
|
+
* Publish Date: Thu Oct 12 2023 15:44:35 GMT+0800 (China Standard Time)
|
|
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.5.
|
|
2
|
+
* VISLite JavaScript Library v0.5.2-alpha.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:
|
|
9
|
+
* Publish Date: Thu Oct 12 2023 15:44:35 GMT+0800 (China Standard Time)
|
|
10
10
|
*/
|
|
11
11
|
(function (global, factory) {
|
|
12
12
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -14,124 +14,124 @@
|
|
|
14
14
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.VISLite_viewHandler = factory());
|
|
15
15
|
})(this, (function () { 'use strict';
|
|
16
16
|
|
|
17
|
-
var mousePosition = function (el, event) {
|
|
18
|
-
var bounding = el.getBoundingClientRect();
|
|
19
|
-
return {
|
|
20
|
-
"x": event.clientX - bounding.left,
|
|
21
|
-
"y": event.clientY - bounding.top
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
var getKeyString = function (event) {
|
|
25
|
-
return {
|
|
26
|
-
37: "left",
|
|
27
|
-
38: "up",
|
|
28
|
-
39: "right",
|
|
29
|
-
40: "down",
|
|
30
|
-
}[event.keyCode || event.which];
|
|
31
|
-
};
|
|
32
|
-
function viewHandler (callback) {
|
|
33
|
-
var el = document.getElementsByTagName('body')[0];
|
|
34
|
-
el.addEventListener("keydown", function (event) {
|
|
35
|
-
var keyCode = getKeyString(event);
|
|
36
|
-
if (keyCode == 'up') {
|
|
37
|
-
callback({
|
|
38
|
-
type: "lookUp",
|
|
39
|
-
normal: [],
|
|
40
|
-
value: 0.1,
|
|
41
|
-
event: event
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
else if (keyCode == 'down') {
|
|
45
|
-
callback({
|
|
46
|
-
type: "lookDown",
|
|
47
|
-
normal: [],
|
|
48
|
-
value: 0.1,
|
|
49
|
-
event: event
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
else if (keyCode == 'left') {
|
|
53
|
-
callback({
|
|
54
|
-
type: "lookLeft",
|
|
55
|
-
normal: [],
|
|
56
|
-
value: 0.1,
|
|
57
|
-
event: event
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
else if (keyCode == 'right') {
|
|
61
|
-
callback({
|
|
62
|
-
type: "lookRight",
|
|
63
|
-
normal: [],
|
|
64
|
-
value: 0.1,
|
|
65
|
-
event: event
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
var mouseP = null;
|
|
70
|
-
var doMove = function (event) {
|
|
71
|
-
if (mouseP == null) {
|
|
72
|
-
callback({
|
|
73
|
-
type: "hover",
|
|
74
|
-
normal: [],
|
|
75
|
-
value: 0,
|
|
76
|
-
event: event
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
var tempMouseP = mousePosition(el, event);
|
|
81
|
-
var normal = [tempMouseP.x - mouseP.x, tempMouseP.y - mouseP.y];
|
|
82
|
-
var rotateNormal = [
|
|
83
|
-
normal[1],
|
|
84
|
-
normal[0],
|
|
85
|
-
0
|
|
86
|
-
];
|
|
87
|
-
if (rotateNormal[0] == 0 && rotateNormal[1] == 0)
|
|
88
|
-
return;
|
|
89
|
-
callback({
|
|
90
|
-
type: "rotate",
|
|
91
|
-
normal: rotateNormal,
|
|
92
|
-
value: (Math.abs(tempMouseP.x - mouseP.x) + Math.abs(tempMouseP.y - mouseP.y)) * 0.01,
|
|
93
|
-
event: event
|
|
94
|
-
});
|
|
95
|
-
mouseP = tempMouseP;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
el.addEventListener("mousedown", function (event) {
|
|
99
|
-
mouseP = mousePosition(el, event);
|
|
100
|
-
});
|
|
101
|
-
el.addEventListener("mouseup", function (event) {
|
|
102
|
-
mouseP = null;
|
|
103
|
-
});
|
|
104
|
-
el.addEventListener("mousemove", function (event) {
|
|
105
|
-
doMove(event);
|
|
106
|
-
});
|
|
107
|
-
el.addEventListener("touchend", function (event) {
|
|
108
|
-
mouseP = null;
|
|
109
|
-
});
|
|
110
|
-
el.addEventListener("touchstart", function (event) {
|
|
111
|
-
mouseP = mousePosition(el, event);
|
|
112
|
-
});
|
|
113
|
-
el.addEventListener("touchmove", function (event) {
|
|
114
|
-
doMove(event.touches[0]);
|
|
115
|
-
});
|
|
116
|
-
var doScale = function (value, event) {
|
|
117
|
-
if (value == 0)
|
|
118
|
-
return;
|
|
119
|
-
var baseTimes = 0.899;
|
|
120
|
-
callback({
|
|
121
|
-
type: "scale",
|
|
122
|
-
value: value < 0 ? baseTimes : 2 - baseTimes,
|
|
123
|
-
normal: [],
|
|
124
|
-
event: event
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
el.addEventListener("mousewheel", function (event) {
|
|
128
|
-
doScale(event.wheelDelta, event);
|
|
129
|
-
});
|
|
130
|
-
if (window.addEventListener) {
|
|
131
|
-
window.addEventListener('DOMMouseScroll', function (event) {
|
|
132
|
-
doScale(-1 * event.detail, event);
|
|
133
|
-
}, false);
|
|
134
|
-
}
|
|
17
|
+
var mousePosition = function (el, event) {
|
|
18
|
+
var bounding = el.getBoundingClientRect();
|
|
19
|
+
return {
|
|
20
|
+
"x": event.clientX - bounding.left,
|
|
21
|
+
"y": event.clientY - bounding.top
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
var getKeyString = function (event) {
|
|
25
|
+
return {
|
|
26
|
+
37: "left",
|
|
27
|
+
38: "up",
|
|
28
|
+
39: "right",
|
|
29
|
+
40: "down",
|
|
30
|
+
}[event.keyCode || event.which];
|
|
31
|
+
};
|
|
32
|
+
function viewHandler (callback) {
|
|
33
|
+
var el = document.getElementsByTagName('body')[0];
|
|
34
|
+
el.addEventListener("keydown", function (event) {
|
|
35
|
+
var keyCode = getKeyString(event);
|
|
36
|
+
if (keyCode == 'up') {
|
|
37
|
+
callback({
|
|
38
|
+
type: "lookUp",
|
|
39
|
+
normal: [],
|
|
40
|
+
value: 0.1,
|
|
41
|
+
event: event
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
else if (keyCode == 'down') {
|
|
45
|
+
callback({
|
|
46
|
+
type: "lookDown",
|
|
47
|
+
normal: [],
|
|
48
|
+
value: 0.1,
|
|
49
|
+
event: event
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else if (keyCode == 'left') {
|
|
53
|
+
callback({
|
|
54
|
+
type: "lookLeft",
|
|
55
|
+
normal: [],
|
|
56
|
+
value: 0.1,
|
|
57
|
+
event: event
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
else if (keyCode == 'right') {
|
|
61
|
+
callback({
|
|
62
|
+
type: "lookRight",
|
|
63
|
+
normal: [],
|
|
64
|
+
value: 0.1,
|
|
65
|
+
event: event
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
var mouseP = null;
|
|
70
|
+
var doMove = function (event) {
|
|
71
|
+
if (mouseP == null) {
|
|
72
|
+
callback({
|
|
73
|
+
type: "hover",
|
|
74
|
+
normal: [],
|
|
75
|
+
value: 0,
|
|
76
|
+
event: event
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
var tempMouseP = mousePosition(el, event);
|
|
81
|
+
var normal = [tempMouseP.x - mouseP.x, tempMouseP.y - mouseP.y];
|
|
82
|
+
var rotateNormal = [
|
|
83
|
+
normal[1],
|
|
84
|
+
normal[0],
|
|
85
|
+
0
|
|
86
|
+
];
|
|
87
|
+
if (rotateNormal[0] == 0 && rotateNormal[1] == 0)
|
|
88
|
+
return;
|
|
89
|
+
callback({
|
|
90
|
+
type: "rotate",
|
|
91
|
+
normal: rotateNormal,
|
|
92
|
+
value: (Math.abs(tempMouseP.x - mouseP.x) + Math.abs(tempMouseP.y - mouseP.y)) * 0.01,
|
|
93
|
+
event: event
|
|
94
|
+
});
|
|
95
|
+
mouseP = tempMouseP;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
el.addEventListener("mousedown", function (event) {
|
|
99
|
+
mouseP = mousePosition(el, event);
|
|
100
|
+
});
|
|
101
|
+
el.addEventListener("mouseup", function (event) {
|
|
102
|
+
mouseP = null;
|
|
103
|
+
});
|
|
104
|
+
el.addEventListener("mousemove", function (event) {
|
|
105
|
+
doMove(event);
|
|
106
|
+
});
|
|
107
|
+
el.addEventListener("touchend", function (event) {
|
|
108
|
+
mouseP = null;
|
|
109
|
+
});
|
|
110
|
+
el.addEventListener("touchstart", function (event) {
|
|
111
|
+
mouseP = mousePosition(el, event);
|
|
112
|
+
});
|
|
113
|
+
el.addEventListener("touchmove", function (event) {
|
|
114
|
+
doMove(event.touches[0]);
|
|
115
|
+
});
|
|
116
|
+
var doScale = function (value, event) {
|
|
117
|
+
if (value == 0)
|
|
118
|
+
return;
|
|
119
|
+
var baseTimes = 0.899;
|
|
120
|
+
callback({
|
|
121
|
+
type: "scale",
|
|
122
|
+
value: value < 0 ? baseTimes : 2 - baseTimes,
|
|
123
|
+
normal: [],
|
|
124
|
+
event: event
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
el.addEventListener("mousewheel", function (event) {
|
|
128
|
+
doScale(event.wheelDelta, event);
|
|
129
|
+
});
|
|
130
|
+
if (window.addEventListener) {
|
|
131
|
+
window.addEventListener('DOMMouseScroll', function (event) {
|
|
132
|
+
doScale(-1 * event.detail, event);
|
|
133
|
+
}, false);
|
|
134
|
+
}
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
return viewHandler;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.5.
|
|
2
|
+
* VISLite JavaScript Library v0.5.2-alpha.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:
|
|
9
|
+
* Publish Date: Thu Oct 12 2023 15:44:35 GMT+0800 (China Standard Time)
|
|
10
10
|
*/
|
|
11
11
|
var e,n;e=this,n=function(){"use strict";var e=function(e,n){var t=e.getBoundingClientRect();return{x:n.clientX-t.left,y:n.clientY-t.top}};return function(n){var t=document.getElementsByTagName("body")[0];t.addEventListener("keydown",(function(e){var t=function(e){return{37:"left",38:"up",39:"right",40:"down"}[e.keyCode||e.which]}(e);"up"==t?n({type:"lookUp",normal:[],value:.1,event:e}):"down"==t?n({type:"lookDown",normal:[],value:.1,event:e}):"left"==t?n({type:"lookLeft",normal:[],value:.1,event:e}):"right"==t&&n({type:"lookRight",normal:[],value:.1,event:e})}));var o=null,i=function(i){if(null==o)n({type:"hover",normal:[],value:0,event:i});else{var u=e(t,i),l=[u.x-o.x,u.y-o.y],a=[l[1],l[0],0];if(0==a[0]&&0==a[1])return;n({type:"rotate",normal:a,value:.01*(Math.abs(u.x-o.x)+Math.abs(u.y-o.y)),event:i}),o=u}};t.addEventListener("mousedown",(function(n){o=e(t,n)})),t.addEventListener("mouseup",(function(e){o=null})),t.addEventListener("mousemove",(function(e){i(e)})),t.addEventListener("touchend",(function(e){o=null})),t.addEventListener("touchstart",(function(n){o=e(t,n)})),t.addEventListener("touchmove",(function(e){i(e.touches[0])}));var u=function(e,t){0!=e&&n({type:"scale",value:e<0?.899:1.101,normal:[],event:t})};t.addEventListener("mousewheel",(function(e){u(e.wheelDelta,e)})),window.addEventListener&&window.addEventListener("DOMMouseScroll",(function(e){u(-1*e.detail,e)}),!1)}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).VISLite_viewHandler=n();
|
|
@@ -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/index.ts
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import Cardinal from "./Cardinal/index"
|
|
2
|
-
import Hermite from "./Hermite/index"
|
|
3
|
-
|
|
4
|
-
import Matrix4 from "./Matrix4/index"
|
|
5
|
-
import rotate from "./rotate/index"
|
|
6
|
-
|
|
7
|
-
import getLoopColors from "./getLoopColors/index"
|
|
8
|
-
import formatColor from "./formatColor/index"
|
|
9
|
-
import animation from "./animation/index"
|
|
10
|
-
import ruler from "./ruler/index"
|
|
11
|
-
|
|
12
|
-
import SVG from "./SVG/index"
|
|
13
|
-
import Canvas from "./Canvas/index"
|
|
14
|
-
import WebGL from "./WebGL/index"
|
|
15
|
-
|
|
16
|
-
import getWebGLContext from "./getWebGLContext/index"
|
|
17
|
-
import Shader from "./Shader/index"
|
|
18
|
-
import Texture from "./Texture/index"
|
|
19
|
-
import Buffer from "./Buffer/index"
|
|
20
|
-
|
|
21
|
-
import Eoap from "./Eoap/index"
|
|
22
|
-
import Mercator from "./Mercator/index"
|
|
23
|
-
|
|
24
|
-
import viewHandler from "./viewHandler/index"
|
|
25
|
-
import resizeObserver from "./resizeObserver/index"
|
|
26
|
-
import throttle from "./throttle/index"
|
|
27
|
-
|
|
28
|
-
import TreeLayout from "./TreeLayout/index"
|
|
29
|
-
|
|
30
|
-
import Geometry from "./Geometry/index"
|
|
31
|
-
|
|
32
|
-
export default {
|
|
33
|
-
|
|
34
|
-
// 插值
|
|
35
|
-
Cardinal,
|
|
36
|
-
Hermite,
|
|
37
|
-
|
|
38
|
-
// 变换
|
|
39
|
-
Matrix4,
|
|
40
|
-
rotate,
|
|
41
|
-
|
|
42
|
-
// 工具
|
|
43
|
-
getLoopColors,
|
|
44
|
-
formatColor,
|
|
45
|
-
animation,
|
|
46
|
-
ruler,
|
|
47
|
-
|
|
48
|
-
// 画笔
|
|
49
|
-
SVG,
|
|
50
|
-
Canvas,
|
|
51
|
-
WebGL,
|
|
52
|
-
|
|
53
|
-
// WebGL
|
|
54
|
-
getWebGLContext,
|
|
55
|
-
Shader,
|
|
56
|
-
Texture,
|
|
57
|
-
Buffer,
|
|
58
|
-
|
|
59
|
-
// 投影
|
|
60
|
-
Eoap,
|
|
61
|
-
Mercator,
|
|
62
|
-
|
|
63
|
-
// 辅助
|
|
64
|
-
viewHandler,
|
|
65
|
-
resizeObserver,
|
|
66
|
-
throttle,
|
|
67
|
-
|
|
68
|
-
// 布局
|
|
69
|
-
TreeLayout,
|
|
70
|
-
|
|
71
|
-
// 几何&模型数据
|
|
72
|
-
Geometry
|
|
1
|
+
import Cardinal from "./Cardinal/index"
|
|
2
|
+
import Hermite from "./Hermite/index"
|
|
3
|
+
|
|
4
|
+
import Matrix4 from "./Matrix4/index"
|
|
5
|
+
import rotate from "./rotate/index"
|
|
6
|
+
|
|
7
|
+
import getLoopColors from "./getLoopColors/index"
|
|
8
|
+
import formatColor from "./formatColor/index"
|
|
9
|
+
import animation from "./animation/index"
|
|
10
|
+
import ruler from "./ruler/index"
|
|
11
|
+
|
|
12
|
+
import SVG from "./SVG/index"
|
|
13
|
+
import Canvas from "./Canvas/index"
|
|
14
|
+
import WebGL from "./WebGL/index"
|
|
15
|
+
|
|
16
|
+
import getWebGLContext from "./getWebGLContext/index"
|
|
17
|
+
import Shader from "./Shader/index"
|
|
18
|
+
import Texture from "./Texture/index"
|
|
19
|
+
import Buffer from "./Buffer/index"
|
|
20
|
+
|
|
21
|
+
import Eoap from "./Eoap/index"
|
|
22
|
+
import Mercator from "./Mercator/index"
|
|
23
|
+
|
|
24
|
+
import viewHandler from "./viewHandler/index"
|
|
25
|
+
import resizeObserver from "./resizeObserver/index"
|
|
26
|
+
import throttle from "./throttle/index"
|
|
27
|
+
|
|
28
|
+
import TreeLayout from "./TreeLayout/index"
|
|
29
|
+
|
|
30
|
+
import Geometry from "./Geometry/index"
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
|
|
34
|
+
// 插值
|
|
35
|
+
Cardinal,
|
|
36
|
+
Hermite,
|
|
37
|
+
|
|
38
|
+
// 变换
|
|
39
|
+
Matrix4,
|
|
40
|
+
rotate,
|
|
41
|
+
|
|
42
|
+
// 工具
|
|
43
|
+
getLoopColors,
|
|
44
|
+
formatColor,
|
|
45
|
+
animation,
|
|
46
|
+
ruler,
|
|
47
|
+
|
|
48
|
+
// 画笔
|
|
49
|
+
SVG,
|
|
50
|
+
Canvas,
|
|
51
|
+
WebGL,
|
|
52
|
+
|
|
53
|
+
// WebGL
|
|
54
|
+
getWebGLContext,
|
|
55
|
+
Shader,
|
|
56
|
+
Texture,
|
|
57
|
+
Buffer,
|
|
58
|
+
|
|
59
|
+
// 投影
|
|
60
|
+
Eoap,
|
|
61
|
+
Mercator,
|
|
62
|
+
|
|
63
|
+
// 辅助
|
|
64
|
+
viewHandler,
|
|
65
|
+
resizeObserver,
|
|
66
|
+
throttle,
|
|
67
|
+
|
|
68
|
+
// 布局
|
|
69
|
+
TreeLayout,
|
|
70
|
+
|
|
71
|
+
// 几何&模型数据
|
|
72
|
+
Geometry
|
|
73
73
|
}
|