Search…
ui-state

Table of Contents

uiStateUpdaters

Updaters for uiState reducer. Can be used in your root reducer to directly modify kepler.gl's state. Read more about Using updaters
Examples
1
import keplerGlReducer, {uiStateUpdaters} from 'kepler.gl/reducers';
2
// Root Reducer
3
const reducers = combineReducers({
4
keplerGl: keplerGlReducer,
5
app: appReducer
6
});
7
8
const composedReducer = (state, action) => {
9
switch (action.type) {
10
// click button to close side panel
11
case 'CLICK_BUTTON':
12
return {
13
...state,
14
keplerGl: {
15
...state.keplerGl,
16
foo: {
17
...state.keplerGl.foo,
18
uiState: uiStateUpdaters.toggleSidePanelUpdater(
19
uiState, {payload: null}
20
)
21
}
22
}
23
};
24
}
25
return reducers(state, action);
26
};
27
28
export default composedReducer;
Copied!

addNotificationUpdater

Add a notification to be displayed. Existing notification is going to be updated in case of matching ids.
Parameters
Returns Object nextState

cleanupExportImage

Delete cached export image
Parameters
Returns Object nextState

DEFAULT_EXPORT_DATA

Default initial exportData settings
Type: Object

Properties

  • selectedDataset string Default: '',
  • dataType string Default: 'csv',
  • filtered boolean Default: true,
  • config boolean deprecated
  • data boolean used in modal config export. Default: false

DEFAULT_EXPORT_IMAGE

Default image export config
Type: Object

Properties

DEFAULT_MAP_CONTROLS_FEATURES

A list of map control visibility and whether is it active.
Type: Object

Properties

  • visibleLayers Object Default: {show: true, active: false}
  • mapLegend Object Default: {show: true, active: false}
  • toggle3d Object Default: {show: true}
  • splitMap Object Default: {show: true}

hideExportDropdownUpdater

Hide side panel header dropdown, activated by clicking the share link on top of the side panel
Parameters
Returns Object nextState

INITIAL_UI_STATE

Default initial uiState
Type: Object

Properties

loadFilesErrUpdater

Handles load file error and set fileLoading property to false
Parameters
  • state
  • error Object
    • error.error
Returns Object nextState

loadFilesUpdater

Fired when file loading begin
Parameters
Returns Object nextState

openDeleteModalUpdater

Toggle active map control panel
Parameters
Returns Object nextState

removeNotificationUpdater

Remove a notification
Parameters
  • state Object uiState
  • action Object
    • action.payload String id of the notification to be removed
Returns Object nextState

setExportDataTypeUpdater

Set data format for exporting data
Parameters
Returns Object nextState

setExportDataUpdater

Whether to including data in map config, toggle between true or false
Parameters
Returns Object nextState

setExportFilteredUpdater

Whether to export filtered data, true or false
Parameters
Returns Object nextState

setExportImageDataUri

Set exportImage.setExportImageDataUri to a image dataUri
Parameters
Returns Object nextState

setExportImageSetting

Set exportImage.legend to true or false
Parameters
Returns Object nextState

setExportSelectedDatasetUpdater

Set selected dataset for export
Parameters
Returns Object nextState

showExportDropdownUpdater

Hide and show side panel header dropdown, activated by clicking the share link on top of the side panel
Parameters
Returns Object nextState

startExportingImage

Set exportImage.exporting to true
Parameters
Returns Object nextState

toggleMapControlUpdater

Toggle active map control panel
Parameters
  • state Object uiState
  • action Object action
    • action.payload string map control panel id, one of the keys of: DEFAULT_MAP_CONTROLS
    • action.payload.panelId
    • action.payload.index (optional, default 0)
Returns Object nextState

toggleModalUpdater

Show and hide modal dialog
Parameters
Returns Object nextState

toggleSidePanelUpdater

Toggle active side panel
Parameters
  • state Object uiState
  • action Object
    • action.payload (string | null) id of side panel to be shown, one of layer, filter, interaction, map. close side panel if null
Returns Object nextState

toggleSplitMapUpdater

Handles toggle map split and reset all map control index to 0
Parameters
  • state
Returns Object nextState

DEFAULT_EXPORT_HTML

Type: Object

Properties

  • exportMapboxAccessToken string Default: null, this is used when we provide a default mapbox token for users to take advantage of
  • userMapboxToken string Default: '', mapbox token provided by user through input field

setUserMapboxAccessTokenUpdater

whether to export a mapbox access to HTML single page
Parameters
Returns Object nextState
Last modified 10mo ago