vislite 1.4.0-alpha.0 → 1.4.0
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 +307 -307
- package/lib/BarLayout/index.es.js +437 -437
- package/lib/BarLayout/index.es.min.js +2 -2
- package/lib/Buffer/index.es.js +35 -35
- package/lib/Buffer/index.es.min.js +1 -1
- package/lib/Canvas/index.es.js +774 -774
- package/lib/Canvas/index.es.min.js +1 -1
- package/lib/Cardinal/index.es.js +90 -90
- package/lib/Cardinal/index.es.min.js +1 -1
- package/lib/Eoap/index.es.js +33 -33
- package/lib/Eoap/index.es.min.js +1 -1
- package/lib/Hermite/index.es.js +35 -35
- package/lib/Hermite/index.es.min.js +1 -1
- package/lib/MapCoordinate/index.es.js +199 -199
- package/lib/MapCoordinate/index.es.min.js +1 -1
- package/lib/Matrix4/index.es.js +124 -124
- package/lib/Matrix4/index.es.min.js +1 -1
- package/lib/Mercator/index.es.js +19 -19
- package/lib/Mercator/index.es.min.js +1 -1
- package/lib/PieLayout/index.es.js +213 -213
- package/lib/PieLayout/index.es.min.js +2 -2
- package/lib/RawCanvas/index.es.js +704 -704
- package/lib/RawCanvas/index.es.min.js +1 -1
- package/lib/SVG/index.es.js +514 -514
- package/lib/SVG/index.es.min.js +1 -1
- package/lib/Shader/index.es.js +35 -35
- package/lib/Shader/index.es.min.js +1 -1
- package/lib/Texture/index.es.js +53 -53
- package/lib/Texture/index.es.min.js +1 -1
- package/lib/TreeLayout/index.es.js +397 -397
- package/lib/TreeLayout/index.es.min.js +2 -2
- package/lib/animation/index.es.js +110 -106
- package/lib/animation/index.es.min.js +3 -3
- package/lib/assemble/index.es.js +17 -17
- package/lib/assemble/index.es.min.js +1 -1
- package/lib/getLoopColors/index.es.js +35 -35
- package/lib/getLoopColors/index.es.min.js +1 -1
- package/lib/getWebGLContext/index.es.js +62 -62
- package/lib/getWebGLContext/index.es.min.js +1 -1
- package/lib/index.umd.js +2795 -2791
- package/lib/index.umd.min.js +5 -5
- package/lib/initOption/index.es.js +6 -6
- package/lib/initOption/index.es.min.js +1 -1
- package/lib/mergeOption/index.es.js +34 -34
- package/lib/mergeOption/index.es.min.js +1 -1
- package/lib/move/index.es.js +7 -7
- package/lib/move/index.es.min.js +1 -1
- package/lib/rotate/index.es.js +7 -7
- package/lib/rotate/index.es.min.js +1 -1
- package/lib/ruler/index.es.js +137 -137
- package/lib/ruler/index.es.min.js +1 -1
- package/lib/scale/index.es.js +6 -6
- package/lib/scale/index.es.min.js +1 -1
- package/lib/throttle/index.es.js +51 -51
- package/lib/throttle/index.es.min.js +2 -2
- package/package/BarLayout/index.ts +2 -2
- package/package/PieLayout/index.ts +2 -2
- package/package/animation/index.ts +6 -3
- package/package/index.ts +84 -84
- package/package/throttle/index.ts +2 -2
- package/package.json +75 -75
- package/src/SVG.ts +55 -55
- package/src/common/canvas/gradient.ts +31 -31
- package/src/common/svg/default.ts +29 -29
- package/src/common/svg/gradient.ts +53 -53
- package/src/common/svg/index.ts +332 -332
- package/src/common/tree/toPlainTree.ts +135 -135
- package/src/common/webgl/texture.ts +98 -98
- package/src/layout/BarLayout.ts +248 -248
- package/src/layout/PieLayout.ts +141 -141
- package/src/layout/TreeLayout.ts +197 -197
- package/types/Bar.d.ts +91 -91
- package/types/BarConfig.d.ts +4 -4
- package/types/BarLayout.d.ts +48 -48
- package/types/BarOption.d.ts +31 -31
- package/types/Pie.d.ts +73 -73
- package/types/PieConfig.d.ts +26 -26
- package/types/PieLayout.d.ts +40 -40
- package/types/PieOption.d.ts +21 -21
- package/types/SVG.d.ts +247 -247
- package/types/animation.d.ts +11 -5
- package/types/index.d.ts +195 -195
- package/types/throttle.d.ts +5 -5
package/lib/Matrix4/index.es.js
CHANGED
|
@@ -1,138 +1,138 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Matrix4 of VISLite JavaScript Library v1.4.0
|
|
2
|
+
* Matrix4 of VISLite JavaScript Library v1.4.0
|
|
3
3
|
* git+https://github.com/oi-contrib/VISLite.git
|
|
4
4
|
*/
|
|
5
|
-
function _move (d, a, b, c) {
|
|
6
|
-
if (c === void 0) { c = 0; }
|
|
7
|
-
var sqrt = Math.sqrt(a * a + b * b + c * c);
|
|
8
|
-
return [
|
|
9
|
-
1, 0, 0, 0,
|
|
10
|
-
0, 1, 0, 0,
|
|
11
|
-
0, 0, 1, 0,
|
|
12
|
-
a * d / sqrt, b * d / sqrt, c * d / sqrt, 1
|
|
13
|
-
];
|
|
5
|
+
function _move (d, a, b, c) {
|
|
6
|
+
if (c === void 0) { c = 0; }
|
|
7
|
+
var sqrt = Math.sqrt(a * a + b * b + c * c);
|
|
8
|
+
return [
|
|
9
|
+
1, 0, 0, 0,
|
|
10
|
+
0, 1, 0, 0,
|
|
11
|
+
0, 0, 1, 0,
|
|
12
|
+
a * d / sqrt, b * d / sqrt, c * d / sqrt, 1
|
|
13
|
+
];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function _rotate (deg) {
|
|
17
|
-
var sin = Math.sin(deg), cos = Math.cos(deg);
|
|
18
|
-
return [
|
|
19
|
-
cos, sin, 0, 0,
|
|
20
|
-
-sin, cos, 0, 0,
|
|
21
|
-
0, 0, 1, 0,
|
|
22
|
-
0, 0, 0, 1
|
|
23
|
-
];
|
|
16
|
+
function _rotate (deg) {
|
|
17
|
+
var sin = Math.sin(deg), cos = Math.cos(deg);
|
|
18
|
+
return [
|
|
19
|
+
cos, sin, 0, 0,
|
|
20
|
+
-sin, cos, 0, 0,
|
|
21
|
+
0, 0, 1, 0,
|
|
22
|
+
0, 0, 0, 1
|
|
23
|
+
];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
function _scale (xTimes, yTimes, zTimes, cx, cy, cz) {
|
|
27
|
-
if (cx === void 0) { cx = 0; }
|
|
28
|
-
if (cy === void 0) { cy = 0; }
|
|
29
|
-
if (cz === void 0) { cz = 0; }
|
|
30
|
-
return [
|
|
31
|
-
xTimes, 0, 0, 0,
|
|
32
|
-
0, yTimes, 0, 0,
|
|
33
|
-
0, 0, zTimes, 0,
|
|
34
|
-
cx - cx * xTimes, cy - cy * yTimes, cz - cz * zTimes, 1
|
|
35
|
-
];
|
|
26
|
+
function _scale (xTimes, yTimes, zTimes, cx, cy, cz) {
|
|
27
|
+
if (cx === void 0) { cx = 0; }
|
|
28
|
+
if (cy === void 0) { cy = 0; }
|
|
29
|
+
if (cz === void 0) { cz = 0; }
|
|
30
|
+
return [
|
|
31
|
+
xTimes, 0, 0, 0,
|
|
32
|
+
0, yTimes, 0, 0,
|
|
33
|
+
0, 0, zTimes, 0,
|
|
34
|
+
cx - cx * xTimes, cy - cy * yTimes, cz - cz * zTimes, 1
|
|
35
|
+
];
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
function _transform (a1, b1, c1, a2, b2, c2) {
|
|
39
|
-
if (typeof a1 === 'number' && typeof b1 === 'number') {
|
|
40
|
-
if (typeof c1 !== 'number') {
|
|
41
|
-
c1 = 0;
|
|
42
|
-
a2 = a1;
|
|
43
|
-
b2 = b1;
|
|
44
|
-
c2 = 1;
|
|
45
|
-
}
|
|
46
|
-
else if (typeof a2 !== 'number' || typeof b2 !== 'number' || typeof c2 !== 'number') {
|
|
47
|
-
a2 = a1;
|
|
48
|
-
b2 = b1;
|
|
49
|
-
c2 = c1;
|
|
50
|
-
a1 = 0;
|
|
51
|
-
b1 = 0;
|
|
52
|
-
c1 = 0;
|
|
53
|
-
}
|
|
54
|
-
if (a1 == a2 && b1 == b2 && c1 == c2)
|
|
55
|
-
throw new Error('It\'s not a legitimate ray!');
|
|
56
|
-
var sqrt1 = Math.sqrt((a2 - a1) * (a2 - a1) + (b2 - b1) * (b2 - b1)), cos1 = sqrt1 != 0 ? (b2 - b1) / sqrt1 : 1, sin1 = sqrt1 != 0 ? (a2 - a1) / sqrt1 : 0, b = (a2 - a1) * sin1 + (b2 - b1) * cos1, c = c2 - c1, sqrt2 = Math.sqrt(b * b + c * c), cos2 = sqrt2 != 0 ? c / sqrt2 : 1, sin2 = sqrt2 != 0 ? b / sqrt2 : 0;
|
|
57
|
-
return [
|
|
58
|
-
[
|
|
59
|
-
cos1, cos2 * sin1, sin1 * sin2, 0,
|
|
60
|
-
-sin1, cos1 * cos2, cos1 * sin2, 0,
|
|
61
|
-
0, -sin2, cos2, 0,
|
|
62
|
-
b1 * sin1 - a1 * cos1, c1 * sin2 - a1 * sin1 * cos2 - b1 * cos1 * cos2, -a1 * sin1 * sin2 - b1 * cos1 * sin2 - c1 * cos2, 1
|
|
63
|
-
],
|
|
64
|
-
[
|
|
65
|
-
cos1, -sin1, 0, 0,
|
|
66
|
-
cos2 * sin1, cos2 * cos1, -sin2, 0,
|
|
67
|
-
sin1 * sin2, cos1 * sin2, cos2, 0,
|
|
68
|
-
a1, b1, c1, 1
|
|
69
|
-
]
|
|
70
|
-
];
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
throw new Error('a1 and b1 is required!');
|
|
74
|
-
}
|
|
38
|
+
function _transform (a1, b1, c1, a2, b2, c2) {
|
|
39
|
+
if (typeof a1 === 'number' && typeof b1 === 'number') {
|
|
40
|
+
if (typeof c1 !== 'number') {
|
|
41
|
+
c1 = 0;
|
|
42
|
+
a2 = a1;
|
|
43
|
+
b2 = b1;
|
|
44
|
+
c2 = 1;
|
|
45
|
+
}
|
|
46
|
+
else if (typeof a2 !== 'number' || typeof b2 !== 'number' || typeof c2 !== 'number') {
|
|
47
|
+
a2 = a1;
|
|
48
|
+
b2 = b1;
|
|
49
|
+
c2 = c1;
|
|
50
|
+
a1 = 0;
|
|
51
|
+
b1 = 0;
|
|
52
|
+
c1 = 0;
|
|
53
|
+
}
|
|
54
|
+
if (a1 == a2 && b1 == b2 && c1 == c2)
|
|
55
|
+
throw new Error('It\'s not a legitimate ray!');
|
|
56
|
+
var sqrt1 = Math.sqrt((a2 - a1) * (a2 - a1) + (b2 - b1) * (b2 - b1)), cos1 = sqrt1 != 0 ? (b2 - b1) / sqrt1 : 1, sin1 = sqrt1 != 0 ? (a2 - a1) / sqrt1 : 0, b = (a2 - a1) * sin1 + (b2 - b1) * cos1, c = c2 - c1, sqrt2 = Math.sqrt(b * b + c * c), cos2 = sqrt2 != 0 ? c / sqrt2 : 1, sin2 = sqrt2 != 0 ? b / sqrt2 : 0;
|
|
57
|
+
return [
|
|
58
|
+
[
|
|
59
|
+
cos1, cos2 * sin1, sin1 * sin2, 0,
|
|
60
|
+
-sin1, cos1 * cos2, cos1 * sin2, 0,
|
|
61
|
+
0, -sin2, cos2, 0,
|
|
62
|
+
b1 * sin1 - a1 * cos1, c1 * sin2 - a1 * sin1 * cos2 - b1 * cos1 * cos2, -a1 * sin1 * sin2 - b1 * cos1 * sin2 - c1 * cos2, 1
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
cos1, -sin1, 0, 0,
|
|
66
|
+
cos2 * sin1, cos2 * cos1, -sin2, 0,
|
|
67
|
+
sin1 * sin2, cos1 * sin2, cos2, 0,
|
|
68
|
+
a1, b1, c1, 1
|
|
69
|
+
]
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
throw new Error('a1 and b1 is required!');
|
|
74
|
+
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
var _multiply = function (matrix4, param) {
|
|
78
|
-
var newParam = [];
|
|
79
|
-
for (var i = 0; i < 4; i++)
|
|
80
|
-
for (var j = 0; j < param.length / 4; j++)
|
|
81
|
-
newParam[j * 4 + i] =
|
|
82
|
-
matrix4[i] * param[j * 4] +
|
|
83
|
-
matrix4[i + 4] * param[j * 4 + 1] +
|
|
84
|
-
matrix4[i + 8] * param[j * 4 + 2] +
|
|
85
|
-
matrix4[i + 12] * param[j * 4 + 3];
|
|
86
|
-
return newParam;
|
|
87
|
-
};
|
|
88
|
-
var __initMatrix4 = [
|
|
89
|
-
1, 0, 0, 0,
|
|
90
|
-
0, 1, 0, 0,
|
|
91
|
-
0, 0, 1, 0,
|
|
92
|
-
0, 0, 0, 1
|
|
93
|
-
];
|
|
94
|
-
var Matrix4 = (function () {
|
|
95
|
-
function Matrix4(initMatrix4) {
|
|
96
|
-
if (initMatrix4 === void 0) { initMatrix4 = __initMatrix4; }
|
|
97
|
-
this.name = 'Matrix4';
|
|
98
|
-
this.__matrix4 = initMatrix4;
|
|
99
|
-
}
|
|
100
|
-
Matrix4.prototype.setValue = function (initMatrix4) {
|
|
101
|
-
if (initMatrix4 === void 0) { initMatrix4 = __initMatrix4; }
|
|
102
|
-
this.__matrix4 = initMatrix4;
|
|
103
|
-
return this;
|
|
104
|
-
};
|
|
105
|
-
Matrix4.prototype.move = function (dis, a, b, c) {
|
|
106
|
-
if (c === void 0) { c = 0; }
|
|
107
|
-
this.__matrix4 = _multiply(_move(dis, a, b, c), this.__matrix4);
|
|
108
|
-
return this;
|
|
109
|
-
};
|
|
110
|
-
Matrix4.prototype.rotate = function (deg, a1, b1, c1, a2, b2, c2) {
|
|
111
|
-
var matrix4s = _transform(a1, b1, c1, a2, b2, c2);
|
|
112
|
-
this.__matrix4 = _multiply(_multiply(_multiply(matrix4s[1], _rotate(deg)), matrix4s[0]), this.__matrix4);
|
|
113
|
-
return this;
|
|
114
|
-
};
|
|
115
|
-
Matrix4.prototype.scale = function (xTimes, yTimes, zTimes, cx, cy, cz) {
|
|
116
|
-
if (cx === void 0) { cx = 0; }
|
|
117
|
-
if (cy === void 0) { cy = 0; }
|
|
118
|
-
if (cz === void 0) { cz = 0; }
|
|
119
|
-
this.__matrix4 = _multiply(_scale(xTimes, yTimes, zTimes, cx, cy, cz), this.__matrix4);
|
|
120
|
-
return this;
|
|
121
|
-
};
|
|
122
|
-
Matrix4.prototype.multiply = function (newMatrix4, flag) {
|
|
123
|
-
if (flag === void 0) { flag = false; }
|
|
124
|
-
this.__matrix4 = flag ? _multiply(this.__matrix4, newMatrix4) : _multiply(newMatrix4, this.__matrix4);
|
|
125
|
-
return this;
|
|
126
|
-
};
|
|
127
|
-
Matrix4.prototype.use = function (x, y, z, w) {
|
|
128
|
-
if (z === void 0) { z = 0; }
|
|
129
|
-
if (w === void 0) { w = 1; }
|
|
130
|
-
return _multiply(this.__matrix4, [x, y, z, w]);
|
|
131
|
-
};
|
|
132
|
-
Matrix4.prototype.value = function () {
|
|
133
|
-
return this.__matrix4;
|
|
134
|
-
};
|
|
135
|
-
return Matrix4;
|
|
77
|
+
var _multiply = function (matrix4, param) {
|
|
78
|
+
var newParam = [];
|
|
79
|
+
for (var i = 0; i < 4; i++)
|
|
80
|
+
for (var j = 0; j < param.length / 4; j++)
|
|
81
|
+
newParam[j * 4 + i] =
|
|
82
|
+
matrix4[i] * param[j * 4] +
|
|
83
|
+
matrix4[i + 4] * param[j * 4 + 1] +
|
|
84
|
+
matrix4[i + 8] * param[j * 4 + 2] +
|
|
85
|
+
matrix4[i + 12] * param[j * 4 + 3];
|
|
86
|
+
return newParam;
|
|
87
|
+
};
|
|
88
|
+
var __initMatrix4 = [
|
|
89
|
+
1, 0, 0, 0,
|
|
90
|
+
0, 1, 0, 0,
|
|
91
|
+
0, 0, 1, 0,
|
|
92
|
+
0, 0, 0, 1
|
|
93
|
+
];
|
|
94
|
+
var Matrix4 = (function () {
|
|
95
|
+
function Matrix4(initMatrix4) {
|
|
96
|
+
if (initMatrix4 === void 0) { initMatrix4 = __initMatrix4; }
|
|
97
|
+
this.name = 'Matrix4';
|
|
98
|
+
this.__matrix4 = initMatrix4;
|
|
99
|
+
}
|
|
100
|
+
Matrix4.prototype.setValue = function (initMatrix4) {
|
|
101
|
+
if (initMatrix4 === void 0) { initMatrix4 = __initMatrix4; }
|
|
102
|
+
this.__matrix4 = initMatrix4;
|
|
103
|
+
return this;
|
|
104
|
+
};
|
|
105
|
+
Matrix4.prototype.move = function (dis, a, b, c) {
|
|
106
|
+
if (c === void 0) { c = 0; }
|
|
107
|
+
this.__matrix4 = _multiply(_move(dis, a, b, c), this.__matrix4);
|
|
108
|
+
return this;
|
|
109
|
+
};
|
|
110
|
+
Matrix4.prototype.rotate = function (deg, a1, b1, c1, a2, b2, c2) {
|
|
111
|
+
var matrix4s = _transform(a1, b1, c1, a2, b2, c2);
|
|
112
|
+
this.__matrix4 = _multiply(_multiply(_multiply(matrix4s[1], _rotate(deg)), matrix4s[0]), this.__matrix4);
|
|
113
|
+
return this;
|
|
114
|
+
};
|
|
115
|
+
Matrix4.prototype.scale = function (xTimes, yTimes, zTimes, cx, cy, cz) {
|
|
116
|
+
if (cx === void 0) { cx = 0; }
|
|
117
|
+
if (cy === void 0) { cy = 0; }
|
|
118
|
+
if (cz === void 0) { cz = 0; }
|
|
119
|
+
this.__matrix4 = _multiply(_scale(xTimes, yTimes, zTimes, cx, cy, cz), this.__matrix4);
|
|
120
|
+
return this;
|
|
121
|
+
};
|
|
122
|
+
Matrix4.prototype.multiply = function (newMatrix4, flag) {
|
|
123
|
+
if (flag === void 0) { flag = false; }
|
|
124
|
+
this.__matrix4 = flag ? _multiply(this.__matrix4, newMatrix4) : _multiply(newMatrix4, this.__matrix4);
|
|
125
|
+
return this;
|
|
126
|
+
};
|
|
127
|
+
Matrix4.prototype.use = function (x, y, z, w) {
|
|
128
|
+
if (z === void 0) { z = 0; }
|
|
129
|
+
if (w === void 0) { w = 1; }
|
|
130
|
+
return _multiply(this.__matrix4, [x, y, z, w]);
|
|
131
|
+
};
|
|
132
|
+
Matrix4.prototype.value = function () {
|
|
133
|
+
return this.__matrix4;
|
|
134
|
+
};
|
|
135
|
+
return Matrix4;
|
|
136
136
|
}());
|
|
137
137
|
|
|
138
138
|
export { Matrix4 as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Matrix4 of VISLite JavaScript Library v1.4.0
|
|
2
|
+
* Matrix4 of VISLite JavaScript Library v1.4.0
|
|
3
3
|
* git+https://github.com/oi-contrib/VISLite.git
|
|
4
4
|
*/
|
|
5
5
|
var t=function(t,r){for(var i=[],o=0;o<4;o++)for(var n=0;n<r.length/4;n++)i[4*n+o]=t[o]*r[4*n]+t[o+4]*r[4*n+1]+t[o+8]*r[4*n+2]+t[o+12]*r[4*n+3];return i},r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],i=function(){function i(t){void 0===t&&(t=r),this.name="Matrix4",this.__matrix4=t}return i.prototype.setValue=function(t){return void 0===t&&(t=r),this.__matrix4=t,this},i.prototype.move=function(r,i,o,n){return void 0===n&&(n=0),this.__matrix4=t(function(t,r,i,o){void 0===o&&(o=0);var n=Math.sqrt(r*r+i*i+o*o);return[1,0,0,0,0,1,0,0,0,0,1,0,r*t/n,i*t/n,o*t/n,1]}(r,i,o,n),this.__matrix4),this},i.prototype.rotate=function(r,i,o,n,e,u,a){var s=function(t,r,i,o,n,e){if("number"==typeof t&&"number"==typeof r){if("number"!=typeof i?(i=0,o=t,n=r,e=1):"number"==typeof o&&"number"==typeof n&&"number"==typeof e||(o=t,n=r,e=i,t=0,r=0,i=0),t==o&&r==n&&i==e)throw new Error("It's not a legitimate ray!");var u=Math.sqrt((o-t)*(o-t)+(n-r)*(n-r)),a=0!=u?(n-r)/u:1,s=0!=u?(o-t)/u:0,h=(o-t)*s+(n-r)*a,_=e-i,f=Math.sqrt(h*h+_*_),m=0!=f?_/f:1,p=0!=f?h/f:0;return[[a,m*s,s*p,0,-s,a*m,a*p,0,0,-p,m,0,r*s-t*a,i*p-t*s*m-r*a*m,-t*s*p-r*a*p-i*m,1],[a,-s,0,0,m*s,m*a,-p,0,s*p,a*p,m,0,t,r,i,1]]}throw new Error("a1 and b1 is required!")}(i,o,n,e,u,a);return this.__matrix4=t(t(t(s[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)),s[0]),this.__matrix4),this},i.prototype.scale=function(r,i,o,n,e,u){return void 0===n&&(n=0),void 0===e&&(e=0),void 0===u&&(u=0),this.__matrix4=t(function(t,r,i,o,n,e){return void 0===o&&(o=0),void 0===n&&(n=0),void 0===e&&(e=0),[t,0,0,0,0,r,0,0,0,0,i,0,o-o*t,n-n*r,e-e*i,1]}(r,i,o,n,e,u),this.__matrix4),this},i.prototype.multiply=function(r,i){return void 0===i&&(i=!1),this.__matrix4=i?t(this.__matrix4,r):t(r,this.__matrix4),this},i.prototype.use=function(r,i,o,n){return void 0===o&&(o=0),void 0===n&&(n=1),t(this.__matrix4,[r,i,o,n])},i.prototype.value=function(){return this.__matrix4},i}();export{i as default};
|
package/lib/Mercator/index.es.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Mercator of VISLite JavaScript Library v1.4.0
|
|
2
|
+
* Mercator of VISLite JavaScript Library v1.4.0
|
|
3
3
|
* git+https://github.com/oi-contrib/VISLite.git
|
|
4
4
|
*/
|
|
5
|
-
var Mercator = (function () {
|
|
6
|
-
function Mercator(scale, center) {
|
|
7
|
-
if (scale === void 0) { scale = 7; }
|
|
8
|
-
if (center === void 0) { center = [107, 36]; }
|
|
9
|
-
this.name = 'Mercator';
|
|
10
|
-
var perimeter = 100 * scale * Math.PI;
|
|
11
|
-
var help = perimeter / 180;
|
|
12
|
-
var cx = help * center[0];
|
|
13
|
-
var cy = -1 * help * center[1];
|
|
14
|
-
this.use = function (λ, φ) {
|
|
15
|
-
return [
|
|
16
|
-
(help * λ - cx) * 0.8,
|
|
17
|
-
-1 * help * φ - cy,
|
|
18
|
-
0
|
|
19
|
-
];
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
return Mercator;
|
|
5
|
+
var Mercator = (function () {
|
|
6
|
+
function Mercator(scale, center) {
|
|
7
|
+
if (scale === void 0) { scale = 7; }
|
|
8
|
+
if (center === void 0) { center = [107, 36]; }
|
|
9
|
+
this.name = 'Mercator';
|
|
10
|
+
var perimeter = 100 * scale * Math.PI;
|
|
11
|
+
var help = perimeter / 180;
|
|
12
|
+
var cx = help * center[0];
|
|
13
|
+
var cy = -1 * help * center[1];
|
|
14
|
+
this.use = function (λ, φ) {
|
|
15
|
+
return [
|
|
16
|
+
(help * λ - cx) * 0.8,
|
|
17
|
+
-1 * help * φ - cy,
|
|
18
|
+
0
|
|
19
|
+
];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return Mercator;
|
|
23
23
|
}());
|
|
24
24
|
|
|
25
25
|
export { Mercator as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Mercator of VISLite JavaScript Library v1.4.0
|
|
2
|
+
* Mercator of VISLite JavaScript Library v1.4.0
|
|
3
3
|
* git+https://github.com/oi-contrib/VISLite.git
|
|
4
4
|
*/
|
|
5
5
|
var t=function(t,a){void 0===t&&(t=7),void 0===a&&(a=[107,36]),this.name="Mercator";var r=100*t*Math.PI/180,e=r*a[0],i=-1*r*a[1];this.use=function(t,a){return[.8*(r*t-e),-1*r*a-i,0]}};export{t as default};
|