@carto/api-client 0.5.18 → 0.5.19

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,11 @@
4
4
 
5
5
  ## 0.5
6
6
 
7
+ ### 0.5.19
8
+
9
+ - fix(fetchMap): support point radius aggregation (#242)
10
+ - fix(sources): export CARTO_SOURCES (#243)
11
+
7
12
  ### 0.5.18
8
13
 
9
14
  - fix(fetchMap): getColorAccessor treats colorMap as override of actual domain (#238)
@@ -102,6 +102,7 @@ __export(src_exports, {
102
102
  AggregationTypes: () => AggregationTypes,
103
103
  ApiVersion: () => ApiVersion,
104
104
  BASEMAP: () => basemap_styles_default,
105
+ CARTO_SOURCES: () => CARTO_SOURCES,
105
106
  CartoAPIError: () => CartoAPIError,
106
107
  CellSet: () => CellSet,
107
108
  DEFAULT_API_BASE_URL: () => DEFAULT_API_BASE_URL,
@@ -6081,6 +6082,9 @@ init_cjs_shims();
6081
6082
  // src/sources/index.ts
6082
6083
  init_cjs_shims();
6083
6084
 
6085
+ // src/sources/boundary-query-source.ts
6086
+ init_cjs_shims();
6087
+
6084
6088
  // src/sources/base-source.ts
6085
6089
  init_cjs_shims();
6086
6090
 
@@ -6264,20 +6268,7 @@ async function baseSource(endpoint, options, urlParameters) {
6264
6268
  return json;
6265
6269
  }
6266
6270
 
6267
- // src/sources/constants.ts
6268
- init_cjs_shims();
6269
- var RasterBandColorinterp = /* @__PURE__ */ ((RasterBandColorinterp2) => {
6270
- RasterBandColorinterp2["Gray"] = "gray";
6271
- RasterBandColorinterp2["Red"] = "red";
6272
- RasterBandColorinterp2["Green"] = "green";
6273
- RasterBandColorinterp2["Blue"] = "blue";
6274
- RasterBandColorinterp2["Alpha"] = "alpha";
6275
- RasterBandColorinterp2["Palette"] = "palette";
6276
- return RasterBandColorinterp2;
6277
- })(RasterBandColorinterp || {});
6278
-
6279
6271
  // src/sources/boundary-query-source.ts
6280
- init_cjs_shims();
6281
6272
  var boundaryQuerySource = async function(options) {
6282
6273
  const {
6283
6274
  columns,
@@ -8331,29 +8322,6 @@ var h3TilesetSource = async function(options) {
8331
8322
  );
8332
8323
  };
8333
8324
 
8334
- // src/sources/raster-source.ts
8335
- init_cjs_shims();
8336
- var rasterSource = async function(options) {
8337
- const { tableName, filters } = options;
8338
- const urlParameters = { name: tableName };
8339
- if (filters) {
8340
- urlParameters.filters = filters;
8341
- }
8342
- return baseSource("raster", options, urlParameters).then(
8343
- (result) => ({
8344
- ...result,
8345
- widgetSource: new WidgetRasterSource({
8346
- ...options,
8347
- tileFormat: getTileFormat(result),
8348
- spatialDataColumn: "quadbin",
8349
- spatialDataType: "quadbin",
8350
- spatialDataBounds: result.bounds,
8351
- rasterMetadata: result.raster_metadata
8352
- })
8353
- })
8354
- );
8355
- };
8356
-
8357
8325
  // src/sources/quadbin-query-source.ts
8358
8326
  init_cjs_shims();
8359
8327
  var quadbinQuerySource = async function(options) {
@@ -8457,106 +8425,24 @@ var quadbinTilesetSource = async function(options) {
8457
8425
  );
8458
8426
  };
8459
8427
 
8460
- // src/sources/vector-query-source.ts
8461
- init_cjs_shims();
8462
- var vectorQuerySource = async function(options) {
8463
- const {
8464
- columns,
8465
- filters,
8466
- spatialDataColumn = DEFAULT_GEO_COLUMN,
8467
- sqlQuery,
8468
- tileResolution = DEFAULT_TILE_RESOLUTION,
8469
- queryParameters,
8470
- aggregationExp
8471
- } = options;
8472
- const spatialDataType = "geo";
8473
- const urlParameters = {
8474
- spatialDataColumn,
8475
- spatialDataType,
8476
- tileResolution: tileResolution.toString(),
8477
- q: sqlQuery
8478
- };
8479
- if (columns) {
8480
- urlParameters.columns = columns.join(",");
8481
- }
8482
- if (filters) {
8483
- urlParameters.filters = filters;
8484
- }
8485
- if (queryParameters) {
8486
- urlParameters.queryParameters = queryParameters;
8487
- }
8488
- if (aggregationExp) {
8489
- urlParameters.aggregationExp = aggregationExp;
8490
- }
8491
- return baseSource("query", options, urlParameters).then(
8492
- (result) => ({
8493
- ...result,
8494
- widgetSource: new WidgetQuerySource({
8495
- ...options,
8496
- // NOTE: Parameters with default values above must be explicitly passed here.
8497
- spatialDataColumn,
8498
- spatialDataType,
8499
- tileResolution
8500
- })
8501
- })
8502
- );
8503
- };
8504
-
8505
- // src/sources/vector-table-source.ts
8428
+ // src/sources/raster-source.ts
8506
8429
  init_cjs_shims();
8507
- var vectorTableSource = async function(options) {
8508
- const {
8509
- columns,
8510
- filters,
8511
- spatialDataColumn = DEFAULT_GEO_COLUMN,
8512
- tableName,
8513
- tileResolution = DEFAULT_TILE_RESOLUTION,
8514
- aggregationExp
8515
- } = options;
8516
- const spatialDataType = "geo";
8517
- const urlParameters = {
8518
- name: tableName,
8519
- spatialDataColumn,
8520
- spatialDataType,
8521
- tileResolution: tileResolution.toString()
8522
- };
8523
- if (columns) {
8524
- urlParameters.columns = columns.join(",");
8525
- }
8430
+ var rasterSource = async function(options) {
8431
+ const { tableName, filters } = options;
8432
+ const urlParameters = { name: tableName };
8526
8433
  if (filters) {
8527
8434
  urlParameters.filters = filters;
8528
8435
  }
8529
- if (aggregationExp) {
8530
- urlParameters.aggregationExp = aggregationExp;
8531
- }
8532
- return baseSource("table", options, urlParameters).then(
8533
- (result) => ({
8534
- ...result,
8535
- widgetSource: new WidgetTableSource({
8536
- ...options,
8537
- // NOTE: Parameters with default values above must be explicitly passed here.
8538
- spatialDataColumn,
8539
- spatialDataType,
8540
- tileResolution
8541
- })
8542
- })
8543
- );
8544
- };
8545
-
8546
- // src/sources/vector-tileset-source.ts
8547
- init_cjs_shims();
8548
- var vectorTilesetSource = async function(options) {
8549
- const { tableName, spatialDataColumn = DEFAULT_GEO_COLUMN } = options;
8550
- const urlParameters = { name: tableName };
8551
- return baseSource("tileset", options, urlParameters).then(
8436
+ return baseSource("raster", options, urlParameters).then(
8552
8437
  (result) => ({
8553
8438
  ...result,
8554
- widgetSource: new WidgetTilesetSource({
8439
+ widgetSource: new WidgetRasterSource({
8555
8440
  ...options,
8556
8441
  tileFormat: getTileFormat(result),
8557
- spatialDataColumn,
8558
- spatialDataType: "geo",
8559
- spatialDataBounds: result.bounds
8442
+ spatialDataColumn: "quadbin",
8443
+ spatialDataType: "quadbin",
8444
+ spatialDataBounds: result.bounds,
8445
+ rasterMetadata: result.raster_metadata
8560
8446
  })
8561
8447
  })
8562
8448
  );
@@ -8660,6 +8546,141 @@ var trajectoryTableSource = async function(options) {
8660
8546
  };
8661
8547
  };
8662
8548
 
8549
+ // src/sources/vector-query-source.ts
8550
+ init_cjs_shims();
8551
+ var vectorQuerySource = async function(options) {
8552
+ const {
8553
+ columns,
8554
+ filters,
8555
+ spatialDataColumn = DEFAULT_GEO_COLUMN,
8556
+ sqlQuery,
8557
+ tileResolution = DEFAULT_TILE_RESOLUTION,
8558
+ queryParameters,
8559
+ aggregationExp
8560
+ } = options;
8561
+ const spatialDataType = "geo";
8562
+ const urlParameters = {
8563
+ spatialDataColumn,
8564
+ spatialDataType,
8565
+ tileResolution: tileResolution.toString(),
8566
+ q: sqlQuery
8567
+ };
8568
+ if (columns) {
8569
+ urlParameters.columns = columns.join(",");
8570
+ }
8571
+ if (filters) {
8572
+ urlParameters.filters = filters;
8573
+ }
8574
+ if (queryParameters) {
8575
+ urlParameters.queryParameters = queryParameters;
8576
+ }
8577
+ if (aggregationExp) {
8578
+ urlParameters.aggregationExp = aggregationExp;
8579
+ }
8580
+ return baseSource("query", options, urlParameters).then(
8581
+ (result) => ({
8582
+ ...result,
8583
+ widgetSource: new WidgetQuerySource({
8584
+ ...options,
8585
+ // NOTE: Parameters with default values above must be explicitly passed here.
8586
+ spatialDataColumn,
8587
+ spatialDataType,
8588
+ tileResolution
8589
+ })
8590
+ })
8591
+ );
8592
+ };
8593
+
8594
+ // src/sources/vector-table-source.ts
8595
+ init_cjs_shims();
8596
+ var vectorTableSource = async function(options) {
8597
+ const {
8598
+ columns,
8599
+ filters,
8600
+ spatialDataColumn = DEFAULT_GEO_COLUMN,
8601
+ tableName,
8602
+ tileResolution = DEFAULT_TILE_RESOLUTION,
8603
+ aggregationExp
8604
+ } = options;
8605
+ const spatialDataType = "geo";
8606
+ const urlParameters = {
8607
+ name: tableName,
8608
+ spatialDataColumn,
8609
+ spatialDataType,
8610
+ tileResolution: tileResolution.toString()
8611
+ };
8612
+ if (columns) {
8613
+ urlParameters.columns = columns.join(",");
8614
+ }
8615
+ if (filters) {
8616
+ urlParameters.filters = filters;
8617
+ }
8618
+ if (aggregationExp) {
8619
+ urlParameters.aggregationExp = aggregationExp;
8620
+ }
8621
+ return baseSource("table", options, urlParameters).then(
8622
+ (result) => ({
8623
+ ...result,
8624
+ widgetSource: new WidgetTableSource({
8625
+ ...options,
8626
+ // NOTE: Parameters with default values above must be explicitly passed here.
8627
+ spatialDataColumn,
8628
+ spatialDataType,
8629
+ tileResolution
8630
+ })
8631
+ })
8632
+ );
8633
+ };
8634
+
8635
+ // src/sources/vector-tileset-source.ts
8636
+ init_cjs_shims();
8637
+ var vectorTilesetSource = async function(options) {
8638
+ const { tableName, spatialDataColumn = DEFAULT_GEO_COLUMN } = options;
8639
+ const urlParameters = { name: tableName };
8640
+ return baseSource("tileset", options, urlParameters).then(
8641
+ (result) => ({
8642
+ ...result,
8643
+ widgetSource: new WidgetTilesetSource({
8644
+ ...options,
8645
+ tileFormat: getTileFormat(result),
8646
+ spatialDataColumn,
8647
+ spatialDataType: "geo",
8648
+ spatialDataBounds: result.bounds
8649
+ })
8650
+ })
8651
+ );
8652
+ };
8653
+
8654
+ // src/sources/constants.ts
8655
+ init_cjs_shims();
8656
+ var RasterBandColorinterp = /* @__PURE__ */ ((RasterBandColorinterp2) => {
8657
+ RasterBandColorinterp2["Gray"] = "gray";
8658
+ RasterBandColorinterp2["Red"] = "red";
8659
+ RasterBandColorinterp2["Green"] = "green";
8660
+ RasterBandColorinterp2["Blue"] = "blue";
8661
+ RasterBandColorinterp2["Alpha"] = "alpha";
8662
+ RasterBandColorinterp2["Palette"] = "palette";
8663
+ return RasterBandColorinterp2;
8664
+ })(RasterBandColorinterp || {});
8665
+
8666
+ // src/sources/index.ts
8667
+ var CARTO_SOURCES = {
8668
+ boundaryQuerySource,
8669
+ boundaryTableSource,
8670
+ h3QuerySource,
8671
+ h3TableSource,
8672
+ h3TilesetSource,
8673
+ quadbinQuerySource,
8674
+ quadbinTableSource,
8675
+ quadbinTilesetSource,
8676
+ rasterSource,
8677
+ trajectoryQuerySource,
8678
+ trajectoryTableSource,
8679
+ vectorQuerySource,
8680
+ vectorTableSource,
8681
+ vectorTilesetSource
8682
+ };
8683
+
8663
8684
  // src/api/query.ts
8664
8685
  var query = async function(options) {
8665
8686
  const {
@@ -10715,7 +10736,7 @@ function createChannelProps(id, layerType, config2, visualChannels, data, datase
10715
10736
  const { accessor, ...scaleProps } = getSizeAccessor(
10716
10737
  radiusField,
10717
10738
  radiusScale,
10718
- visConfig.sizeAggregation,
10739
+ visConfig.radiusAggregation,
10719
10740
  radiusRange,
10720
10741
  data
10721
10742
  );
@@ -11541,6 +11562,7 @@ function hashBuckets(initialCount) {
11541
11562
  AggregationTypes,
11542
11563
  ApiVersion,
11543
11564
  BASEMAP,
11565
+ CARTO_SOURCES,
11544
11566
  CartoAPIError,
11545
11567
  CellSet,
11546
11568
  DEFAULT_API_BASE_URL,