@carto/api-client 0.5.15-alpha.raster-0 → 0.5.15-alpha.raster-1

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.
@@ -126,6 +126,7 @@ __export(src_exports, {
126
126
  WidgetTableSource: () => WidgetTableSource,
127
127
  WidgetTilesetSource: () => WidgetTilesetSource,
128
128
  _ErrorCode: () => ErrorCode,
129
+ _applyLayerGroupFilters: () => applyLayerGroupFilters,
129
130
  _buildFeatureFilter: () => _buildFeatureFilter,
130
131
  _createVecExprEvaluator: () => createVecExprEvaluator,
131
132
  _domainFromValues: () => domainFromValues,
@@ -9622,13 +9623,13 @@ function domainFromAttribute(attribute, scaleType, scaleLength) {
9622
9623
  return attribute.categories.map((c) => c.category).filter((c) => c !== void 0 && c !== null);
9623
9624
  }
9624
9625
  if (scaleType === "quantile" && attribute.quantiles) {
9625
- return attribute.quantiles.global ? attribute.quantiles.global[scaleLength] : attribute.quantiles[scaleLength];
9626
+ return "global" in attribute.quantiles ? attribute.quantiles.global[scaleLength] : attribute.quantiles[scaleLength];
9626
9627
  }
9627
9628
  let { min: min2 } = attribute;
9628
9629
  if (scaleType === "log" && min2 === 0) {
9629
9630
  min2 = 1e-5;
9630
9631
  }
9631
- return [min2, attribute.max];
9632
+ return [min2 ?? 0, attribute.max ?? 1];
9632
9633
  }
9633
9634
  function domainFromValues(values, scaleType) {
9634
9635
  if (scaleType === "ordinal" || scaleType === "point") {
@@ -9649,7 +9650,9 @@ function calculateDomain(data, name, scaleType, scaleLength) {
9649
9650
  if (data.tilestats) {
9650
9651
  const { attributes } = data.tilestats.layers[0];
9651
9652
  const attribute = attributes.find((a) => a.attribute === name);
9652
- return domainFromAttribute(attribute, scaleType, scaleLength);
9653
+ if (attribute) {
9654
+ return domainFromAttribute(attribute, scaleType, scaleLength);
9655
+ }
9653
9656
  }
9654
9657
  return [0, 1];
9655
9658
  }
@@ -10364,15 +10367,24 @@ function createChannelProps(id, layerType, config2, visualChannels, data, datase
10364
10367
  radiusScale,
10365
10368
  strokeColorField,
10366
10369
  strokeColorScale,
10370
+ sizeField: strokeWidthField,
10371
+ sizeScale: strokeWidthScale,
10367
10372
  weightField
10368
10373
  } = visualChannels;
10369
10374
  if (layerType === "raster") {
10375
+ const rasterMetadata = data.raster_metadata;
10376
+ if (!rasterMetadata) {
10377
+ return {
10378
+ channelProps: {},
10379
+ scales: {}
10380
+ };
10381
+ }
10370
10382
  const rasterStyleType = config2.visConfig.rasterStyleType;
10371
10383
  if (rasterStyleType === "Rgb") {
10372
10384
  return {
10373
10385
  channelProps: getRasterTileLayerStylePropsRgb({
10374
10386
  layerConfig: config2,
10375
- rasterMetadata: data.raster_metadata,
10387
+ rasterMetadata,
10376
10388
  visualChannels
10377
10389
  }),
10378
10390
  scales: {}
@@ -10382,7 +10394,7 @@ function createChannelProps(id, layerType, config2, visualChannels, data, datase
10382
10394
  channelProps: getRasterTileLayerStylePropsScaledBand({
10383
10395
  layerConfig: config2,
10384
10396
  visualChannels,
10385
- rasterMetadata: data.raster_metadata
10397
+ rasterMetadata
10386
10398
  }),
10387
10399
  scales: {
10388
10400
  ...colorField && {
@@ -10503,6 +10515,21 @@ function createChannelProps(id, layerType, config2, visualChannels, data, datase
10503
10515
  ...domainAndRangeFromScale(scale2)
10504
10516
  };
10505
10517
  }
10518
+ if (strokeWidthField) {
10519
+ const { accessor, scale: scale2 } = getSizeAccessor(
10520
+ strokeWidthField,
10521
+ strokeWidthScale,
10522
+ visConfig.sizeAggregation,
10523
+ visConfig.sizeRange,
10524
+ data
10525
+ );
10526
+ result.getLineWidth = accessor;
10527
+ scales.lineWidth = updateTriggers.getLineWidth = {
10528
+ field: strokeWidthField,
10529
+ type: strokeWidthScale || "identity",
10530
+ ...domainAndRangeFromScale(scale2)
10531
+ };
10532
+ }
10506
10533
  if (heightField && visConfig.enable3d) {
10507
10534
  const { accessor, scale: scale2 } = getSizeAccessor(
10508
10535
  heightField,
@@ -11293,6 +11320,7 @@ function hashBuckets(initialCount) {
11293
11320
  WidgetTableSource,
11294
11321
  WidgetTilesetSource,
11295
11322
  _ErrorCode,
11323
+ _applyLayerGroupFilters,
11296
11324
  _buildFeatureFilter,
11297
11325
  _createVecExprEvaluator,
11298
11326
  _domainFromValues,