vis-why 1.2.1 → 1.2.3
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/Readme.md +7 -7
- package/index.js +5 -4
- package/package.json +6 -10
- package/History.md +0 -71
package/Readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[![NPM version][npm-image]][npm-url]
|
|
2
|
-
[![Build Status][
|
|
3
|
-
[![Dependency Status][
|
|
2
|
+
[![Build Status][build-image]][build-url]
|
|
3
|
+
[![Dependency Status][deps-image]][deps-url]
|
|
4
4
|
|
|
5
5
|
# vis-why
|
|
6
6
|
|
|
@@ -51,11 +51,11 @@ simplify(poly, 4, area);
|
|
|
51
51
|
[npm]: https://www.npmjs.org/
|
|
52
52
|
[vis-why]: https://hydra.hull.ac.uk/resources/hull:8338
|
|
53
53
|
|
|
54
|
-
[npm-image]: https://img.shields.io/npm/v/vis-why
|
|
54
|
+
[npm-image]: https://img.shields.io/npm/v/vis-why
|
|
55
55
|
[npm-url]: https://npmjs.org/package/vis-why
|
|
56
56
|
|
|
57
|
-
[
|
|
58
|
-
[
|
|
57
|
+
[build-url]: https://github.com/pirxpilot/vis-why/actions/workflows/check.yaml
|
|
58
|
+
[build-image]: https://img.shields.io/github/actions/workflow/status/pirxpilot/vis-why/check.yaml?branch=main
|
|
59
59
|
|
|
60
|
-
[
|
|
61
|
-
[
|
|
60
|
+
[deps-image]: https://img.shields.io/librariesio/release/npm/vis-why
|
|
61
|
+
[deps-url]: https://libraries.io/npm/vis-why
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var heap = require('
|
|
1
|
+
var heap = require('sterta');
|
|
2
2
|
|
|
3
3
|
module.exports = simplify;
|
|
4
4
|
|
|
@@ -20,7 +20,8 @@ function calculate(poly, area) {
|
|
|
20
20
|
ts = { heap: heap(areaCompare, true) },
|
|
21
21
|
triangle,
|
|
22
22
|
trianglePrev,
|
|
23
|
-
a = poly[0],
|
|
23
|
+
a = poly[0],
|
|
24
|
+
b, c = poly[1],
|
|
24
25
|
list = [];
|
|
25
26
|
|
|
26
27
|
// calculate areas
|
|
@@ -62,7 +63,7 @@ function eliminate(ts, limit, area) {
|
|
|
62
63
|
nextTriangle,
|
|
63
64
|
counter = ts.heap.size() - limit;
|
|
64
65
|
|
|
65
|
-
while(counter-- > 0) {
|
|
66
|
+
while (counter-- > 0) {
|
|
66
67
|
triangle = ts.heap.pop();
|
|
67
68
|
prevTriangle = triangle.prev;
|
|
68
69
|
nextTriangle = triangle.next;
|
|
@@ -91,7 +92,7 @@ function eliminate(ts, limit, area) {
|
|
|
91
92
|
function collect(triangle) {
|
|
92
93
|
var poly = [triangle.a];
|
|
93
94
|
|
|
94
|
-
while(true) {
|
|
95
|
+
while (true) {
|
|
95
96
|
poly.push(triangle.b);
|
|
96
97
|
if (!triangle.next) {
|
|
97
98
|
break;
|
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vis-why",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "M Visvalingam and J D Whyatt line simplification algorithm",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "make check"
|
|
8
8
|
},
|
|
9
|
-
"repository":
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "https://github.com/pirxpilot/vis-why.git"
|
|
12
|
-
},
|
|
9
|
+
"repository": "pirxpilot/vis-why",
|
|
13
10
|
"keywords": [
|
|
14
11
|
"line",
|
|
15
12
|
"simplification"
|
|
@@ -18,16 +15,15 @@
|
|
|
18
15
|
"license": "MIT",
|
|
19
16
|
"homepage": "https://github.com/pirxpilot/vis-why",
|
|
20
17
|
"devDependencies": {
|
|
18
|
+
"@pirxpilot/jshint": "~3",
|
|
21
19
|
"@pirxpilot/matcha": "~1",
|
|
22
|
-
"jshint": "~2",
|
|
23
|
-
"mocha": "~3",
|
|
24
20
|
"polyline-encoded": "^0.0.8",
|
|
25
|
-
"should": "~
|
|
21
|
+
"should": "~13"
|
|
26
22
|
},
|
|
27
23
|
"dependencies": {
|
|
28
|
-
"
|
|
24
|
+
"sterta": "^2.2.1"
|
|
29
25
|
},
|
|
30
26
|
"files": [
|
|
31
27
|
"index.js"
|
|
32
28
|
]
|
|
33
|
-
}
|
|
29
|
+
}
|
package/History.md
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
1.2.1 / 2017-02-17
|
|
3
|
-
==================
|
|
4
|
-
|
|
5
|
-
* change name to vis-why
|
|
6
|
-
* remove obsolete component.json
|
|
7
|
-
|
|
8
|
-
1.2.0 / 2017-02-08
|
|
9
|
-
==================
|
|
10
|
-
|
|
11
|
-
* add support for custom area function
|
|
12
|
-
|
|
13
|
-
1.1.6 / 2017-01-12
|
|
14
|
-
==================
|
|
15
|
-
|
|
16
|
-
* fix elimination of empty triangles
|
|
17
|
-
|
|
18
|
-
1.1.5 / 2016-12-15
|
|
19
|
-
==================
|
|
20
|
-
|
|
21
|
-
* use @pirxpilot/matcha instead od matcha
|
|
22
|
-
* minor adjustment to calculate loop
|
|
23
|
-
|
|
24
|
-
1.1.4 / 2016-12-10
|
|
25
|
-
==================
|
|
26
|
-
|
|
27
|
-
* fix iexception for duplicate and co-linear stops
|
|
28
|
-
|
|
29
|
-
1.1.3 / 2016-12-08
|
|
30
|
-
==================
|
|
31
|
-
|
|
32
|
-
* make it faster - especially for polylines longer than 1k items
|
|
33
|
-
|
|
34
|
-
1.1.2 / 2016-12-06
|
|
35
|
-
==================
|
|
36
|
-
|
|
37
|
-
* properly collect triangles
|
|
38
|
-
* add basic benchmarks
|
|
39
|
-
* let all test run
|
|
40
|
-
|
|
41
|
-
1.1.1 / 2016-11-18
|
|
42
|
-
==================
|
|
43
|
-
|
|
44
|
-
* fix exception when applied to straight line case
|
|
45
|
-
|
|
46
|
-
1.1.0 / 2016-11-06
|
|
47
|
-
==================
|
|
48
|
-
|
|
49
|
-
* fix Makefile test target
|
|
50
|
-
* upgrade code42day-binary-heap to 2.0.0
|
|
51
|
-
* upgrade mocha to ~3 and should to ~11
|
|
52
|
-
|
|
53
|
-
1.0.3 / 2015-11-11
|
|
54
|
-
==================
|
|
55
|
-
|
|
56
|
-
* switch to browserify build
|
|
57
|
-
|
|
58
|
-
1.0.2 / 2014-07-30
|
|
59
|
-
==================
|
|
60
|
-
|
|
61
|
-
* declare code42day/binary-heap dependency properly
|
|
62
|
-
|
|
63
|
-
1.0.1 / 2014-07-30
|
|
64
|
-
==================
|
|
65
|
-
|
|
66
|
-
* optimization: rebuild triangle heap
|
|
67
|
-
|
|
68
|
-
1.0.0 / 2014-07-29
|
|
69
|
-
==================
|
|
70
|
-
|
|
71
|
-
* Initial implementation
|