@guardian/interactive-component-library 0.1.0-alpha.50 → 0.1.0-alpha.52

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.
@@ -306,9 +306,9 @@ function StackedBar({
306
306
  children: [content2, labelType === LabelType.hanging && !hideLabels && hangingLabelConfig.map((config, i) => renderLabel(config, i))]
307
307
  });
308
308
  }
309
- const svg$8 = "_svg_1cajk_6";
310
- const previous = "_previous_1cajk_12";
311
- const next = "_next_1cajk_16";
309
+ const svg$8 = "_svg_ihy3w_6";
310
+ const previous = "_previous_ihy3w_12";
311
+ const next = "_next_ihy3w_16";
312
312
  const defaultStyles$u = {
313
313
  svg: svg$8,
314
314
  previous,
@@ -6897,7 +6897,14 @@ class VectorSource {
6897
6897
  }
6898
6898
  getFeaturesAtCoordinate(coordinate) {
6899
6899
  const [lon, lat] = coordinate;
6900
- return knn$1(this._featuresRtree, lon, lat, 1, (d2) => d2.feature.containsCoordinate(coordinate)).map((d2) => d2.feature);
6900
+ const features = knn$1(this._featuresRtree, lon, lat, 10, (d2) => d2.feature.containsCoordinate(coordinate)).map((d2) => {
6901
+ const midX = d2.minX + (d2.minX + d2.maxX) / 2;
6902
+ const midY = d2.minY + (d2.minY + d2.maxY) / 2;
6903
+ d2.distance = Math.hypot(midX - lon, midY - lat);
6904
+ return d2;
6905
+ });
6906
+ features.sort((a, b) => a.distance - b.distance);
6907
+ return features.map((d2) => d2.feature);
6901
6908
  }
6902
6909
  getFeaturesInExtent(extent) {
6903
6910
  const [minX, minY, maxX, maxY] = extent;