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