@thi.ng/distance 3.0.37 → 3.0.38
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 +24 -23
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
|
-
<!-- Please see: https://
|
|
3
|
-
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/distance)
|
|
6
6
|

|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
10
|
> This is one of 214 standalone projects, maintained as part
|
|
11
|
-
> of the [@thi.ng/umbrella](https://
|
|
11
|
+
> of the [@thi.ng/umbrella](https://codeberg.org/thi.ng/umbrella/) ecosystem
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
|
14
|
-
> 🚀 Please help me to work full-time on these projects by [sponsoring
|
|
15
|
-
>
|
|
14
|
+
> 🚀 Please help me to work full-time on these projects by [sponsoring
|
|
15
|
+
> me](https://codeberg.org/thi.ng/umbrella/src/branch/develop/CONTRIBUTING.md#donations).
|
|
16
|
+
> Thank you! ❤️
|
|
16
17
|
|
|
17
18
|
- [About](#about)
|
|
18
19
|
- [Distance metrics](#distance-metrics)
|
|
@@ -62,7 +63,7 @@ distance values. The following preset metrics are provided too:
|
|
|
62
63
|
Neighborhoods can be used to select n-D spatial items around a given target
|
|
63
64
|
location and an optional catchment radius (infinite by default). Neighborhoods
|
|
64
65
|
also use one of the given distance metrics and implement the widely used
|
|
65
|
-
[`IDeref`](https://
|
|
66
|
+
[`IDeref`](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/api/src/deref.ts)
|
|
66
67
|
interface to obtain the final query results.
|
|
67
68
|
|
|
68
69
|
Custom neighborhood selections can be defined via the
|
|
@@ -82,7 +83,7 @@ proximity.
|
|
|
82
83
|
An `INeighborhood` implementation for K-nearest neighbor queries around a given
|
|
83
84
|
target location, initial query radius and `IDistance` metric to determine
|
|
84
85
|
proximity. The K-nearest neighbors will be accumulated via an internal
|
|
85
|
-
[heap](https://
|
|
86
|
+
[heap](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/heaps) and
|
|
86
87
|
results can be optionally returned in order of proximity (via `.deref()` or
|
|
87
88
|
`.values()`). For K=1 it will be more efficient to use `Nearest` to avoid the
|
|
88
89
|
additional overhead.
|
|
@@ -97,22 +98,22 @@ will be accumulated in order of processing via an internal array.
|
|
|
97
98
|
|
|
98
99
|
**STABLE** - used in production
|
|
99
100
|
|
|
100
|
-
[Search or submit any issues for this package](https://
|
|
101
|
+
[Search or submit any issues for this package](https://codeberg.org/thi.ng/umbrella/issues?q=%5Bdistance%5D)
|
|
101
102
|
|
|
102
103
|
Work is underway integrating this approach into the spatial indexing data
|
|
103
104
|
structures provided by the
|
|
104
|
-
[@thi.ng/geom-accel](https://
|
|
105
|
+
[@thi.ng/geom-accel](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/geom-accel)
|
|
105
106
|
package.
|
|
106
107
|
|
|
107
108
|
## Support packages
|
|
108
109
|
|
|
109
|
-
- [@thi.ng/distance-transform](https://
|
|
110
|
+
- [@thi.ng/distance-transform](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/distance-transform) - Binary image to Distance Field transformation
|
|
110
111
|
|
|
111
112
|
## Related packages
|
|
112
113
|
|
|
113
|
-
- [@thi.ng/geom-accel](https://
|
|
114
|
-
- [@thi.ng/k-means](https://
|
|
115
|
-
- [@thi.ng/vectors](https://
|
|
114
|
+
- [@thi.ng/geom-accel](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/geom-accel) - n-D spatial indexing data structures with a shared ES6 Map/Set-like API
|
|
115
|
+
- [@thi.ng/k-means](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/k-means) - k-means & k-medians with customizable distance functions and centroid initializations for n-D vectors
|
|
116
|
+
- [@thi.ng/vectors](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/vectors) - Optimized 2d/3d/4d and arbitrary length vector operations, support for memory mapping/layouts
|
|
116
117
|
|
|
117
118
|
## Installation
|
|
118
119
|
|
|
@@ -144,24 +145,24 @@ Package sizes (brotli'd, pre-treeshake): ESM: 1.41 KB
|
|
|
144
145
|
|
|
145
146
|
## Dependencies
|
|
146
147
|
|
|
147
|
-
- [@thi.ng/api](https://
|
|
148
|
-
- [@thi.ng/checks](https://
|
|
149
|
-
- [@thi.ng/errors](https://
|
|
150
|
-
- [@thi.ng/heaps](https://
|
|
151
|
-
- [@thi.ng/math](https://
|
|
152
|
-
- [@thi.ng/vectors](https://
|
|
148
|
+
- [@thi.ng/api](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/api)
|
|
149
|
+
- [@thi.ng/checks](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/checks)
|
|
150
|
+
- [@thi.ng/errors](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/errors)
|
|
151
|
+
- [@thi.ng/heaps](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/heaps)
|
|
152
|
+
- [@thi.ng/math](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/math)
|
|
153
|
+
- [@thi.ng/vectors](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/vectors)
|
|
153
154
|
|
|
154
155
|
Note: @thi.ng/api is in _most_ cases a type-only import (not used at runtime)
|
|
155
156
|
|
|
156
157
|
## Usage examples
|
|
157
158
|
|
|
158
159
|
One project in this repo's
|
|
159
|
-
[/examples](https://
|
|
160
|
+
[/examples](https://codeberg.org/thi.ng/umbrella/src/branch/develop/examples)
|
|
160
161
|
directory is using this package:
|
|
161
162
|
|
|
162
|
-
| Screenshot | Description | Live demo | Source
|
|
163
|
-
|
|
164
|
-
| <img src="https://
|
|
163
|
+
| Screenshot | Description | Live demo | Source |
|
|
164
|
+
|:---------------------------------------------------------------------------------------------------------------------|:------------------------------------------|:----------------------------------------------------|:-----------------------------------------------------------------------------------------|
|
|
165
|
+
| <img src="https://codeberg.org/thi.ng/umbrella/media/branch/develop/assets/examples/geom-knn-hash.jpg" width="240"/> | K-nearest neighbor search in an hash grid | [Demo](https://demo.thi.ng/umbrella/geom-knn-hash/) | [Source](https://codeberg.org/thi.ng/umbrella/src/branch/develop/examples/geom-knn-hash) |
|
|
165
166
|
|
|
166
167
|
## API
|
|
167
168
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/distance",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.38",
|
|
4
4
|
"description": "N-dimensional distance metrics & K-nearest neighborhoods for point queries",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://
|
|
11
|
+
"url": "git+https://codeberg.org/thi.ng/umbrella.git",
|
|
12
12
|
"directory": "packages/distance"
|
|
13
13
|
},
|
|
14
14
|
"homepage": "https://thi.ng/distance",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.12.
|
|
44
|
-
"@thi.ng/checks": "^3.8.
|
|
45
|
-
"@thi.ng/errors": "^2.6.
|
|
46
|
-
"@thi.ng/heaps": "^2.1.
|
|
47
|
-
"@thi.ng/math": "^5.15.
|
|
48
|
-
"@thi.ng/vectors": "^8.6.
|
|
43
|
+
"@thi.ng/api": "^8.12.18",
|
|
44
|
+
"@thi.ng/checks": "^3.8.8",
|
|
45
|
+
"@thi.ng/errors": "^2.6.7",
|
|
46
|
+
"@thi.ng/heaps": "^2.1.127",
|
|
47
|
+
"@thi.ng/math": "^5.15.7",
|
|
48
|
+
"@thi.ng/vectors": "^8.6.26"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"esbuild": "^0.27.2",
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
],
|
|
130
130
|
"year": 2021
|
|
131
131
|
},
|
|
132
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "8ddf86ea0a1e658ddbf19cc645b29d0c176e29c4\n"
|
|
133
133
|
}
|