microboard-ui-temp 0.1.99 → 0.1.101

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/index.js CHANGED
@@ -229537,14 +229537,14 @@ class SpatialIndex {
229537
229537
  return this.Mbr;
229538
229538
  }
229539
229539
  getNearestTo(point32, maxItems, filter, maxDistance) {
229540
- const allItems = this.getItemsWithIncludedChildren(this.itemsArray);
229541
- const filtered = allItems.filter((item) => filter(item));
229542
- const withDistance = filtered.map((item) => ({
229540
+ const items = this.getItemsWithIncludedChildren(this.itemsArray);
229541
+ const filteredItems = filter ? items.filter(filter) : items;
229542
+ const itemsWithDistance = filteredItems.map((item) => ({
229543
229543
  item,
229544
- distance: point32.getDistance(item.getMbr().getCenter())
229545
- })).filter(({ distance }) => distance <= maxDistance);
229546
- withDistance.sort((a, b) => a.distance - b.distance);
229547
- return withDistance.slice(0, maxItems).map(({ item }) => item);
229544
+ distance: item.getMbr().getDistanceToPoint(point32)
229545
+ }));
229546
+ const inRange = itemsWithDistance.filter((x) => x.distance <= maxDistance);
229547
+ return inRange.sort((a, b) => a.distance - b.distance).slice(0, maxItems).map((x) => x.item);
229548
229548
  }
229549
229549
  list() {
229550
229550
  return this.getItemsWithIncludedChildren(this.itemsArray).concat();
package/dist/spa.js CHANGED
@@ -229537,14 +229537,14 @@ class SpatialIndex {
229537
229537
  return this.Mbr;
229538
229538
  }
229539
229539
  getNearestTo(point32, maxItems, filter, maxDistance) {
229540
- const allItems = this.getItemsWithIncludedChildren(this.itemsArray);
229541
- const filtered = allItems.filter((item) => filter(item));
229542
- const withDistance = filtered.map((item) => ({
229540
+ const items = this.getItemsWithIncludedChildren(this.itemsArray);
229541
+ const filteredItems = filter ? items.filter(filter) : items;
229542
+ const itemsWithDistance = filteredItems.map((item) => ({
229543
229543
  item,
229544
- distance: point32.getDistance(item.getMbr().getCenter())
229545
- })).filter(({ distance }) => distance <= maxDistance);
229546
- withDistance.sort((a, b) => a.distance - b.distance);
229547
- return withDistance.slice(0, maxItems).map(({ item }) => item);
229544
+ distance: item.getMbr().getDistanceToPoint(point32)
229545
+ }));
229546
+ const inRange = itemsWithDistance.filter((x) => x.distance <= maxDistance);
229547
+ return inRange.sort((a, b) => a.distance - b.distance).slice(0, maxItems).map((x) => x.item);
229548
229548
  }
229549
229549
  list() {
229550
229550
  return this.getItemsWithIncludedChildren(this.itemsArray).concat();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-ui-temp",
3
- "version": "0.1.99",
3
+ "version": "0.1.101",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",
@@ -60,7 +60,7 @@
60
60
  "i18next-browser-languagedetector": "^8.2.0",
61
61
  "js-cookie": "^3.0.5",
62
62
  "jwt-decode": "^4.0.0",
63
- "microboard-temp": "^0.5.35",
63
+ "microboard-temp": "^0.5.37",
64
64
  "nanoid": "^5.1.5",
65
65
  "prop-types": "^15.8.1",
66
66
  "react-hot-toast": "2.4.1",