microboard-temp 0.5.36 → 0.5.37
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/dist/cjs/browser.js +8 -7
- package/dist/cjs/index.js +8 -7
- package/dist/cjs/node.js +8 -7
- package/dist/esm/browser.js +8 -7
- package/dist/esm/index.js +8 -7
- package/dist/esm/node.js +8 -7
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -21044,13 +21044,14 @@ class SpatialIndex {
|
|
|
21044
21044
|
return this.Mbr;
|
|
21045
21045
|
}
|
|
21046
21046
|
getNearestTo(point3, maxItems, filter, maxDistance) {
|
|
21047
|
-
const
|
|
21048
|
-
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
|
|
21052
|
-
});
|
|
21053
|
-
|
|
21047
|
+
const items = this.getItemsWithIncludedChildren(this.itemsArray);
|
|
21048
|
+
const filteredItems = filter ? items.filter(filter) : items;
|
|
21049
|
+
const itemsWithDistance = filteredItems.map((item) => ({
|
|
21050
|
+
item,
|
|
21051
|
+
distance: item.getMbr().getDistanceToPoint(point3)
|
|
21052
|
+
}));
|
|
21053
|
+
const inRange = itemsWithDistance.filter((x) => x.distance <= maxDistance);
|
|
21054
|
+
return inRange.sort((a, b) => a.distance - b.distance).slice(0, maxItems).map((x) => x.item);
|
|
21054
21055
|
}
|
|
21055
21056
|
list() {
|
|
21056
21057
|
return this.getItemsWithIncludedChildren(this.itemsArray).concat();
|
package/dist/cjs/index.js
CHANGED
|
@@ -21044,13 +21044,14 @@ class SpatialIndex {
|
|
|
21044
21044
|
return this.Mbr;
|
|
21045
21045
|
}
|
|
21046
21046
|
getNearestTo(point3, maxItems, filter, maxDistance) {
|
|
21047
|
-
const
|
|
21048
|
-
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
|
|
21052
|
-
});
|
|
21053
|
-
|
|
21047
|
+
const items = this.getItemsWithIncludedChildren(this.itemsArray);
|
|
21048
|
+
const filteredItems = filter ? items.filter(filter) : items;
|
|
21049
|
+
const itemsWithDistance = filteredItems.map((item) => ({
|
|
21050
|
+
item,
|
|
21051
|
+
distance: item.getMbr().getDistanceToPoint(point3)
|
|
21052
|
+
}));
|
|
21053
|
+
const inRange = itemsWithDistance.filter((x) => x.distance <= maxDistance);
|
|
21054
|
+
return inRange.sort((a, b) => a.distance - b.distance).slice(0, maxItems).map((x) => x.item);
|
|
21054
21055
|
}
|
|
21055
21056
|
list() {
|
|
21056
21057
|
return this.getItemsWithIncludedChildren(this.itemsArray).concat();
|
package/dist/cjs/node.js
CHANGED
|
@@ -23516,13 +23516,14 @@ class SpatialIndex {
|
|
|
23516
23516
|
return this.Mbr;
|
|
23517
23517
|
}
|
|
23518
23518
|
getNearestTo(point3, maxItems, filter, maxDistance) {
|
|
23519
|
-
const
|
|
23520
|
-
|
|
23521
|
-
|
|
23522
|
-
|
|
23523
|
-
|
|
23524
|
-
});
|
|
23525
|
-
|
|
23519
|
+
const items = this.getItemsWithIncludedChildren(this.itemsArray);
|
|
23520
|
+
const filteredItems = filter ? items.filter(filter) : items;
|
|
23521
|
+
const itemsWithDistance = filteredItems.map((item) => ({
|
|
23522
|
+
item,
|
|
23523
|
+
distance: item.getMbr().getDistanceToPoint(point3)
|
|
23524
|
+
}));
|
|
23525
|
+
const inRange = itemsWithDistance.filter((x) => x.distance <= maxDistance);
|
|
23526
|
+
return inRange.sort((a, b) => a.distance - b.distance).slice(0, maxItems).map((x) => x.item);
|
|
23526
23527
|
}
|
|
23527
23528
|
list() {
|
|
23528
23529
|
return this.getItemsWithIncludedChildren(this.itemsArray).concat();
|
package/dist/esm/browser.js
CHANGED
|
@@ -20890,13 +20890,14 @@ class SpatialIndex {
|
|
|
20890
20890
|
return this.Mbr;
|
|
20891
20891
|
}
|
|
20892
20892
|
getNearestTo(point3, maxItems, filter, maxDistance) {
|
|
20893
|
-
const
|
|
20894
|
-
|
|
20895
|
-
|
|
20896
|
-
|
|
20897
|
-
|
|
20898
|
-
});
|
|
20899
|
-
|
|
20893
|
+
const items = this.getItemsWithIncludedChildren(this.itemsArray);
|
|
20894
|
+
const filteredItems = filter ? items.filter(filter) : items;
|
|
20895
|
+
const itemsWithDistance = filteredItems.map((item) => ({
|
|
20896
|
+
item,
|
|
20897
|
+
distance: item.getMbr().getDistanceToPoint(point3)
|
|
20898
|
+
}));
|
|
20899
|
+
const inRange = itemsWithDistance.filter((x) => x.distance <= maxDistance);
|
|
20900
|
+
return inRange.sort((a, b) => a.distance - b.distance).slice(0, maxItems).map((x) => x.item);
|
|
20900
20901
|
}
|
|
20901
20902
|
list() {
|
|
20902
20903
|
return this.getItemsWithIncludedChildren(this.itemsArray).concat();
|
package/dist/esm/index.js
CHANGED
|
@@ -20883,13 +20883,14 @@ class SpatialIndex {
|
|
|
20883
20883
|
return this.Mbr;
|
|
20884
20884
|
}
|
|
20885
20885
|
getNearestTo(point3, maxItems, filter, maxDistance) {
|
|
20886
|
-
const
|
|
20887
|
-
|
|
20888
|
-
|
|
20889
|
-
|
|
20890
|
-
|
|
20891
|
-
});
|
|
20892
|
-
|
|
20886
|
+
const items = this.getItemsWithIncludedChildren(this.itemsArray);
|
|
20887
|
+
const filteredItems = filter ? items.filter(filter) : items;
|
|
20888
|
+
const itemsWithDistance = filteredItems.map((item) => ({
|
|
20889
|
+
item,
|
|
20890
|
+
distance: item.getMbr().getDistanceToPoint(point3)
|
|
20891
|
+
}));
|
|
20892
|
+
const inRange = itemsWithDistance.filter((x) => x.distance <= maxDistance);
|
|
20893
|
+
return inRange.sort((a, b) => a.distance - b.distance).slice(0, maxItems).map((x) => x.item);
|
|
20893
20894
|
}
|
|
20894
20895
|
list() {
|
|
20895
20896
|
return this.getItemsWithIncludedChildren(this.itemsArray).concat();
|
package/dist/esm/node.js
CHANGED
|
@@ -23350,13 +23350,14 @@ class SpatialIndex {
|
|
|
23350
23350
|
return this.Mbr;
|
|
23351
23351
|
}
|
|
23352
23352
|
getNearestTo(point3, maxItems, filter, maxDistance) {
|
|
23353
|
-
const
|
|
23354
|
-
|
|
23355
|
-
|
|
23356
|
-
|
|
23357
|
-
|
|
23358
|
-
});
|
|
23359
|
-
|
|
23353
|
+
const items = this.getItemsWithIncludedChildren(this.itemsArray);
|
|
23354
|
+
const filteredItems = filter ? items.filter(filter) : items;
|
|
23355
|
+
const itemsWithDistance = filteredItems.map((item) => ({
|
|
23356
|
+
item,
|
|
23357
|
+
distance: item.getMbr().getDistanceToPoint(point3)
|
|
23358
|
+
}));
|
|
23359
|
+
const inRange = itemsWithDistance.filter((x) => x.distance <= maxDistance);
|
|
23360
|
+
return inRange.sort((a, b) => a.distance - b.distance).slice(0, maxItems).map((x) => x.item);
|
|
23360
23361
|
}
|
|
23361
23362
|
list() {
|
|
23362
23363
|
return this.getItemsWithIncludedChildren(this.itemsArray).concat();
|