Skip to content

Commit 13ef812

Browse files
authored
docs: Pass on CARTO docs for v9.2 (#9795)
1 parent bc006eb commit 13ef812

File tree

12 files changed

+100
-26
lines changed

12 files changed

+100
-26
lines changed

docs/api-reference/carto/cluster-tile-layer.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# ClusterTileLayer
22

3-
`ClusterTileLayer` is a layer for visualizing point data aggregated using the [Quadbin Spatial Index](https://docs.carto.com/data-and-analysis/analytics-toolbox-for-bigquery/key-concepts/spatial-indexes#quadbin) with dynamic clustering. It provides efficient visualization of large point datasets with automatic clustering based on zoom level and customizable aggregation strategies.
3+
`ClusterTileLayer` is a layer for visualizing point data aggregated using spatial indexes like [Quadbin](https://docs.carto.com/data-and-analysis/analytics-toolbox-for-bigquery/key-concepts/spatial-indexes#quadbin) or [H3](https://docs.carto.com/data-and-analysis/analytics-toolbox-for-bigquery/key-concepts/spatial-indexes#h3) with dynamic clustering. It provides efficient visualization of large point datasets with automatic clustering based on zoom level and customizable aggregation strategies. The layer automatically detects the spatial index type and renders cells accordingly.
44

5-
## Usage
5+
## Usage
66

77
```tsx
88
import {DeckGL} from '@deck.gl/react';
9-
import {ClusterTileLayer, quadbinTableSource} from '@deck.gl/carto';
9+
import {ClusterTileLayer} from '@deck.gl/carto';
10+
import {quadbinTableSource} from '@carto/api-client';
1011

1112
function App({viewState}) {
1213
const data = quadbinTableSource({
@@ -77,13 +78,19 @@ Required. A valid `TilejsonResult` object.
7778

7879
Use one of the following [Data Sources](./data-sources.md) to fetch this from the CARTO API:
7980

81+
**Quadbin sources:**
8082
- [quadbinTableSource](./data-sources#quadbintablesource)
8183
- [quadbinQuerySource](./data-sources#quadbinquerysource)
8284
- [quadbinTilesetSource](./data-sources#quadbintilesetsource)
8385

86+
**H3 sources:**
87+
- [h3TableSource](./data-sources#h3tablesource)
88+
- [h3QuerySource](./data-sources#h3querysource)
89+
- [h3TilesetSource](./data-sources#h3tilesetsource)
90+
8491
### Clustering Options
8592

86-
The following props control how the data is grouped into clusters. The accessor methods will be called on each quadbin cell in the data to retrieve the position and weight of the cell. All of the properties are then aggregated and made available to the `GeoJsonLayer` accessors for styling.
93+
The following props control how the data is grouped into clusters. The accessor methods will be called on each spatial index cell (quadbin or H3) in the data to retrieve the position and weight of the cell. All of the properties are then aggregated and made available to the `GeoJsonLayer` accessors for styling.
8794

8895
#### `clusterLevel` (number, optional) {#clusterlevel}
8996

@@ -93,7 +100,7 @@ The number of aggregation levels to cluster cells by. Larger values increase the
93100

94101
#### `getPosition` ([Accessor<Position>](../../developer-guide/using-layers.md#accessors), optional) {#getposition}
95102

96-
The (average) position of points in a cell used for clustering. If not supplied the center of the quadbin cell is used.
103+
The (average) position of points in a cell used for clustering. If not supplied the center of the spatial index cell (quadbin or H3) is used.
97104

98105
#### `getWeight` ([Accessor<number>](../../developer-guide/using-layers.md#accessors)) {#getweight}
99106

@@ -107,7 +114,7 @@ When using the `GeoJsonLayer` accessors to style the clusters, aggregated values
107114

108115
### Aggregation types
109116

110-
The type aggregation is infered based on the property name, for example `population_average` will be aggregated using a (mean) average operation across all the quadbin cells that are present in the cluster, while `age_min` will give the minimum value present in the cluster.
117+
The type aggregation is infered based on the property name, for example `population_average` will be aggregated using a (mean) average operation across all the spatial index cells that are present in the cluster, while `age_min` will give the minimum value present in the cluster.
111118

112119
The following suffixes are supported:
113120

@@ -129,7 +136,7 @@ In addition to the aggregated values across the cluster, the features passed to
129136
Display clusters using an `'cluster'` icon scaled between 20 and 80, switching to an icon defined by the `icon_any` property once the cluster only contains a single point.
130137

131138
```ts
132-
// Data present in quadbin cell
139+
// Data present in spatial index cell (quadbin or H3)
133140
type PropertiesType = {
134141
longitude_count: number; // count of points in cell
135142
longitude_average: number;
@@ -138,12 +145,12 @@ type PropertiesType = {
138145
};
139146

140147
const layer = new ClusterTileLayer<PropertiesType>({
141-
data, // Defined using `quadbinTableSource` or similar
148+
data, // Defined using `quadbinTableSource`, `h3TableSource` or similar
142149

143150
// Clustering props
144151
getWeight: d => d.properties.longitude_count,
145152
getPosition: d => [d.properties.longitude_average, d.properties.latitude_average];
146-
153+
147154
// Style
148155
pointType: 'icon',
149156
iconAtlas,

docs/api-reference/carto/data-sources.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To ease interacting with the CARTO platform, the CARTO deck.gl module includes a
77
The data source functions are a compact way to describe the data that you want to fetch. For example, to fetch a table from a data warehouse from the connection `carto_dw`:
88

99
```js
10-
import {vectorTableSource} from '@deck.gl/carto';
10+
import {vectorTableSource} from '@carto/api-client';
1111
const data = vectorTableSource({
1212
accessToken: 'XXX',
1313
connectionName: 'carto_dw',
@@ -20,7 +20,8 @@ const data = vectorTableSource({
2020
All data source functions return a Promise, which can be resolved to obtain the actual Tilejson. However, as the [core deck.gl Layer prop supports Promises](../core/layer#data), it is often not necessary to resolve or await the Promise and the data source can be directly passed to the data prop:
2121

2222
```jsx
23-
import {H3TileLayer, h3TilesetSource} from '@deck.gl/carto';
23+
import {H3TileLayer} from '@deck.gl/carto';
24+
import {h3TilesetSource} from '@carto/api-client';
2425
new H3TileLayer({
2526
data: h3TilesetSource({
2627
accessToken: 'XXX',

docs/api-reference/carto/h3-tile-layer.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
```tsx
88
import {DeckGL} from '@deck.gl/react';
9-
import {H3TileLayer, h3QuerySource} from '@deck.gl/carto';
9+
import {H3TileLayer} from '@deck.gl/carto';
10+
import {h3QuerySource} from '@carto/api-client';
1011

1112
function App({viewState}) {
1213
const data = h3QuerySource({

docs/api-reference/carto/heatmap-tile-layer.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# HeatmapTileLayer
22

3-
`HeatmapTileLayer` is a layer for visualizing point data aggregated using the [Quadbin Spatial Index](https://docs.carto.com/data-and-analysis/analytics-toolbox-for-bigquery/key-concepts/spatial-indexes#quadbin) using a heatmap.
3+
`HeatmapTileLayer` is a layer for visualizing point data aggregated using spatial indexes like [Quadbin](https://docs.carto.com/data-and-analysis/analytics-toolbox-for-bigquery/key-concepts/spatial-indexes#quadbin) or [H3](https://docs.carto.com/data-and-analysis/analytics-toolbox-for-bigquery/key-concepts/spatial-indexes#h3) using a heatmap. The layer automatically detects the spatial index type and renders cells accordingly.
44

5-
## Usage
5+
## Usage
66

77
```tsx
88
import {DeckGL} from '@deck.gl/react';
9-
import {HeatmapTileLayer, quadbinTableSource} from '@deck.gl/carto';
9+
import {HeatmapTileLayer} from '@deck.gl/carto';
10+
import {quadbinTableSource} from '@carto/api-client';
1011

1112
function App({viewState}) {
1213
const data = quadbinTableSource({
@@ -72,10 +73,16 @@ Required. A valid `TilejsonResult` object.
7273

7374
Use one of the following [Data Sources](./data-sources.md) to fetch this from the CARTO API:
7475

76+
**Quadbin sources:**
7577
- [quadbinTableSource](./data-sources#quadbintablesource)
7678
- [quadbinQuerySource](./data-sources#quadbinquerysource)
7779
- [quadbinTilesetSource](./data-sources#quadbintilesetsource)
7880

81+
**H3 sources:**
82+
- [h3TableSource](./data-sources#h3tablesource)
83+
- [h3QuerySource](./data-sources#h3querysource)
84+
- [h3TilesetSource](./data-sources#h3tilesetsource)
85+
7986
### Render Options
8087

8188
#### `radiusPixels` (number, optional) ![transition-enabled](https://img.shields.io/badge/transition-enabled-green.svg?style=flat-square") {#radiuspixels}
@@ -117,7 +124,7 @@ Value that is multiplied with the total weight at a pixel to obtain the final we
117124

118125
* Default: `1`
119126

120-
Method called to retrieve weight of each quadbin cell. By default each cell will use a weight of `1`.
127+
Method called to retrieve weight of each spatial index cell (quadbin or H3). By default each cell will use a weight of `1`.
121128

122129
### Callbacks
123130

docs/api-reference/carto/overview.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ fetchMap({cartoMapId}).then(map => new Deck(map));
3838

3939
```jsx
4040
import {DeckGL} from '@deck.gl/react';
41-
import {VectorTileLayer, vectorQuerySource} from '@deck.gl/carto';
41+
import {VectorTileLayer} from '@deck.gl/carto';
42+
import {vectorQuerySource} from '@carto/api-client';
4243

4344
function App() {
4445
const data = vectorQuerySource({

docs/api-reference/carto/quadbin-tile-layer.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
```tsx
88
import {DeckGL} from '@deck.gl/react';
9-
import {QuadbinTileLayer, quadbinTilesetSource} from '@deck.gl/carto';
9+
import {QuadbinTileLayer} from '@deck.gl/carto';
10+
import {quadbinTilesetSource} from '@carto/api-client';
1011

1112
function App({viewState}) {
1213
const data = quadbinTilesetSource({

docs/api-reference/carto/raster-tile-layer.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
```tsx
88
import {DeckGL} from '@deck.gl/react';
9-
import {RasterTileLayer, rasterSource} from '@deck.gl/carto';
9+
import {RasterTileLayer} from '@deck.gl/carto';
10+
import {rasterSource} from '@carto/api-client';
1011

1112
function App({viewState}) {
1213
const data = rasterSource({

docs/api-reference/carto/vector-tile-layer.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
```tsx
88
import {DeckGL} from '@deck.gl/react';
9-
import {VectorTileLayer, vectorTableSource} from '@deck.gl/carto';
9+
import {VectorTileLayer} from '@deck.gl/carto';
10+
import {vectorTableSource} from '@carto/api-client';
1011

1112
function App({viewState}) {
1213
const data = vectorTableSource({
@@ -59,7 +60,7 @@ new deck.carto.VectorTileLayer({});
5960

6061
## Properties
6162

62-
The properties of [`MVTLayer`](../geo-layers/mvt-layer.md) will be inherited.
63+
Inherits all properties from [`MVTLayer`](../geo-layers/mvt-layer.md).
6364

6465
#### `data` (TilejsonResult) {#data}
6566

@@ -71,6 +72,16 @@ Use one of the following [Data Sources](./data-sources.md) to fetch this from th
7172
- [vectorQuerySource](./data-sources#vectorquerysource)
7273
- [vectorTilesetSource](./data-sources#vectortilesetsource)
7374

75+
#### `autoLabels` (boolean | object, optional) {#autolabels}
76+
77+
* Default: `false`
78+
79+
If `true`, automatically creates labels for lines and polygons at their centroids.
80+
81+
For more control over labeling, pass an object with the following properties:
82+
83+
* `uniqueIdProperty` (string): Property name to use for deduplication. Only creates a single label for each unique feature value.
84+
7485
## Source
7586

7687
[modules/carto/src/layers/vector-tile-layer.ts](https://github.com/visgl/deck.gl/tree/master/modules/carto/src/layers/vector-tile-layer.ts)

docs/upgrade-guide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ map.addLayer(new MapboxLayer({type: ArcLayer, ...}))
253253

254254
```ts
255255
// deck.gl v9
256-
import {VectorTileLayer, vectorQuerySource} from '@deck.gl/carto';
256+
import {VectorTileLayer} from '@deck.gl/carto';
257+
import {vectorQuerySource} from '@carto/api-client';
257258
const data = vectorQuerySource({
258259
accessToken: 'XXX',
259260
connectionName: 'carto_dw',

docs/whats-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ See documentation about how to [test WebGPU support](./developer-guide/webgpu.md
5050
### CARTO
5151

5252
- [ClusterTileLayer](./api-reference/carto/cluster-tile-layer) and [HeatmapTileLayer](./api-reference/carto/heatmap-tile-layer) support H3 data
53-
- [VectorTileLayer](./api-reference/carto/vector-tile-layer) supports labels for line & polygon data, via new `autoLabels` prop
53+
- [VectorTileLayer](./api-reference/carto/vector-tile-layer) supports labels for line & polygon data, via new [`autoLabels`](./api-reference/carto/vector-tile-layer#autolabels) prop
5454

5555
### Mapbox
5656

0 commit comments

Comments
 (0)