@carto/api-client 0.5.8-alpha-others-orderby.2 → 0.5.8
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/CHANGELOG.md +5 -0
- package/build/api-client.cjs +19 -45
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +3 -12
- package/build/api-client.d.ts +3 -12
- package/build/api-client.js +20 -49
- package/build/api-client.js.map +1 -1
- package/build/worker-compat.js +17 -50
- package/build/worker-compat.js.map +1 -1
- package/build/worker.js +18 -38
- package/build/worker.js.map +1 -1
- package/package.json +2 -2
- package/src/filters/tileFeaturesRaster.ts +23 -20
- package/src/operations/groupBy.ts +2 -31
- package/src/widget-sources/types.ts +0 -12
- package/src/widget-sources/widget-remote-source.ts +2 -9
- package/src/widget-sources/widget-tileset-source-impl.ts +0 -2
package/build/api-client.d.cts
CHANGED
|
@@ -1165,7 +1165,6 @@ interface BaseRequestOptions {
|
|
|
1165
1165
|
filters?: Filters;
|
|
1166
1166
|
filterOwner?: string;
|
|
1167
1167
|
}
|
|
1168
|
-
type CategoryOrderBy = 'frequency_asc' | 'frequency_desc' | 'alphabetical_asc' | 'alphabetical_desc';
|
|
1169
1168
|
/**
|
|
1170
1169
|
* Examples:
|
|
1171
1170
|
* * population by state
|
|
@@ -1196,11 +1195,6 @@ interface CategoryRequestOptions extends BaseRequestOptions {
|
|
|
1196
1195
|
joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
|
|
1197
1196
|
/** Calculate `_carto_others` category for all categories after first N (N is threshold). */
|
|
1198
1197
|
othersThreshold?: number;
|
|
1199
|
-
/**
|
|
1200
|
-
* Order categories by frequency or alphabetically.
|
|
1201
|
-
* @default 'frequency_desc'
|
|
1202
|
-
*/
|
|
1203
|
-
orderBy?: CategoryOrderBy;
|
|
1204
1198
|
/** Return raw result (CategoryResponseRaw). */
|
|
1205
1199
|
rawResult?: boolean;
|
|
1206
1200
|
}
|
|
@@ -1337,7 +1331,6 @@ type FeaturesResponse = {
|
|
|
1337
1331
|
type FormulaResponse = {
|
|
1338
1332
|
value: number | null;
|
|
1339
1333
|
};
|
|
1340
|
-
/** Entry in the category widget response, see {@link WidgetRemoteSource#getCategories}. */
|
|
1341
1334
|
type CategoryResponseEntry = {
|
|
1342
1335
|
name: string | null;
|
|
1343
1336
|
value: number;
|
|
@@ -1631,7 +1624,7 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
|
|
|
1631
1624
|
getFeatures(): Promise<FeaturesResponse>;
|
|
1632
1625
|
getFormula({ column, operation, joinOperation, filters, filterOwner, spatialFilter, }: FormulaRequestOptions): Promise<FormulaResponse>;
|
|
1633
1626
|
getHistogram({ operation, ticks, column, joinOperation, filters, filterOwner, spatialFilter, }: HistogramRequestOptions): Promise<HistogramResponse>;
|
|
1634
|
-
getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, othersThreshold,
|
|
1627
|
+
getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, othersThreshold, rawResult, }: CategoryRequestOptions): Promise<CategoryResponse>;
|
|
1635
1628
|
getScatter({ xAxisColumn, yAxisColumn, xAxisJoinOperation, yAxisJoinOperation, filters, filterOwner, spatialFilter, }: ScatterRequestOptions): Promise<ScatterResponse>;
|
|
1636
1629
|
getTable({ columns, searchFilterColumn, searchFilterText, sortBy, sortDirection, sortByColumnType, offset, limit, filters, filterOwner, spatialFilter, }: TableRequestOptions): Promise<TableResponse>;
|
|
1637
1630
|
getTimeSeries({ column, stepSize, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
@@ -1837,16 +1830,14 @@ interface SortOptions {
|
|
|
1837
1830
|
declare function applySorting(features: FeatureData[], { sortBy, sortByDirection, sortByColumnType, }?: SortOptions): FeatureData[];
|
|
1838
1831
|
|
|
1839
1832
|
/** @privateRemarks Source: @carto/react-core */
|
|
1840
|
-
declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, othersThreshold,
|
|
1833
|
+
declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, othersThreshold, }: {
|
|
1841
1834
|
data: FeatureData[];
|
|
1842
1835
|
valuesColumns?: string[];
|
|
1843
1836
|
joinOperation?: AggregationType;
|
|
1844
1837
|
keysColumn: string;
|
|
1845
1838
|
operation: AggregationType;
|
|
1846
1839
|
othersThreshold?: number;
|
|
1847
|
-
orderBy?: CategoryOrderBy;
|
|
1848
1840
|
}): CategoryResponseRaw | null;
|
|
1849
|
-
declare function getSorter(orderBy: CategoryOrderBy): (a: CategoryResponseEntry, b: CategoryResponseEntry) => number;
|
|
1850
1841
|
|
|
1851
1842
|
/** @privateRemarks Source: @carto/react-core */
|
|
1852
1843
|
type GroupByFeature = {
|
|
@@ -1949,4 +1940,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
1949
1940
|
*/
|
|
1950
1941
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
1951
1942
|
|
|
1952
|
-
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
|
|
1943
|
+
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 CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, 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, _buildFeatureFilter, domainFromValues as _domainFromValues, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, clearDefaultRequestCache, clearFilters, configureSource, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerProps, getMaxMarkerSize, getSizeAccessor, 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
|
@@ -1165,7 +1165,6 @@ interface BaseRequestOptions {
|
|
|
1165
1165
|
filters?: Filters;
|
|
1166
1166
|
filterOwner?: string;
|
|
1167
1167
|
}
|
|
1168
|
-
type CategoryOrderBy = 'frequency_asc' | 'frequency_desc' | 'alphabetical_asc' | 'alphabetical_desc';
|
|
1169
1168
|
/**
|
|
1170
1169
|
* Examples:
|
|
1171
1170
|
* * population by state
|
|
@@ -1196,11 +1195,6 @@ interface CategoryRequestOptions extends BaseRequestOptions {
|
|
|
1196
1195
|
joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
|
|
1197
1196
|
/** Calculate `_carto_others` category for all categories after first N (N is threshold). */
|
|
1198
1197
|
othersThreshold?: number;
|
|
1199
|
-
/**
|
|
1200
|
-
* Order categories by frequency or alphabetically.
|
|
1201
|
-
* @default 'frequency_desc'
|
|
1202
|
-
*/
|
|
1203
|
-
orderBy?: CategoryOrderBy;
|
|
1204
1198
|
/** Return raw result (CategoryResponseRaw). */
|
|
1205
1199
|
rawResult?: boolean;
|
|
1206
1200
|
}
|
|
@@ -1337,7 +1331,6 @@ type FeaturesResponse = {
|
|
|
1337
1331
|
type FormulaResponse = {
|
|
1338
1332
|
value: number | null;
|
|
1339
1333
|
};
|
|
1340
|
-
/** Entry in the category widget response, see {@link WidgetRemoteSource#getCategories}. */
|
|
1341
1334
|
type CategoryResponseEntry = {
|
|
1342
1335
|
name: string | null;
|
|
1343
1336
|
value: number;
|
|
@@ -1631,7 +1624,7 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
|
|
|
1631
1624
|
getFeatures(): Promise<FeaturesResponse>;
|
|
1632
1625
|
getFormula({ column, operation, joinOperation, filters, filterOwner, spatialFilter, }: FormulaRequestOptions): Promise<FormulaResponse>;
|
|
1633
1626
|
getHistogram({ operation, ticks, column, joinOperation, filters, filterOwner, spatialFilter, }: HistogramRequestOptions): Promise<HistogramResponse>;
|
|
1634
|
-
getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, othersThreshold,
|
|
1627
|
+
getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, othersThreshold, rawResult, }: CategoryRequestOptions): Promise<CategoryResponse>;
|
|
1635
1628
|
getScatter({ xAxisColumn, yAxisColumn, xAxisJoinOperation, yAxisJoinOperation, filters, filterOwner, spatialFilter, }: ScatterRequestOptions): Promise<ScatterResponse>;
|
|
1636
1629
|
getTable({ columns, searchFilterColumn, searchFilterText, sortBy, sortDirection, sortByColumnType, offset, limit, filters, filterOwner, spatialFilter, }: TableRequestOptions): Promise<TableResponse>;
|
|
1637
1630
|
getTimeSeries({ column, stepSize, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
@@ -1837,16 +1830,14 @@ interface SortOptions {
|
|
|
1837
1830
|
declare function applySorting(features: FeatureData[], { sortBy, sortByDirection, sortByColumnType, }?: SortOptions): FeatureData[];
|
|
1838
1831
|
|
|
1839
1832
|
/** @privateRemarks Source: @carto/react-core */
|
|
1840
|
-
declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, othersThreshold,
|
|
1833
|
+
declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, othersThreshold, }: {
|
|
1841
1834
|
data: FeatureData[];
|
|
1842
1835
|
valuesColumns?: string[];
|
|
1843
1836
|
joinOperation?: AggregationType;
|
|
1844
1837
|
keysColumn: string;
|
|
1845
1838
|
operation: AggregationType;
|
|
1846
1839
|
othersThreshold?: number;
|
|
1847
|
-
orderBy?: CategoryOrderBy;
|
|
1848
1840
|
}): CategoryResponseRaw | null;
|
|
1849
|
-
declare function getSorter(orderBy: CategoryOrderBy): (a: CategoryResponseEntry, b: CategoryResponseEntry) => number;
|
|
1850
1841
|
|
|
1851
1842
|
/** @privateRemarks Source: @carto/react-core */
|
|
1852
1843
|
type GroupByFeature = {
|
|
@@ -1949,4 +1940,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
1949
1940
|
*/
|
|
1950
1941
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
1951
1942
|
|
|
1952
|
-
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
|
|
1943
|
+
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 CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, 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, _buildFeatureFilter, domainFromValues as _domainFromValues, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, clearDefaultRequestCache, clearFilters, configureSource, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerProps, getMaxMarkerSize, getSizeAccessor, 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
|
@@ -5474,11 +5474,7 @@ var DEFAULT_AGGREGATION_EXP_ALIAS = "__aggregationValue";
|
|
|
5474
5474
|
var DEFAULT_AGGREGATION_EXP = `1 AS ${DEFAULT_AGGREGATION_EXP_ALIAS}`;
|
|
5475
5475
|
|
|
5476
5476
|
// src/filters/tileFeaturesRaster.ts
|
|
5477
|
-
import {
|
|
5478
|
-
cellToChildren as _cellToChildren,
|
|
5479
|
-
cellToTile,
|
|
5480
|
-
getResolution as getResolution2
|
|
5481
|
-
} from "quadbin";
|
|
5477
|
+
import { cellToTile, getResolution as getResolution2, tileToCell } from "quadbin";
|
|
5482
5478
|
function tileFeaturesRaster({
|
|
5483
5479
|
tiles,
|
|
5484
5480
|
...options
|
|
@@ -5501,7 +5497,7 @@ function tileFeaturesRaster({
|
|
|
5501
5497
|
options.spatialFilter
|
|
5502
5498
|
);
|
|
5503
5499
|
if (intersection3 === false) continue;
|
|
5504
|
-
const tileSortedCells =
|
|
5500
|
+
const tileSortedCells = cellToChildrenRaster(parent, cellResolution);
|
|
5505
5501
|
for (let i = 0; i < tileSortedCells.length; i++) {
|
|
5506
5502
|
if (intersection3 !== true && !intersection3.has(tileSortedCells[i])) {
|
|
5507
5503
|
continue;
|
|
@@ -5529,17 +5525,19 @@ function isRasterTile(tile) {
|
|
|
5529
5525
|
function isRasterTileVisible(tile) {
|
|
5530
5526
|
return !!(tile.isVisible && tile.data?.cells?.numericProps);
|
|
5531
5527
|
}
|
|
5532
|
-
function
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5528
|
+
function cellToChildrenRaster(parent, resolution) {
|
|
5529
|
+
const parentTile = cellToTile(parent);
|
|
5530
|
+
const childZ = Number(resolution);
|
|
5531
|
+
const blockSize = 2 ** (childZ - parentTile.z);
|
|
5532
|
+
const childBaseX = parentTile.x * blockSize;
|
|
5533
|
+
const childBaseY = parentTile.y * blockSize;
|
|
5534
|
+
const cells = [];
|
|
5535
|
+
for (let i = 0, il = blockSize ** 2; i < il; i++) {
|
|
5536
|
+
const x = childBaseX + i % blockSize;
|
|
5537
|
+
const y = childBaseY + Math.floor(i / blockSize);
|
|
5538
|
+
cells.push(tileToCell({ x, y, z: childZ }));
|
|
5539
|
+
}
|
|
5540
|
+
return cells;
|
|
5543
5541
|
}
|
|
5544
5542
|
function isValidBandValue(value, nodata) {
|
|
5545
5543
|
return Number.isNaN(value) ? false : nodata !== value;
|
|
@@ -6321,14 +6319,7 @@ var WidgetRemoteSource = class extends WidgetSource {
|
|
|
6321
6319
|
rawResult,
|
|
6322
6320
|
...params
|
|
6323
6321
|
} = options;
|
|
6324
|
-
const {
|
|
6325
|
-
column,
|
|
6326
|
-
operation: operation2,
|
|
6327
|
-
operationColumn,
|
|
6328
|
-
operationExp,
|
|
6329
|
-
othersThreshold,
|
|
6330
|
-
orderBy
|
|
6331
|
-
} = params;
|
|
6322
|
+
const { column, operation: operation2, operationColumn, operationExp, othersThreshold } = params;
|
|
6332
6323
|
if (operation2 === AggregationTypes.Custom) {
|
|
6333
6324
|
assert2(operationExp, "operationExp is required for custom operation");
|
|
6334
6325
|
}
|
|
@@ -6344,8 +6335,7 @@ var WidgetRemoteSource = class extends WidgetSource {
|
|
|
6344
6335
|
operation: operation2,
|
|
6345
6336
|
operationExp,
|
|
6346
6337
|
operationColumn: operationColumn || column,
|
|
6347
|
-
othersThreshold
|
|
6348
|
-
orderBy
|
|
6338
|
+
othersThreshold
|
|
6349
6339
|
},
|
|
6350
6340
|
opts: { signal, headers: this.props.headers }
|
|
6351
6341
|
});
|
|
@@ -6753,8 +6743,7 @@ function groupValuesByColumn({
|
|
|
6753
6743
|
joinOperation,
|
|
6754
6744
|
keysColumn,
|
|
6755
6745
|
operation: operation2,
|
|
6756
|
-
othersThreshold
|
|
6757
|
-
orderBy = "frequency_desc"
|
|
6746
|
+
othersThreshold
|
|
6758
6747
|
}) {
|
|
6759
6748
|
if (Array.isArray(data) && data.length === 0) {
|
|
6760
6749
|
return { rows: null };
|
|
@@ -6778,7 +6767,7 @@ function groupValuesByColumn({
|
|
|
6778
6767
|
const allCategories = Array.from(groups).map(([name, value]) => ({
|
|
6779
6768
|
name,
|
|
6780
6769
|
value: targetOperation(value)
|
|
6781
|
-
})).sort(
|
|
6770
|
+
})).sort((a, b) => b.value - a.value);
|
|
6782
6771
|
if (othersThreshold && allCategories.length > othersThreshold) {
|
|
6783
6772
|
const otherValue = allCategories.slice(othersThreshold).flatMap(({ name }) => groups.get(name));
|
|
6784
6773
|
return {
|
|
@@ -6792,21 +6781,6 @@ function groupValuesByColumn({
|
|
|
6792
6781
|
rows: allCategories
|
|
6793
6782
|
};
|
|
6794
6783
|
}
|
|
6795
|
-
function getSorter(orderBy) {
|
|
6796
|
-
switch (orderBy) {
|
|
6797
|
-
case "frequency_asc":
|
|
6798
|
-
return (a, b) => a.value - b.value || localeCompare(a.name, b.name);
|
|
6799
|
-
case "frequency_desc":
|
|
6800
|
-
return (a, b) => b.value - a.value || localeCompare(a.name, b.name);
|
|
6801
|
-
case "alphabetical_asc":
|
|
6802
|
-
return (a, b) => localeCompare(a.name, b.name) || b.value - a.value;
|
|
6803
|
-
case "alphabetical_desc":
|
|
6804
|
-
return (a, b) => localeCompare(b.name, a.name) || b.value - a.value;
|
|
6805
|
-
}
|
|
6806
|
-
}
|
|
6807
|
-
function localeCompare(a, b) {
|
|
6808
|
-
return (a ?? "null").localeCompare(b ?? "null");
|
|
6809
|
-
}
|
|
6810
6784
|
|
|
6811
6785
|
// src/utils/dateUtils.ts
|
|
6812
6786
|
function getUTCMonday(date) {
|
|
@@ -7370,7 +7344,6 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
7370
7344
|
filterOwner,
|
|
7371
7345
|
spatialFilter,
|
|
7372
7346
|
othersThreshold,
|
|
7373
|
-
orderBy = "frequency_desc",
|
|
7374
7347
|
rawResult
|
|
7375
7348
|
}) {
|
|
7376
7349
|
const filteredFeatures = this._getFilteredFeatures(
|
|
@@ -7388,8 +7361,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
7388
7361
|
joinOperation,
|
|
7389
7362
|
keysColumn: column,
|
|
7390
7363
|
operation: operation2,
|
|
7391
|
-
othersThreshold
|
|
7392
|
-
orderBy
|
|
7364
|
+
othersThreshold
|
|
7393
7365
|
});
|
|
7394
7366
|
if (rawResult) {
|
|
7395
7367
|
return result;
|
|
@@ -10197,7 +10169,6 @@ export {
|
|
|
10197
10169
|
getLayerProps,
|
|
10198
10170
|
getMaxMarkerSize,
|
|
10199
10171
|
getSizeAccessor,
|
|
10200
|
-
getSorter,
|
|
10201
10172
|
getSpatialIndexFromGeoColumn,
|
|
10202
10173
|
getTextAccessor,
|
|
10203
10174
|
groupValuesByColumn,
|