@carto/api-client 0.5.15-alpha.raster-1 → 0.5.15-alpha.raster-3
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 +212 -134
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +45 -17
- package/build/api-client.d.ts +45 -17
- package/build/api-client.js +211 -134
- package/build/api-client.js.map +1 -1
- package/package.json +1 -1
- package/src/fetch-map/index.ts +1 -0
- package/src/fetch-map/layer-map.ts +76 -18
- package/src/fetch-map/parse-map.ts +136 -126
- package/src/fetch-map/raster-layer.ts +6 -4
- package/src/fetch-map/types.ts +7 -7
- package/src/fetch-map/utils.ts +56 -0
- package/src/fetch-map/vec-expr-evaluator.ts +0 -12
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. */
|
|
@@ -1148,6 +1159,23 @@ declare function fetchBasemapProps({ config, errorContext, applyLayerFilters, }:
|
|
|
1148
1159
|
errorContext?: APIErrorContext;
|
|
1149
1160
|
}): Promise<Basemap | null>;
|
|
1150
1161
|
|
|
1162
|
+
/**
|
|
1163
|
+
* Create domain for D3 threshold scale with logarithmic steps.
|
|
1164
|
+
*
|
|
1165
|
+
* If min is 0, it starts with max and goes down to fill color scale.
|
|
1166
|
+
* If max is Infinity, it starts with 10 and goes up to fill color scale.
|
|
1167
|
+
* Othersise it starts on first power of 10 that is greater than min.
|
|
1168
|
+
*
|
|
1169
|
+
* Generates `steps-1` entries, as this is what d3 threshold scale expects
|
|
1170
|
+
*
|
|
1171
|
+
* @see https://d3js.org/d3-scale/threshold
|
|
1172
|
+
*/
|
|
1173
|
+
declare function getLog10ScaleSteps({ min, max, steps, }: {
|
|
1174
|
+
min: number;
|
|
1175
|
+
max: number;
|
|
1176
|
+
steps: number;
|
|
1177
|
+
}): number[];
|
|
1178
|
+
|
|
1151
1179
|
/**
|
|
1152
1180
|
* Create vector expresion evaluator.
|
|
1153
1181
|
*
|
|
@@ -2082,4 +2110,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
2082
2110
|
*/
|
|
2083
2111
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
2084
2112
|
|
|
2085
|
-
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, 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. */
|
|
@@ -1148,6 +1159,23 @@ declare function fetchBasemapProps({ config, errorContext, applyLayerFilters, }:
|
|
|
1148
1159
|
errorContext?: APIErrorContext;
|
|
1149
1160
|
}): Promise<Basemap | null>;
|
|
1150
1161
|
|
|
1162
|
+
/**
|
|
1163
|
+
* Create domain for D3 threshold scale with logarithmic steps.
|
|
1164
|
+
*
|
|
1165
|
+
* If min is 0, it starts with max and goes down to fill color scale.
|
|
1166
|
+
* If max is Infinity, it starts with 10 and goes up to fill color scale.
|
|
1167
|
+
* Othersise it starts on first power of 10 that is greater than min.
|
|
1168
|
+
*
|
|
1169
|
+
* Generates `steps-1` entries, as this is what d3 threshold scale expects
|
|
1170
|
+
*
|
|
1171
|
+
* @see https://d3js.org/d3-scale/threshold
|
|
1172
|
+
*/
|
|
1173
|
+
declare function getLog10ScaleSteps({ min, max, steps, }: {
|
|
1174
|
+
min: number;
|
|
1175
|
+
max: number;
|
|
1176
|
+
steps: number;
|
|
1177
|
+
}): number[];
|
|
1178
|
+
|
|
1151
1179
|
/**
|
|
1152
1180
|
* Create vector expresion evaluator.
|
|
1153
1181
|
*
|
|
@@ -2082,4 +2110,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
2082
2110
|
*/
|
|
2083
2111
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
2084
2112
|
|
|
2085
|
-
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, 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 };
|