@carto/api-client 0.5.15-alpha.raster-2 → 0.5.15-alpha.raster-4
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/build/api-client.cjs +167 -133
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +28 -17
- package/build/api-client.d.ts +28 -17
- package/build/api-client.js +167 -133
- package/build/api-client.js.map +1 -1
- package/package.json +1 -1
- package/src/fetch-map/layer-map.ts +71 -27
- package/src/fetch-map/parse-map.ts +136 -126
- package/src/fetch-map/types.ts +7 -7
package/build/api-client.d.cts
CHANGED
|
@@ -773,13 +773,18 @@ declare function getLayerProps(type: LayerType, config: MapLayerConfig, dataset:
|
|
|
773
773
|
declare function domainFromValues(values: any, scaleType: ScaleType): any;
|
|
774
774
|
declare function opacityToAlpha(opacity?: number): number;
|
|
775
775
|
declare function getColorAccessor({ name, colorColumn }: VisualChannelField, scaleType: ScaleType, { aggregation, range }: {
|
|
776
|
-
aggregation
|
|
777
|
-
range:
|
|
776
|
+
aggregation?: string;
|
|
777
|
+
range: ColorRange;
|
|
778
778
|
}, opacity: number | undefined, data: TilejsonResult): {
|
|
779
779
|
accessor: any;
|
|
780
|
-
|
|
780
|
+
domain: number[] | string[];
|
|
781
|
+
scaleDomain: number[] | string[];
|
|
782
|
+
range: string[];
|
|
783
|
+
};
|
|
784
|
+
declare function calculateLayerScale(name: string, scaleType: ScaleType, range: ColorRange, data: TilejsonResult): {
|
|
785
|
+
scale: D3Scale;
|
|
786
|
+
domain: string[] | number[];
|
|
781
787
|
};
|
|
782
|
-
declare function calculateLayerScale(name: string, scaleType: ScaleType, range: ColorRange, data: TilejsonResult): D3Scale;
|
|
783
788
|
declare function createColorScale<T>(scaleType: ScaleType, domain: string[] | number[], range: T[], unknown: T): D3Scale;
|
|
784
789
|
declare function getIconUrlAccessor(field: VisualChannelField | null | undefined, range: CustomMarkersRange | null | undefined, { fallbackUrl, maxIconSize, useMaskedIcons, }: {
|
|
785
790
|
fallbackUrl?: string | null;
|
|
@@ -789,9 +794,11 @@ declare function getIconUrlAccessor(field: VisualChannelField | null | undefined
|
|
|
789
794
|
declare function getMaxMarkerSize(visConfig: VisConfig, visualChannels: VisualChannels): number;
|
|
790
795
|
type Accessor = number | ((d: any, i: any) => number);
|
|
791
796
|
declare function negateAccessor(accessor: Accessor): Accessor;
|
|
792
|
-
declare function getSizeAccessor({ name }: VisualChannelField, scaleType: ScaleType | undefined, aggregation: string | null | undefined, range:
|
|
797
|
+
declare function getSizeAccessor({ name }: VisualChannelField, scaleType: ScaleType | undefined, aggregation: string | null | undefined, range: number[] | undefined, data: TilejsonResult): {
|
|
793
798
|
accessor: any;
|
|
794
|
-
|
|
799
|
+
domain: number[];
|
|
800
|
+
scaleDomain: number[];
|
|
801
|
+
range: number[] | undefined;
|
|
795
802
|
};
|
|
796
803
|
declare function getTextAccessor({ name, type }: VisualChannelField, data: any): any;
|
|
797
804
|
|
|
@@ -854,21 +861,21 @@ type VisConfig = {
|
|
|
854
861
|
filled?: boolean;
|
|
855
862
|
opacity?: number;
|
|
856
863
|
enable3d?: boolean;
|
|
857
|
-
colorAggregation?:
|
|
864
|
+
colorAggregation?: string;
|
|
858
865
|
colorRange: ColorRange;
|
|
859
866
|
customMarkers?: boolean;
|
|
860
867
|
customMarkersRange?: CustomMarkersRange | null;
|
|
861
868
|
customMarkersUrl?: string | null;
|
|
862
869
|
radius: number;
|
|
863
870
|
radiusRange?: number[];
|
|
864
|
-
sizeAggregation?:
|
|
865
|
-
sizeRange?:
|
|
866
|
-
strokeColorAggregation?:
|
|
871
|
+
sizeAggregation?: string;
|
|
872
|
+
sizeRange?: number[];
|
|
873
|
+
strokeColorAggregation?: string;
|
|
867
874
|
strokeOpacity?: number;
|
|
868
875
|
strokeColorRange?: ColorRange;
|
|
869
|
-
heightRange?:
|
|
870
|
-
heightAggregation?:
|
|
871
|
-
weightAggregation?:
|
|
876
|
+
heightRange?: number[];
|
|
877
|
+
heightAggregation?: string;
|
|
878
|
+
weightAggregation?: string;
|
|
872
879
|
clusterLevel?: number;
|
|
873
880
|
isTextVisible?: boolean;
|
|
874
881
|
rasterStyleType?: 'Rgb' | 'ColorRange' | 'UniqueValues';
|
|
@@ -1035,17 +1042,21 @@ declare function getRasterTileLayerStyleProps({ layerConfig, visualChannels, ras
|
|
|
1035
1042
|
};
|
|
1036
1043
|
|
|
1037
1044
|
type Scale = {
|
|
1045
|
+
type: ScaleType;
|
|
1038
1046
|
field: VisualChannelField;
|
|
1047
|
+
/** Natural domain of the scale, as defined by the data */
|
|
1039
1048
|
domain: string[] | number[];
|
|
1040
|
-
|
|
1041
|
-
|
|
1049
|
+
/** Domain of the user to construct d3 scale */
|
|
1050
|
+
scaleDomain?: string[] | number[];
|
|
1051
|
+
range?: string[] | number[];
|
|
1042
1052
|
};
|
|
1043
1053
|
type ScaleKey = 'fillColor' | 'pointRadius' | 'lineColor' | 'elevation' | 'weight';
|
|
1054
|
+
type Scales = Partial<Record<ScaleKey, Scale>>;
|
|
1044
1055
|
type LayerDescriptor = {
|
|
1045
1056
|
type: LayerType;
|
|
1046
1057
|
props: Record<string, any>;
|
|
1047
1058
|
filters?: Filters;
|
|
1048
|
-
scales:
|
|
1059
|
+
scales: Scales;
|
|
1049
1060
|
};
|
|
1050
1061
|
type ParseMapResult = {
|
|
1051
1062
|
/** Map id. */
|
|
@@ -2099,4 +2110,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
2099
2110
|
*/
|
|
2100
2111
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
2101
2112
|
|
|
2102
|
-
export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, type ExtentRequestOptions, type ExtentResponse, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, ErrorCode as _ErrorCode, type VecExprResult as _VecExprResult, applyLayerGroupFilters as _applyLayerGroupFilters, _buildFeatureFilter, createVecExprEvaluator as _createVecExprEvaluator, domainFromValues as _domainFromValues, evaluateVecExpr as _evaluateVecExpr, _getHexagonResolution, getLog10ScaleSteps as _getLog10ScaleSteps, getRasterTileLayerStyleProps as _getRasterTileLayerStyleProps, validateVecExprSyntax as _validateVecExprSyntax, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, calculateLayerScale, clearDefaultRequestCache, clearFilters, configureSource, createColorScale, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerDescriptor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
|
|
2113
|
+
export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, type ExtentRequestOptions, type ExtentResponse, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type Scales, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, ErrorCode as _ErrorCode, type VecExprResult as _VecExprResult, applyLayerGroupFilters as _applyLayerGroupFilters, _buildFeatureFilter, createVecExprEvaluator as _createVecExprEvaluator, domainFromValues as _domainFromValues, evaluateVecExpr as _evaluateVecExpr, _getHexagonResolution, getLog10ScaleSteps as _getLog10ScaleSteps, getRasterTileLayerStyleProps as _getRasterTileLayerStyleProps, validateVecExprSyntax as _validateVecExprSyntax, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, calculateLayerScale, clearDefaultRequestCache, clearFilters, configureSource, createColorScale, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerDescriptor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
|
package/build/api-client.d.ts
CHANGED
|
@@ -773,13 +773,18 @@ declare function getLayerProps(type: LayerType, config: MapLayerConfig, dataset:
|
|
|
773
773
|
declare function domainFromValues(values: any, scaleType: ScaleType): any;
|
|
774
774
|
declare function opacityToAlpha(opacity?: number): number;
|
|
775
775
|
declare function getColorAccessor({ name, colorColumn }: VisualChannelField, scaleType: ScaleType, { aggregation, range }: {
|
|
776
|
-
aggregation
|
|
777
|
-
range:
|
|
776
|
+
aggregation?: string;
|
|
777
|
+
range: ColorRange;
|
|
778
778
|
}, opacity: number | undefined, data: TilejsonResult): {
|
|
779
779
|
accessor: any;
|
|
780
|
-
|
|
780
|
+
domain: number[] | string[];
|
|
781
|
+
scaleDomain: number[] | string[];
|
|
782
|
+
range: string[];
|
|
783
|
+
};
|
|
784
|
+
declare function calculateLayerScale(name: string, scaleType: ScaleType, range: ColorRange, data: TilejsonResult): {
|
|
785
|
+
scale: D3Scale;
|
|
786
|
+
domain: string[] | number[];
|
|
781
787
|
};
|
|
782
|
-
declare function calculateLayerScale(name: string, scaleType: ScaleType, range: ColorRange, data: TilejsonResult): D3Scale;
|
|
783
788
|
declare function createColorScale<T>(scaleType: ScaleType, domain: string[] | number[], range: T[], unknown: T): D3Scale;
|
|
784
789
|
declare function getIconUrlAccessor(field: VisualChannelField | null | undefined, range: CustomMarkersRange | null | undefined, { fallbackUrl, maxIconSize, useMaskedIcons, }: {
|
|
785
790
|
fallbackUrl?: string | null;
|
|
@@ -789,9 +794,11 @@ declare function getIconUrlAccessor(field: VisualChannelField | null | undefined
|
|
|
789
794
|
declare function getMaxMarkerSize(visConfig: VisConfig, visualChannels: VisualChannels): number;
|
|
790
795
|
type Accessor = number | ((d: any, i: any) => number);
|
|
791
796
|
declare function negateAccessor(accessor: Accessor): Accessor;
|
|
792
|
-
declare function getSizeAccessor({ name }: VisualChannelField, scaleType: ScaleType | undefined, aggregation: string | null | undefined, range:
|
|
797
|
+
declare function getSizeAccessor({ name }: VisualChannelField, scaleType: ScaleType | undefined, aggregation: string | null | undefined, range: number[] | undefined, data: TilejsonResult): {
|
|
793
798
|
accessor: any;
|
|
794
|
-
|
|
799
|
+
domain: number[];
|
|
800
|
+
scaleDomain: number[];
|
|
801
|
+
range: number[] | undefined;
|
|
795
802
|
};
|
|
796
803
|
declare function getTextAccessor({ name, type }: VisualChannelField, data: any): any;
|
|
797
804
|
|
|
@@ -854,21 +861,21 @@ type VisConfig = {
|
|
|
854
861
|
filled?: boolean;
|
|
855
862
|
opacity?: number;
|
|
856
863
|
enable3d?: boolean;
|
|
857
|
-
colorAggregation?:
|
|
864
|
+
colorAggregation?: string;
|
|
858
865
|
colorRange: ColorRange;
|
|
859
866
|
customMarkers?: boolean;
|
|
860
867
|
customMarkersRange?: CustomMarkersRange | null;
|
|
861
868
|
customMarkersUrl?: string | null;
|
|
862
869
|
radius: number;
|
|
863
870
|
radiusRange?: number[];
|
|
864
|
-
sizeAggregation?:
|
|
865
|
-
sizeRange?:
|
|
866
|
-
strokeColorAggregation?:
|
|
871
|
+
sizeAggregation?: string;
|
|
872
|
+
sizeRange?: number[];
|
|
873
|
+
strokeColorAggregation?: string;
|
|
867
874
|
strokeOpacity?: number;
|
|
868
875
|
strokeColorRange?: ColorRange;
|
|
869
|
-
heightRange?:
|
|
870
|
-
heightAggregation?:
|
|
871
|
-
weightAggregation?:
|
|
876
|
+
heightRange?: number[];
|
|
877
|
+
heightAggregation?: string;
|
|
878
|
+
weightAggregation?: string;
|
|
872
879
|
clusterLevel?: number;
|
|
873
880
|
isTextVisible?: boolean;
|
|
874
881
|
rasterStyleType?: 'Rgb' | 'ColorRange' | 'UniqueValues';
|
|
@@ -1035,17 +1042,21 @@ declare function getRasterTileLayerStyleProps({ layerConfig, visualChannels, ras
|
|
|
1035
1042
|
};
|
|
1036
1043
|
|
|
1037
1044
|
type Scale = {
|
|
1045
|
+
type: ScaleType;
|
|
1038
1046
|
field: VisualChannelField;
|
|
1047
|
+
/** Natural domain of the scale, as defined by the data */
|
|
1039
1048
|
domain: string[] | number[];
|
|
1040
|
-
|
|
1041
|
-
|
|
1049
|
+
/** Domain of the user to construct d3 scale */
|
|
1050
|
+
scaleDomain?: string[] | number[];
|
|
1051
|
+
range?: string[] | number[];
|
|
1042
1052
|
};
|
|
1043
1053
|
type ScaleKey = 'fillColor' | 'pointRadius' | 'lineColor' | 'elevation' | 'weight';
|
|
1054
|
+
type Scales = Partial<Record<ScaleKey, Scale>>;
|
|
1044
1055
|
type LayerDescriptor = {
|
|
1045
1056
|
type: LayerType;
|
|
1046
1057
|
props: Record<string, any>;
|
|
1047
1058
|
filters?: Filters;
|
|
1048
|
-
scales:
|
|
1059
|
+
scales: Scales;
|
|
1049
1060
|
};
|
|
1050
1061
|
type ParseMapResult = {
|
|
1051
1062
|
/** Map id. */
|
|
@@ -2099,4 +2110,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
2099
2110
|
*/
|
|
2100
2111
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
2101
2112
|
|
|
2102
|
-
export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, type ExtentRequestOptions, type ExtentResponse, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, ErrorCode as _ErrorCode, type VecExprResult as _VecExprResult, applyLayerGroupFilters as _applyLayerGroupFilters, _buildFeatureFilter, createVecExprEvaluator as _createVecExprEvaluator, domainFromValues as _domainFromValues, evaluateVecExpr as _evaluateVecExpr, _getHexagonResolution, getLog10ScaleSteps as _getLog10ScaleSteps, getRasterTileLayerStyleProps as _getRasterTileLayerStyleProps, validateVecExprSyntax as _validateVecExprSyntax, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, calculateLayerScale, clearDefaultRequestCache, clearFilters, configureSource, createColorScale, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerDescriptor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
|
|
2113
|
+
export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, type ExtentRequestOptions, type ExtentResponse, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type Scales, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, ErrorCode as _ErrorCode, type VecExprResult as _VecExprResult, applyLayerGroupFilters as _applyLayerGroupFilters, _buildFeatureFilter, createVecExprEvaluator as _createVecExprEvaluator, domainFromValues as _domainFromValues, evaluateVecExpr as _evaluateVecExpr, _getHexagonResolution, getLog10ScaleSteps as _getLog10ScaleSteps, getRasterTileLayerStyleProps as _getRasterTileLayerStyleProps, validateVecExprSyntax as _validateVecExprSyntax, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, calculateLayerScale, clearDefaultRequestCache, clearFilters, configureSource, createColorScale, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerDescriptor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
|
package/build/api-client.js
CHANGED
|
@@ -9204,7 +9204,19 @@ var SCALE_FUNCS = {
|
|
|
9204
9204
|
function identity2(v2) {
|
|
9205
9205
|
return v2;
|
|
9206
9206
|
}
|
|
9207
|
+
var hexToRGB = (c) => {
|
|
9208
|
+
const { r, g, b } = rgb(c);
|
|
9209
|
+
return [r, g, b];
|
|
9210
|
+
};
|
|
9211
|
+
var rgbToHex = (c) => {
|
|
9212
|
+
const [r, g, b] = c;
|
|
9213
|
+
const rStr = r.toString(16).padStart(2, "0");
|
|
9214
|
+
const gStr = g.toString(16).padStart(2, "0");
|
|
9215
|
+
const bStr = b.toString(16).padStart(2, "0");
|
|
9216
|
+
return `#${rStr}${gStr}${bStr}`.toUpperCase();
|
|
9217
|
+
};
|
|
9207
9218
|
var UNKNOWN_COLOR = "#868d91";
|
|
9219
|
+
var UNKNOWN_COLOR_RGB = hexToRGB(UNKNOWN_COLOR);
|
|
9208
9220
|
var OPACITY_MAP = {
|
|
9209
9221
|
getFillColor: "opacity",
|
|
9210
9222
|
getLineColor: "strokeOpacity",
|
|
@@ -9311,13 +9323,6 @@ function getLayerProps(type, config2, dataset) {
|
|
|
9311
9323
|
};
|
|
9312
9324
|
}
|
|
9313
9325
|
function domainFromAttribute(attribute, scaleType, scaleLength) {
|
|
9314
|
-
if (scaleType === "log10steps" && attribute.min !== void 0 && attribute.max !== void 0) {
|
|
9315
|
-
return getLog10ScaleSteps({
|
|
9316
|
-
min: attribute.min,
|
|
9317
|
-
max: attribute.max,
|
|
9318
|
-
steps: scaleLength
|
|
9319
|
-
});
|
|
9320
|
-
}
|
|
9321
9326
|
if (scaleType === "ordinal" || scaleType === "point") {
|
|
9322
9327
|
if (!attribute.categories) {
|
|
9323
9328
|
return [0, 1];
|
|
@@ -9392,7 +9397,7 @@ function findAccessorKey(keys, properties) {
|
|
|
9392
9397
|
return keys;
|
|
9393
9398
|
}
|
|
9394
9399
|
function getColorAccessor({ name, colorColumn }, scaleType, { aggregation, range }, opacity, data) {
|
|
9395
|
-
const scale2 = calculateLayerScale(
|
|
9400
|
+
const { scale: scale2, domain } = calculateLayerScale(
|
|
9396
9401
|
colorColumn || name,
|
|
9397
9402
|
scaleType,
|
|
9398
9403
|
range,
|
|
@@ -9405,23 +9410,36 @@ function getColorAccessor({ name, colorColumn }, scaleType, { aggregation, range
|
|
|
9405
9410
|
accessorKeys = findAccessorKey(accessorKeys, properties);
|
|
9406
9411
|
}
|
|
9407
9412
|
const propertyValue = properties[accessorKeys[0]];
|
|
9408
|
-
const
|
|
9413
|
+
const [r, g, b] = scale2(propertyValue);
|
|
9409
9414
|
return [r, g, b, propertyValue === null ? 0 : alpha];
|
|
9410
9415
|
};
|
|
9411
|
-
return {
|
|
9416
|
+
return {
|
|
9417
|
+
accessor: normalizeAccessor(accessor, data),
|
|
9418
|
+
scaleDomain: scale2.domain(),
|
|
9419
|
+
domain,
|
|
9420
|
+
range: scale2.range().map(rgbToHex)
|
|
9421
|
+
};
|
|
9412
9422
|
}
|
|
9413
9423
|
function calculateLayerScale(name, scaleType, range, data) {
|
|
9414
9424
|
let domain = [];
|
|
9425
|
+
let scaleDomain;
|
|
9415
9426
|
let scaleColor = [];
|
|
9416
9427
|
const { colors } = range;
|
|
9417
9428
|
if (scaleType === "custom") {
|
|
9429
|
+
domain = calculateDomain(data, name, scaleType, colors.length);
|
|
9430
|
+
const [min2, max2] = domain;
|
|
9418
9431
|
if (range.uiCustomScaleType === "logarithmic") {
|
|
9419
|
-
|
|
9432
|
+
scaleDomain = getLog10ScaleSteps({
|
|
9433
|
+
min: min2,
|
|
9434
|
+
max: max2,
|
|
9435
|
+
steps: colors.length
|
|
9436
|
+
});
|
|
9420
9437
|
scaleColor = colors;
|
|
9421
9438
|
} else if (range.colorMap) {
|
|
9422
9439
|
const { colorMap } = range;
|
|
9440
|
+
scaleDomain = [];
|
|
9423
9441
|
colorMap.forEach(([value, color2]) => {
|
|
9424
|
-
|
|
9442
|
+
scaleDomain.push(Number(value));
|
|
9425
9443
|
scaleColor.push(color2);
|
|
9426
9444
|
});
|
|
9427
9445
|
}
|
|
@@ -9432,7 +9450,15 @@ function calculateLayerScale(name, scaleType, range, data) {
|
|
|
9432
9450
|
domain = domain.slice(0, scaleColor.length);
|
|
9433
9451
|
}
|
|
9434
9452
|
}
|
|
9435
|
-
return
|
|
9453
|
+
return {
|
|
9454
|
+
scale: createColorScale(
|
|
9455
|
+
scaleType,
|
|
9456
|
+
scaleDomain || domain,
|
|
9457
|
+
scaleColor.map(hexToRGB),
|
|
9458
|
+
UNKNOWN_COLOR_RGB
|
|
9459
|
+
),
|
|
9460
|
+
domain
|
|
9461
|
+
};
|
|
9436
9462
|
}
|
|
9437
9463
|
function createColorScale(scaleType, domain, range, unknown) {
|
|
9438
9464
|
const scale2 = SCALE_FUNCS[scaleType]();
|
|
@@ -9488,9 +9514,13 @@ function negateAccessor(accessor) {
|
|
|
9488
9514
|
}
|
|
9489
9515
|
function getSizeAccessor({ name }, scaleType, aggregation, range, data) {
|
|
9490
9516
|
const scale2 = scaleType ? SCALE_FUNCS[scaleType]() : identity2;
|
|
9491
|
-
|
|
9517
|
+
let domain = [];
|
|
9518
|
+
if (scaleType && range) {
|
|
9492
9519
|
if (aggregation !== AggregationTypes.Count) {
|
|
9493
|
-
|
|
9520
|
+
domain = calculateDomain(data, name, scaleType);
|
|
9521
|
+
scale2.domain(domain);
|
|
9522
|
+
} else {
|
|
9523
|
+
domain = scale2.domain();
|
|
9494
9524
|
}
|
|
9495
9525
|
scale2.range(range);
|
|
9496
9526
|
}
|
|
@@ -9502,7 +9532,12 @@ function getSizeAccessor({ name }, scaleType, aggregation, range, data) {
|
|
|
9502
9532
|
const propertyValue = properties[accessorKeys[0]];
|
|
9503
9533
|
return scale2(propertyValue);
|
|
9504
9534
|
};
|
|
9505
|
-
return {
|
|
9535
|
+
return {
|
|
9536
|
+
accessor: normalizeAccessor(accessor, data),
|
|
9537
|
+
domain,
|
|
9538
|
+
scaleDomain: domain,
|
|
9539
|
+
range
|
|
9540
|
+
};
|
|
9506
9541
|
}
|
|
9507
9542
|
var FORMATS = {
|
|
9508
9543
|
date: formatDate,
|
|
@@ -9847,7 +9882,7 @@ function getRasterTileLayerStylePropsScaledBand({
|
|
|
9847
9882
|
const scaleFun = createColorScale(
|
|
9848
9883
|
scaleType,
|
|
9849
9884
|
domain,
|
|
9850
|
-
colorRange.colors.map(
|
|
9885
|
+
colorRange.colors.map(hexToRGB2),
|
|
9851
9886
|
UNKNOWN_COLOR2
|
|
9852
9887
|
);
|
|
9853
9888
|
const bandColorScaleDataTransform = createBandColorScaleDataTransform({
|
|
@@ -9915,7 +9950,7 @@ function bufferSetRgba(target, index, r, g, b, a) {
|
|
|
9915
9950
|
target[index + 2] = b;
|
|
9916
9951
|
target[index + 3] = a;
|
|
9917
9952
|
}
|
|
9918
|
-
function
|
|
9953
|
+
function hexToRGB2(hexColor) {
|
|
9919
9954
|
const r = parseInt(hexColor.slice(1, 3), 16);
|
|
9920
9955
|
const g = parseInt(hexColor.slice(3, 5), 16);
|
|
9921
9956
|
const b = parseInt(hexColor.slice(5, 7), 16);
|
|
@@ -10056,24 +10091,7 @@ function createStyleProps(config2, mapping) {
|
|
|
10056
10091
|
result.highlightColor = config2.visConfig.enable3d ? [255, 255, 255, 60] : [252, 242, 26, 255];
|
|
10057
10092
|
return result;
|
|
10058
10093
|
}
|
|
10059
|
-
function domainAndRangeFromScale(scale2) {
|
|
10060
|
-
return {
|
|
10061
|
-
domain: scale2.domain(),
|
|
10062
|
-
range: scale2.range()
|
|
10063
|
-
};
|
|
10064
|
-
}
|
|
10065
10094
|
function createChannelProps(id, layerType, config2, visualChannels, data, dataset) {
|
|
10066
|
-
const {
|
|
10067
|
-
colorField,
|
|
10068
|
-
colorScale,
|
|
10069
|
-
radiusField,
|
|
10070
|
-
radiusScale,
|
|
10071
|
-
strokeColorField,
|
|
10072
|
-
strokeColorScale,
|
|
10073
|
-
sizeField: strokeWidthField,
|
|
10074
|
-
sizeScale: strokeWidthScale,
|
|
10075
|
-
weightField
|
|
10076
|
-
} = visualChannels;
|
|
10077
10095
|
if (layerType === "raster") {
|
|
10078
10096
|
const rasterMetadata = data.raster_metadata;
|
|
10079
10097
|
if (!rasterMetadata) {
|
|
@@ -10091,6 +10109,7 @@ function createChannelProps(id, layerType, config2, visualChannels, data, datase
|
|
|
10091
10109
|
visualChannels
|
|
10092
10110
|
}),
|
|
10093
10111
|
scales: {}
|
|
10112
|
+
// TODO
|
|
10094
10113
|
};
|
|
10095
10114
|
} else {
|
|
10096
10115
|
return {
|
|
@@ -10100,40 +10119,35 @@ function createChannelProps(id, layerType, config2, visualChannels, data, datase
|
|
|
10100
10119
|
rasterMetadata
|
|
10101
10120
|
}),
|
|
10102
10121
|
scales: {
|
|
10103
|
-
|
|
10104
|
-
fillColor: {
|
|
10105
|
-
field: colorField,
|
|
10106
|
-
type: "ordinal",
|
|
10107
|
-
domain: [],
|
|
10108
|
-
range: []
|
|
10109
|
-
}
|
|
10110
|
-
}
|
|
10122
|
+
// TODO
|
|
10111
10123
|
}
|
|
10112
10124
|
};
|
|
10113
10125
|
}
|
|
10114
10126
|
}
|
|
10115
|
-
const { heightField, heightScale } = visualChannels;
|
|
10116
10127
|
const { textLabel, visConfig } = config2;
|
|
10117
10128
|
const result = {};
|
|
10118
10129
|
const updateTriggers = {};
|
|
10119
10130
|
const scales = {};
|
|
10120
|
-
|
|
10121
|
-
const {
|
|
10122
|
-
const {
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10131
|
+
{
|
|
10132
|
+
const { colorField, colorScale } = visualChannels;
|
|
10133
|
+
const { colorRange, colorAggregation } = visConfig;
|
|
10134
|
+
if (colorField && colorScale && colorRange) {
|
|
10135
|
+
const { accessor, ...scaleProps } = getColorAccessor(
|
|
10136
|
+
colorField,
|
|
10137
|
+
colorScale,
|
|
10138
|
+
{ aggregation: colorAggregation, range: colorRange },
|
|
10139
|
+
visConfig.opacity,
|
|
10140
|
+
data
|
|
10141
|
+
);
|
|
10142
|
+
result.getFillColor = accessor;
|
|
10143
|
+
scales.fillColor = updateTriggers.getFillColor = {
|
|
10144
|
+
field: colorField,
|
|
10145
|
+
type: colorScale,
|
|
10146
|
+
...scaleProps
|
|
10147
|
+
};
|
|
10148
|
+
} else {
|
|
10149
|
+
scales.fillColor = {};
|
|
10150
|
+
}
|
|
10137
10151
|
}
|
|
10138
10152
|
if (layerType === "clusterTile") {
|
|
10139
10153
|
const aggregationExpAlias = getDefaultAggregationExpColumnAliasForLayerType(
|
|
@@ -10186,82 +10200,102 @@ function createChannelProps(id, layerType, config2, visualChannels, data, datase
|
|
|
10186
10200
|
radiusRange: visConfig.radiusRange
|
|
10187
10201
|
};
|
|
10188
10202
|
}
|
|
10189
|
-
|
|
10190
|
-
const
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
+
{
|
|
10204
|
+
const radiusRange = visConfig.radiusRange;
|
|
10205
|
+
const { radiusField, radiusScale } = visualChannels;
|
|
10206
|
+
if (radiusField && radiusRange && radiusScale) {
|
|
10207
|
+
const { accessor, ...scaleProps } = getSizeAccessor(
|
|
10208
|
+
radiusField,
|
|
10209
|
+
radiusScale,
|
|
10210
|
+
visConfig.sizeAggregation,
|
|
10211
|
+
radiusRange,
|
|
10212
|
+
data
|
|
10213
|
+
);
|
|
10214
|
+
result.getPointRadius = accessor;
|
|
10215
|
+
scales.pointRadius = updateTriggers.getPointRadius = {
|
|
10216
|
+
field: radiusField,
|
|
10217
|
+
type: radiusScale,
|
|
10218
|
+
...scaleProps
|
|
10219
|
+
};
|
|
10220
|
+
}
|
|
10203
10221
|
}
|
|
10204
|
-
|
|
10205
|
-
const
|
|
10206
|
-
const {
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
{
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10222
|
+
{
|
|
10223
|
+
const strokeColorRange = visConfig.strokeColorRange;
|
|
10224
|
+
const { strokeColorScale, strokeColorField } = visualChannels;
|
|
10225
|
+
if (strokeColorField && strokeColorRange && strokeColorScale) {
|
|
10226
|
+
const { strokeColorAggregation: aggregation } = visConfig;
|
|
10227
|
+
const opacity = visConfig.strokeOpacity !== void 0 ? visConfig.strokeOpacity : 1;
|
|
10228
|
+
const { accessor, ...scaleProps } = getColorAccessor(
|
|
10229
|
+
strokeColorField,
|
|
10230
|
+
strokeColorScale,
|
|
10231
|
+
{ aggregation, range: strokeColorRange },
|
|
10232
|
+
opacity,
|
|
10233
|
+
data
|
|
10234
|
+
);
|
|
10235
|
+
result.getLineColor = accessor;
|
|
10236
|
+
scales.lineColor = updateTriggers.getLineColor = {
|
|
10237
|
+
field: strokeColorField,
|
|
10238
|
+
type: strokeColorScale,
|
|
10239
|
+
...scaleProps
|
|
10240
|
+
};
|
|
10241
|
+
}
|
|
10220
10242
|
}
|
|
10221
|
-
|
|
10222
|
-
const {
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10234
|
-
|
|
10243
|
+
{
|
|
10244
|
+
const { sizeField: strokeWidthField, sizeScale: strokeWidthScale } = visualChannels;
|
|
10245
|
+
const { sizeRange, sizeAggregation } = visConfig;
|
|
10246
|
+
if (strokeWidthField && sizeRange) {
|
|
10247
|
+
const { accessor, ...scaleProps } = getSizeAccessor(
|
|
10248
|
+
strokeWidthField,
|
|
10249
|
+
strokeWidthScale,
|
|
10250
|
+
sizeAggregation,
|
|
10251
|
+
sizeRange,
|
|
10252
|
+
data
|
|
10253
|
+
);
|
|
10254
|
+
result.getLineWidth = accessor;
|
|
10255
|
+
scales.lineWidth = updateTriggers.getLineWidth = {
|
|
10256
|
+
field: strokeWidthField,
|
|
10257
|
+
type: strokeWidthScale || "identity",
|
|
10258
|
+
...scaleProps
|
|
10259
|
+
};
|
|
10260
|
+
}
|
|
10235
10261
|
}
|
|
10236
|
-
|
|
10237
|
-
const {
|
|
10238
|
-
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10262
|
+
{
|
|
10263
|
+
const { enable3d, heightRange } = visConfig;
|
|
10264
|
+
const { heightField, heightScale } = visualChannels;
|
|
10265
|
+
if (heightField && heightRange && enable3d) {
|
|
10266
|
+
const { accessor, ...scaleProps } = getSizeAccessor(
|
|
10267
|
+
heightField,
|
|
10268
|
+
heightScale,
|
|
10269
|
+
visConfig.heightAggregation,
|
|
10270
|
+
heightRange,
|
|
10271
|
+
data
|
|
10272
|
+
);
|
|
10273
|
+
result.getElevation = accessor;
|
|
10274
|
+
scales.elevation = updateTriggers.getElevation = {
|
|
10275
|
+
field: heightField,
|
|
10276
|
+
type: heightScale || "identity",
|
|
10277
|
+
...scaleProps
|
|
10278
|
+
};
|
|
10279
|
+
}
|
|
10250
10280
|
}
|
|
10251
|
-
|
|
10252
|
-
const {
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10281
|
+
{
|
|
10282
|
+
const { weightField } = visualChannels;
|
|
10283
|
+
const { weightAggregation } = visConfig;
|
|
10284
|
+
if (weightField && weightAggregation) {
|
|
10285
|
+
const { accessor, ...scaleProps } = getSizeAccessor(
|
|
10286
|
+
weightField,
|
|
10287
|
+
void 0,
|
|
10288
|
+
weightAggregation,
|
|
10289
|
+
void 0,
|
|
10290
|
+
data
|
|
10291
|
+
);
|
|
10292
|
+
result.getWeight = accessor;
|
|
10293
|
+
scales.weight = updateTriggers.getWeight = {
|
|
10294
|
+
field: weightField,
|
|
10295
|
+
type: "identity",
|
|
10296
|
+
...scaleProps
|
|
10297
|
+
};
|
|
10298
|
+
}
|
|
10265
10299
|
}
|
|
10266
10300
|
if (visConfig.customMarkers) {
|
|
10267
10301
|
const maxIconSize = getMaxMarkerSize(visConfig, visualChannels);
|