@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/build/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from './types.js';
8
8
  export { APIErrorContext, APIRequestType, CartoAPIError, QueryOptions, buildPublicMapUrl, // Internal, but required for fetchMap().
9
9
  buildStatsUrl, // Internal, but required for fetchMap().
10
10
  query, requestWithParameters, } from './api/index.js';
11
+ export { _getHexagonResolution } from './spatial-index.js';
@@ -2,7 +2,13 @@ import type { ModelSource } from './models/model';
2
2
  import type { AggregationOptions } from './sources/types';
3
3
  import type { ViewState } from './widget-sources';
4
4
  export declare function getSpatialFiltersResolution(source: Partial<ModelSource & AggregationOptions>, viewState: ViewState): number | undefined;
5
- export declare function getHexagonResolution(viewport: {
5
+ /**
6
+ * Resolution conversion function. Takes a WebMercatorViewport and returns
7
+ * a H3 resolution such that the screen space size of the hexagons is
8
+ * "similar" to the given tileSize on screen. Intended for use with deck.gl.
9
+ * @internal
10
+ */
11
+ export declare function _getHexagonResolution(viewport: {
6
12
  zoom: number;
7
13
  latitude: number;
8
14
  }, tileSize: number): number;
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@carto/api-client",
3
3
  "description": "Client library for CARTO APIs and framework-agnostic CARTO + deck.gl applications",
4
- "repository": "github:CartoDB/carto-api-client",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/CartoDB/carto-api-client.git"
7
+ },
8
+ "homepage": "https://github.com/CartoDB/carto-api-client#readme",
5
9
  "author": "Don McCurdy <donmccurdy@carto.com>",
6
10
  "packageManager": "yarn@4.3.1",
7
- "version": "0.4.5",
11
+ "version": "0.4.6",
8
12
  "license": "MIT",
9
13
  "publishConfig": {
10
14
  "access": "public",
@@ -70,12 +74,12 @@
70
74
  "@lit/react": "^1.0.6",
71
75
  "@lit/task": "^1.0.1",
72
76
  "@loaders.gl/core": "^4.3.3",
73
- "@luma.gl/core": "9.0.27",
74
- "@luma.gl/engine": "9.0.27",
77
+ "@luma.gl/core": "9.0.28",
78
+ "@luma.gl/engine": "9.0.28",
75
79
  "@types/json-schema": "^7.0.15",
76
80
  "@types/react": "^18.3.18",
77
81
  "@types/semver": "^7.5.8",
78
- "@vitest/coverage-istanbul": "^2.1.8",
82
+ "@vitest/coverage-istanbul": "^3.0.2",
79
83
  "@webcomponents/webcomponentsjs": "^2.8.0",
80
84
  "concurrently": "^9.1.2",
81
85
  "echarts": "^5.6.0",
package/src/index.ts CHANGED
@@ -16,3 +16,5 @@ export {
16
16
  query,
17
17
  requestWithParameters,
18
18
  } from './api/index.js';
19
+
20
+ export {_getHexagonResolution} from './spatial-index.js';
@@ -40,7 +40,7 @@ export function getSpatialFiltersResolution(
40
40
  : dataResolution;
41
41
 
42
42
  const hexagonResolution =
43
- getHexagonResolution(viewState, tileSize) + aggregationResLevelOffset;
43
+ _getHexagonResolution(viewState, tileSize) + aggregationResLevelOffset;
44
44
 
45
45
  return Math.min(hexagonResolution, maxSpatialFiltersResolution);
46
46
  }
@@ -88,10 +88,13 @@ const maxH3SpatialFiltersResolutions = [
88
88
  // Relative scale factor (0 = no biasing, 2 = a few hexagons cover view)
89
89
  const BIAS = 2;
90
90
 
91
- // Resolution conversion function. Takes a WebMercatorViewport and returns
92
- // a H3 resolution such that the screen space size of the hexagons is
93
- // similar
94
- export function getHexagonResolution(
91
+ /**
92
+ * Resolution conversion function. Takes a WebMercatorViewport and returns
93
+ * a H3 resolution such that the screen space size of the hexagons is
94
+ * "similar" to the given tileSize on screen. Intended for use with deck.gl.
95
+ * @internal
96
+ */
97
+ export function _getHexagonResolution(
95
98
  viewport: {zoom: number; latitude: number},
96
99
  tileSize: number
97
100
  ): number {