kepler.gl 3.1.0 → 3.1.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/README.md +27 -132
- package/dist/src/common-utils/src/data-type.d.ts +9 -1
- package/dist/src/components/src/common/data-table/header-cell.d.ts +1 -0
- package/dist/src/components/src/common/data-table/index.d.ts +1 -0
- package/dist/src/components/src/common/file-uploader/file-drop.d.ts +1 -32
- package/dist/src/components/src/common/item-selector/dropdown-list.d.ts +2 -2
- package/dist/src/components/src/common/item-selector/item-selector.d.ts +1 -1
- package/dist/src/components/src/common/item-selector/typeahead.d.ts +1 -1
- package/dist/src/components/src/geocoder/geocoder.d.ts +7 -0
- package/dist/src/components/src/geocoder-panel.d.ts +2 -2
- package/dist/src/components/src/hooks/use-fetch-vector-tile-metadata.d.ts +4 -3
- package/dist/src/constants/src/default-settings.d.ts +14 -1
- package/dist/src/deckgl-arrow-layers/src/constants.d.ts +0 -12
- package/dist/src/deckgl-arrow-layers/src/index.d.ts +0 -1
- package/dist/src/deckgl-arrow-layers/src/utils/utils.d.ts +12 -1
- package/dist/src/duckdb/src/components/preview-data-panel.d.ts +7 -2
- package/dist/src/duckdb/src/components/schema-panel.d.ts +12 -3
- package/dist/src/duckdb/src/processors/data-processor.d.ts +1 -0
- package/dist/src/duckdb/src/table/duckdb-table-utils.d.ts +106 -0
- package/dist/src/duckdb/src/table/duckdb-table.d.ts +5 -3
- package/dist/src/processors/src/data-processor.d.ts +15 -1
- package/dist/src/reducers/src/provider-state-updaters.d.ts +1 -0
- package/dist/src/reducers/src/vis-state-updaters.d.ts +1 -1
- package/dist/src/table/src/dataset-utils.d.ts +1 -1
- package/dist/src/table/src/tileset/vector-tile-utils.d.ts +17 -1
- package/dist/src/utils/src/application-config.d.ts +4 -3
- package/dist/src/utils/src/data-utils.d.ts +9 -3
- package/dist/src/utils/src/indexed-data-container.d.ts +2 -2
- package/dist/src/utils/src/map-style-utils/mapbox-utils.d.ts +1 -1
- package/dist/src/utils/src/map-utils.d.ts +1 -1
- package/dist/src/utils/src/plot.d.ts +2 -2
- package/package.json +5 -5
- package/src/actions/package.json +8 -8
- package/src/ai-assistant/dist/components/ai-assistant-component.js +2 -1
- package/src/ai-assistant/package.json +7 -7
- package/src/ai-assistant/src/components/ai-assistant-component.tsx +1 -0
- package/src/cloud-providers/package.json +2 -2
- package/src/common-utils/dist/data-type.d.ts +9 -1
- package/src/common-utils/dist/data-type.js +50 -1
- package/src/common-utils/package.json +3 -3
- package/src/common-utils/src/data-type.ts +49 -1
- package/src/components/dist/common/data-table/header-cell.d.ts +1 -0
- package/src/components/dist/common/data-table/header-cell.js +2 -2
- package/src/components/dist/common/data-table/index.d.ts +1 -0
- package/src/components/dist/common/data-table/index.js +5 -1
- package/src/components/dist/common/file-uploader/file-drop.d.ts +1 -32
- package/src/components/dist/common/file-uploader/file-drop.js +152 -167
- package/src/components/dist/common/item-selector/dropdown-list.d.ts +2 -2
- package/src/components/dist/common/item-selector/dropdown-list.js +2 -3
- package/src/components/dist/common/item-selector/item-selector.d.ts +1 -1
- package/src/components/dist/common/item-selector/typeahead.d.ts +1 -1
- package/src/components/dist/common/range-brush.js +3 -3
- package/src/components/dist/geocoder/geocoder.d.ts +7 -0
- package/src/components/dist/geocoder/geocoder.js +19 -11
- package/src/components/dist/geocoder-panel.d.ts +2 -2
- package/src/components/dist/geocoder-panel.js +64 -91
- package/src/components/dist/hooks/use-fetch-vector-tile-metadata.d.ts +4 -3
- package/src/components/dist/hooks/use-fetch-vector-tile-metadata.js +35 -26
- package/src/components/dist/hooks/use-legend-position.js +8 -4
- package/src/components/dist/map/map-legend-panel.js +2 -3
- package/src/components/dist/modal-container.js +8 -8
- package/src/components/dist/modals/tilesets-modals/tileset-vector-form.js +31 -12
- package/src/components/dist/side-panel/layer-panel/color-palette-preset.js +2 -2
- package/src/components/dist/side-panel/layer-panel/color-range-selector.js +10 -11
- package/src/components/dist/side-panel/layer-panel/color-selector.js +3 -3
- package/src/components/dist/side-panel/layer-panel/custom-palette.js +1 -2
- package/src/components/dist/side-panel/layer-panel/layer-configurator.js +6 -8
- package/src/components/dist/side-panel/layer-panel/vector-tile-layer-configurator.js +1 -2
- package/src/components/package.json +16 -16
- package/src/components/src/common/data-table/header-cell.tsx +2 -1
- package/src/components/src/common/data-table/index.tsx +4 -0
- package/src/components/src/common/file-uploader/file-drop.tsx +186 -161
- package/src/components/src/common/item-selector/dropdown-list.tsx +1 -6
- package/src/components/src/common/range-brush.tsx +2 -2
- package/src/components/src/geocoder/geocoder.tsx +16 -8
- package/src/components/src/geocoder-panel.tsx +95 -85
- package/src/components/src/hooks/use-fetch-vector-tile-metadata.ts +27 -25
- package/src/components/src/hooks/use-legend-position.ts +5 -2
- package/src/components/src/map/map-legend-panel.tsx +1 -2
- package/src/components/src/modal-container.tsx +7 -7
- package/src/components/src/modals/tilesets-modals/tileset-vector-form.tsx +12 -3
- package/src/components/src/side-panel/layer-panel/color-palette-preset.tsx +1 -1
- package/src/components/src/side-panel/layer-panel/color-range-selector.tsx +6 -11
- package/src/components/src/side-panel/layer-panel/color-selector.tsx +2 -2
- package/src/components/src/side-panel/layer-panel/custom-palette.tsx +0 -1
- package/src/components/src/side-panel/layer-panel/layer-configurator.tsx +23 -33
- package/src/components/src/side-panel/layer-panel/vector-tile-layer-configurator.tsx +0 -1
- package/src/constants/dist/default-settings.d.ts +14 -1
- package/src/constants/dist/default-settings.js +20 -5
- package/src/constants/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/91/4f/6c65f3a1eba584ffd2d892cabc25ab5804d4a9ef53694c98707372a83e56343a274bec04f15927a6fe7602615f0f23f73ccf599f524ef97ad6c77c8832ea +1 -0
- package/src/constants/node_modules/.cache/terser-webpack-plugin/index-v5/a6/b2/5424aa4477192fb44cc90fd80892efdc96731f2ff0f48e8f28abf64243cc +2 -0
- package/src/constants/package.json +2 -2
- package/src/constants/src/default-settings.ts +16 -1
- package/src/constants/umd/keplergl.min.js +2 -2
- package/src/deckgl-arrow-layers/dist/constants.d.ts +0 -12
- package/src/deckgl-arrow-layers/dist/constants.js +4 -15
- package/src/deckgl-arrow-layers/dist/index.d.ts +0 -1
- package/src/deckgl-arrow-layers/dist/index.js +1 -8
- package/src/deckgl-arrow-layers/dist/layers/geo-arrow-scatterplot-layer.js +4 -4
- package/src/deckgl-arrow-layers/dist/layers/geo-arrow-text-layer.js +5 -5
- package/src/deckgl-arrow-layers/dist/utils/utils.d.ts +12 -1
- package/src/deckgl-arrow-layers/dist/utils/utils.js +7 -5
- package/src/deckgl-arrow-layers/package.json +2 -1
- package/src/deckgl-arrow-layers/src/constants.ts +0 -13
- package/src/deckgl-arrow-layers/src/index.ts +0 -2
- package/src/deckgl-arrow-layers/src/layers/geo-arrow-scatterplot-layer.ts +5 -3
- package/src/deckgl-arrow-layers/src/layers/geo-arrow-text-layer.ts +8 -4
- package/src/deckgl-arrow-layers/src/utils/utils.ts +7 -5
- package/src/deckgl-layers/dist/deckgl-extensions/filter-arrow-layer.d.ts +1 -1
- package/src/deckgl-layers/dist/deckgl-extensions/filter-shader-module.d.ts +1 -1
- package/src/deckgl-layers/dist/deckgl-extensions/filter-shader-module.js +3 -3
- package/src/deckgl-layers/package.json +5 -5
- package/src/deckgl-layers/src/deckgl-extensions/filter-shader-module.ts +4 -3
- package/src/duckdb/dist/components/monaco-editor.js +4 -5
- package/src/duckdb/dist/components/preview-data-panel.d.ts +7 -2
- package/src/duckdb/dist/components/preview-data-panel.js +7 -8
- package/src/duckdb/dist/components/schema-panel.d.ts +12 -3
- package/src/duckdb/dist/components/schema-panel.js +41 -24
- package/src/duckdb/dist/components/sql-panel.js +245 -56
- package/src/duckdb/dist/init.js +20 -14
- package/src/duckdb/dist/processors/data-processor.d.ts +1 -0
- package/src/duckdb/dist/processors/data-processor.js +4 -4
- package/src/duckdb/dist/table/duckdb-table-utils.d.ts +106 -0
- package/src/duckdb/dist/table/duckdb-table-utils.js +493 -2
- package/src/duckdb/dist/table/duckdb-table.d.ts +5 -3
- package/src/duckdb/dist/table/duckdb-table.js +153 -261
- package/src/duckdb/package.json +6 -6
- package/src/duckdb/src/components/monaco-editor.tsx +3 -3
- package/src/duckdb/src/components/preview-data-panel.tsx +15 -8
- package/src/duckdb/src/components/schema-panel.tsx +92 -21
- package/src/duckdb/src/components/sql-panel.tsx +160 -22
- package/src/duckdb/src/init.ts +4 -1
- package/src/duckdb/src/processors/data-processor.ts +2 -2
- package/src/duckdb/src/table/duckdb-table-utils.ts +407 -1
- package/src/duckdb/src/table/duckdb-table.ts +61 -92
- package/src/effects/package.json +5 -5
- package/src/layers/dist/arc-layer/arc-layer.d.ts +1 -1
- package/src/layers/dist/arc-layer/arc-layer.js +2 -3
- package/src/layers/dist/base-layer.d.ts +7 -6
- package/src/layers/dist/base-layer.js +36 -19
- package/src/layers/dist/geojson-layer/geojson-layer.js +4 -2
- package/src/layers/dist/geojson-layer/geojson-utils.js +10 -3
- package/src/layers/dist/heatmap-layer/heatmap-layer.d.ts +2 -0
- package/src/layers/dist/heatmap-layer/heatmap-layer.js +16 -9
- package/src/layers/dist/icon-layer/icon-layer.d.ts +6 -3
- package/src/layers/dist/icon-layer/icon-layer.js +19 -11
- package/src/layers/dist/index.d.ts +1 -1
- package/src/layers/dist/index.js +1 -1
- package/src/layers/dist/layer-text-label.d.ts +9 -0
- package/src/layers/dist/layer-text-label.js +51 -6
- package/src/layers/dist/layer-utils.d.ts +39 -30
- package/src/layers/dist/layer-utils.js +69 -9
- package/src/layers/dist/line-layer/line-layer.d.ts +1 -1
- package/src/layers/dist/line-layer/line-layer.js +2 -3
- package/src/layers/dist/point-layer/point-layer.d.ts +10 -7
- package/src/layers/dist/point-layer/point-layer.js +16 -8
- package/src/layers/dist/trip-layer/trip-layer.d.ts +2 -2
- package/src/layers/dist/trip-layer/trip-layer.js +4 -2
- package/src/layers/dist/vector-tile/abstract-tile-layer.d.ts +3 -7
- package/src/layers/dist/vector-tile/abstract-tile-layer.js +7 -6
- package/src/layers/dist/vector-tile/vector-tile-layer.d.ts +5 -7
- package/src/layers/dist/vector-tile/vector-tile-layer.js +23 -2
- package/src/layers/package.json +11 -10
- package/src/layers/src/arc-layer/arc-layer.ts +1 -1
- package/src/layers/src/base-layer.ts +50 -9
- package/src/layers/src/geojson-layer/geojson-layer.ts +3 -1
- package/src/layers/src/geojson-layer/geojson-utils.ts +4 -1
- package/src/layers/src/heatmap-layer/heatmap-layer.ts +17 -12
- package/src/layers/src/icon-layer/icon-layer.ts +7 -3
- package/src/layers/src/index.ts +1 -2
- package/src/layers/src/layer-text-label.ts +53 -4
- package/src/layers/src/layer-utils.ts +88 -9
- package/src/layers/src/line-layer/line-layer.ts +1 -1
- package/src/layers/src/point-layer/point-layer.ts +15 -11
- package/src/layers/src/trip-layer/trip-layer.ts +4 -2
- package/src/layers/src/vector-tile/abstract-tile-layer.ts +11 -5
- package/src/layers/src/vector-tile/vector-tile-layer.ts +33 -4
- package/src/localization/package.json +1 -1
- package/src/processors/dist/data-processor.d.ts +15 -1
- package/src/processors/dist/data-processor.js +104 -11
- package/src/processors/package.json +8 -7
- package/src/processors/src/data-processor.ts +116 -13
- package/src/reducers/dist/export-utils.js +2 -2
- package/src/reducers/dist/layer-utils.js +1 -1
- package/src/reducers/dist/provider-state-updaters.d.ts +1 -0
- package/src/reducers/dist/provider-state-updaters.js +5 -2
- package/src/reducers/dist/vis-state-updaters.d.ts +1 -1
- package/src/reducers/dist/vis-state-updaters.js +23 -12
- package/src/reducers/package.json +16 -16
- package/src/reducers/src/export-utils.ts +1 -1
- package/src/reducers/src/layer-utils.ts +2 -1
- package/src/reducers/src/provider-state-updaters.ts +4 -1
- package/src/reducers/src/vis-state-updaters.ts +45 -10
- package/src/schemas/dist/dataset-schema.js +35 -6
- package/src/schemas/package.json +7 -7
- package/src/schemas/src/dataset-schema.ts +36 -8
- package/src/styles/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/a3/a9/7f26bbc52905b0e21e9366a30ef0ba98f4ccf9aa8dd8326d90ba90191ba2e305323f505bf134c825356156c793bf9386ed2cef2aeb48eb327c26d106f69a +1 -0
- package/src/styles/node_modules/.cache/terser-webpack-plugin/index-v5/7e/51/b8756555a0e2e696d944445ac23f7febf769006013fbc8419f39a701649d +2 -0
- package/src/styles/package.json +2 -2
- package/src/styles/umd/keplergl.min.js +2 -2
- package/src/table/dist/dataset-utils.js +23 -14
- package/src/table/dist/src/table/src/dataset-utils.d.ts +1 -1
- package/src/table/dist/src/table/src/tileset/vector-tile-utils.d.ts +17 -1
- package/src/table/dist/tileset/vector-tile-utils.js +122 -2
- package/src/table/package.json +5 -5
- package/src/table/src/dataset-utils.ts +16 -6
- package/src/table/src/tileset/vector-tile-utils.ts +131 -8
- package/src/tasks/package.json +2 -2
- package/src/types/actions.d.ts +1 -0
- package/src/types/layers.d.ts +1 -0
- package/src/types/package.json +1 -1
- package/src/types/types.d.ts +17 -0
- package/src/utils/dist/application-config.d.ts +4 -3
- package/src/utils/dist/application-config.js +3 -2
- package/src/utils/dist/data-scale-utils.js +4 -4
- package/src/utils/dist/data-utils.d.ts +9 -3
- package/src/utils/dist/data-utils.js +40 -7
- package/src/utils/dist/dataset-utils.js +23 -8
- package/src/utils/dist/indexed-data-container.d.ts +2 -2
- package/src/utils/dist/indexed-data-container.js +1 -1
- package/src/utils/dist/map-style-utils/mapbox-utils.d.ts +1 -1
- package/src/utils/dist/map-style-utils/mapbox-utils.js +3 -3
- package/src/utils/dist/plot.d.ts +2 -2
- package/src/utils/dist/plot.js +6 -6
- package/src/utils/map-utils.spec.js +1 -2
- package/src/utils/package.json +5 -4
- package/src/utils/src/application-config.ts +11 -8
- package/src/utils/src/data-scale-utils.ts +3 -3
- package/src/utils/src/data-utils.ts +36 -7
- package/src/utils/src/dataset-utils.ts +41 -9
- package/src/utils/src/indexed-data-container.ts +1 -1
- package/src/utils/src/map-style-utils/mapbox-utils.ts +2 -2
- package/src/utils/src/plot.ts +5 -5
- package/umd/keplergl.min.js +1279 -1295
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
[Kepler.gl][web] is a data-agnostic, high-performance web-based application for visual exploration of large-scale geolocation data sets. Built on top of [MapLibre GL](https://maplibre.org/) and [deck.gl](https://deck.gl/), kepler.gl can render millions of points representing thousands of trips and perform spatial aggregations on the fly.
|
|
35
35
|
|
|
36
|
-
Kepler.gl is also a React component that uses [Redux](https://redux.js.org/) to manage its state and data flow. It can be embedded into other React-Redux applications and is highly customizable. For information on how to embed kepler.gl in your app take a look at this step-by-step [tutorial]
|
|
36
|
+
Kepler.gl is also a React component that uses [Redux](https://redux.js.org/) to manage its state and data flow. It can be embedded into other React-Redux applications and is highly customizable. For information on how to embed kepler.gl in your app take a look at this step-by-step [tutorial](https://github.com/uber-archive/vis-academy/blob/master/src/docs/kepler.gl/0-setup.md) on vis.academy.
|
|
37
37
|
|
|
38
38
|
## Links
|
|
39
39
|
|
|
@@ -149,122 +149,32 @@ const Map = props => (
|
|
|
149
149
|
);
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
- Default: `state => state.keplerGl`
|
|
179
|
-
|
|
180
|
-
The path to the root keplerGl state in your reducer.
|
|
181
|
-
|
|
182
|
-
##### `width` (Number, optional)
|
|
183
|
-
|
|
184
|
-
- Default: `800`
|
|
185
|
-
|
|
186
|
-
Width of the KeplerGl UI.
|
|
187
|
-
|
|
188
|
-
##### `height` (Number, optional)
|
|
189
|
-
|
|
190
|
-
- Default: `800`
|
|
191
|
-
|
|
192
|
-
##### `appName` (String, optional)
|
|
193
|
-
|
|
194
|
-
- Default: `Kepler.Gl`
|
|
195
|
-
|
|
196
|
-
App name displayed in side panel header
|
|
197
|
-
|
|
198
|
-
##### `version` (String, optional)
|
|
199
|
-
|
|
200
|
-
- Default: `v1.0`
|
|
201
|
-
|
|
202
|
-
version displayed in side panel header
|
|
203
|
-
|
|
204
|
-
##### `onSaveMap` (Function, optional)
|
|
205
|
-
|
|
206
|
-
- Default: `undefined`
|
|
207
|
-
|
|
208
|
-
Action called when click Save Map Url in side panel header.
|
|
209
|
-
|
|
210
|
-
##### `onViewStateChange` (Function, optional)
|
|
211
|
-
|
|
212
|
-
- Default: `undefined`
|
|
213
|
-
- Parameter: `viewState` - An updated view state object containing parameters such as longitude, latitude, zoom etc
|
|
214
|
-
|
|
215
|
-
Action triggered when map viewport is updated.
|
|
216
|
-
|
|
217
|
-
##### `getMapboxRef(mapbox, index)` (Function, optional)
|
|
218
|
-
|
|
219
|
-
- Default: `undefined`
|
|
220
|
-
|
|
221
|
-
Function called when `KeplerGL` adds or removes a `MapContainer` component having an inner Mapbox map.
|
|
222
|
-
|
|
223
|
-
The `mapbox` argument is an [`MapRef`](https://visgl.github.io/react-map-gl/docs/api-reference/types#mapref) when added or `null` when removed.
|
|
224
|
-
|
|
225
|
-
The `index` argument is 0 for a single map or 1 for an additional map (since `KeplerGL` supports an optional split map view).
|
|
226
|
-
|
|
227
|
-
##### `actions` (Object, optional)
|
|
228
|
-
|
|
229
|
-
- Default: `{}`
|
|
230
|
-
|
|
231
|
-
Actions creators to replace default kepler.gl action creator. Only use custom action when you want to modify action payload.
|
|
232
|
-
|
|
233
|
-
##### `mint` (Boolean, optional)
|
|
234
|
-
|
|
235
|
-
- Default: `true`
|
|
236
|
-
|
|
237
|
-
Whether to load a fresh empty state when component is mounted. when parse `mint: true` kepler.gl component will always load a fresh state when re-mount the same component, state inside this component will be destroyed once its unmounted.
|
|
238
|
-
By Parsing `mint: false` kepler.gl will keep the component state in the store even when it is unmounted, and use it as initial state when re-mounted again. This is useful when mounting kepler.gl in a modal, and keep the same map when re-open.
|
|
239
|
-
|
|
240
|
-
Read more about [Components][components].
|
|
241
|
-
|
|
242
|
-
##### `theme` (Object | String, optional)
|
|
243
|
-
|
|
244
|
-
- default: `null`
|
|
245
|
-
|
|
246
|
-
One of `"dark"`, `"light"` or `"base"`
|
|
247
|
-
You can pass theme name or object used to customize Kepler.gl style. Kepler.gl provide an `'light'` theme besides the default 'dark' theme. When pass in a theme object Kepler.gl will use the value passed as input to override values from [theme](https://github.com/keplergl/kepler.gl/blob/master/src/styles/base.js).
|
|
248
|
-
|
|
249
|
-
Read more about [Custom Theme][custom-theme]
|
|
250
|
-
|
|
251
|
-
#### `mapboxApiUrl` (String, optional)
|
|
252
|
-
|
|
253
|
-
- Default: `https://api.mapbox.com`
|
|
254
|
-
|
|
255
|
-
If you are using your own mapbox tile server, you can pass in your own tile server api url.
|
|
256
|
-
|
|
257
|
-
#### `mapStylesReplaceDefault` (Boolean, optional)
|
|
258
|
-
|
|
259
|
-
- Default: `false`
|
|
260
|
-
|
|
261
|
-
kepler.gl provide 4 map styles to choose from. Pass `true` if you want to supply your own `mapStyles`. See Below.
|
|
262
|
-
|
|
263
|
-
#### `mapStyles` (Array, optional)
|
|
264
|
-
|
|
265
|
-
- Default: `[]`
|
|
266
|
-
|
|
267
|
-
You can supply additional map styles to be displayed in [map style selection panel](https://github.com/keplergl/kepler.gl/blob/master/docs/user-guides/f-map-styles/1-base-map-styles.md). By default, additional map styles will be added to default map styles. If pass `mapStylesReplaceDefault: true`, they will replace the default ones. kepler.gl will attempt to group layers of your style based on its `id` naming convention and use it to allow toggle visibility of [base map layers](https://github.com/keplergl/kepler.gl/blob/master/docs/user-guides/f-map-styles/2-map-layers.md). Supply your own `layerGroups` to override default for more accurate layer grouping.
|
|
152
|
+
### Props
|
|
153
|
+
|
|
154
|
+
| Prop Name | Type | Default Value | Description |
|
|
155
|
+
|-------------------------------|-------------|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
156
|
+
| `id` | String | `map` | The unique identifier for the KeplerGl instance. Required when multiple KeplerGl instances exist. It maps to the state in the reducer (e.g. component with id `foo` can be found in`state.keplerGl.foo`). |
|
|
157
|
+
| `mapboxApiAccessToken` | String | `undefined` | API token for Mapbox, used for rendering base maps. Create a free token at [Mapbox](https://www.mapbox.com). |
|
|
158
|
+
| `getState` | Function | `state => state.keplerGl` | Function that specifies the path to the root KeplerGl state in the reducer. |
|
|
159
|
+
| `width` | Number | `800` | The width of the KeplerGl UI in pixels. |
|
|
160
|
+
| `height` | Number | `800` | The height of the KeplerGl UI in pixels. |
|
|
161
|
+
| `appName` | String | `Kepler.Gl` | The app name displayed in the side panel header. |
|
|
162
|
+
| `version` | String | `v1.0` | The version displayed in the side panel header. |
|
|
163
|
+
| `onSaveMap` | Function | `undefined` | A function called when the "Save Map URL" in side panel header is clicked. |
|
|
164
|
+
| `onViewStateChange` | Function | `undefined` | Triggered when the map viewport is updated. Receives `viewState` parameter with updated values like longitude, latitude, zoom, etc. |
|
|
165
|
+
| `getMapboxRef(mapbox, index)` | Function | `undefined` | Called when `KeplerGl` adds or removes a MapContainer with an inner Mapbox map. `mapbox` is a `MapRef` when added, or `null` when removed. `index` is `0` for the first map and `1` for the second map in a split view. |
|
|
166
|
+
| `actions` | Object | `{}` | Custom action creators to override the default KeplerGl action creators. Only use custom action when you want to modify action payload. |
|
|
167
|
+
| `mint` | Boolean | `true` | Determines whether to load a fresh empty state when mounted. When `false`, the state persists across remounts. Useful for modal use cases. |
|
|
168
|
+
| `theme` | Object/String| `null` | Set to `"dark"`, `"light"`, or `"base"`, or pass a theme object to customize KeplerGl’s style. |
|
|
169
|
+
| `mapboxApiUrl` | String | `https://api.mapbox.com` | The Mapbox API URL if you are using a custom Mapbox tile server. |
|
|
170
|
+
| `mapStylesReplaceDefault` | Boolean | `false` | Set to `true` to replace default map styles with custom ones. (see ```mapStyles``` prop) |
|
|
171
|
+
| `mapStyles` | Array | `[]` | An array of [custom map styles](#example-custom-map-style) for the map style selection panel. Styles replace the default ones if `mapStylesReplaceDefault` is `true`. |
|
|
172
|
+
| `initialUiState` | Object | `undefined` | The initial UI state applied to the `uiState` reducer. |
|
|
173
|
+
| `localeMessages` | Object | `undefined` | Used to modify or add new translations. Read more about [Localization][localization]. |
|
|
174
|
+
|
|
175
|
+
#### Example Custom Map Style
|
|
176
|
+
|
|
177
|
+
You can supply additional map styles to be displayed in [map style selection panel](https://github.com/keplergl/kepler.gl/blob/master/docs/user-guides/f-map-styles/1-base-map-styles.md). By default, additional map styles will be added to default map styles. If you pass `mapStylesReplaceDefault: true`, they will replace the default ones. kepler.gl will attempt to group layers of your style based on its `id` naming convention and use it to allow toggle visibility of [base map layers](https://github.com/keplergl/kepler.gl/blob/master/docs/user-guides/f-map-styles/2-map-layers.md). Supply your own `layerGroups` to override default for more accurate layer grouping.
|
|
268
178
|
|
|
269
179
|
Each `mapStyles` should has the following properties:
|
|
270
180
|
|
|
@@ -288,7 +198,6 @@ const mapStyles = [
|
|
|
288
198
|
defaultVisibility: true
|
|
289
199
|
},
|
|
290
200
|
{
|
|
291
|
-
// adding this will keep the 3d building option
|
|
292
201
|
slug: '3d building',
|
|
293
202
|
filter: () => false,
|
|
294
203
|
defaultVisibility: false
|
|
@@ -298,20 +207,6 @@ const mapStyles = [
|
|
|
298
207
|
];
|
|
299
208
|
```
|
|
300
209
|
|
|
301
|
-
Read more about [Custom Map Styles][custom-map-styles].
|
|
302
|
-
|
|
303
|
-
#### `initialUiState` (object, optional)
|
|
304
|
-
|
|
305
|
-
- Default: `undefined`
|
|
306
|
-
|
|
307
|
-
Intial UI State applied to uiState reducer, value will be shallow merged with default [`INITIAL_UI_STATE`](https://docs.kepler.gl/docs/api-reference/reducers/ui-state#initial_ui_state)
|
|
308
|
-
|
|
309
|
-
#### `localeMessages` (object, optional)
|
|
310
|
-
|
|
311
|
-
- Default: `undefined` Modify default translation or add new translation
|
|
312
|
-
|
|
313
|
-
Read more about [Localization][localization].
|
|
314
|
-
|
|
315
210
|
### 3. Dispatch custom actions to `keplerGl` reducer.
|
|
316
211
|
|
|
317
212
|
One advantage of using the reducer over React component state to handle keplerGl state is the flexibility
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RowData, Field } from '@kepler.gl/types';
|
|
1
|
+
import { ArrowTableInterface, ApacheVectorInterface, RowData, Field } from '@kepler.gl/types';
|
|
2
2
|
export declare const ACCEPTED_ANALYZER_TYPES: any[];
|
|
3
3
|
/**
|
|
4
4
|
* Getting sample data for analyzing field type.
|
|
@@ -8,6 +8,14 @@ export declare function getSampleForTypeAnalyze({ fields, rows, sampleCount }: {
|
|
|
8
8
|
rows: unknown[][] | RowData;
|
|
9
9
|
sampleCount?: number;
|
|
10
10
|
}): RowData;
|
|
11
|
+
/**
|
|
12
|
+
* Getting sample data for analyzing field type for Arrow tables.
|
|
13
|
+
* @param table Arrow table or an array of vectors.
|
|
14
|
+
* @param fields Field names.
|
|
15
|
+
* @param sampleCount Number of sample rows to get.
|
|
16
|
+
* @returns Sample rows.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getSampleForTypeAnalyzeArrow(table: ArrowTableInterface | ApacheVectorInterface[], fields: string[], sampleCount?: number): any[];
|
|
11
19
|
/**
|
|
12
20
|
* Convert type-analyzer output to kepler.gl field types
|
|
13
21
|
*
|
|
@@ -20,6 +20,7 @@ declare type HeaderCellProps = {
|
|
|
20
20
|
props: DataTableProps;
|
|
21
21
|
toggleMoreOptions: (moreOptionsColumn: string) => void;
|
|
22
22
|
moreOptionsColumn: null | string;
|
|
23
|
+
style: CSSProperties;
|
|
23
24
|
};
|
|
24
25
|
declare const HeaderCellFactory: {
|
|
25
26
|
(FieldToken: React.FC<FieldTokenProps>): ({ cellInfo, columns, isPinned, props, toggleMoreOptions, moreOptionsColumn }: HeaderCellProps) => React.JSX.Element;
|
|
@@ -94,6 +94,7 @@ declare namespace DataTableFactory {
|
|
|
94
94
|
props: DataTableProps;
|
|
95
95
|
toggleMoreOptions: (moreOptionsColumn: string) => void;
|
|
96
96
|
moreOptionsColumn: string | null;
|
|
97
|
+
style: React.CSSProperties;
|
|
97
98
|
}) => React.JSX.Element;
|
|
98
99
|
deps: typeof import("../field-token").default[];
|
|
99
100
|
}[];
|
|
@@ -19,36 +19,5 @@ export declare type FileDropProps = {
|
|
|
19
19
|
onFrameDrop?: (event: any) => void;
|
|
20
20
|
children?: ReactNode;
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
/** @augments React.PureComponent<FileDropProps> */
|
|
24
|
-
declare class FileDrop extends React.PureComponent<FileDropProps> {
|
|
25
|
-
static isIE: () => any;
|
|
26
|
-
static eventHasFiles: (event: any) => boolean;
|
|
27
|
-
static defaultProps: {
|
|
28
|
-
dropEffect: string;
|
|
29
|
-
frame: any;
|
|
30
|
-
className: string;
|
|
31
|
-
targetClassName: string;
|
|
32
|
-
draggingOverFrameClassName: string;
|
|
33
|
-
draggingOverTargetClassName: string;
|
|
34
|
-
};
|
|
35
|
-
frameDragCounter: number;
|
|
36
|
-
state: {
|
|
37
|
-
draggingOverFrame: boolean;
|
|
38
|
-
draggingOverTarget: boolean;
|
|
39
|
-
};
|
|
40
|
-
componentDidMount(): void;
|
|
41
|
-
componentDidUpdate(prevProps: any): void;
|
|
42
|
-
componentWillUnmount(): void;
|
|
43
|
-
resetDragging: () => void;
|
|
44
|
-
handleWindowDragOverOrDrop: (event: any) => void;
|
|
45
|
-
handleFrameDrag: (event: any) => void;
|
|
46
|
-
handleFrameDrop: (event: any) => void;
|
|
47
|
-
handleDragOver: (event: any) => void;
|
|
48
|
-
handleDragLeave: (event: any) => void;
|
|
49
|
-
handleDrop: (event: any) => void;
|
|
50
|
-
stopFrameListeners: (frame: any) => void;
|
|
51
|
-
startFrameListeners: (frame: any) => void;
|
|
52
|
-
render(): React.JSX.Element;
|
|
53
|
-
}
|
|
22
|
+
declare const FileDrop: ({ dropEffect, frame, className, targetClassName, draggingOverFrameClassName, draggingOverTargetClassName, onDragOver, onDragLeave, onDrop, onFrameDragEnter, onFrameDragLeave, onFrameDrop, children }: FileDropProps) => React.JSX.Element;
|
|
54
23
|
export default FileDrop;
|
|
@@ -14,7 +14,7 @@ export declare type ListItemProps<Option> = {
|
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
light?: boolean;
|
|
16
16
|
};
|
|
17
|
-
export declare const ListItem: ({ value, displayOption, disabled
|
|
17
|
+
export declare const ListItem: ({ value, displayOption, disabled }: ListItemProps<any>) => React.JSX.Element;
|
|
18
18
|
export declare type DropdownListWrapperProps = BaseComponentProps & {
|
|
19
19
|
light?: boolean;
|
|
20
20
|
};
|
|
@@ -47,7 +47,7 @@ interface DropdownListState {
|
|
|
47
47
|
export default class DropdownList extends Component<DropdownListProps, DropdownListState> {
|
|
48
48
|
static defaultProps: {
|
|
49
49
|
customClasses: {};
|
|
50
|
-
customListItemComponent: ({ value, displayOption, disabled
|
|
50
|
+
customListItemComponent: ({ value, displayOption, disabled }: ListItemProps<any>) => React.JSX.Element;
|
|
51
51
|
customListHeaderComponent: null;
|
|
52
52
|
allowCustomValues: number;
|
|
53
53
|
customValues: never[];
|
|
@@ -47,7 +47,7 @@ declare class ItemSelectorUnmemoized extends Component<ItemSelectorProps<any>> {
|
|
|
47
47
|
closeOnSelect: boolean;
|
|
48
48
|
searchable: boolean;
|
|
49
49
|
DropDownRenderComponent: typeof DropdownList;
|
|
50
|
-
DropDownLineItemRenderComponent: ({ value, displayOption, disabled
|
|
50
|
+
DropDownLineItemRenderComponent: ({ value, displayOption, disabled }: import("./dropdown-list").ListItemProps<any>) => React.JSX.Element;
|
|
51
51
|
DropDownWrapperComponent: IStyledComponent<"web", DropdownWrapperProps>;
|
|
52
52
|
reorderItems: undefined;
|
|
53
53
|
className: string;
|
|
@@ -95,7 +95,7 @@ declare class Typeahead extends Component<TypeaheadProps, TypeaheadState> {
|
|
|
95
95
|
inputDisplayOption: null;
|
|
96
96
|
defaultClassNames: boolean;
|
|
97
97
|
customListComponent: typeof DropdownList;
|
|
98
|
-
customListItemComponent: ({ value, displayOption, disabled
|
|
98
|
+
customListItemComponent: ({ value, displayOption, disabled }: import("./dropdown-list").ListItemProps<any>) => React.JSX.Element;
|
|
99
99
|
inputIcon: typeof Search;
|
|
100
100
|
customListHeaderComponent: null;
|
|
101
101
|
showOptionsWhenEmpty: boolean;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IntlShape } from 'react-intl';
|
|
3
3
|
import { Viewport } from '@kepler.gl/types';
|
|
4
|
+
/**
|
|
5
|
+
* Tests if a given query string contains valid coordinates.
|
|
6
|
+
* @param query The input string to test for coordinates.
|
|
7
|
+
* @returns A tuple where:
|
|
8
|
+
* - If valid, returns `[true, longitude, latitude]`.
|
|
9
|
+
* - If invalid, returns `[false, query]`.
|
|
10
|
+
*/
|
|
4
11
|
export declare const testForCoordinates: (query: string) => [true, number, number] | [false, string];
|
|
5
12
|
export interface Result {
|
|
6
13
|
center: [number, number];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { AddDataToMapOptions, MapState, ProtoDataset, UiState } from '@kepler.gl/types';
|
|
3
3
|
import { ActionHandler, removeDataset, updateMap, updateVisData } from '@kepler.gl/actions';
|
|
4
4
|
import { MapViewState } from '@deck.gl/core/typed';
|
|
@@ -24,5 +24,5 @@ interface GeocoderPanelProps {
|
|
|
24
24
|
index: number;
|
|
25
25
|
unsyncedViewports: boolean;
|
|
26
26
|
}
|
|
27
|
-
export default function GeocoderPanelFactory():
|
|
27
|
+
export default function GeocoderPanelFactory(): React.FC<GeocoderPanelProps>;
|
|
28
28
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TileJSON } from '@loaders.gl/mvt';
|
|
2
2
|
import { PMTilesMetadata } from '@loaders.gl/pmtiles';
|
|
3
3
|
import { RemoteTileFormat } from '@kepler.gl/constants';
|
|
4
4
|
import { VectorTileMetadata } from '@kepler.gl/table';
|
|
5
5
|
declare type FetchVectorTileMetadataProps = {
|
|
6
|
-
|
|
6
|
+
metadataUrl: string | null;
|
|
7
|
+
tilesetUrl: string | null;
|
|
7
8
|
remoteTileFormat: RemoteTileFormat;
|
|
8
9
|
process?: (json: PMTilesMetadata | TileJSON) => VectorTileMetadata | Error | null;
|
|
9
10
|
};
|
|
@@ -13,5 +14,5 @@ declare type FetchVectorTileMetadataReturn = {
|
|
|
13
14
|
error: Error | null;
|
|
14
15
|
};
|
|
15
16
|
/** Hook to fetch and return mvt or pmtiles metadata. */
|
|
16
|
-
export default function useFetchVectorTileMetadata({ remoteTileFormat,
|
|
17
|
+
export default function useFetchVectorTileMetadata({ remoteTileFormat, tilesetUrl, metadataUrl, process }: FetchVectorTileMetadataProps): FetchVectorTileMetadataReturn;
|
|
17
18
|
export {};
|
|
@@ -569,7 +569,7 @@ export declare const FIELD_OPTS: {
|
|
|
569
569
|
size: never[];
|
|
570
570
|
};
|
|
571
571
|
format: {
|
|
572
|
-
legend: (
|
|
572
|
+
legend: () => string;
|
|
573
573
|
tooltip: never[];
|
|
574
574
|
};
|
|
575
575
|
};
|
|
@@ -843,4 +843,17 @@ export declare const POSTPROCESSING_EFFECTS: {
|
|
|
843
843
|
export declare const EFFECT_DESCRIPTIONS: EffectDescription[];
|
|
844
844
|
export declare type EffectType = 'ink' | 'brightnessContrast' | 'hueSaturation' | 'vibrance' | 'sepia' | 'dotScreen' | 'colorHalftone' | 'noise' | 'triangleBlur' | 'zoomBlur' | 'tiltShift' | 'edgeWork' | 'vignette' | 'magnify' | 'hexagonalPixelate' | 'lightAndShadow';
|
|
845
845
|
export declare const SYNC_TIMELINE_MODES: Record<string, SyncTimelineMode>;
|
|
846
|
+
export declare const GEOARROW_METADATA_KEY = "ARROW:extension:name";
|
|
847
|
+
/**
|
|
848
|
+
* Enum holding GeoArrow extension type names
|
|
849
|
+
*/
|
|
850
|
+
export declare enum GEOARROW_EXTENSIONS {
|
|
851
|
+
POINT = "geoarrow.point",
|
|
852
|
+
LINESTRING = "geoarrow.linestring",
|
|
853
|
+
POLYGON = "geoarrow.polygon",
|
|
854
|
+
MULTIPOINT = "geoarrow.multipoint",
|
|
855
|
+
MULTILINESTRING = "geoarrow.multilinestring",
|
|
856
|
+
MULTIPOLYGON = "geoarrow.multipolygon",
|
|
857
|
+
WKB = "geoarrow.wkb"
|
|
858
|
+
}
|
|
846
859
|
export {};
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum holding GeoArrow extension type names
|
|
3
|
-
*/
|
|
4
|
-
export declare enum EXTENSION_NAME {
|
|
5
|
-
POINT = "geoarrow.point",
|
|
6
|
-
LINESTRING = "geoarrow.linestring",
|
|
7
|
-
POLYGON = "geoarrow.polygon",
|
|
8
|
-
MULTIPOINT = "geoarrow.multipoint",
|
|
9
|
-
MULTILINESTRING = "geoarrow.multilinestring",
|
|
10
|
-
MULTIPOLYGON = "geoarrow.multipolygon",
|
|
11
|
-
WKB = "geoarrow.wkb"
|
|
12
|
-
}
|
|
13
1
|
export declare const DEFAULT_COLOR: [number, number, number, number];
|
|
@@ -6,6 +6,16 @@ export declare function findGeometryColumnIndex(schema: arrow.Schema, extensionN
|
|
|
6
6
|
* Returns `true` if the input is a reference to a column in the table
|
|
7
7
|
*/
|
|
8
8
|
export declare function isColumnReference(input: any): input is string;
|
|
9
|
+
/**
|
|
10
|
+
* Convert geoarrow Struct coordinates to FixedSizeList coords
|
|
11
|
+
*
|
|
12
|
+
* The GeoArrow spec allows for either separated or interleaved coords, but at
|
|
13
|
+
* this time deck.gl only supports interleaved.
|
|
14
|
+
*/
|
|
15
|
+
export declare function convertStructToFixedSizeList(coords: arrow.Data<arrow.FixedSizeList<arrow.Float64>> | arrow.Data<arrow.Struct<{
|
|
16
|
+
x: arrow.Float64;
|
|
17
|
+
y: arrow.Float64;
|
|
18
|
+
}>>): arrow.Data<arrow.FixedSizeList<arrow.Float64>>;
|
|
9
19
|
declare type AssignAccessorProps = {
|
|
10
20
|
/** The object on which to assign the resolved accesor */
|
|
11
21
|
props: Record<string, any>;
|
|
@@ -34,10 +44,11 @@ export declare function assignAccessor(args: AssignAccessorProps): void;
|
|
|
34
44
|
* @param input: the input array to expand
|
|
35
45
|
* @param size : the number of nested elements in the input array per geometry. So for example, for RGB data this would be 3, for RGBA this would be 4. For radius, this would be 1.
|
|
36
46
|
* @param geomOffsets : an offsets array mapping from the geometry to the coordinate indexes. So in the case of a LineStringArray, this is retrieved directly from the GeoArrow storage. In the case of a PolygonArray, this comes from the resolved indexes that need to be given to the SolidPolygonLayer anyways.
|
|
47
|
+
* @param numPositions : end position in geomOffsets, as geomOffsets can potentially contain preallocated zeroes in the end of the buffer.
|
|
37
48
|
*
|
|
38
49
|
* @return {TypedArray} values expanded to be per-coordinate
|
|
39
50
|
*/
|
|
40
|
-
export declare function expandArrayToCoords<T extends TypedArray>(input: T, size: number, geomOffsets: Int32Array): T;
|
|
51
|
+
export declare function expandArrayToCoords<T extends TypedArray>(input: T, size: number, geomOffsets: Int32Array, numPositions?: number): T;
|
|
41
52
|
/**
|
|
42
53
|
* Get a geometry vector with the specified extension type name from the table.
|
|
43
54
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as arrow from 'apache-arrow';
|
|
1
2
|
import React, { CSSProperties } from 'react';
|
|
2
3
|
declare type BaseComponentProps = {
|
|
3
4
|
className?: string;
|
|
@@ -18,8 +19,12 @@ export declare type DataTableStyle = {
|
|
|
18
19
|
font?: string;
|
|
19
20
|
optionsButton?: number;
|
|
20
21
|
};
|
|
22
|
+
export declare type QueryResult = {
|
|
23
|
+
table: arrow.Table;
|
|
24
|
+
tableDuckDBTypes: Record<string, string>;
|
|
25
|
+
};
|
|
21
26
|
export declare type PreviewDataPanelProps = BaseComponentProps & {
|
|
22
|
-
result:
|
|
27
|
+
result: QueryResult;
|
|
23
28
|
rowsToCalculatePreview?: number;
|
|
24
29
|
theme?: any;
|
|
25
30
|
setColumnDisplayFormat?: (formats: {
|
|
@@ -27,7 +32,7 @@ export declare type PreviewDataPanelProps = BaseComponentProps & {
|
|
|
27
32
|
}) => void;
|
|
28
33
|
defaultPinnedColumns?: string[];
|
|
29
34
|
dataTableStyle: DataTableStyle;
|
|
30
|
-
onAddResultToMap: (result:
|
|
35
|
+
onAddResultToMap: (result: QueryResult) => void;
|
|
31
36
|
};
|
|
32
37
|
export declare const PreviewDataPanel: React.FC<PreviewDataPanelProps>;
|
|
33
38
|
export {};
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export declare type SchemaSuggestion = {
|
|
3
|
+
column_name: string;
|
|
4
|
+
table_name: string;
|
|
5
|
+
};
|
|
6
|
+
declare type SchemaPanelProps = {
|
|
7
|
+
setTableSchema: (tableSchema: SchemaSuggestion[]) => void;
|
|
8
|
+
droppedFile: File | null;
|
|
9
|
+
schemaUpdateTrigger: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const SchemaPanelDropMessage: () => React.JSX.Element;
|
|
12
|
+
export declare const SchemaPanel: ({ setTableSchema, droppedFile, schemaUpdateTrigger }: SchemaPanelProps) => React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -10,6 +10,7 @@ export declare type ProcessorResult = {
|
|
|
10
10
|
rows: RowData;
|
|
11
11
|
fields: ProtoDatasetField[];
|
|
12
12
|
};
|
|
13
|
+
export declare const COLUMN_TYPES_PRIORITIES: string[];
|
|
13
14
|
export declare function columnTypeToFieldType(columnType: string): string | null;
|
|
14
15
|
export declare function fieldTypeToColumnType(fieldType: string): string | null;
|
|
15
16
|
export declare function processKeplerglJSONforDuckDb(keplerJson: any): Promise<ReturnType<typeof processKeplerglJSON>>;
|
|
@@ -1,4 +1,65 @@
|
|
|
1
|
+
import * as arrow from 'apache-arrow';
|
|
1
2
|
import { DataType } from 'apache-arrow/type';
|
|
3
|
+
import { AsyncDuckDBConnection } from '@duckdb/duckdb-wasm';
|
|
4
|
+
import { ProtoDatasetField } from '@kepler.gl/types';
|
|
5
|
+
export declare const SUPPORTED_DUCKDB_DROP_EXTENSIONS: string[];
|
|
6
|
+
export declare type DuckDBColumnDesc = {
|
|
7
|
+
name: string;
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Queries a DuckDB table for the schema description.
|
|
12
|
+
* @param connection An active DuckDB connection.
|
|
13
|
+
* @param tableName A name of DuckDB table to query.
|
|
14
|
+
* @returns An array of column names and DuckDB types.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getDuckDBColumnTypes(connection: AsyncDuckDBConnection, tableName: string): Promise<DuckDBColumnDesc[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Generates a mapping of column names to their corresponding DuckDB data types.
|
|
19
|
+
* @param columns An array of column descriptions from DuckDB. Check getDuckDBColumnTypes.
|
|
20
|
+
* @returns A record where keys are column names and values are their data types.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getDuckDBColumnTypesMap(columns: DuckDBColumnDesc[]): Record<string, string>;
|
|
23
|
+
/**
|
|
24
|
+
* Constructs an SQL query to select all columns from a given table,
|
|
25
|
+
* converting specified columns to Well-Known Binary (WKB) format using ST_AsWKB.
|
|
26
|
+
* @param tableName The name of the table from which to select data.
|
|
27
|
+
* @param columnsToConvertToWKB An array of column names that should be converted to WKB format.
|
|
28
|
+
* @returns The constructed SQL query.
|
|
29
|
+
*/
|
|
30
|
+
export declare function constructST_asWKBQuery(tableName: string, columnsToConvertToWKB: string[]): string;
|
|
31
|
+
/**
|
|
32
|
+
* Finds the names of columns that have a GEOMETRY type.
|
|
33
|
+
* @param columns An array of column descriptors from a DuckDB table.
|
|
34
|
+
* @returns An array of column names that are of type GEOMETRY.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getGeometryColumns(columns: DuckDBColumnDesc[]): string[];
|
|
37
|
+
/**
|
|
38
|
+
* Sets the GeoArrow WKB extension metadata for columns of type GEOMETRY in an Arrow table.
|
|
39
|
+
* @param table The Apache Arrow table whose schema fields will be modified.
|
|
40
|
+
* @param columns An array of column descriptors from a DuckDB table.
|
|
41
|
+
*/
|
|
42
|
+
export declare function setGeoArrowWKBExtension(table: arrow.Table, columns: DuckDBColumnDesc[]): void;
|
|
43
|
+
/**
|
|
44
|
+
* Creates an arrow table from an array of arrow vectors and fields.
|
|
45
|
+
* @param columns An array of arrow vectors.
|
|
46
|
+
* @param fields An array of fields per arrow vector.
|
|
47
|
+
* @param arrowSchema Optional arrow table schema when available.
|
|
48
|
+
* @returns An arrow table.
|
|
49
|
+
*/
|
|
50
|
+
export declare const restoreArrowTable: (columns: arrow.Vector[], fields: ProtoDatasetField[], arrowSchema?: arrow.Schema) => arrow.Table<any>;
|
|
51
|
+
/**
|
|
52
|
+
* DuckDb throws when geoarrow extensions are present in metadata.
|
|
53
|
+
* @param table An arrow table to clear from extensions.
|
|
54
|
+
* @returns A map of removed per field geoarrow extensions.
|
|
55
|
+
*/
|
|
56
|
+
export declare const removeUnsupportedExtensions: (table: arrow.Table) => Record<string, string>;
|
|
57
|
+
/**
|
|
58
|
+
* Restore removed metadata extensions after a call to removeUnsupportedExtensions.
|
|
59
|
+
* @param table An arrow table to restore geoarrow extensions.
|
|
60
|
+
* @param removedExtensions A map of per field geoarrow extensions to restore.
|
|
61
|
+
*/
|
|
62
|
+
export declare const restoreUnsupportedExtensions: (table: arrow.Table, removedExtensions: Record<string, string>) => void;
|
|
2
63
|
/** Checks whether the given Apache Arrow JS type is a Point data type */
|
|
3
64
|
export declare function isGeoArrowPoint(type: DataType): boolean;
|
|
4
65
|
/** Checks whether the given Apache Arrow JS type is a Point data type */
|
|
@@ -11,3 +72,48 @@ export declare function isGeoArrowMultiPoint(type: DataType): boolean;
|
|
|
11
72
|
export declare function isGeoArrowMultiLineString(type: DataType): boolean;
|
|
12
73
|
/** Checks whether the given Apache Arrow JS type is a Polygon data type */
|
|
13
74
|
export declare function isGeoArrowMultiPolygon(type: DataType): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Checks if the given SQL query is a SELECT query by using the EXPLAIN command.
|
|
77
|
+
* @param connection The DuckDB connection instance.
|
|
78
|
+
* @param query The SQL query to check.
|
|
79
|
+
* @returns Resolves to `true` if the query is a SELECT statement, otherwise `false`.
|
|
80
|
+
*/
|
|
81
|
+
export declare function checkIsSelectQuery(connection: AsyncDuckDBConnection, query: string): Promise<boolean>;
|
|
82
|
+
/**
|
|
83
|
+
* Split a string with potentially multiple SQL queries (separated as usual by ';') into an array of queries.
|
|
84
|
+
* This implementation:
|
|
85
|
+
* - Handles single and double quoted strings with proper escaping
|
|
86
|
+
* - Ignores semicolons in line comments (--) and block comments (slash asterisk)
|
|
87
|
+
* - Trims whitespace from queries
|
|
88
|
+
* - Handles SQL-style escaped quotes ('' inside strings)
|
|
89
|
+
* - Returns only non-empty queries
|
|
90
|
+
* @param input A string with potentially multiple SQL queries.
|
|
91
|
+
* @returns An array of queries.
|
|
92
|
+
*/
|
|
93
|
+
export declare function splitSqlStatements(input: string): string[];
|
|
94
|
+
/**
|
|
95
|
+
* Removes SQL comments from a given SQL string.
|
|
96
|
+
* @param sql The SQL query string from which comments should be removed.
|
|
97
|
+
* @returns The cleaned SQL string without comments.
|
|
98
|
+
*/
|
|
99
|
+
export declare function removeSQLComments(sql: string): string;
|
|
100
|
+
/**
|
|
101
|
+
* Drops a table if it exists in the DuckDB database.
|
|
102
|
+
* @param connection The DuckDB connection instance.
|
|
103
|
+
* @param tableName The name of the table to drop.
|
|
104
|
+
* @returns A promise that resolves when the operation is complete.
|
|
105
|
+
* @throws Logs an error if the table drop operation fails.
|
|
106
|
+
*/
|
|
107
|
+
export declare const dropTableIfExists: (connection: AsyncDuckDBConnection, tableName: string) => Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Imports a file into DuckDB as a table, supporting multiple formats from SUPPORTED_DUCKDB_DROP_EXTENSIONS.
|
|
110
|
+
* @param file The file to be imported.
|
|
111
|
+
* @returns A promise that resolves when the file has been processed into a DuckDB table.
|
|
112
|
+
*/
|
|
113
|
+
export declare function tableFromFile(file: File | null): Promise<null | Error>;
|
|
114
|
+
/**
|
|
115
|
+
* Sanitizes a file name to be a valid DuckDB table name.
|
|
116
|
+
* @param fileName The input file name to be sanitized.
|
|
117
|
+
* @returns A valid DuckDB table name.
|
|
118
|
+
*/
|
|
119
|
+
export declare function sanitizeDuckDBTableName(fileName: string): string;
|
|
@@ -3,12 +3,14 @@ import { AsyncDuckDB, AsyncDuckDBConnection } from '@duckdb/duckdb-wasm';
|
|
|
3
3
|
import { KeplerTable } from '@kepler.gl/table';
|
|
4
4
|
import { ProcessorResult } from '../processors/data-processor';
|
|
5
5
|
declare type ImportDataToDuckProps = {
|
|
6
|
-
data: ProcessorResult
|
|
6
|
+
data: ProcessorResult & {
|
|
7
|
+
arrowSchema: arrow.Schema;
|
|
8
|
+
};
|
|
7
9
|
db: AsyncDuckDB;
|
|
8
10
|
c: AsyncDuckDBConnection;
|
|
9
11
|
};
|
|
10
12
|
declare type ImportDataToDuckResult = {
|
|
11
|
-
|
|
13
|
+
geoarrowMetadata?: Record<string, string>;
|
|
12
14
|
useNewFields?: boolean;
|
|
13
15
|
};
|
|
14
16
|
export declare class KeplerGlDuckDbTable extends KeplerTable {
|
|
@@ -19,7 +21,7 @@ export declare class KeplerGlDuckDbTable extends KeplerTable {
|
|
|
19
21
|
constructor(props: any);
|
|
20
22
|
importRowData({ data, db, c }: ImportDataToDuckProps): Promise<void>;
|
|
21
23
|
importGeoJsonData({ data, db, c }: ImportDataToDuckProps): Promise<ImportDataToDuckResult>;
|
|
22
|
-
importArrowData({ data,
|
|
24
|
+
importArrowData({ data, c }: ImportDataToDuckProps): Promise<ImportDataToDuckResult>;
|
|
23
25
|
/**
|
|
24
26
|
* Creates a table from data, returns an arrow table with the data
|
|
25
27
|
* @param data
|