@carto/api-client 0.5.5-alpha.0 → 0.5.5

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.
@@ -3169,9 +3169,9 @@ function compare(x, y) {
3169
3169
  for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
3170
3170
  return k == l ? 0 : k > l ^ a ? 1 : -1;
3171
3171
  }
3172
- function intCheck(n, min3, max3, name) {
3173
- if (n < min3 || n > max3 || n !== mathfloor(n)) {
3174
- throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min3 || n > max3 ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
3172
+ function intCheck(n, min2, max2, name) {
3173
+ if (n < min2 || n > max2 || n !== mathfloor(n)) {
3174
+ throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min2 || n > max2 ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
3175
3175
  }
3176
3176
  }
3177
3177
  function isOdd(n) {
@@ -6563,11 +6563,11 @@ function min(values, keys, joinOperation) {
6563
6563
  Infinity
6564
6564
  );
6565
6565
  }
6566
- let min3 = Number.POSITIVE_INFINITY;
6566
+ let min2 = Number.POSITIVE_INFINITY;
6567
6567
  for (const value of values) {
6568
- min3 = Math.min(min3, value);
6568
+ min2 = Math.min(min2, value);
6569
6569
  }
6570
- return min3;
6570
+ return min2;
6571
6571
  }
6572
6572
  function max(values, keys, joinOperation) {
6573
6573
  const normalizedKeys = normalizeKeys(keys);
@@ -6577,11 +6577,11 @@ function max(values, keys, joinOperation) {
6577
6577
  -Infinity
6578
6578
  );
6579
6579
  }
6580
- let max3 = Number.NEGATIVE_INFINITY;
6580
+ let max2 = Number.NEGATIVE_INFINITY;
6581
6581
  for (const value of values) {
6582
- max3 = Math.max(max3, value);
6582
+ max2 = Math.max(max2, value);
6583
6583
  }
6584
- return max3;
6584
+ return max2;
6585
6585
  }
6586
6586
  function normalizeKeys(keys) {
6587
6587
  return Array.isArray(keys) ? keys : typeof keys === "string" ? [keys] : void 0;
@@ -8108,69 +8108,18 @@ function ascending(a, b) {
8108
8108
  return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
8109
8109
  }
8110
8110
 
8111
- // node_modules/d3-array/src/number.js
8112
- function* numbers(values, valueof) {
8113
- if (valueof === void 0) {
8114
- for (let value of values) {
8115
- if (value != null && (value = +value) >= value) {
8116
- yield value;
8117
- }
8118
- }
8119
- } else {
8120
- let index = -1;
8121
- for (let value of values) {
8122
- if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
8123
- yield value;
8124
- }
8125
- }
8126
- }
8127
- }
8128
-
8129
- // node_modules/d3-array/src/variance.js
8130
- function variance(values, valueof) {
8131
- let count = 0;
8132
- let delta;
8133
- let mean = 0;
8134
- let sum3 = 0;
8135
- if (valueof === void 0) {
8136
- for (let value of values) {
8137
- if (value != null && (value = +value) >= value) {
8138
- delta = value - mean;
8139
- mean += delta / ++count;
8140
- sum3 += delta * (value - mean);
8141
- }
8142
- }
8143
- } else {
8144
- let index = -1;
8145
- for (let value of values) {
8146
- if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
8147
- delta = value - mean;
8148
- mean += delta / ++count;
8149
- sum3 += delta * (value - mean);
8150
- }
8151
- }
8152
- }
8153
- if (count > 1) return sum3 / (count - 1);
8154
- }
8155
-
8156
- // node_modules/d3-array/src/deviation.js
8157
- function deviation(values, valueof) {
8158
- const v2 = variance(values, valueof);
8159
- return v2 ? Math.sqrt(v2) : v2;
8160
- }
8161
-
8162
8111
  // node_modules/d3-array/src/extent.js
8163
8112
  function extent(values, valueof) {
8164
- let min3;
8165
- let max3;
8113
+ let min2;
8114
+ let max2;
8166
8115
  if (valueof === void 0) {
8167
8116
  for (const value of values) {
8168
8117
  if (value != null) {
8169
- if (min3 === void 0) {
8170
- if (value >= value) min3 = max3 = value;
8118
+ if (min2 === void 0) {
8119
+ if (value >= value) min2 = max2 = value;
8171
8120
  } else {
8172
- if (min3 > value) min3 = value;
8173
- if (max3 < value) max3 = value;
8121
+ if (min2 > value) min2 = value;
8122
+ if (max2 < value) max2 = value;
8174
8123
  }
8175
8124
  }
8176
8125
  }
@@ -8178,16 +8127,16 @@ function extent(values, valueof) {
8178
8127
  let index = -1;
8179
8128
  for (let value of values) {
8180
8129
  if ((value = valueof(value, ++index, values)) != null) {
8181
- if (min3 === void 0) {
8182
- if (value >= value) min3 = max3 = value;
8130
+ if (min2 === void 0) {
8131
+ if (value >= value) min2 = max2 = value;
8183
8132
  } else {
8184
- if (min3 > value) min3 = value;
8185
- if (max3 < value) max3 = value;
8133
+ if (min2 > value) min2 = value;
8134
+ if (max2 < value) max2 = value;
8186
8135
  }
8187
8136
  }
8188
8137
  }
8189
8138
  }
8190
- return [min3, max3];
8139
+ return [min2, max2];
8191
8140
  }
8192
8141
 
8193
8142
  // node_modules/internmap/src/index.js
@@ -8309,102 +8258,6 @@ function groupSort(values, reduce, key) {
8309
8258
  return (reduce.length !== 2 ? sort(rollup(values, reduce, key), ([ak, av], [bk, bv]) => ascending(av, bv) || ascending(ak, bk)) : sort(group(values, key), ([ak, av], [bk, bv]) => reduce(av, bv) || ascending(ak, bk))).map(([key2]) => key2);
8310
8259
  }
8311
8260
 
8312
- // node_modules/d3-array/src/max.js
8313
- function max2(values, valueof) {
8314
- let max3;
8315
- if (valueof === void 0) {
8316
- for (const value of values) {
8317
- if (value != null && (max3 < value || max3 === void 0 && value >= value)) {
8318
- max3 = value;
8319
- }
8320
- }
8321
- } else {
8322
- let index = -1;
8323
- for (let value of values) {
8324
- if ((value = valueof(value, ++index, values)) != null && (max3 < value || max3 === void 0 && value >= value)) {
8325
- max3 = value;
8326
- }
8327
- }
8328
- }
8329
- return max3;
8330
- }
8331
-
8332
- // node_modules/d3-array/src/min.js
8333
- function min2(values, valueof) {
8334
- let min3;
8335
- if (valueof === void 0) {
8336
- for (const value of values) {
8337
- if (value != null && (min3 > value || min3 === void 0 && value >= value)) {
8338
- min3 = value;
8339
- }
8340
- }
8341
- } else {
8342
- let index = -1;
8343
- for (let value of values) {
8344
- if ((value = valueof(value, ++index, values)) != null && (min3 > value || min3 === void 0 && value >= value)) {
8345
- min3 = value;
8346
- }
8347
- }
8348
- }
8349
- return min3;
8350
- }
8351
-
8352
- // node_modules/d3-array/src/quickselect.js
8353
- function quickselect(array, k, left = 0, right = Infinity, compare2) {
8354
- k = Math.floor(k);
8355
- left = Math.floor(Math.max(0, left));
8356
- right = Math.floor(Math.min(array.length - 1, right));
8357
- if (!(left <= k && k <= right)) return array;
8358
- compare2 = compare2 === void 0 ? ascendingDefined : compareDefined(compare2);
8359
- while (right > left) {
8360
- if (right - left > 600) {
8361
- const n = right - left + 1;
8362
- const m = k - left + 1;
8363
- const z = Math.log(n);
8364
- const s = 0.5 * Math.exp(2 * z / 3);
8365
- const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
8366
- const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
8367
- const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));
8368
- quickselect(array, k, newLeft, newRight, compare2);
8369
- }
8370
- const t = array[k];
8371
- let i = left;
8372
- let j = right;
8373
- swap(array, left, k);
8374
- if (compare2(array[right], t) > 0) swap(array, left, right);
8375
- while (i < j) {
8376
- swap(array, i, j), ++i, --j;
8377
- while (compare2(array[i], t) < 0) ++i;
8378
- while (compare2(array[j], t) > 0) --j;
8379
- }
8380
- if (compare2(array[left], t) === 0) swap(array, left, j);
8381
- else ++j, swap(array, j, right);
8382
- if (j <= k) left = j + 1;
8383
- if (k <= j) right = j - 1;
8384
- }
8385
- return array;
8386
- }
8387
- function swap(array, i, j) {
8388
- const t = array[i];
8389
- array[i] = array[j];
8390
- array[j] = t;
8391
- }
8392
-
8393
- // node_modules/d3-array/src/quantile.js
8394
- function quantile(values, p, valueof) {
8395
- values = Float64Array.from(numbers(values, valueof));
8396
- if (!(n = values.length) || isNaN(p = +p)) return;
8397
- if (p <= 0 || n < 2) return min2(values);
8398
- if (p >= 1) return max2(values);
8399
- var n, i = (n - 1) * p, i0 = Math.floor(i), value0 = max2(quickselect(values, i0).subarray(0, i0 + 1)), value1 = min2(values.subarray(i0 + 1));
8400
- return value0 + (value1 - value0) * (i - i0);
8401
- }
8402
-
8403
- // node_modules/d3-array/src/median.js
8404
- function median(values, valueof) {
8405
- return quantile(values, 0.5, valueof);
8406
- }
8407
-
8408
8261
  // node_modules/d3-color/src/define.js
8409
8262
  function define_default(constructor, factory, prototype) {
8410
8263
  constructor.prototype = factory.prototype = prototype;
@@ -8692,12 +8545,12 @@ function hslConvert(o) {
8692
8545
  if (!o) return new Hsl();
8693
8546
  if (o instanceof Hsl) return o;
8694
8547
  o = o.rgb();
8695
- var r = o.r / 255, g = o.g / 255, b = o.b / 255, min3 = Math.min(r, g, b), max3 = Math.max(r, g, b), h = NaN, s = max3 - min3, l = (max3 + min3) / 2;
8548
+ var r = o.r / 255, g = o.g / 255, b = o.b / 255, min2 = Math.min(r, g, b), max2 = Math.max(r, g, b), h = NaN, s = max2 - min2, l = (max2 + min2) / 2;
8696
8549
  if (s) {
8697
- if (r === max3) h = (g - b) / s + (g < b) * 6;
8698
- else if (g === max3) h = (b - r) / s + 2;
8550
+ if (r === max2) h = (g - b) / s + (g < b) * 6;
8551
+ else if (g === max2) h = (b - r) / s + 2;
8699
8552
  else h = (r - g) / s + 4;
8700
- s /= l < 0.5 ? max3 + min3 : 2 - max3 - min3;
8553
+ s /= l < 0.5 ? max2 + min2 : 2 - max2 - min2;
8701
8554
  h *= 60;
8702
8555
  } else {
8703
8556
  s = l > 0 && l < 1 ? 0 : h;
@@ -8845,25 +8698,11 @@ function identity2(v2) {
8845
8698
  return v2;
8846
8699
  }
8847
8700
  var UNKNOWN_COLOR = "#868d91";
8848
- var AGGREGATION = {
8849
- average: "MEAN",
8850
- maximum: "MAX",
8851
- minimum: "MIN",
8852
- sum: "SUM"
8853
- };
8854
8701
  var OPACITY_MAP = {
8855
8702
  getFillColor: "opacity",
8856
8703
  getLineColor: "strokeOpacity",
8857
8704
  getTextColor: "opacity"
8858
8705
  };
8859
- var AGGREGATION_FUNC = {
8860
- "count unique": (values, accessor) => groupSort(values, (v2) => v2.length, accessor).length,
8861
- median,
8862
- // Unfortunately mode() is only available in d3-array@3+ which is ESM only
8863
- mode: (values, accessor) => groupSort(values, (v2) => v2.length, accessor).pop(),
8864
- stddev: deviation,
8865
- variance
8866
- };
8867
8706
  var hexToRGBA = (c) => {
8868
8707
  const { r, g, b, opacity } = rgb(c);
8869
8708
  return [r, g, b, 255 * opacity];
@@ -8959,11 +8798,11 @@ function domainFromAttribute(attribute, scaleType, scaleLength) {
8959
8798
  if (scaleType === "quantile" && attribute.quantiles) {
8960
8799
  return attribute.quantiles.global ? attribute.quantiles.global[scaleLength] : attribute.quantiles[scaleLength];
8961
8800
  }
8962
- let { min: min3 } = attribute;
8963
- if (scaleType === "log" && min3 === 0) {
8964
- min3 = 1e-5;
8801
+ let { min: min2 } = attribute;
8802
+ if (scaleType === "log" && min2 === 0) {
8803
+ min2 = 1e-5;
8965
8804
  }
8966
- return [min3, attribute.max];
8805
+ return [min2, attribute.max];
8967
8806
  }
8968
8807
  function domainFromValues(values, scaleType) {
8969
8808
  if (scaleType === "ordinal" || scaleType === "point") {
@@ -9021,11 +8860,6 @@ function findAccessorKey(keys, properties) {
9021
8860
  }
9022
8861
  return keys;
9023
8862
  }
9024
- function getColorValueAccessor({ name }, colorAggregation, data) {
9025
- const aggregator = AGGREGATION_FUNC[colorAggregation];
9026
- const accessor = (values) => aggregator(values, (p) => p[name]);
9027
- return normalizeAccessor(accessor, data);
9028
- }
9029
8863
  function getColorAccessor({ name, colorColumn }, scaleType, { aggregation, range }, opacity, data) {
9030
8864
  const scale2 = calculateLayerScale(
9031
8865
  colorColumn || name,
@@ -9043,7 +8877,7 @@ function getColorAccessor({ name, colorColumn }, scaleType, { aggregation, range
9043
8877
  const { r, g, b } = rgb(scale2(propertyValue));
9044
8878
  return [r, g, b, propertyValue === null ? 0 : alpha];
9045
8879
  };
9046
- return normalizeAccessor(accessor, data);
8880
+ return { accessor: normalizeAccessor(accessor, data), scale: scale2 };
9047
8881
  }
9048
8882
  function calculateLayerScale(name, scaleType, range, data) {
9049
8883
  const scale2 = SCALE_FUNCS[scaleType]();
@@ -9130,7 +8964,7 @@ function getSizeAccessor({ name }, scaleType, aggregation, range, data) {
9130
8964
  const propertyValue = properties[accessorKeys[0]];
9131
8965
  return scale2(propertyValue);
9132
8966
  };
9133
- return normalizeAccessor(accessor, data);
8967
+ return { accessor: normalizeAccessor(accessor, data), scale: scale2 };
9134
8968
  }
9135
8969
  var FORMATS = {
9136
8970
  date: formatDate,
@@ -9147,10 +8981,10 @@ function getTextAccessor({ name, type }, data) {
9147
8981
  return normalizeAccessor(accessor, data);
9148
8982
  }
9149
8983
  function calculateClusterRadius(properties, stats, radiusRange, column) {
9150
- const { min: min3, max: max3 } = stats[column];
8984
+ const { min: min2, max: max2 } = stats[column];
9151
8985
  const value = properties[column];
9152
- if (min3 === max3) return radiusRange[1];
9153
- const normalizedValue = (value - min3) / (max3 - min3);
8986
+ if (min2 === max2) return radiusRange[1];
8987
+ const normalizedValue = (value - min2) / (max2 - min2);
9154
8988
  return radiusRange[0] + normalizedValue * (radiusRange[1] - radiusRange[0]);
9155
8989
  }
9156
8990
  function getDefaultAggregationExpColumnAliasForLayerType(layerType, provider, schema) {
@@ -9211,6 +9045,14 @@ function parseMap(json) {
9211
9045
  assert2(data, `No data loaded for dataId: ${dataId}`);
9212
9046
  const { propMap, defaultProps: defaultProps2 } = getLayerProps(type, config3, dataset);
9213
9047
  const styleProps = createStyleProps(config3, propMap);
9048
+ const { channelProps, scales } = createChannelProps(
9049
+ id,
9050
+ type,
9051
+ config3,
9052
+ visualChannels,
9053
+ data,
9054
+ dataset
9055
+ );
9214
9056
  const layer = {
9215
9057
  type,
9216
9058
  filters: isEmptyObject(filters) || isRemoteCalculationSupported(dataset) ? void 0 : filters[dataId],
@@ -9220,22 +9062,15 @@ function parseMap(json) {
9220
9062
  ...defaultProps2,
9221
9063
  ...createInteractionProps(interactionConfig),
9222
9064
  ...styleProps,
9223
- ...createChannelProps(
9224
- id,
9225
- type,
9226
- config3,
9227
- visualChannels,
9228
- data,
9229
- dataset
9230
- ),
9231
- // Must come after style
9065
+ ...channelProps,
9232
9066
  ...createParametersProp(
9233
9067
  layerBlending,
9234
9068
  styleProps.parameters || {}
9235
9069
  ),
9236
9070
  // Must come after style
9237
9071
  ...createLoadOptions(token)
9238
- }
9072
+ },
9073
+ scales
9239
9074
  };
9240
9075
  return layer;
9241
9076
  } catch (e) {
@@ -9302,69 +9137,47 @@ function createStyleProps(config2, mapping) {
9302
9137
  result.highlightColor = config2.visConfig.enable3d ? [255, 255, 255, 60] : [252, 242, 26, 255];
9303
9138
  return result;
9304
9139
  }
9305
- function createChannelProps(id, type, config2, visualChannels, data, dataset) {
9140
+ function domainAndRangeFromScale(scale2) {
9141
+ return {
9142
+ domain: scale2.domain(),
9143
+ range: scale2.range()
9144
+ };
9145
+ }
9146
+ function createChannelProps(id, layerType, config2, visualChannels, data, dataset) {
9306
9147
  const {
9307
9148
  colorField,
9308
9149
  colorScale,
9309
9150
  radiusField,
9310
9151
  radiusScale,
9311
- sizeField,
9312
- sizeScale,
9313
9152
  strokeColorField,
9314
9153
  strokeColorScale,
9315
9154
  weightField
9316
9155
  } = visualChannels;
9317
- let { heightField, heightScale } = visualChannels;
9318
- if (type === "hexagonId") {
9319
- heightField = sizeField;
9320
- heightScale = sizeScale;
9321
- }
9156
+ const { heightField, heightScale } = visualChannels;
9322
9157
  const { textLabel, visConfig } = config2;
9323
9158
  const result = {};
9324
- if (type === "grid" || type === "hexagon") {
9325
- result.colorScaleType = colorScale;
9326
- if (colorField) {
9327
- const { colorAggregation } = config2.visConfig;
9328
- if (!AGGREGATION[colorAggregation]) {
9329
- result.getColorValue = getColorValueAccessor(
9330
- colorField,
9331
- colorAggregation,
9332
- data
9333
- );
9334
- } else {
9335
- result.getColorWeight = (d) => d[colorField.name];
9336
- }
9337
- }
9338
- } else if (colorField) {
9159
+ const scales = {};
9160
+ if (colorField) {
9339
9161
  const { colorAggregation: aggregation, colorRange: range } = visConfig;
9340
- result.getFillColor = getColorAccessor(
9162
+ const { accessor, scale: scale2 } = getColorAccessor(
9341
9163
  colorField,
9342
- // @ts-ignore
9343
9164
  colorScale,
9344
9165
  { aggregation, range },
9345
9166
  visConfig.opacity,
9346
9167
  data
9347
9168
  );
9169
+ result.getFillColor = accessor;
9170
+ scales.fillColor = {
9171
+ field: colorField,
9172
+ type: colorScale,
9173
+ ...domainAndRangeFromScale(scale2)
9174
+ };
9175
+ } else if (visConfig.filled) {
9176
+ scales.fillColor = {};
9348
9177
  }
9349
- if (type === "point") {
9350
- const altitude = config2.columns?.altitude;
9351
- if (altitude) {
9352
- result.dataTransform = (data2) => {
9353
- data2.features.forEach(
9354
- ({ geometry, properties }) => {
9355
- const { type: type2, coordinates } = geometry;
9356
- if (type2 === "Point") {
9357
- coordinates[2] = properties[altitude];
9358
- }
9359
- }
9360
- );
9361
- return data2;
9362
- };
9363
- }
9364
- }
9365
- if (type === "clusterTile") {
9178
+ if (layerType === "clusterTile") {
9366
9179
  const aggregationExpAlias = getDefaultAggregationExpColumnAliasForLayerType(
9367
- type,
9180
+ layerType,
9368
9181
  dataset.providerId,
9369
9182
  data.schema
9370
9183
  );
@@ -9403,49 +9216,67 @@ function createChannelProps(id, type, config2, visualChannels, data, dataset) {
9403
9216
  return calculateClusterTextFontSize(radius);
9404
9217
  };
9405
9218
  }
9406
- if (radiusField || sizeField) {
9407
- result.getPointRadius = getSizeAccessor(
9408
- // @ts-ignore
9409
- radiusField || sizeField,
9410
- // @ts-ignore
9411
- radiusScale || sizeScale,
9219
+ if (radiusField) {
9220
+ const { accessor, scale: scale2 } = getSizeAccessor(
9221
+ radiusField,
9222
+ radiusScale,
9412
9223
  visConfig.sizeAggregation,
9413
9224
  visConfig.radiusRange || visConfig.sizeRange,
9414
9225
  data
9415
9226
  );
9227
+ result.getPointRadius = accessor;
9228
+ scales.pointRadius = {
9229
+ field: radiusField,
9230
+ type: radiusScale || "identity",
9231
+ ...domainAndRangeFromScale(scale2)
9232
+ };
9416
9233
  }
9417
9234
  if (strokeColorField) {
9418
- const fallbackOpacity = type === "point" ? visConfig.opacity : 1;
9419
- const opacity = visConfig.strokeOpacity !== void 0 ? visConfig.strokeOpacity : fallbackOpacity;
9235
+ const opacity = visConfig.strokeOpacity !== void 0 ? visConfig.strokeOpacity : 1;
9420
9236
  const { strokeColorAggregation: aggregation, strokeColorRange: range } = visConfig;
9421
- result.getLineColor = getColorAccessor(
9237
+ const { accessor, scale: scale2 } = getColorAccessor(
9422
9238
  strokeColorField,
9423
- // @ts-ignore
9424
9239
  strokeColorScale,
9425
- // @ts-ignore
9426
9240
  { aggregation, range },
9427
9241
  opacity,
9428
9242
  data
9429
9243
  );
9244
+ result.getLineColor = accessor;
9245
+ scales.lineColor = {
9246
+ field: strokeColorField,
9247
+ type: strokeColorScale,
9248
+ ...domainAndRangeFromScale(scale2)
9249
+ };
9430
9250
  }
9431
9251
  if (heightField && visConfig.enable3d) {
9432
- result.getElevation = getSizeAccessor(
9252
+ const { accessor, scale: scale2 } = getSizeAccessor(
9433
9253
  heightField,
9434
- // @ts-ignore
9435
9254
  heightScale,
9436
9255
  visConfig.heightAggregation,
9437
9256
  visConfig.heightRange || visConfig.sizeRange,
9438
9257
  data
9439
9258
  );
9259
+ result.getElevation = accessor;
9260
+ scales.elevation = {
9261
+ field: heightField,
9262
+ type: heightScale || "identity",
9263
+ ...domainAndRangeFromScale(scale2)
9264
+ };
9440
9265
  }
9441
9266
  if (weightField) {
9442
- result.getWeight = getSizeAccessor(
9267
+ const { accessor, scale: scale2 } = getSizeAccessor(
9443
9268
  weightField,
9444
9269
  void 0,
9445
9270
  visConfig.weightAggregation,
9446
9271
  void 0,
9447
9272
  data
9448
9273
  );
9274
+ result.getWeight = accessor;
9275
+ scales.weight = {
9276
+ field: weightField,
9277
+ type: "identity",
9278
+ ...domainAndRangeFromScale(scale2)
9279
+ };
9449
9280
  }
9450
9281
  if (visConfig.customMarkers) {
9451
9282
  const maxIconSize = getMaxMarkerSize(visConfig, visualChannels);
@@ -9483,17 +9314,16 @@ function createChannelProps(id, type, config2, visualChannels, data, dataset) {
9483
9314
  result.getIconSize = getPointRadius;
9484
9315
  }
9485
9316
  if (visualChannels.rotationField) {
9486
- result.getIconAngle = negateAccessor(
9487
- getSizeAccessor(
9488
- visualChannels.rotationField,
9489
- void 0,
9490
- null,
9491
- void 0,
9492
- data
9493
- )
9317
+ const { accessor } = getSizeAccessor(
9318
+ visualChannels.rotationField,
9319
+ void 0,
9320
+ null,
9321
+ void 0,
9322
+ data
9494
9323
  );
9324
+ result.getIconAngle = negateAccessor(accessor);
9495
9325
  }
9496
- } else if (type === "point" || type === "tileset") {
9326
+ } else if (layerType === "tileset") {
9497
9327
  result.pointType = "circle";
9498
9328
  }
9499
9329
  if (textLabel && textLabel.length && textLabel[0].field) {
@@ -9536,7 +9366,7 @@ function createChannelProps(id, type, config2, visualChannels, data, dataset) {
9536
9366
  }
9537
9367
  };
9538
9368
  }
9539
- return result;
9369
+ return { channelProps: result, scales };
9540
9370
  }
9541
9371
  function createLoadOptions(accessToken) {
9542
9372
  return {
@@ -10101,7 +9931,6 @@ function _getHexagonResolution(viewport, tileSize) {
10101
9931
  );
10102
9932
  }
10103
9933
  export {
10104
- AGGREGATION,
10105
9934
  ApiVersion,
10106
9935
  basemap_styles_default as BASEMAP,
10107
9936
  CartoAPIError,
@@ -10151,7 +9980,6 @@ export {
10151
9980
  getApplicableFilters,
10152
9981
  getClient,
10153
9982
  getColorAccessor,
10154
- getColorValueAccessor,
10155
9983
  getColumnNameFromGeoColumn,
10156
9984
  getDataFilterExtensionProps,
10157
9985
  getDefaultAggregationExpColumnAliasForLayerType,