@kepler.gl/table 3.3.0-alpha.8 → 3.3.0-alpha.9

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.
@@ -51,6 +51,11 @@ 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[];
@@ -83,11 +88,52 @@ declare class KeplerTable<F extends Field = Field> {
83
88
  importData({ data }: {
84
89
  data: ProtoDataset['data'];
85
90
  }): Promise<void>;
91
+ /**
92
+ * Replace this table's columns and fields with new data in place.
93
+ *
94
+ * Unlike `update()` (which only refreshes the rows of the existing data
95
+ * container), `updateSchema` rebuilds the schema — it can add, remove, rename
96
+ * or re-type columns. It preserves the table identity (`id`, `label`, `color`,
97
+ * `metadata`, `type`, `supportedFilterTypes`, `disableDataOperation`) set in
98
+ * the constructor.
99
+ *
100
+ * Synchronous on purpose: reducers call it directly to commit a schema change
101
+ * (see `UPDATE_DATASET`), while `importData` remains the async entry point for
102
+ * the task-based loading pipeline.
103
+ *
104
+ * @param data - new column data + field descriptors, e.g. `{cols, fields, arrowTable}`.
105
+ * When replacing columns, pass `cols` (the arrow vectors) so an
106
+ * `ArrowDataContainer` is built; a rows-only payload cannot express a schema change.
107
+ */
108
+ updateSchema(data: ProtoDataset['data']): this;
86
109
  /**
87
110
  * update table with new data
88
- * @param data - new data e.g. the arrow data with new batches loaded
111
+ * @param data - new data e.g. the arrow data with new batches loaded, or a full row snapshot
89
112
  */
90
113
  update(data: ProtoDataset['data']): Promise<this>;
114
+ /**
115
+ * Append column-ordered rows in place. No-op for Arrow/DuckDB (no `append`).
116
+ * Accessors stay bound: the container instance is not replaced.
117
+ * @returns false when the payload is rejected and the table is unchanged.
118
+ */
119
+ appendRows(rows: any[][]): boolean;
120
+ /**
121
+ * Replace rows that share `keyField` and append the rest. Last incoming row
122
+ * wins for a repeated key. No-op for Arrow/DuckDB.
123
+ * @returns false when the payload is rejected and the table is unchanged.
124
+ */
125
+ upsertRows(rows: any[][], keyField: string): boolean;
126
+ /**
127
+ * Remove rows by index in place. No-op for Arrow/DuckDB (no `remove`).
128
+ * @returns false when any index is invalid and the table is unchanged.
129
+ */
130
+ removeRows(indexes: number[]): boolean;
131
+ /**
132
+ * Indexes of rows whose `fieldName` value is in `values` (first-column-wins
133
+ * equality via Set). Empty when the field is missing.
134
+ */
135
+ findRowIndexesByFieldValues(fieldName: string, values: unknown[]): number[];
136
+ private afterRowMutation;
91
137
  get length(): number;
92
138
  /**
93
139
  * Get field
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kepler.gl/table",
3
3
  "author": "Shan He <shan@uber.com>",
4
- "version": "3.3.0-alpha.8",
4
+ "version": "3.3.0-alpha.9",
5
5
  "description": "kepler.gl constants used by kepler.gl components, actions and reducers",
6
6
  "license": "MIT",
7
7
  "main": "dist/cjs/index.js",
@@ -28,10 +28,10 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@kepler.gl/common-utils": "3.3.0-alpha.8",
32
- "@kepler.gl/constants": "3.3.0-alpha.8",
33
- "@kepler.gl/types": "3.3.0-alpha.8",
34
- "@kepler.gl/utils": "3.3.0-alpha.8",
31
+ "@kepler.gl/common-utils": "3.3.0-alpha.9",
32
+ "@kepler.gl/constants": "3.3.0-alpha.9",
33
+ "@kepler.gl/types": "3.3.0-alpha.9",
34
+ "@kepler.gl/utils": "3.3.0-alpha.9",
35
35
  "@loaders.gl/mvt": "^4.4.1",
36
36
  "@loaders.gl/pmtiles": "^4.4.1",
37
37
  "@types/d3-array": "^2.8.0",