geojs 1.14.0 → 1.14.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/geo.js +47 -22
- package/geo.lean.js +47 -22
- package/geo.lean.min.js +2 -2
- package/geo.min.js +4 -4
- package/package.json +5 -5
- package/src/quadFeature.js +5 -0
- package/src/trackFeature.js +2 -0
- package/src/webgl/lineFeature.vert +26 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geojs",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.2",
|
|
4
4
|
"description": "JavaScript Geo Visualization and Analysis Library",
|
|
5
5
|
"homepage": "https://github.com/OpenGeoscience/geojs",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"url": "https://github.com/OpenGeoscience/geojs"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"canvas": "^
|
|
15
|
+
"canvas": "^3.0.0",
|
|
16
16
|
"color-name": "^2.0.0",
|
|
17
17
|
"docdash": "^2.0.1",
|
|
18
18
|
"earcut": "^3.0.0",
|
|
@@ -30,12 +30,13 @@
|
|
|
30
30
|
"@egjs/hammerjs": "^2.0.8",
|
|
31
31
|
"d3": "^7.8.5",
|
|
32
32
|
"glslang-validator-prebuilt-predownloaded": "^0.0.2",
|
|
33
|
-
"vtk.js": "
|
|
33
|
+
"vtk.js": "<32.10.0 || >32.10.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.17.0",
|
|
37
37
|
"@babel/plugin-proposal-class-properties": "^7.16.5",
|
|
38
38
|
"@babel/preset-env": "^7.16.5",
|
|
39
|
+
"@fontsource/lato": "^5.1.1",
|
|
39
40
|
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
40
41
|
"babel-loader": "^9.0.1",
|
|
41
42
|
"babel-plugin-istanbul": "^7.0.0",
|
|
@@ -91,9 +92,8 @@
|
|
|
91
92
|
"tar": "^7.4.3",
|
|
92
93
|
"terser-webpack-plugin": "^5.3.1",
|
|
93
94
|
"touch-emulator": "^1.0.0",
|
|
94
|
-
"typeface-lato": "^1.1.13",
|
|
95
95
|
"webpack": "^5.68.0",
|
|
96
|
-
"webpack-cli": "^
|
|
96
|
+
"webpack-cli": "^6.0.1",
|
|
97
97
|
"webpack-merge": "^6.0.1",
|
|
98
98
|
"webpack-string-replacer": "^0.0.20"
|
|
99
99
|
},
|
package/src/quadFeature.js
CHANGED
|
@@ -237,6 +237,11 @@ var quadFeature = function (arg) {
|
|
|
237
237
|
coordbasis.y = 1 - coordbasis.y;
|
|
238
238
|
}
|
|
239
239
|
if (coordbasis) {
|
|
240
|
+
if (quad.crop && quad.crop.x !== undefined && quad.crop.y !== undefined && (coordbasis.x >= quad.crop.x || coordbasis.y >= quad.crop.y)) {
|
|
241
|
+
indices.pop();
|
|
242
|
+
found.pop();
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
240
245
|
extra[quad.idx] = {basis: coordbasis, _quad: quad};
|
|
241
246
|
}
|
|
242
247
|
}
|
package/src/trackFeature.js
CHANGED
|
@@ -216,6 +216,8 @@ var trackFeature = function (arg) {
|
|
|
216
216
|
highidx = testidx;
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
+
// todo: if we want non-linear travel between points, we would adjust
|
|
220
|
+
// fl and fh here
|
|
219
221
|
var fh = (time - lowt) / (hight - lowt), fl = 1 - fh;
|
|
220
222
|
return {posidx0: lowidx, posidx1: highidx, factor0: fl, factor1: fh, angidx0: lowidx, angidx1: highidx};
|
|
221
223
|
});
|
|
@@ -62,6 +62,29 @@ void main(void)
|
|
|
62
62
|
gl_Position = vec4(2.0, 2.0, 0.0, 1.0);
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
+
float lineLength = length(vec2(deltaCB.x, deltaCB.y / aspect)) / pixelWidth;
|
|
66
|
+
// if lines reverse upon themselves and are not nearly the same length, skip
|
|
67
|
+
// joins. This is a heuristic; the correct method would to be to pass some
|
|
68
|
+
// sort of length of the adjacent line to the fragment renderer and adjust
|
|
69
|
+
// which fragments are rendered, but this is much more complex.
|
|
70
|
+
float abLimit = length(vec2(A.x - B.x, (A.y - B.y) / aspect)) / pixelWidth;
|
|
71
|
+
float dcLimit = length(vec2(D.x - C.x, (D.y - C.y) / aspect)) / pixelWidth;
|
|
72
|
+
if (abLimit >= lineLength - antialiasing - strokeWidth * 0.5 && abLimit <= lineLength + antialiasing + strokeWidth * 0.5) {
|
|
73
|
+
abLimit = 0.0001;
|
|
74
|
+
} else {
|
|
75
|
+
if (abLimit < lineLength) abLimit = lineLength;
|
|
76
|
+
abLimit = (strokeWidth - antialiasing) / (abLimit + antialiasing);
|
|
77
|
+
if (abLimit < 0.0001) abLimit = 0.0001;
|
|
78
|
+
if (abLimit > 0.1) abLimit = 0.1;
|
|
79
|
+
}
|
|
80
|
+
if (dcLimit >= lineLength - antialiasing - strokeWidth * 0.5 && dcLimit <= lineLength + antialiasing + strokeWidth * 0.5) {
|
|
81
|
+
dcLimit = 0.0001;
|
|
82
|
+
} else {
|
|
83
|
+
if (dcLimit < lineLength) dcLimit = lineLength;
|
|
84
|
+
dcLimit = (strokeWidth - antialiasing) / (dcLimit + antialiasing);
|
|
85
|
+
if (dcLimit < 0.0001) dcLimit = 0.0001;
|
|
86
|
+
if (dcLimit > 0.1) dcLimit = 0.1;
|
|
87
|
+
}
|
|
65
88
|
float angleCB = atan2(deltaCB.y, deltaCB.x * aspect);
|
|
66
89
|
// values we need to pass along
|
|
67
90
|
strokeColorVar = vec4(strokeColor, strokeOpacity);
|
|
@@ -78,7 +101,7 @@ void main(void)
|
|
|
78
101
|
// by default, offset by the width and don't extend lines. Later,
|
|
79
102
|
// calculate line extensions based on end cap and end join modes
|
|
80
103
|
float yOffset = strokeWidth + antialiasing;
|
|
81
|
-
if (vertex == 0
|
|
104
|
+
if (vertex == 0) yOffset *= -1.0;
|
|
82
105
|
yOffset += strokeWidth * offset;
|
|
83
106
|
float xOffset = 0.0;
|
|
84
107
|
// end caps
|
|
@@ -105,7 +128,7 @@ void main(void)
|
|
|
105
128
|
angleABC = (mod(angleABC + 3.0 * PI, 2.0 * PI) - PI) / 2.0;
|
|
106
129
|
cosABC = cos(angleABC); sinABC = sin(angleABC);
|
|
107
130
|
// if this angle is close to flat, pass-through the join
|
|
108
|
-
if (nearMode >= 4 && cosABC > 0.999999) {
|
|
131
|
+
if (nearMode >= 4 && (cosABC > 0.999999 || cosABC < abLimit)) {
|
|
109
132
|
nearMode = 3;
|
|
110
133
|
}
|
|
111
134
|
// miter, miter-clip
|
|
@@ -138,7 +161,7 @@ void main(void)
|
|
|
138
161
|
angleBCD = (mod(angleBCD + 3.0 * PI, 2.0 * PI) - PI) / 2.0;
|
|
139
162
|
cosBCD = cos(angleBCD); sinBCD = sin(angleBCD);
|
|
140
163
|
// if this angle is close to flat, pass-through the join
|
|
141
|
-
if (farMode >= 4 && cosBCD > 0.999999) {
|
|
164
|
+
if (farMode >= 4 && (cosBCD > 0.999999 || cosBCD < dcLimit)) {
|
|
142
165
|
farMode = 3;
|
|
143
166
|
}
|
|
144
167
|
// miter, miter-clip
|
|
@@ -159,8 +182,6 @@ void main(void)
|
|
|
159
182
|
B.y + (xOffset * sin(angleCB) + yOffset * cos(angleCB)) * pixelWidth * aspect,
|
|
160
183
|
B.z, 1.0);
|
|
161
184
|
// store other values needed to determine which pixels to plot.
|
|
162
|
-
float lineLength = length(vec2(deltaCB.x, deltaCB.y / aspect)) / pixelWidth;
|
|
163
|
-
|
|
164
185
|
if (vertex == 0 || vertex == 1) {
|
|
165
186
|
subpos = vec4(xOffset, yOffset, lineLength - xOffset, strokeWidth);
|
|
166
187
|
info = vec4(float(nearMode), float(farMode), offset, 0.0);
|