@carto/api-client 0.5.15-alpha.raster-0 → 0.5.15-alpha.raster-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api-client.cjs +33 -5
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +45 -14
- package/build/api-client.d.ts +45 -14
- package/build/api-client.js +32 -5
- package/build/api-client.js.map +1 -1
- package/package.json +1 -1
- package/src/fetch-map/basemap-styles.ts +1 -1
- package/src/fetch-map/index.ts +4 -1
- package/src/fetch-map/layer-map.ts +10 -8
- package/src/fetch-map/parse-map.ts +29 -3
- package/src/index.ts +0 -5
- package/src/sources/types.ts +52 -11
package/build/api-client.d.cts
CHANGED
|
@@ -575,13 +575,50 @@ interface Tilestats {
|
|
|
575
575
|
}
|
|
576
576
|
interface Layer {
|
|
577
577
|
layer: string;
|
|
578
|
+
/** Number of features in the layer. */
|
|
578
579
|
count: number;
|
|
580
|
+
/** Number of attributes in the layer. */
|
|
579
581
|
attributeCount: number;
|
|
580
582
|
attributes: Attribute[];
|
|
583
|
+
/** Type of geometry as in geojson geometry type (Point, LineString, Polygon, etc.) */
|
|
584
|
+
geometry?: string;
|
|
585
|
+
}
|
|
586
|
+
interface AttributeCategoryItem {
|
|
587
|
+
category: string;
|
|
588
|
+
frequency: number;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Quantiles by number of buckets.
|
|
592
|
+
*
|
|
593
|
+
* Example:
|
|
594
|
+
* ```ts
|
|
595
|
+
* {
|
|
596
|
+
* // for 3 buckets, first 1/3 of items lies in range [min, 20], second 1/3 is in [20, 40], and last 1/3 is in [40, max]
|
|
597
|
+
* 3: [20, 40],
|
|
598
|
+
* 4: [20, 30, 50], for 4 buckets ...
|
|
599
|
+
* }
|
|
600
|
+
* ```
|
|
601
|
+
*/
|
|
602
|
+
interface QuantileStats {
|
|
603
|
+
[bucketCount: number]: number[];
|
|
581
604
|
}
|
|
582
605
|
interface Attribute {
|
|
583
|
-
|
|
606
|
+
/**
|
|
607
|
+
* String, Number, Timestamp, Boolean
|
|
608
|
+
*/
|
|
584
609
|
type: string;
|
|
610
|
+
/**
|
|
611
|
+
* Attribute name.
|
|
612
|
+
*/
|
|
613
|
+
attribute: string;
|
|
614
|
+
min?: number;
|
|
615
|
+
max?: number;
|
|
616
|
+
sum?: number;
|
|
617
|
+
/** Quantiles by number of buckets */
|
|
618
|
+
quantiles?: {
|
|
619
|
+
global: QuantileStats;
|
|
620
|
+
} | QuantileStats;
|
|
621
|
+
categories?: AttributeCategoryItem[];
|
|
585
622
|
}
|
|
586
623
|
interface VectorLayer {
|
|
587
624
|
id: string;
|
|
@@ -601,17 +638,8 @@ type RasterMetadataBandStats = {
|
|
|
601
638
|
count: number;
|
|
602
639
|
/**
|
|
603
640
|
* Quantiles by number of buckets.
|
|
604
|
-
*
|
|
605
|
-
* Example:
|
|
606
|
-
* ```ts
|
|
607
|
-
* {
|
|
608
|
-
* // for 3 buckets, first 1/3 of items lies in range [min, 20], second 1/3 is in [20, 40], and last 1/3 is in [40, max]
|
|
609
|
-
* 3: [20, 40],
|
|
610
|
-
* 4: [20, 30, 50], for 4 buckets ...
|
|
611
|
-
* }
|
|
612
|
-
* ```
|
|
613
641
|
*/
|
|
614
|
-
quantiles?:
|
|
642
|
+
quantiles?: QuantileStats;
|
|
615
643
|
/**
|
|
616
644
|
* Top values by number of values.
|
|
617
645
|
*
|
|
@@ -747,7 +775,7 @@ declare function opacityToAlpha(opacity?: number): number;
|
|
|
747
775
|
declare function getColorAccessor({ name, colorColumn }: VisualChannelField, scaleType: ScaleType, { aggregation, range }: {
|
|
748
776
|
aggregation: string;
|
|
749
777
|
range: any;
|
|
750
|
-
}, opacity: number | undefined, data:
|
|
778
|
+
}, opacity: number | undefined, data: TilejsonResult): {
|
|
751
779
|
accessor: any;
|
|
752
780
|
scale: any;
|
|
753
781
|
};
|
|
@@ -761,7 +789,7 @@ declare function getIconUrlAccessor(field: VisualChannelField | null | undefined
|
|
|
761
789
|
declare function getMaxMarkerSize(visConfig: VisConfig, visualChannels: VisualChannels): number;
|
|
762
790
|
type Accessor = number | ((d: any, i: any) => number);
|
|
763
791
|
declare function negateAccessor(accessor: Accessor): Accessor;
|
|
764
|
-
declare function getSizeAccessor({ name }: VisualChannelField, scaleType: ScaleType | undefined, aggregation: string | null | undefined, range: Iterable<Range> | null | undefined, data:
|
|
792
|
+
declare function getSizeAccessor({ name }: VisualChannelField, scaleType: ScaleType | undefined, aggregation: string | null | undefined, range: Iterable<Range> | null | undefined, data: TilejsonResult): {
|
|
765
793
|
accessor: any;
|
|
766
794
|
scale: any;
|
|
767
795
|
};
|
|
@@ -980,6 +1008,9 @@ type Dataset = {
|
|
|
980
1008
|
exportToBucketAvailable?: boolean;
|
|
981
1009
|
};
|
|
982
1010
|
|
|
1011
|
+
type StyleLayerGroupSlug = 'label' | 'road' | 'border' | 'building' | 'water' | 'land';
|
|
1012
|
+
declare function applyLayerGroupFilters(style: any, // this Maplibre/Mapbox style, we don't want to add a dependency on Maplibre
|
|
1013
|
+
visibleLayerGroups: Record<StyleLayerGroupSlug, boolean>): any;
|
|
983
1014
|
declare const _default: {
|
|
984
1015
|
readonly VOYAGER: string;
|
|
985
1016
|
readonly POSITRON: string;
|
|
@@ -2051,4 +2082,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
2051
2082
|
*/
|
|
2052
2083
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
2053
2084
|
|
|
2054
|
-
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, _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 };
|
|
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 };
|
package/build/api-client.d.ts
CHANGED
|
@@ -575,13 +575,50 @@ interface Tilestats {
|
|
|
575
575
|
}
|
|
576
576
|
interface Layer {
|
|
577
577
|
layer: string;
|
|
578
|
+
/** Number of features in the layer. */
|
|
578
579
|
count: number;
|
|
580
|
+
/** Number of attributes in the layer. */
|
|
579
581
|
attributeCount: number;
|
|
580
582
|
attributes: Attribute[];
|
|
583
|
+
/** Type of geometry as in geojson geometry type (Point, LineString, Polygon, etc.) */
|
|
584
|
+
geometry?: string;
|
|
585
|
+
}
|
|
586
|
+
interface AttributeCategoryItem {
|
|
587
|
+
category: string;
|
|
588
|
+
frequency: number;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Quantiles by number of buckets.
|
|
592
|
+
*
|
|
593
|
+
* Example:
|
|
594
|
+
* ```ts
|
|
595
|
+
* {
|
|
596
|
+
* // for 3 buckets, first 1/3 of items lies in range [min, 20], second 1/3 is in [20, 40], and last 1/3 is in [40, max]
|
|
597
|
+
* 3: [20, 40],
|
|
598
|
+
* 4: [20, 30, 50], for 4 buckets ...
|
|
599
|
+
* }
|
|
600
|
+
* ```
|
|
601
|
+
*/
|
|
602
|
+
interface QuantileStats {
|
|
603
|
+
[bucketCount: number]: number[];
|
|
581
604
|
}
|
|
582
605
|
interface Attribute {
|
|
583
|
-
|
|
606
|
+
/**
|
|
607
|
+
* String, Number, Timestamp, Boolean
|
|
608
|
+
*/
|
|
584
609
|
type: string;
|
|
610
|
+
/**
|
|
611
|
+
* Attribute name.
|
|
612
|
+
*/
|
|
613
|
+
attribute: string;
|
|
614
|
+
min?: number;
|
|
615
|
+
max?: number;
|
|
616
|
+
sum?: number;
|
|
617
|
+
/** Quantiles by number of buckets */
|
|
618
|
+
quantiles?: {
|
|
619
|
+
global: QuantileStats;
|
|
620
|
+
} | QuantileStats;
|
|
621
|
+
categories?: AttributeCategoryItem[];
|
|
585
622
|
}
|
|
586
623
|
interface VectorLayer {
|
|
587
624
|
id: string;
|
|
@@ -601,17 +638,8 @@ type RasterMetadataBandStats = {
|
|
|
601
638
|
count: number;
|
|
602
639
|
/**
|
|
603
640
|
* Quantiles by number of buckets.
|
|
604
|
-
*
|
|
605
|
-
* Example:
|
|
606
|
-
* ```ts
|
|
607
|
-
* {
|
|
608
|
-
* // for 3 buckets, first 1/3 of items lies in range [min, 20], second 1/3 is in [20, 40], and last 1/3 is in [40, max]
|
|
609
|
-
* 3: [20, 40],
|
|
610
|
-
* 4: [20, 30, 50], for 4 buckets ...
|
|
611
|
-
* }
|
|
612
|
-
* ```
|
|
613
641
|
*/
|
|
614
|
-
quantiles?:
|
|
642
|
+
quantiles?: QuantileStats;
|
|
615
643
|
/**
|
|
616
644
|
* Top values by number of values.
|
|
617
645
|
*
|
|
@@ -747,7 +775,7 @@ declare function opacityToAlpha(opacity?: number): number;
|
|
|
747
775
|
declare function getColorAccessor({ name, colorColumn }: VisualChannelField, scaleType: ScaleType, { aggregation, range }: {
|
|
748
776
|
aggregation: string;
|
|
749
777
|
range: any;
|
|
750
|
-
}, opacity: number | undefined, data:
|
|
778
|
+
}, opacity: number | undefined, data: TilejsonResult): {
|
|
751
779
|
accessor: any;
|
|
752
780
|
scale: any;
|
|
753
781
|
};
|
|
@@ -761,7 +789,7 @@ declare function getIconUrlAccessor(field: VisualChannelField | null | undefined
|
|
|
761
789
|
declare function getMaxMarkerSize(visConfig: VisConfig, visualChannels: VisualChannels): number;
|
|
762
790
|
type Accessor = number | ((d: any, i: any) => number);
|
|
763
791
|
declare function negateAccessor(accessor: Accessor): Accessor;
|
|
764
|
-
declare function getSizeAccessor({ name }: VisualChannelField, scaleType: ScaleType | undefined, aggregation: string | null | undefined, range: Iterable<Range> | null | undefined, data:
|
|
792
|
+
declare function getSizeAccessor({ name }: VisualChannelField, scaleType: ScaleType | undefined, aggregation: string | null | undefined, range: Iterable<Range> | null | undefined, data: TilejsonResult): {
|
|
765
793
|
accessor: any;
|
|
766
794
|
scale: any;
|
|
767
795
|
};
|
|
@@ -980,6 +1008,9 @@ type Dataset = {
|
|
|
980
1008
|
exportToBucketAvailable?: boolean;
|
|
981
1009
|
};
|
|
982
1010
|
|
|
1011
|
+
type StyleLayerGroupSlug = 'label' | 'road' | 'border' | 'building' | 'water' | 'land';
|
|
1012
|
+
declare function applyLayerGroupFilters(style: any, // this Maplibre/Mapbox style, we don't want to add a dependency on Maplibre
|
|
1013
|
+
visibleLayerGroups: Record<StyleLayerGroupSlug, boolean>): any;
|
|
983
1014
|
declare const _default: {
|
|
984
1015
|
readonly VOYAGER: string;
|
|
985
1016
|
readonly POSITRON: string;
|
|
@@ -2051,4 +2082,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
2051
2082
|
*/
|
|
2052
2083
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
2053
2084
|
|
|
2054
|
-
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, _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 };
|
|
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 };
|
package/build/api-client.js
CHANGED
|
@@ -9287,13 +9287,13 @@ function domainFromAttribute(attribute, scaleType, scaleLength) {
|
|
|
9287
9287
|
return attribute.categories.map((c) => c.category).filter((c) => c !== void 0 && c !== null);
|
|
9288
9288
|
}
|
|
9289
9289
|
if (scaleType === "quantile" && attribute.quantiles) {
|
|
9290
|
-
return attribute.quantiles
|
|
9290
|
+
return "global" in attribute.quantiles ? attribute.quantiles.global[scaleLength] : attribute.quantiles[scaleLength];
|
|
9291
9291
|
}
|
|
9292
9292
|
let { min: min2 } = attribute;
|
|
9293
9293
|
if (scaleType === "log" && min2 === 0) {
|
|
9294
9294
|
min2 = 1e-5;
|
|
9295
9295
|
}
|
|
9296
|
-
return [min2, attribute.max];
|
|
9296
|
+
return [min2 ?? 0, attribute.max ?? 1];
|
|
9297
9297
|
}
|
|
9298
9298
|
function domainFromValues(values, scaleType) {
|
|
9299
9299
|
if (scaleType === "ordinal" || scaleType === "point") {
|
|
@@ -9314,7 +9314,9 @@ function calculateDomain(data, name, scaleType, scaleLength) {
|
|
|
9314
9314
|
if (data.tilestats) {
|
|
9315
9315
|
const { attributes } = data.tilestats.layers[0];
|
|
9316
9316
|
const attribute = attributes.find((a) => a.attribute === name);
|
|
9317
|
-
|
|
9317
|
+
if (attribute) {
|
|
9318
|
+
return domainFromAttribute(attribute, scaleType, scaleLength);
|
|
9319
|
+
}
|
|
9318
9320
|
}
|
|
9319
9321
|
return [0, 1];
|
|
9320
9322
|
}
|
|
@@ -10025,15 +10027,24 @@ function createChannelProps(id, layerType, config2, visualChannels, data, datase
|
|
|
10025
10027
|
radiusScale,
|
|
10026
10028
|
strokeColorField,
|
|
10027
10029
|
strokeColorScale,
|
|
10030
|
+
sizeField: strokeWidthField,
|
|
10031
|
+
sizeScale: strokeWidthScale,
|
|
10028
10032
|
weightField
|
|
10029
10033
|
} = visualChannels;
|
|
10030
10034
|
if (layerType === "raster") {
|
|
10035
|
+
const rasterMetadata = data.raster_metadata;
|
|
10036
|
+
if (!rasterMetadata) {
|
|
10037
|
+
return {
|
|
10038
|
+
channelProps: {},
|
|
10039
|
+
scales: {}
|
|
10040
|
+
};
|
|
10041
|
+
}
|
|
10031
10042
|
const rasterStyleType = config2.visConfig.rasterStyleType;
|
|
10032
10043
|
if (rasterStyleType === "Rgb") {
|
|
10033
10044
|
return {
|
|
10034
10045
|
channelProps: getRasterTileLayerStylePropsRgb({
|
|
10035
10046
|
layerConfig: config2,
|
|
10036
|
-
rasterMetadata
|
|
10047
|
+
rasterMetadata,
|
|
10037
10048
|
visualChannels
|
|
10038
10049
|
}),
|
|
10039
10050
|
scales: {}
|
|
@@ -10043,7 +10054,7 @@ function createChannelProps(id, layerType, config2, visualChannels, data, datase
|
|
|
10043
10054
|
channelProps: getRasterTileLayerStylePropsScaledBand({
|
|
10044
10055
|
layerConfig: config2,
|
|
10045
10056
|
visualChannels,
|
|
10046
|
-
rasterMetadata
|
|
10057
|
+
rasterMetadata
|
|
10047
10058
|
}),
|
|
10048
10059
|
scales: {
|
|
10049
10060
|
...colorField && {
|
|
@@ -10164,6 +10175,21 @@ function createChannelProps(id, layerType, config2, visualChannels, data, datase
|
|
|
10164
10175
|
...domainAndRangeFromScale(scale2)
|
|
10165
10176
|
};
|
|
10166
10177
|
}
|
|
10178
|
+
if (strokeWidthField) {
|
|
10179
|
+
const { accessor, scale: scale2 } = getSizeAccessor(
|
|
10180
|
+
strokeWidthField,
|
|
10181
|
+
strokeWidthScale,
|
|
10182
|
+
visConfig.sizeAggregation,
|
|
10183
|
+
visConfig.sizeRange,
|
|
10184
|
+
data
|
|
10185
|
+
);
|
|
10186
|
+
result.getLineWidth = accessor;
|
|
10187
|
+
scales.lineWidth = updateTriggers.getLineWidth = {
|
|
10188
|
+
field: strokeWidthField,
|
|
10189
|
+
type: strokeWidthScale || "identity",
|
|
10190
|
+
...domainAndRangeFromScale(scale2)
|
|
10191
|
+
};
|
|
10192
|
+
}
|
|
10167
10193
|
if (heightField && visConfig.enable3d) {
|
|
10168
10194
|
const { accessor, scale: scale2 } = getSizeAccessor(
|
|
10169
10195
|
heightField,
|
|
@@ -10945,6 +10971,7 @@ export {
|
|
|
10945
10971
|
WidgetTableSource,
|
|
10946
10972
|
WidgetTilesetSource,
|
|
10947
10973
|
ErrorCode as _ErrorCode,
|
|
10974
|
+
applyLayerGroupFilters as _applyLayerGroupFilters,
|
|
10948
10975
|
_buildFeatureFilter,
|
|
10949
10976
|
createVecExprEvaluator as _createVecExprEvaluator,
|
|
10950
10977
|
domainFromValues as _domainFromValues,
|