@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 +4 -0
- package/build/api-client.cjs +9 -5
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.modern.js +9 -6
- package/build/api-client.modern.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/spatial-index.d.ts +7 -1
- package/package.json +9 -5
- package/src/index.ts +2 -0
- package/src/spatial-index.ts +8 -5
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';
|
package/build/spatial-index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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":
|
|
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.
|
|
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.
|
|
74
|
-
"@luma.gl/engine": "9.0.
|
|
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": "^
|
|
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
package/src/spatial-index.ts
CHANGED
|
@@ -40,7 +40,7 @@ export function getSpatialFiltersResolution(
|
|
|
40
40
|
: dataResolution;
|
|
41
41
|
|
|
42
42
|
const hexagonResolution =
|
|
43
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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 {
|