@sqlrooms/kepler 0.29.0-rc.1 → 0.29.0-rc.10
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/LICENSE.md +2 -1
- package/README.md +133 -6
- package/dist/KeplerSlice.d.ts +85 -11
- package/dist/KeplerSlice.d.ts.map +1 -1
- package/dist/KeplerSlice.js +391 -123
- package/dist/KeplerSlice.js.map +1 -1
- package/dist/components/CustomDndContext.d.ts.map +1 -1
- package/dist/components/CustomDndContext.js +5 -2
- package/dist/components/CustomDndContext.js.map +1 -1
- package/dist/components/CustomFilterManager.d.ts.map +1 -1
- package/dist/components/CustomFilterManager.js +20 -5
- package/dist/components/CustomFilterManager.js.map +1 -1
- package/dist/components/CustomFilterPanelHeader.d.ts.map +1 -1
- package/dist/components/CustomFilterPanelHeader.js +5 -5
- package/dist/components/CustomFilterPanelHeader.js.map +1 -1
- package/dist/components/CustomInteractionManager.d.ts.map +1 -1
- package/dist/components/CustomInteractionManager.js +4 -1
- package/dist/components/CustomInteractionManager.js.map +1 -1
- package/dist/components/CustomLayerManager.d.ts.map +1 -1
- package/dist/components/CustomLayerManager.js +51 -17
- package/dist/components/CustomLayerManager.js.map +1 -1
- package/dist/components/CustomMapDrawPanel.d.ts +8 -0
- package/dist/components/CustomMapDrawPanel.d.ts.map +1 -0
- package/dist/components/CustomMapDrawPanel.js +28 -0
- package/dist/components/CustomMapDrawPanel.js.map +1 -0
- package/dist/components/CustomMapLegend.d.ts +4 -1
- package/dist/components/CustomMapLegend.d.ts.map +1 -1
- package/dist/components/CustomMapLegend.js +39 -12
- package/dist/components/CustomMapLegend.js.map +1 -1
- package/dist/components/CustomMapLegendPanel.d.ts +3 -3
- package/dist/components/CustomMapLegendPanel.d.ts.map +1 -1
- package/dist/components/CustomMapLegendPanel.js +27 -4
- package/dist/components/CustomMapLegendPanel.js.map +1 -1
- package/dist/components/CustomSourceDataSelector.d.ts +18 -0
- package/dist/components/CustomSourceDataSelector.d.ts.map +1 -0
- package/dist/components/CustomSourceDataSelector.js +130 -0
- package/dist/components/CustomSourceDataSelector.js.map +1 -0
- package/dist/components/KeplerAddDataDialog.d.ts +2 -3
- package/dist/components/KeplerAddDataDialog.d.ts.map +1 -1
- package/dist/components/KeplerAddDataDialog.js +19 -8
- package/dist/components/KeplerAddDataDialog.js.map +1 -1
- package/dist/components/KeplerImageExport.d.ts.map +1 -1
- package/dist/components/KeplerImageExport.js +26 -8
- package/dist/components/KeplerImageExport.js.map +1 -1
- package/dist/components/KeplerInjector.d.ts.map +1 -1
- package/dist/components/KeplerInjector.js +5 -1
- package/dist/components/KeplerInjector.js.map +1 -1
- package/dist/components/KeplerMapContainer.d.ts.map +1 -1
- package/dist/components/KeplerMapContainer.js +45 -6
- package/dist/components/KeplerMapContainer.js.map +1 -1
- package/dist/components/KeplerPlotContainer.d.ts +1 -1
- package/dist/components/KeplerPlotContainer.d.ts.map +1 -1
- package/dist/components/KeplerPlotContainer.js +3 -1
- package/dist/components/KeplerPlotContainer.js.map +1 -1
- package/dist/components/KeplerProvider.d.ts.map +1 -1
- package/dist/components/KeplerProvider.js +3 -1
- package/dist/components/KeplerProvider.js.map +1 -1
- package/dist/components/KeplerTableSourceSelector.d.ts +20 -0
- package/dist/components/KeplerTableSourceSelector.d.ts.map +1 -0
- package/dist/components/KeplerTableSourceSelector.js +21 -0
- package/dist/components/KeplerTableSourceSelector.js.map +1 -0
- package/dist/components/SplitMapIndexContext.d.ts +2 -0
- package/dist/components/SplitMapIndexContext.d.ts.map +1 -0
- package/dist/components/SplitMapIndexContext.js +3 -0
- package/dist/components/SplitMapIndexContext.js.map +1 -0
- package/dist/hooks/useDndEffects.d.ts +1 -1
- package/dist/hooks/useDndEffects.d.ts.map +1 -1
- package/dist/hooks/useDndEffects.js +4 -0
- package/dist/hooks/useDndEffects.js.map +1 -1
- package/dist/hooks/useDndLayers.d.ts +1 -1
- package/dist/hooks/useDndLayers.d.ts.map +1 -1
- package/dist/hooks/useDndLayers.js +4 -0
- package/dist/hooks/useDndLayers.js.map +1 -1
- package/dist/hooks/useKeplerStateActions.d.ts +7 -6
- package/dist/hooks/useKeplerStateActions.d.ts.map +1 -1
- package/dist/hooks/useKeplerStateActions.js +1 -1
- package/dist/hooks/useKeplerStateActions.js.map +1 -1
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/keplerTableSelection.d.ts +142 -0
- package/dist/keplerTableSelection.d.ts.map +1 -0
- package/dist/keplerTableSelection.js +232 -0
- package/dist/keplerTableSelection.js.map +1 -0
- package/dist/styles/theme.d.ts +12 -0
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +12 -0
- package/dist/styles/theme.js.map +1 -1
- package/package.json +43 -37
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright
|
|
3
|
+
Copyright 2024-2026 SQLRooms Contributors
|
|
4
|
+
Copyright Vis.gl contributors
|
|
4
5
|
|
|
5
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
7
|
|
package/README.md
CHANGED
|
@@ -7,7 +7,16 @@ Use this package when you want a **map-first analytics experience** in a SQLRoom
|
|
|
7
7
|
- `createKeplerSlice()` to add Kepler state/actions to your Room store
|
|
8
8
|
- `KeplerMapContainer` and `KeplerPlotContainer` for rendering maps/overlays
|
|
9
9
|
- `KeplerSidePanels` for layer/filter/interaction UI
|
|
10
|
-
- utilities for map config persistence
|
|
10
|
+
- utilities for map config persistence, dataset synchronization, and migration
|
|
11
|
+
from legacy Kepler-owned tabs to artifact-backed tabs
|
|
12
|
+
|
|
13
|
+
## Selection model
|
|
14
|
+
|
|
15
|
+
- `createKeplerSlice()` manages Kepler map documents and runtime state keyed by
|
|
16
|
+
map id, but it does not own host-level map selection.
|
|
17
|
+
- Render maps with explicit ids, for example `<KeplerMapContainer mapId={id} />`.
|
|
18
|
+
- Use `@sqlrooms/artifacts` when an app needs multiple user-managed map tabs;
|
|
19
|
+
artifact state should own the selected map artifact.
|
|
11
20
|
|
|
12
21
|
## Installation
|
|
13
22
|
|
|
@@ -51,17 +60,21 @@ export const {roomStore, useRoomStore} = createRoomStore<RoomState>(
|
|
|
51
60
|
);
|
|
52
61
|
|
|
53
62
|
function MapPanel() {
|
|
54
|
-
const mapId = useRoomStore((state) => state.kepler.config.
|
|
63
|
+
const mapId = useRoomStore((state) => state.kepler.config.maps[0]?.id);
|
|
55
64
|
const addTableToMap = useRoomStore((state) => state.kepler.addTableToMap);
|
|
56
65
|
const isTableReady = useRoomStore((state) =>
|
|
57
|
-
Boolean(state.db.
|
|
66
|
+
Boolean(state.db.findTable('earthquakes')),
|
|
58
67
|
);
|
|
59
68
|
|
|
60
69
|
useEffect(() => {
|
|
61
70
|
if (!isTableReady || !mapId) return;
|
|
62
|
-
void addTableToMap(
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
void addTableToMap({
|
|
72
|
+
mapId,
|
|
73
|
+
tableName: 'earthquakes',
|
|
74
|
+
options: {
|
|
75
|
+
autoCreateLayers: true,
|
|
76
|
+
centerMap: true,
|
|
77
|
+
},
|
|
65
78
|
});
|
|
66
79
|
}, [isTableReady, mapId, addTableToMap]);
|
|
67
80
|
|
|
@@ -79,21 +92,135 @@ export function App() {
|
|
|
79
92
|
}
|
|
80
93
|
```
|
|
81
94
|
|
|
95
|
+
## Adding tables to maps
|
|
96
|
+
|
|
97
|
+
Use `state.kepler.addTableToMap()` to load a DuckDB table into a Kepler map. The
|
|
98
|
+
preferred API is an object parameter:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
await state.kepler.addTableToMap({
|
|
102
|
+
mapId,
|
|
103
|
+
tableName: 'earthquakes',
|
|
104
|
+
options: {
|
|
105
|
+
autoCreateLayers: true,
|
|
106
|
+
centerMap: true,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`tableName` is the SQL table reference to load. It can also be a saved Kepler
|
|
112
|
+
dataset id when the configured table-selection policy can resolve that id back
|
|
113
|
+
to a DuckDB table.
|
|
114
|
+
|
|
115
|
+
For normal add-table flows, omit `datasetId`. SQLRooms derives the persisted
|
|
116
|
+
Kepler dataset id from the table-selection policy:
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
await state.kepler.addTableToMap({
|
|
120
|
+
mapId,
|
|
121
|
+
tableName: 'main.places',
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Only pass `datasetId` when you need to load a table under an existing Kepler
|
|
126
|
+
`dataId`, such as when restoring a saved map config:
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
await state.kepler.addTableToMap({
|
|
130
|
+
mapId,
|
|
131
|
+
tableName: savedDataId,
|
|
132
|
+
options: {
|
|
133
|
+
autoCreateLayers: false,
|
|
134
|
+
centerMap: false,
|
|
135
|
+
},
|
|
136
|
+
datasetId: savedDataId,
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The older positional signature is still accepted for compatibility, but new code
|
|
141
|
+
should use the object form so the table reference, Kepler options, config, and
|
|
142
|
+
dataset-id override remain clear at the call site.
|
|
143
|
+
|
|
82
144
|
## Common customization
|
|
83
145
|
|
|
84
146
|
Pass options to `createKeplerSlice()`:
|
|
85
147
|
|
|
86
148
|
```ts
|
|
149
|
+
import {createKeplerTheme, type KeplerThemeOverrides} from '@sqlrooms/kepler';
|
|
150
|
+
|
|
87
151
|
createKeplerSlice({
|
|
88
152
|
basicKeplerProps: {
|
|
89
153
|
mapboxApiAccessToken: import.meta.env.VITE_MAPBOX_TOKEN,
|
|
90
154
|
},
|
|
155
|
+
keplerTheme: createKeplerTheme({
|
|
156
|
+
modalOverLayZ: 40,
|
|
157
|
+
} satisfies KeplerThemeOverrides),
|
|
158
|
+
modalPortalTarget: 'body',
|
|
91
159
|
actionLogging: false,
|
|
92
160
|
});
|
|
93
161
|
```
|
|
94
162
|
|
|
163
|
+
Notes:
|
|
164
|
+
|
|
165
|
+
- `basicKeplerProps` is for base Kepler registration/component props.
|
|
166
|
+
- `keplerTheme` (optional) sets the theme passed to Kepler `ThemeProvider`.
|
|
167
|
+
- `modalPortalTarget` controls modal portal placement: `'container'` (default)
|
|
168
|
+
or `'body'`.
|
|
169
|
+
|
|
170
|
+
### Table selection and dataset ids
|
|
171
|
+
|
|
172
|
+
`tableSelection` controls which DuckDB tables Kepler exposes and how those
|
|
173
|
+
tables are represented in persisted Kepler layer and filter config.
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
createKeplerSlice({
|
|
177
|
+
tableSelection: {
|
|
178
|
+
defaultDbSchema: {
|
|
179
|
+
database: 'project',
|
|
180
|
+
schema: 'main',
|
|
181
|
+
},
|
|
182
|
+
includeTable: (table) => table.table.database === 'project',
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
By default, tables in `defaultDbSchema` use bare dataset ids such as `places`.
|
|
188
|
+
Tables outside that database/schema use qualified SQL table references. This
|
|
189
|
+
keeps common main-schema project tables readable while preserving enough
|
|
190
|
+
identity for tables from other schemas.
|
|
191
|
+
|
|
192
|
+
Use `includeTable` to hide tables from Kepler's Add Layer UI and to skip matching
|
|
193
|
+
saved dataset ids during dataset synchronization. Host apps commonly use this to
|
|
194
|
+
hide attached databases that will not be available when a project is reopened.
|
|
195
|
+
|
|
196
|
+
If the default dataset-id policy is not right for your app, provide both
|
|
197
|
+
`getDatasetIdForTable` and `findTableForDatasetId` so new layers and restored
|
|
198
|
+
layers agree on the same identity scheme:
|
|
199
|
+
|
|
200
|
+
```ts
|
|
201
|
+
createKeplerSlice({
|
|
202
|
+
tableSelection: {
|
|
203
|
+
getDatasetIdForTable: (table) =>
|
|
204
|
+
`${table.table.schema}:${table.table.table}`,
|
|
205
|
+
findTableForDatasetId: (tables, datasetId) => {
|
|
206
|
+
const [schema, tableName] = datasetId.split(':');
|
|
207
|
+
return tables.find(
|
|
208
|
+
(table) =>
|
|
209
|
+
table.table.schema === schema && table.table.table === tableName,
|
|
210
|
+
);
|
|
211
|
+
},
|
|
212
|
+
getTableLabel: (table) =>
|
|
213
|
+
[table.table.schema, table.table.table].filter(Boolean).join('.'),
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`getTableLabel` only affects display labels in Kepler table selectors. It does
|
|
219
|
+
not change persisted dataset ids.
|
|
220
|
+
|
|
95
221
|
## Related packages
|
|
96
222
|
|
|
223
|
+
- `@sqlrooms/artifacts` for artifact-backed map tabs
|
|
97
224
|
- `@sqlrooms/kepler-config` for Zod schemas used by persisted Kepler config
|
|
98
225
|
- `@sqlrooms/room-shell` for Room store composition and UI shell
|
|
99
226
|
- `@sqlrooms/duckdb` for DuckDB-backed table loading/querying
|
package/dist/KeplerSlice.d.ts
CHANGED
|
@@ -1,23 +1,48 @@
|
|
|
1
1
|
import { VectorTileDatasetMetadata } from '@kepler.gl/constants';
|
|
2
|
-
import { Layer } from '@kepler.gl/layers';
|
|
3
2
|
import { KeplerGlState } from '@kepler.gl/reducers';
|
|
4
|
-
import { AddDataToMapPayload } from '@kepler.gl/types';
|
|
3
|
+
import { AddDataToMapPayload, MinSavedLayer, ParsedLayer } from '@kepler.gl/types';
|
|
5
4
|
import { KeplerApplicationConfig } from '@kepler.gl/utils';
|
|
6
5
|
import { KeplerMapSchema, KeplerSliceConfig } from '@sqlrooms/kepler-config';
|
|
7
6
|
import { RoomShellSliceState, type StateCreator } from '@sqlrooms/room-shell';
|
|
8
7
|
import type { AnyAction, Store as ReduxStore } from 'redux';
|
|
9
8
|
import { Dispatch, Middleware } from 'redux';
|
|
10
9
|
import { ReduxLoggerOptions } from 'redux-logger';
|
|
10
|
+
import type { DefaultTheme } from 'styled-components';
|
|
11
|
+
import { type KeplerTableSelectionOptions } from './keplerTableSelection';
|
|
11
12
|
export type KeplerGLBasicProps = {
|
|
12
13
|
mapboxApiAccessToken?: string;
|
|
13
14
|
};
|
|
15
|
+
export type KeplerModalPortalTarget = 'body' | 'container';
|
|
16
|
+
export type CreateInitialMapKeplerStateContext = {
|
|
17
|
+
reason: 'initialize' | 'create-map' | 'duplicate-map' | 'register-map' | 'sync-config';
|
|
18
|
+
defaultInitialMapKeplerState: Partial<KeplerGlState>;
|
|
19
|
+
mapId?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
};
|
|
14
22
|
export type CreateKeplerSliceOptions = {
|
|
15
23
|
config?: Partial<KeplerSliceConfig>;
|
|
16
|
-
|
|
24
|
+
createInitialMapKeplerState?: (context: CreateInitialMapKeplerStateContext) => Partial<KeplerGlState>;
|
|
17
25
|
basicKeplerProps?: Partial<KeplerGLBasicProps>;
|
|
26
|
+
/**
|
|
27
|
+
* Theme passed to Kepler's ThemeProvider.
|
|
28
|
+
* Use createKeplerTheme() to merge app-level overrides into the default theme.
|
|
29
|
+
*/
|
|
30
|
+
keplerTheme?: DefaultTheme;
|
|
31
|
+
/**
|
|
32
|
+
* Where the Kepler modal (Add Map Style, Export, etc.) should be portaled.
|
|
33
|
+
* - 'body': portals to document.body (escapes stacking contexts)
|
|
34
|
+
* - 'container': portals inside the kepler map container element
|
|
35
|
+
* @default 'container'
|
|
36
|
+
*/
|
|
37
|
+
modalPortalTarget?: KeplerModalPortalTarget;
|
|
18
38
|
actionLogging?: boolean | ReduxLoggerOptions;
|
|
19
39
|
middlewares?: Middleware[];
|
|
20
40
|
applicationConfig?: KeplerApplicationConfig;
|
|
41
|
+
/**
|
|
42
|
+
* Controls which DuckDB tables appear in Kepler's Add Layer menu and how
|
|
43
|
+
* those tables are represented in saved Kepler dataset ids.
|
|
44
|
+
*/
|
|
45
|
+
tableSelection?: KeplerTableSelectionOptions;
|
|
21
46
|
/**
|
|
22
47
|
* Called when a kepler action is dispatched
|
|
23
48
|
* @param mapId - The map id
|
|
@@ -40,48 +65,97 @@ export declare function hasMapId(action: KeplerAction): action is KeplerAction &
|
|
|
40
65
|
export type KeplerGlReduxState = {
|
|
41
66
|
[id: string]: KeplerGlState;
|
|
42
67
|
};
|
|
68
|
+
export type AddTableToMapLoadOptions = {
|
|
69
|
+
/**
|
|
70
|
+
* Load the table under an explicit Kepler dataset id.
|
|
71
|
+
*
|
|
72
|
+
* Normal callers should omit this so the table-selection policy decides the
|
|
73
|
+
* id. Restore uses it to satisfy already-saved layer/filter dataIds.
|
|
74
|
+
*/
|
|
75
|
+
datasetId?: string;
|
|
76
|
+
};
|
|
77
|
+
export type AddTableToMapParams = {
|
|
78
|
+
mapId: string;
|
|
79
|
+
/**
|
|
80
|
+
* Table reference to load. This can also be an existing/saved Kepler dataset
|
|
81
|
+
* id when the table-selection policy can resolve it back to a table.
|
|
82
|
+
*/
|
|
83
|
+
tableName: string;
|
|
84
|
+
options?: AddDataToMapPayload['options'];
|
|
85
|
+
config?: AddDataToMapPayload['config'];
|
|
86
|
+
/**
|
|
87
|
+
* Explicit Kepler dataset id to write into `datasets.info.id`.
|
|
88
|
+
*
|
|
89
|
+
* Most callers should omit this so `tableSelection.getDatasetIdForTable`
|
|
90
|
+
* controls new ids. Restore passes it to preserve saved layer/filter dataIds.
|
|
91
|
+
*/
|
|
92
|
+
datasetId?: string;
|
|
93
|
+
};
|
|
94
|
+
export type AddTableToMapFn = {
|
|
95
|
+
(params: AddTableToMapParams): Promise<void>;
|
|
96
|
+
(mapId: string, tableName: string, options?: AddDataToMapPayload['options'], config?: AddDataToMapPayload['config'], loadOptions?: AddTableToMapLoadOptions): Promise<void>;
|
|
97
|
+
};
|
|
43
98
|
export type KeplerSliceState = {
|
|
44
99
|
kepler: {
|
|
45
100
|
config: KeplerSliceConfig;
|
|
46
101
|
map: KeplerGlReduxState;
|
|
47
102
|
basicKeplerProps?: Partial<KeplerGLBasicProps>;
|
|
103
|
+
keplerTheme?: DefaultTheme;
|
|
104
|
+
modalPortalTarget: KeplerModalPortalTarget;
|
|
105
|
+
tableSelection: KeplerTableSelectionOptions;
|
|
48
106
|
forwardDispatch: {
|
|
49
107
|
[mapId: string]: Dispatch;
|
|
50
108
|
};
|
|
51
109
|
initialize: () => Promise<void>;
|
|
110
|
+
destroy: () => Promise<void>;
|
|
52
111
|
setConfig: (config: KeplerSliceConfig) => void;
|
|
53
112
|
/**
|
|
54
113
|
* Update the datasets in all the kepler map so that they correspond to
|
|
55
114
|
* the latest table schemas in the database
|
|
56
115
|
*/
|
|
57
116
|
syncKeplerDatasets: () => Promise<void>;
|
|
58
|
-
addLayer: (mapId: string, layer:
|
|
59
|
-
|
|
117
|
+
addLayer: (mapId: string, layer: ParsedLayer | MinSavedLayer | undefined, datasetId: string) => void;
|
|
118
|
+
addFilter: (mapId: string, datasetId: string) => void;
|
|
119
|
+
setFilter: (mapId: string, filterIdx: number, prop: string | string[], value: any, valueIndex?: number) => void;
|
|
120
|
+
setFilterAnimationTime: (mapId: string, filterIdx: number, prop: string, value: any) => void;
|
|
121
|
+
setFilterAnimationWindow: (mapId: string, filterId: string, animationWindow: string) => void;
|
|
122
|
+
setFilterView: (mapId: string, filterIdx: number, view: 'side' | 'enlarged' | 'minified') => void;
|
|
123
|
+
updateTooltipFields: (mapId: string, datasetId: string, fieldNames: string[]) => void;
|
|
124
|
+
toggleSplitMap: (mapId: string, index?: number) => void;
|
|
125
|
+
toggleLayerForMap: (mapId: string, mapIndex: number, layerId: string) => void;
|
|
126
|
+
addTableToMap: AddTableToMapFn;
|
|
60
127
|
addTileSetToMap: (mapId: string, tableName: string, tileset: {
|
|
61
128
|
name: string;
|
|
62
129
|
type: string;
|
|
63
130
|
metadata: VectorTileDatasetMetadata;
|
|
64
131
|
}, tileMetadata: Record<string, any>, autoCreateLayers: boolean) => void;
|
|
65
132
|
addConfigToMap: (mapId: string, config: KeplerMapSchema) => void;
|
|
133
|
+
isRestoringConfig: boolean;
|
|
134
|
+
withConfigPersistencePaused: <TResult>(fn: () => TResult | Promise<TResult>) => Promise<TResult>;
|
|
135
|
+
waitForConfigRestore: () => Promise<void>;
|
|
66
136
|
removeDatasetFromMaps: (datasetId: string) => void;
|
|
67
137
|
dispatchAction: (mapId: string, action: KeplerAction) => void;
|
|
68
|
-
|
|
138
|
+
ensureMap: (mapId: string, name?: string) => void;
|
|
69
139
|
/**
|
|
70
140
|
* Create a new map and return the map id
|
|
71
141
|
* @param name - The name of the map
|
|
72
142
|
* @returns The map id
|
|
73
143
|
*/
|
|
74
|
-
createMap: (name?: string
|
|
144
|
+
createMap: (name?: string, options?: {
|
|
145
|
+
id?: string;
|
|
146
|
+
}) => string;
|
|
75
147
|
deleteMap: (mapId: string) => void;
|
|
148
|
+
duplicateMap: (mapId: string) => Promise<{
|
|
149
|
+
success: boolean;
|
|
150
|
+
message?: string;
|
|
151
|
+
code?: string;
|
|
152
|
+
}>;
|
|
76
153
|
renameMap: (mapId: string, name: string) => void;
|
|
77
|
-
closeMap: (mapId: string) => void;
|
|
78
|
-
setOpenTabs: (tabIds: string[]) => void;
|
|
79
|
-
getCurrentMap: () => KeplerMapSchema | undefined;
|
|
80
154
|
registerKeplerMapIfNotExists: (mapId: string) => void;
|
|
81
155
|
__reduxProviderStore: ReduxStore<KeplerGlReduxState, AnyAction> | undefined;
|
|
82
156
|
};
|
|
83
157
|
};
|
|
84
|
-
export declare function createKeplerSlice({ basicKeplerProps, config: initialConfigProps,
|
|
158
|
+
export declare function createKeplerSlice({ basicKeplerProps, keplerTheme, modalPortalTarget, config: initialConfigProps, createInitialMapKeplerState, actionLogging, middlewares: additionalMiddlewares, applicationConfig, tableSelection, onAction, }?: CreateKeplerSliceOptions): StateCreator<KeplerSliceState>;
|
|
85
159
|
type RoomStateWithDiscuss = RoomShellSliceState & KeplerSliceState;
|
|
86
160
|
export declare function useStoreWithKepler<T>(selector: (state: RoomStateWithDiscuss) => T): T;
|
|
87
161
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeplerSlice.d.ts","sourceRoot":"","sources":["../src/KeplerSlice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KeplerSlice.d.ts","sourceRoot":"","sources":["../src/KeplerSlice.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAkB,yBAAyB,EAAC,MAAM,sBAAsB,CAAC;AAShF,OAAO,EAGL,aAAa,EAEd,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAC,eAAe,EAAE,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAIL,mBAAmB,EAEnB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,KAAK,EAEV,SAAS,EAET,KAAK,IAAI,UAAU,EACpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAU,QAAQ,EAAE,UAAU,EAAC,MAAM,OAAO,CAAC;AACpD,OAAO,EAAe,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAKpD,OAAO,EAKL,KAAK,2BAA2B,EACjC,MAAM,wBAAwB,CAAC;AAahC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,WAAW,CAAC;AAE3D,MAAM,MAAM,kCAAkC,GAAG;IAC/C,MAAM,EACF,YAAY,GACZ,YAAY,GACZ,eAAe,GACf,cAAc,GACd,aAAa,CAAC;IAClB,4BAA4B,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACrD,KAA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