@carto/api-client 0.4.5 → 0.4.6

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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  ## 0.4
6
6
 
7
+ ### 0.4.6
8
+
9
+ - chore: Add repository and homepage in npm package metadata
10
+
7
11
  ### 0.4.5
8
12
 
9
13
  - types: Export TileResolution and SpatialFilterPolyfillMode types (#63)
@@ -975,7 +975,7 @@ function getSpatialFiltersResolution(source, viewState) {
975
975
  return zoom === currentZoomInt;
976
976
  })?.[1] ?? Math.max(0, currentZoomInt - 3);
977
977
  const maxSpatialFiltersResolution = maxResolutionForZoom ? Math.min(dataResolution, maxResolutionForZoom) : dataResolution;
978
- const hexagonResolution = getHexagonResolution(viewState, tileSize) + aggregationResLevelOffset;
978
+ const hexagonResolution = _getHexagonResolution(viewState, tileSize) + aggregationResLevelOffset;
979
979
  return Math.min(hexagonResolution, maxSpatialFiltersResolution);
980
980
  }
981
981
  if (source.spatialDataType === 'quadbin') {
@@ -990,10 +990,13 @@ const maxH3SpatialFiltersResolutions = [[20, 14], [19, 13], [18, 12], [17, 11],
990
990
  // stolen from https://github.com/visgl/deck.gl/blob/master/modules/carto/src/layers/h3-tileset-2d.ts
991
991
  // Relative scale factor (0 = no biasing, 2 = a few hexagons cover view)
992
992
  const BIAS = 2;
993
- // Resolution conversion function. Takes a WebMercatorViewport and returns
994
- // a H3 resolution such that the screen space size of the hexagons is
995
- // similar
996
- function getHexagonResolution(viewport, tileSize) {
993
+ /**
994
+ * Resolution conversion function. Takes a WebMercatorViewport and returns
995
+ * a H3 resolution such that the screen space size of the hexagons is
996
+ * "similar" to the given tileSize on screen. Intended for use with deck.gl.
997
+ * @internal
998
+ */
999
+ function _getHexagonResolution(viewport, tileSize) {
997
1000
  // Difference in given tile size compared to deck's internal 512px tile size,
998
1001
  // expressed as an offset to the viewport zoom.
999
1002
  const zoomOffset = Math.log2(tileSize / DEFAULT_TILE_SIZE);
@@ -1938,6 +1941,7 @@ exports.SOURCE_DEFAULTS = SOURCE_DEFAULTS;
1938
1941
  exports.WidgetBaseSource = WidgetBaseSource;
1939
1942
  exports.WidgetQuerySource = WidgetQuerySource;
1940
1943
  exports.WidgetTableSource = WidgetTableSource;
1944
+ exports._getHexagonResolution = _getHexagonResolution;
1941
1945
  exports.addFilter = addFilter;
1942
1946
  exports.boundaryQuerySource = boundaryQuerySource;
1943
1947
  exports.boundaryTableSource = boundaryTableSource;