@carto/kepler.gl 0.0.61 → 0.0.62

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.
@@ -0,0 +1,33 @@
1
+ // Copyright (c) 2022 Uber Technologies, Inc.
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ // of this software and associated documentation files (the "Software"), to deal
5
+ // in the Software without restriction, including without limitation the rights
6
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ // copies of the Software, and to permit persons to whom the Software is
8
+ // furnished to do so, subject to the following conditions:
9
+ //
10
+ // The above copyright notice and this permission notice shall be included in
11
+ // all copies or substantial portions of the Software.
12
+ //
13
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ // THE SOFTWARE.
20
+
21
+ import React from 'react';
22
+ import {injectIntl} from 'react-intl';
23
+
24
+ CustomMarkerCategoriesSelectorFactory.deps = [];
25
+ function CustomMarkerCategoriesSelectorFactory() {
26
+ const CustomMarkerCategoriesSelector = () => {
27
+ return <div>Component replaced by cloud native</div>;
28
+ };
29
+
30
+ return injectIntl(CustomMarkerCategoriesSelector);
31
+ }
32
+
33
+ export default CustomMarkerCategoriesSelectorFactory;
@@ -460,6 +460,7 @@ export const FIELD_TYPES_AGGREGATORS = {
460
460
  date: null,
461
461
  geojson: null,
462
462
  integer: [
463
+ AGGREGATION_TYPES.count,
463
464
  AGGREGATION_TYPES.average,
464
465
  AGGREGATION_TYPES.maximum,
465
466
  AGGREGATION_TYPES.minimum,
@@ -468,6 +469,7 @@ export const FIELD_TYPES_AGGREGATORS = {
468
469
  AGGREGATION_TYPES.variance
469
470
  ],
470
471
  real: [
472
+ AGGREGATION_TYPES.count,
471
473
  AGGREGATION_TYPES.average,
472
474
  AGGREGATION_TYPES.maximum,
473
475
  AGGREGATION_TYPES.minimum,
@@ -481,6 +483,10 @@ export const FIELD_TYPES_AGGREGATORS = {
481
483
  };
482
484
 
483
485
  export const FIELD_AGGREGATORS = [
486
+ {
487
+ id: AGGREGATION_TYPES.count,
488
+ displayName: 'COUNT'
489
+ },
484
490
  {
485
491
  id: AGGREGATION_TYPES.average,
486
492
  displayName: 'AVG'
@@ -525,6 +531,7 @@ export const linearFieldScaleFunctions = {
525
531
 
526
532
  export const linearFieldAggrScaleFunctions = {
527
533
  [CHANNEL_SCALES.colorAggr]: {
534
+ [AGGREGATION_TYPES.count]: [SCALE_TYPES.custom],
528
535
  [AGGREGATION_TYPES.average]: [SCALE_TYPES.quantize, SCALE_TYPES.quantile, SCALE_TYPES.custom],
529
536
  [AGGREGATION_TYPES.maximum]: [SCALE_TYPES.quantize, SCALE_TYPES.quantile, SCALE_TYPES.custom],
530
537
  [AGGREGATION_TYPES.minimum]: [SCALE_TYPES.quantize, SCALE_TYPES.quantile, SCALE_TYPES.custom],
@@ -535,6 +542,7 @@ export const linearFieldAggrScaleFunctions = {
535
542
  },
536
543
 
537
544
  [CHANNEL_SCALES.sizeAggr]: {
545
+ [AGGREGATION_TYPES.count]: [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log],
538
546
  [AGGREGATION_TYPES.average]: [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log],
539
547
  [AGGREGATION_TYPES.maximum]: [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log],
540
548
  [AGGREGATION_TYPES.minimum]: [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log],
@@ -975,10 +975,16 @@ class Layer {
975
975
  .unknown(UNKNOWN_COLOR);
976
976
  }
977
977
 
978
+ // for `count` aggregation, we domain is actually `[0, Infinity]` so it doesn't make sense
979
+ // to use it, so skip specyfying this domains
980
+ const domainIsInfinite = domain && (domain[0] === 0 && domain[1] === Infinity);
981
+ const scaleFactory = SCALE_FUNC[fixed ? 'linear' : scale];
978
982
  // @ts-ignore d3-scale type
979
- return SCALE_FUNC[fixed ? 'linear' : scale]()
980
- .domain(domain)
981
- .range(fixed ? domain : range);
983
+ let result = scaleFactory();
984
+ if (domain && !domainIsInfinite) {
985
+ result = result.domain(domain);
986
+ }
987
+ return result.range(fixed ? domain : range);
982
988
  }
983
989
 
984
990
  /**