@thi.ng/distance 2.4.26 → 2.4.28

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.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-10-30T14:31:56Z
3
+ - **Last updated**: 2023-11-09T10:02:12Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -130,7 +130,7 @@ For Node.js REPL:
130
130
  const distance = await import("@thi.ng/distance");
131
131
  ```
132
132
 
133
- Package sizes (brotli'd, pre-treeshake): ESM: 1.26 KB
133
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.42 KB
134
134
 
135
135
  ## Dependencies
136
136
 
package/eucledian.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { dist, dist2, dist3 } from "@thi.ng/vectors/dist";
2
2
  export class Eucledian {
3
+ metric;
3
4
  constructor(metric) {
4
5
  this.metric = metric;
5
6
  }
package/knearest.js CHANGED
@@ -19,15 +19,21 @@ import { DIST_SQ, DIST_SQ1, DIST_SQ2, DIST_SQ3 } from "./squared.js";
19
19
  * @typeParam T - indexed value
20
20
  */
21
21
  export class KNearest {
22
+ dist;
23
+ target;
24
+ k;
25
+ radius;
26
+ sorted;
27
+ _currR;
28
+ _heap = new Heap(null, {
29
+ compare: (a, b) => b[0] - a[0],
30
+ });
22
31
  constructor(dist, target, k, radius = Infinity, sorted = false) {
23
32
  this.dist = dist;
24
33
  this.target = target;
25
34
  this.k = k;
26
35
  this.radius = radius;
27
36
  this.sorted = sorted;
28
- this._heap = new Heap(null, {
29
- compare: (a, b) => b[0] - a[0],
30
- });
31
37
  this.radius = clamp0(radius);
32
38
  this.setK(k);
33
39
  }
package/manhattan.js CHANGED
@@ -42,6 +42,9 @@ import { distManhattan, distManhattan2, distManhattan3, } from "@thi.ng/vectors/
42
42
  * ```
43
43
  */
44
44
  export class Manhattan {
45
+ dim;
46
+ metric;
47
+ _invD;
45
48
  constructor(dim, metric) {
46
49
  this.dim = dim;
47
50
  this.metric = metric;
package/nearest.js CHANGED
@@ -9,6 +9,11 @@ import { DIST_SQ, DIST_SQ1, DIST_SQ2, DIST_SQ3 } from "./squared.js";
9
9
  * @typeParam T - indexed value
10
10
  */
11
11
  export class Nearest {
12
+ dist;
13
+ target;
14
+ radius;
15
+ _currR;
16
+ value;
12
17
  constructor(dist, target, radius = Infinity) {
13
18
  this.dist = dist;
14
19
  this.target = target;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/distance",
3
- "version": "2.4.26",
3
+ "version": "2.4.28",
4
4
  "description": "N-dimensional distance metrics & K-nearest neighborhoods for point queries",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -28,25 +28,24 @@
28
28
  "clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc",
29
29
  "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
30
  "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
31
- "doc:readme": "yarn doc:stats && tools:readme",
32
- "doc:stats": "tools:module-stats",
31
+ "doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
33
32
  "pub": "yarn npm publish --access public",
34
- "test": "testament test"
33
+ "test": "bun test"
35
34
  },
36
35
  "dependencies": {
37
- "@thi.ng/api": "^8.9.6",
38
- "@thi.ng/checks": "^3.4.6",
39
- "@thi.ng/errors": "^2.4.0",
40
- "@thi.ng/heaps": "^2.1.42",
41
- "@thi.ng/math": "^5.7.1",
42
- "@thi.ng/vectors": "^7.8.1"
36
+ "@thi.ng/api": "^8.9.7",
37
+ "@thi.ng/checks": "^3.4.7",
38
+ "@thi.ng/errors": "^2.4.1",
39
+ "@thi.ng/heaps": "^2.1.43",
40
+ "@thi.ng/math": "^5.7.2",
41
+ "@thi.ng/vectors": "^7.8.3"
43
42
  },
44
43
  "devDependencies": {
45
- "@microsoft/api-extractor": "^7.38.0",
46
- "@thi.ng/testament": "^0.3.24",
44
+ "@microsoft/api-extractor": "^7.38.2",
45
+ "@thi.ng/testament": "^0.4.0",
47
46
  "rimraf": "^5.0.5",
48
47
  "tools": "^0.0.1",
49
- "typedoc": "^0.25.2",
48
+ "typedoc": "^0.25.3",
50
49
  "typescript": "^5.2.2"
51
50
  },
52
51
  "keywords": [
@@ -112,5 +111,5 @@
112
111
  ],
113
112
  "year": 2021
114
113
  },
115
- "gitHead": "bfa16829786146bd24df3cdbd44649a45a603e44\n"
114
+ "gitHead": "9f4d8ad79bca1d68214fbc9bbc5fb55f5a445f7e\n"
116
115
  }
package/radial.js CHANGED
@@ -14,6 +14,11 @@ import { DIST_SQ, DIST_SQ1, DIST_SQ2, DIST_SQ3 } from "./squared.js";
14
14
  * @typeParam T - indexed value
15
15
  */
16
16
  export class Radial {
17
+ dist;
18
+ target;
19
+ radius;
20
+ _r;
21
+ _items;
17
22
  constructor(dist, target, radius = Infinity) {
18
23
  this.dist = dist;
19
24
  this.target = target;
package/squared.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { distSq, distSq2, distSq3 } from "@thi.ng/vectors/distsq";
2
2
  export class Squared {
3
+ metric;
3
4
  constructor(metric) {
4
5
  this.metric = metric;
5
6
  }