@kepler.gl/table 3.3.0-alpha.2 → 3.3.0-alpha.20

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.
Files changed (75) hide show
  1. package/dist/cjs/dataset-ops/aggregations.js +133 -0
  2. package/dist/cjs/dataset-ops/column-edit.js +472 -0
  3. package/dist/cjs/dataset-ops/geometry.js +237 -0
  4. package/dist/cjs/dataset-ops/group-by.js +139 -0
  5. package/dist/cjs/dataset-ops/index.js +135 -0
  6. package/dist/cjs/dataset-ops/join.js +213 -0
  7. package/dist/cjs/dataset-ops/normalize-bigint-columns.js +58 -0
  8. package/dist/cjs/dataset-ops/proto-dataset.js +71 -0
  9. package/dist/cjs/dataset-ops/spatial-join.js +340 -0
  10. package/dist/cjs/dataset-ops/suitability.js +200 -0
  11. package/dist/cjs/dataset-ops/table-helpers.js +48 -0
  12. package/dist/cjs/dataset-ops/types.js +81 -0
  13. package/dist/cjs/dataset-utils.js +466 -0
  14. package/dist/cjs/gpu-filter-utils.js +368 -0
  15. package/dist/cjs/index.js +243 -0
  16. package/dist/cjs/kepler-table.js +1044 -0
  17. package/dist/cjs/tileset/raster-tile-utils.js +76 -0
  18. package/dist/cjs/tileset/tileset-utils.js +83 -0
  19. package/dist/cjs/tileset/vector-tile-utils.js +757 -0
  20. package/dist/cjs/tileset/wms-utils.js +236 -0
  21. package/dist/cjs/tileset/zarr-axis.js +178 -0
  22. package/dist/cjs/tileset/zarr-runtime.js +29 -0
  23. package/dist/cjs/tileset/zarr-utils.js +2168 -0
  24. package/dist/dataset-ops/aggregations.d.ts +17 -0
  25. package/dist/dataset-ops/column-edit.d.ts +48 -0
  26. package/dist/dataset-ops/geometry.d.ts +13 -0
  27. package/dist/dataset-ops/group-by.d.ts +3 -0
  28. package/dist/dataset-ops/index.d.ts +12 -0
  29. package/dist/dataset-ops/join.d.ts +3 -0
  30. package/dist/dataset-ops/normalize-bigint-columns.d.ts +7 -0
  31. package/dist/dataset-ops/proto-dataset.d.ts +20 -0
  32. package/dist/dataset-ops/spatial-join.d.ts +17 -0
  33. package/dist/dataset-ops/suitability.d.ts +15 -0
  34. package/dist/dataset-ops/table-helpers.d.ts +12 -0
  35. package/dist/dataset-ops/types.d.ts +164 -0
  36. package/dist/dataset-utils.d.ts +2 -2
  37. package/dist/esm/dataset-ops/aggregations.js +120 -0
  38. package/dist/esm/dataset-ops/column-edit.js +460 -0
  39. package/dist/esm/dataset-ops/geometry.js +225 -0
  40. package/dist/esm/dataset-ops/group-by.js +134 -0
  41. package/dist/esm/dataset-ops/index.js +24 -0
  42. package/dist/esm/dataset-ops/join.js +208 -0
  43. package/dist/esm/dataset-ops/normalize-bigint-columns.js +51 -0
  44. package/dist/esm/dataset-ops/proto-dataset.js +62 -0
  45. package/dist/esm/dataset-ops/spatial-join.js +332 -0
  46. package/dist/esm/dataset-ops/suitability.js +191 -0
  47. package/dist/esm/dataset-ops/table-helpers.js +38 -0
  48. package/dist/esm/dataset-ops/types.js +74 -0
  49. package/dist/esm/dataset-utils.js +460 -0
  50. package/dist/esm/gpu-filter-utils.js +357 -0
  51. package/dist/esm/index.js +18 -0
  52. package/dist/esm/kepler-table.js +1031 -0
  53. package/dist/esm/tileset/raster-tile-utils.js +69 -0
  54. package/dist/esm/tileset/tileset-utils.js +79 -0
  55. package/dist/esm/tileset/vector-tile-utils.js +747 -0
  56. package/dist/esm/tileset/wms-utils.js +224 -0
  57. package/dist/esm/tileset/zarr-axis.js +167 -0
  58. package/dist/esm/tileset/zarr-runtime.js +22 -0
  59. package/dist/esm/tileset/zarr-utils.js +2144 -0
  60. package/dist/gpu-filter-utils.d.ts +4 -0
  61. package/dist/index.d.ts +7 -1
  62. package/dist/kepler-table.d.ts +56 -5
  63. package/dist/tileset/wms-utils.d.ts +40 -0
  64. package/dist/tileset/zarr-axis.d.ts +23 -0
  65. package/dist/tileset/zarr-runtime.d.ts +4 -0
  66. package/dist/tileset/zarr-utils.d.ts +200 -0
  67. package/package.json +34 -17
  68. package/dist/dataset-utils.js +0 -440
  69. package/dist/gpu-filter-utils.js +0 -254
  70. package/dist/index.js +0 -127
  71. package/dist/kepler-table.js +0 -648
  72. package/dist/tileset/raster-tile-utils.js +0 -76
  73. package/dist/tileset/tileset-utils.js +0 -73
  74. package/dist/tileset/vector-tile-utils.js +0 -741
  75. package/dist/tileset/vector-tile-utils.spec.js +0 -303
@@ -26,3 +26,7 @@ export declare function getGpuFilterProps(filters: Filter[], dataId: string, fie
26
26
  * The index matches the same dataset index for filter.dataId
27
27
  */
28
28
  export declare function getDatasetFieldIndexForFilter(dataId: string, filter: Filter): number;
29
+ /**
30
+ * Return dataset field index from filter.endFieldIdx for interval time filters.
31
+ */
32
+ export declare function getDatasetEndFieldIndexForFilter(dataId: string, filter: Filter): number;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,13 @@
1
- export { default, default as KeplerTable, findPointFieldPairs, copyTableAndUpdate, pinTableColumns, sortDatasetByColumn, copyTable, maybeToDate } from './kepler-table';
1
+ export { default, default as KeplerTable, findPointFieldPairs, copyTableAndUpdate, pinTableColumns, showAllTableColumns, toggleHiddenTableColumn, sortDatasetByColumn, copyTable, maybeToDate, getFieldValueAccessor } from './kepler-table';
2
2
  export type { BooleanFieldFilterProps, Datasets, FilterProps, GpuFilter, NumericFieldFilterProps, StringFieldFilterProps, TimeFieldFilterProps } from './kepler-table';
3
3
  export * from './gpu-filter-utils';
4
4
  export * from './dataset-utils';
5
+ export * from './tileset/wms-utils';
5
6
  export * from './tileset/tileset-utils';
6
7
  export * from './tileset/vector-tile-utils';
7
8
  export * from './tileset/raster-tile-utils';
9
+ export { getZarrMetadata, getZarrTimeDomain, getZarrVariable, openZarrNode, selectZarrVariable } from './tileset/zarr-utils';
10
+ export type { ZarrMetadataProgress } from './tileset/zarr-utils';
11
+ export * from './dataset-ops';
12
+ export { getZarrAxis, getZarrAxisDimensions, getZarrForecastAxes, isExplicitZarrAxis, formatZarrCoordinate } from './tileset/zarr-axis';
13
+ export type { ZarrAxis, ZarrAxisFrame } from './tileset/zarr-axis';
@@ -1,4 +1,4 @@
1
- import { RGBColor, Field, FieldPair, FieldDomain, Filter, ProtoDataset, FilterRecord, FilterDatasetOpt, RangeFieldDomain, SelectFieldDomain, MultiSelectFieldDomain, TimeRangeFieldDomain } from '@kepler.gl/types';
1
+ import { RGBColor, ColorRange, Field, FieldPair, FieldDomain, Filter, ProtoDataset, FilterRecord, FilterDatasetOpt, RangeFieldDomain, SelectFieldDomain, MultiSelectFieldDomain, TimeRangeFieldDomain } from '@kepler.gl/types';
2
2
  import { DataContainerInterface, FilterChanged } from '@kepler.gl/utils';
3
3
  type Layer = any;
4
4
  export type GpuFilter = {
@@ -51,10 +51,16 @@ declare class KeplerTable<F extends Field = Field> {
51
51
  color: RGBColor;
52
52
  fields: F[];
53
53
  dataContainer: DataContainerInterface;
54
+ /**
55
+ * Bumped in {@link update} so layer `dataUpdateTriggers` notice in-place row
56
+ * snapshots (the dataContainer instance stays the same).
57
+ */
58
+ dataRevision: number;
54
59
  allIndexes: number[];
55
60
  filteredIndex: number[];
56
61
  filteredIdxCPU?: number[];
57
62
  filteredIndexForDomain: number[];
63
+ filteredIndexByLayer: Record<string, number[]>;
58
64
  fieldPairs: FieldPair[];
59
65
  gpuFilter: GpuFilter;
60
66
  filterRecord?: FilterRecord;
@@ -65,6 +71,8 @@ declare class KeplerTable<F extends Field = Field> {
65
71
  };
66
72
  sortOrder?: number[] | null;
67
73
  pinnedColumns?: string[];
74
+ /** Attribute-table columns omitted from data export. */
75
+ hiddenColumns?: string[];
68
76
  supportedFilterTypes?: string[] | null;
69
77
  disableDataOperation?: boolean;
70
78
  metadata: Record<string, any>;
@@ -82,11 +90,52 @@ declare class KeplerTable<F extends Field = Field> {
82
90
  importData({ data }: {
83
91
  data: ProtoDataset['data'];
84
92
  }): Promise<void>;
93
+ /**
94
+ * Replace this table's columns and fields with new data in place.
95
+ *
96
+ * Unlike `update()` (which only refreshes the rows of the existing data
97
+ * container), `updateSchema` rebuilds the schema — it can add, remove, rename
98
+ * or re-type columns. It preserves the table identity (`id`, `label`, `color`,
99
+ * `metadata`, `type`, `supportedFilterTypes`, `disableDataOperation`) set in
100
+ * the constructor.
101
+ *
102
+ * Synchronous on purpose: reducers call it directly to commit a schema change
103
+ * (see `UPDATE_DATASET`), while `importData` remains the async entry point for
104
+ * the task-based loading pipeline.
105
+ *
106
+ * @param data - new column data + field descriptors, e.g. `{cols, fields, arrowTable}`.
107
+ * When replacing columns, pass `cols` (the arrow vectors) so an
108
+ * `ArrowDataContainer` is built; a rows-only payload cannot express a schema change.
109
+ */
110
+ updateSchema(data: ProtoDataset['data']): this;
85
111
  /**
86
112
  * update table with new data
87
- * @param data - new data e.g. the arrow data with new batches loaded
113
+ * @param data - new data e.g. the arrow data with new batches loaded, or a full row snapshot
88
114
  */
89
115
  update(data: ProtoDataset['data']): Promise<this>;
116
+ /**
117
+ * Append column-ordered rows in place. Accessors stay bound: the container
118
+ * instance is not replaced. No-op when the container has no `append`.
119
+ * @returns false when the payload is rejected and the table is unchanged.
120
+ */
121
+ appendRows(rows: any[][]): boolean;
122
+ /**
123
+ * Replace rows that share `keyField` and append the rest. Last incoming row
124
+ * wins for a repeated key. No-op when the container has no `append`/`replace`.
125
+ * @returns false when the payload is rejected and the table is unchanged.
126
+ */
127
+ upsertRows(rows: any[][], keyField: string): boolean;
128
+ /**
129
+ * Remove rows by index in place. No-op when the container has no `remove`.
130
+ * @returns false when any index is invalid and the table is unchanged.
131
+ */
132
+ removeRows(indexes: number[]): boolean;
133
+ /**
134
+ * Indexes of rows whose `fieldName` value is in `values` (first-column-wins
135
+ * equality via Set). Empty when the field is missing.
136
+ */
137
+ findRowIndexesByFieldValues(fieldName: string, values: unknown[]): number[];
138
+ private afterRowMutation;
90
139
  get length(): number;
91
140
  /**
92
141
  * Get field
@@ -144,7 +193,7 @@ declare class KeplerTable<F extends Field = Field> {
144
193
  /**
145
194
  * Get the domain of this column based on scale type
146
195
  */
147
- getColumnLayerDomain(field: F, scaleType: string): number[] | string[] | [number, number] | null;
196
+ getColumnLayerDomain(field: F, scaleType: string, range?: ColorRange): number[] | string[] | [number, number] | null;
148
197
  /**
149
198
  * Get a sample of rows to calculate layer boundaries
150
199
  */
@@ -178,6 +227,8 @@ export declare function findPointFieldPairs(fields: Field[]): FieldPair[];
178
227
  */
179
228
  export declare function sortDatasetByColumn(dataset: KeplerTable<Field>, column: string, mode?: string): KeplerTable<Field>;
180
229
  export declare function pinTableColumns(dataset: KeplerTable<Field>, column: string): KeplerTable<Field>;
230
+ export declare function toggleHiddenTableColumn(dataset: KeplerTable<Field>, column: string): KeplerTable<Field>;
231
+ export declare function showAllTableColumns(dataset: KeplerTable<Field>): KeplerTable<Field>;
181
232
  export declare function copyTable(original: KeplerTable<Field>): KeplerTable<Field>;
182
233
  /**
183
234
  * @type
@@ -187,7 +238,7 @@ export declare function copyTableAndUpdate(original: KeplerTable<Field>, options
187
238
  export declare function getFieldValueAccessor<F extends {
188
239
  type?: Field['type'];
189
240
  format?: Field['format'];
190
- }>(f: F, i: number, dc: DataContainerInterface): (d: any[] | {
241
+ }>(f: F, i: number, dc: DataContainerInterface): (d: {
191
242
  index: number;
192
- }) => any;
243
+ } | any[]) => any;
193
244
  export default KeplerTable;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * LegendURL may be a relative URI. Resolve it against the WMS service URL so
3
+ * `<img src>` does not load it from the Kepler app origin.
4
+ */
5
+ export declare function resolveWmsLegendUrl(href: string, serviceUrl?: string): string | null;
6
+ /**
7
+ * Walk raw GetCapabilities JSON (from loaders.gl `includeRawJSON`) and collect
8
+ * Style/LegendURL OnlineResource hrefs keyed by layer name.
9
+ */
10
+ export declare function collectWmsLegendUrlsFromRawJson(json: unknown): Record<string, string>;
11
+ /**
12
+ * Replace WMS request parameters on a service URL while keeping vendor query params.
13
+ */
14
+ export declare function buildWmsRequestUrl(serviceUrl: string, params: Record<string, string | undefined>): string | null;
15
+ export declare function buildWmsGetCapabilitiesUrl(serviceUrl: string): string | null;
16
+ export declare function buildWmsGetLegendGraphicUrl(serviceUrl: string, layerName: string, options?: {
17
+ version?: string;
18
+ format?: string;
19
+ style?: string;
20
+ }): string | null;
21
+ export declare function wmsCapabilitiesToDatasetMetadata(capabilities: {
22
+ layers?: Array<{
23
+ name?: string;
24
+ title?: string;
25
+ geographicBoundingBox?: unknown;
26
+ queryable?: boolean;
27
+ layers?: any[];
28
+ }>;
29
+ json?: unknown;
30
+ version?: string;
31
+ }, serviceUrl?: string): {
32
+ layers: Array<{
33
+ name: string;
34
+ title: string;
35
+ boundingBox: number[] | null;
36
+ queryable?: boolean;
37
+ legendUrl?: string | null;
38
+ }>;
39
+ version: string;
40
+ };
@@ -0,0 +1,23 @@
1
+ import type { ZarrAxisConfig, ZarrDimensionInfo, ZarrVariableInfo } from '@kepler.gl/constants';
2
+ export type ZarrAxisFrame = {
3
+ /** Numeric slider position; categorical/duplicate values use ordinal positions. */
4
+ value: number;
5
+ label: string;
6
+ /** Original array indices, independent of axis sorting and display labels. */
7
+ selection: Record<string, number>;
8
+ };
9
+ export type ZarrAxis = {
10
+ label: string;
11
+ dimensions: string[];
12
+ frames: ZarrAxisFrame[];
13
+ error?: string;
14
+ };
15
+ export declare function isExplicitZarrAxis(axis?: ZarrAxisConfig): boolean;
16
+ export declare function getZarrAxisDimensions(axis?: ZarrAxisConfig): string[];
17
+ export declare function getZarrForecastAxes(variable: ZarrVariableInfo): ZarrAxisConfig[];
18
+ export declare function formatZarrCoordinate(dimension: ZarrDimensionInfo, index: number): string;
19
+ /**
20
+ * A small, per-variable table of playable slices. Never expands unrelated
21
+ * dimensions (ensemble, band, scenario, etc.) or raster pixels into rows.
22
+ */
23
+ export declare function getZarrAxis(variable: ZarrVariableInfo | null | undefined, config?: ZarrAxisConfig, pins?: Record<string, number>): ZarrAxis;
@@ -0,0 +1,4 @@
1
+ export declare function loadZarrRuntime(): Promise<{
2
+ zarr: typeof import("zarrita");
3
+ parseGeoZarrMetadata: typeof import("@developmentseed/geozarr")["parseGeoZarrMetadata"];
4
+ }>;
@@ -0,0 +1,200 @@
1
+ import type * as zarr from 'zarrita';
2
+ import type { ZarrDatasetMetadata, ZarrDimensionInfo, ZarrVariableInfo } from '@kepler.gl/constants';
3
+ export type CfTimeUnits = {
4
+ /** Milliseconds represented by one coordinate step. */
5
+ stepMs: number;
6
+ /** Epoch milliseconds of coordinate value zero. */
7
+ originMs: number;
8
+ };
9
+ type AnyAttrs = Record<string, unknown>;
10
+ type StoreContents = {
11
+ path: string;
12
+ kind: 'array' | 'group';
13
+ }[];
14
+ type ListableStore = zarr.Readable & {
15
+ contents?: () => StoreContents;
16
+ signal?: AbortSignal;
17
+ };
18
+ /**
19
+ * Node kinds by normalized path, built from the store's consolidated metadata.
20
+ *
21
+ * Zarr over plain HTTP has no directory listing, so without this every guess at
22
+ * a coordinate or grid-mapping path costs a round trip that usually 404s. When
23
+ * the store publishes a listing we consult it instead of probing. Null means
24
+ * the store has no consolidated metadata and probing is the only option.
25
+ */
26
+ type StoreIndex = Map<string, 'array' | 'group'> | null;
27
+ /**
28
+ * Parse a CF `units` string of the form `"<unit> since <timestamp>"`.
29
+ *
30
+ * Returns null for units that are not fixed-length (months, years) or for a
31
+ * timestamp the runtime cannot parse, so callers can fall back to treating the
32
+ * dimension as non-temporal instead of producing nonsense dates.
33
+ */
34
+ export declare function parseCfTimeUnits(units?: string | null): CfTimeUnits | null;
35
+ /**
36
+ * Decode CF-encoded time coordinates into epoch milliseconds.
37
+ *
38
+ * Returns null when the units are missing, not fixed-length, or the calendar is
39
+ * one of the synthetic CF calendars (`360_day`, `noleap`, ...) that cannot be
40
+ * represented on a real timeline.
41
+ */
42
+ export declare function decodeCfTime(values: ArrayLike<number | bigint> | null | undefined, units?: string | null, calendar?: string | null): number[] | null;
43
+ /**
44
+ * Animation domain for a decoded time dimension, or null when the dimension
45
+ * carries fewer than two usable timestamps.
46
+ */
47
+ export declare function getZarrTimeDomain(dimension?: ZarrDimensionInfo | null): {
48
+ domain: [number, number];
49
+ timeSteps: number[];
50
+ } | null;
51
+ /** Find a variable by path, falling back to the dataset's active variable. */
52
+ export declare function getZarrVariable(metadata?: Partial<ZarrDatasetMetadata> | null, variablePath?: string): ZarrVariableInfo | undefined;
53
+ /**
54
+ * Switch the active variable of an already-fetched dataset metadata. Pure, so
55
+ * the layer can react to the variable dropdown without refetching the store.
56
+ */
57
+ export declare function selectZarrVariable(metadata: ZarrDatasetMetadata, variablePath: string): ZarrDatasetMetadata;
58
+ export type ZarrMetadataProgress = {
59
+ phase: 'connecting' | 'downloading' | 'processing';
60
+ loadedBytes: number;
61
+ /** Total for completed and active downloads, when every active size is known. */
62
+ totalBytes?: number;
63
+ };
64
+ /**
65
+ * Open a Zarr store, preferring consolidated metadata so variable discovery
66
+ * costs one request instead of one per node. Memoized per URL because the
67
+ * dataset refresh and the layer open the same store. Cancellable metadata
68
+ * previews use their own store so aborting a preview cannot affect a layer.
69
+ */
70
+ export declare function openZarrStore(url: string): Promise<ListableStore>;
71
+ /**
72
+ * Open the node that backs a variable: a multiscale group, or the array itself
73
+ * for a single-resolution dataset. This is what `ZarrLayer` takes as its `node`
74
+ * prop, already resolved so the layer does not need a `variable` path.
75
+ */
76
+ export declare function openZarrNode(url: string, variablePath?: string): Promise<zarr.Array<zarr.DataType, zarr.Readable> | zarr.Group<zarr.Readable>>;
77
+ /** Drop a cached store so a refresh re-reads the consolidated metadata. */
78
+ export declare function clearZarrStoreCache(url?: string): void;
79
+ /**
80
+ * Dimension names for a zarr array. Zarr v3 stores them in `dimension_names`;
81
+ * xarray-written v2 stores put them in the `_ARRAY_DIMENSIONS` attribute.
82
+ */
83
+ export declare function getZarrDimensionNames(arr: {
84
+ dimensionNames?: (string | null)[];
85
+ attrs?: AnyAttrs;
86
+ shape: number[];
87
+ }): string[] | null;
88
+ /**
89
+ * Resolve a coordinate array to a concrete path using the store listing, with
90
+ * no network access. Returns null when the store has no listing (the caller
91
+ * must probe) or when no candidate exists.
92
+ */
93
+ export declare function resolveCoordinatePath(index: StoreIndex, variablePath: string, name: string): string | null;
94
+ /**
95
+ * GDAL writes its six-element `GeoTransform` as a space-separated string in
96
+ * `[c, a, b, f, d, e]` order. `@developmentseed/affine` wants `[a, b, c, d, e, f]`.
97
+ */
98
+ export declare function parseGdalGeoTransform(value: unknown): number[] | null;
99
+ export type AxisSpacing = {
100
+ first: number;
101
+ step: number;
102
+ };
103
+ /**
104
+ * Build an affine from the spacing of two cell-center axes. The affine maps the
105
+ * outer edge of the first cell, so each origin is stepped back by half a cell.
106
+ */
107
+ export declare function affineFromCellCenters(x: AxisSpacing, y: AxisSpacing): number[];
108
+ /**
109
+ * Derive a constant step from a cell-center coordinate array, rejecting any grid
110
+ * the affine would misrepresent. Every coordinate is checked rather than just
111
+ * the last, because an axis that drifts in the middle yet lands on the expected
112
+ * endpoint would otherwise yield a silently wrong georeference.
113
+ */
114
+ export declare function axisSpacingFromValues(raw: ArrayLike<number | bigint>): AxisSpacing | null;
115
+ /**
116
+ * Level paths of an OME-NGFF style `multiscales` attribute, finest first.
117
+ *
118
+ * `ndpyramid` and `xarray-multiscale` write a pyramid this way: a list of
119
+ * multiscale descriptors, each holding a `datasets` array of child paths. The
120
+ * zarr-conventions form the GeoZarr parser reads is instead an object with a
121
+ * `layout`, so the two have to be told apart and the OME form rewritten.
122
+ */
123
+ export declare function parseOmeMultiscaleLevels(attrs: AnyAttrs): string[] | null;
124
+ /**
125
+ * Whether `multiscales` describes a web-mercator tile pyramid.
126
+ *
127
+ * This is what `ndpyramid`'s `pyramid_reproject` writes and what CarbonPlan
128
+ * publishes: every level is reprojected to EPSG:3857 and covers the whole world
129
+ * in `pixels_per_tile * 2 ** level` pixels. Knowing that lets the renderer tie
130
+ * the level it draws to the map zoom, which is how such a pyramid is meant to
131
+ * be read.
132
+ */
133
+ export declare function isWebMercatorPyramid(attrs: AnyAttrs): boolean;
134
+ /**
135
+ * Order pyramid levels finest first, which is what the renderer expects.
136
+ *
137
+ * OME-NGFF asks for that order in the declaration, but a web-mercator pyramid —
138
+ * what `ndpyramid`'s `pyramid_reproject` writes, and what CarbonPlan publishes —
139
+ * numbers its levels by zoom, so `0` is the coarsest. Sorting by resolution
140
+ * rather than trusting the declared order reads either convention right.
141
+ */
142
+ export declare function orderLevelsFinestFirst<T extends {
143
+ shape: number[];
144
+ }>(levels: T[]): T[];
145
+ /**
146
+ * Names of the data arrays a pyramid level holds.
147
+ *
148
+ * An OME-NGFF level path points straight at the array, so there is nothing to
149
+ * name and the result is a single empty string. `ndpyramid` instead writes an
150
+ * xarray dataset per level, so the level is a group and each array inside it is
151
+ * a separate variable sharing the same pyramid.
152
+ */
153
+ export declare function multiscaleVariableNames(index: StoreIndex, levelPath: string): string[];
154
+ /**
155
+ * Rewrite per-level grids into the `multiscales.layout` the GeoZarr parser
156
+ * reads. Levels stay finest-first, which is the order it expects.
157
+ */
158
+ export declare function buildMultiscaleAttrs(base: AnyAttrs, levels: {
159
+ asset: string;
160
+ transform: number[];
161
+ shape: number[];
162
+ }[]): AnyAttrs;
163
+ type CoordinateResult = {
164
+ dimension: ZarrDimensionInfo;
165
+ isCfTime: boolean;
166
+ };
167
+ /** Decode coordinates without losing categorical labels or duration/calendar metadata. */
168
+ export declare function decodeZarrCoordinate(name: string, size: number, raw: ArrayLike<unknown> | Iterable<unknown>, attrs: AnyAttrs): CoordinateResult;
169
+ /**
170
+ * Stores often repeat a variable across scenario groups, e.g. `FUTUR/evap_total`
171
+ * and `HISTO/evap_total`. Listing those by array name alone shows the same label
172
+ * several times, so prepend the fewest leading path segments that tell them
173
+ * apart. Names that are already unique are left alone.
174
+ */
175
+ export declare function assignVariableDisplayNames<T extends {
176
+ path: string;
177
+ name: string;
178
+ displayName: string;
179
+ }>(variables: T[]): T[];
180
+ /**
181
+ * Prefix matching everything below a matched node, so its resolution levels are
182
+ * not offered as variables of their own. When the root matched, every remaining
183
+ * path is one of its children.
184
+ */
185
+ export declare function childPrefix(path: string): string;
186
+ /**
187
+ * Discover every renderable variable in a store.
188
+ *
189
+ * Nodes that declare the GeoZarr `spatial` and `geo-proj` conventions are used
190
+ * as-is. Very little published data does yet, so an array that does not declare
191
+ * them is still accepted when its CF/GDAL metadata is enough to derive the same
192
+ * information. Children of a matched node are skipped so resolution levels are
193
+ * not offered as separate variables.
194
+ */
195
+ export declare function getZarrMetadata(url: string, options?: {
196
+ variable?: string;
197
+ signal?: AbortSignal;
198
+ onProgress?: (progress: ZarrMetadataProgress) => void;
199
+ }): Promise<ZarrDatasetMetadata>;
200
+ export {};
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@kepler.gl/table",
3
3
  "author": "Shan He <shan@uber.com>",
4
- "version": "3.3.0-alpha.2",
4
+ "version": "3.3.0-alpha.20",
5
5
  "description": "kepler.gl constants used by kepler.gl components, actions and reducers",
6
6
  "license": "MIT",
7
- "main": "dist/index.js",
7
+ "main": "dist/cjs/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "keywords": [
10
10
  "babel",
@@ -19,31 +19,39 @@
19
19
  "url": "https://github.com/keplergl/kepler.gl.git"
20
20
  },
21
21
  "scripts": {
22
- "build": "rm -fr dist && babel src --out-dir dist --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts'",
23
- "build:umd": "NODE_OPTIONS=--openssl-legacy-provider webpack --config ./webpack/umd.js --progress --env.prod",
22
+ "build": "rm -fr dist && babel src --out-dir dist/cjs --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts,**/*.spec.ts,**/*.spec.tsx,**/*.spec.js,**/*.spec.jsx,**/*.test.ts,**/*.test.tsx,**/*.test.js,**/*.test.jsx' && BABEL_ENV=esm babel src --out-dir dist/esm --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts,**/*.spec.ts,**/*.spec.tsx,**/*.spec.js,**/*.spec.jsx,**/*.test.ts,**/*.test.tsx,**/*.test.js,**/*.test.jsx'",
24
23
  "build:types": "tsc --project ./tsconfig.production.json",
25
24
  "prepublishOnly": "babel-node ../../scripts/license-header/bin --license ../../FILE-HEADER && yarn build && yarn build:types",
26
- "stab": "mkdir -p dist && touch dist/index.js"
25
+ "stab": "mkdir -p dist/cjs dist/esm && touch dist/cjs/index.js dist/esm/index.js"
27
26
  },
28
27
  "files": [
29
- "dist",
30
- "umd"
28
+ "dist"
31
29
  ],
32
30
  "dependencies": {
33
- "@kepler.gl/common-utils": "3.3.0-alpha.2",
34
- "@kepler.gl/constants": "3.3.0-alpha.2",
35
- "@kepler.gl/types": "3.3.0-alpha.2",
36
- "@kepler.gl/utils": "3.3.0-alpha.2",
31
+ "@developmentseed/geozarr": "0.7.0",
32
+ "@kepler.gl/common-utils": "3.3.0-alpha.20",
33
+ "@kepler.gl/constants": "3.3.0-alpha.20",
34
+ "@kepler.gl/tasks-core": "3.3.0-alpha.20",
35
+ "@kepler.gl/types": "3.3.0-alpha.20",
36
+ "@kepler.gl/utils": "3.3.0-alpha.20",
37
+ "@loaders.gl/core": "^4.4.1",
37
38
  "@loaders.gl/mvt": "^4.4.1",
38
39
  "@loaders.gl/pmtiles": "^4.4.1",
40
+ "@loaders.gl/wkt": "^4.4.1",
41
+ "@turf/boolean-crosses": "^7.2.0",
42
+ "@turf/boolean-equal": "^7.2.0",
43
+ "@turf/boolean-intersects": "^7.2.0",
44
+ "@turf/boolean-overlap": "^7.2.0",
45
+ "@turf/boolean-touches": "^7.2.0",
46
+ "@turf/boolean-within": "^7.2.0",
47
+ "@turf/difference": "^7.2.0",
39
48
  "@types/d3-array": "^2.8.0",
40
- "@types/lodash": "4.17.5",
41
49
  "d3-array": "^2.8.0",
50
+ "es-toolkit": "^1.39.10",
42
51
  "global": "^4.3.0",
43
- "lodash": "4.17.23",
44
52
  "moment": "^2.10.6",
45
- "react-palm": "^3.3.8",
46
- "type-analyzer": "0.4.0"
53
+ "type-analyzer": "0.4.0",
54
+ "zarrita": "^0.7.3"
47
55
  },
48
56
  "nyc": {
49
57
  "sourceMap": false,
@@ -59,8 +67,17 @@
59
67
  "node": ">=20"
60
68
  },
61
69
  "volta": {
62
- "node": "20.19.3",
70
+ "node": "24.21.0",
63
71
  "yarn": "4.4.0"
64
72
  },
65
- "packageManager": "yarn@4.4.0"
73
+ "packageManager": "yarn@4.4.0",
74
+ "module": "dist/esm/index.js",
75
+ "exports": {
76
+ ".": {
77
+ "types": "./dist/index.d.ts",
78
+ "import": "./dist/esm/index.js",
79
+ "require": "./dist/cjs/index.js",
80
+ "default": "./dist/cjs/index.js"
81
+ }
82
+ }
66
83
  }