LogoLogo
  • Welcome
  • What's new?
  • Docs
    • User guides
      • Get Started
      • Kepler.gl workflow
        • Add data to layers
          • Adding Data Layers
          • Create a Layer
          • Blend and Rearrange Layers
          • Hide, Edit and Delete Layers
        • Add Data to the Map
      • Layers
        • Point
        • S2 Layer
        • Icon
        • Line
        • Cluster
        • Polygon
        • Hexbin
        • Grid
        • H3
        • Heatmap
        • Arc
        • Trip layer
      • Layer Attributes
      • Color Palettes
      • Filters
      • Map Styles
      • Interactions
      • Map Settings
      • Time Playback
      • Save and Export
      • FAQ
    • API Reference
      • ecosystem
      • Get Started
      • Advanced usages
        • Saving and Loading Maps with Schema Manager
        • Replace UI Component with Component Dependency Injection
        • Forward Dispatch Actions
        • Reducer Plugin
        • Using Updaters
        • Custom reducer initial state
        • custom-mapbox-host
      • Components
      • Reducers
        • reducers
        • map-style
        • map-state
        • combine
        • overview
        • ui-state
        • vis-state
      • Processors
        • All processors
      • Schemas
      • Actions
        • All actions
      • Cloud providers
        • Provider
      • Custom theme
      • Localization
    • Jupyter Notebook
  • Examples
    • Node/Express
    • Demo App
    • Open modal
    • Open modal
    • UMD client
    • Customize kepler.gl Theme
    • Customize kepler.gl Reducer
  • Contributing
    • Developing Kepler.gl
    • Contributor Covenant Code of Conduct
  • Change Log
  • Upgrade Guide
Powered by GitBook
On this page
  • uiStateUpdaters
  • DEFAULT_EXPORT_HTML
  • setUserMapboxAccessTokenUpdater

Was this helpful?

  1. Docs
  2. API Reference
  3. Reducers

ui-state

PreviouscombineNextvis-state

Last updated 5 months ago

Was this helpful?

Table of Contents

uiStateUpdaters

Examples

import keplerGlReducer, {uiStateUpdaters} from '@kepler.gl/reducers';
// Root Reducer
const reducers = combineReducers({
 keplerGl: keplerGlReducer,
 app: appReducer
});

const composedReducer = (state, action) => {
 switch (action.type) {
   // click button to close side panel
   case 'CLICK_BUTTON':
     return {
       ...state,
       keplerGl: {
         ...state.keplerGl,
         foo: {
            ...state.keplerGl.foo,
            uiState: uiStateUpdaters.toggleSidePanelUpdater(
              uiState, {payload: null}
            )
         }
       }
     };
 }
 return reducers(state, action);
};

export default composedReducer;

addNotificationUpdater

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

Parameters

cleanupExportImage

Delete cached export image

Parameters

DEFAULT_EXPORT_DATA

Default initial exportData settings

Properties

DEFAULT_EXPORT_IMAGE

Default image export config

Properties

DEFAULT_MAP_CONTROLS_FEATURES

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

Properties

hideExportDropdownUpdater

Hide side panel header dropdown, activated by clicking the share link on top of the side panel

Parameters

INITIAL_UI_STATE

Default initial uiState

Properties

loadFilesErrUpdater

Handles load file error and set fileLoading property to false

Parameters

  • state

    • error.error

loadFilesUpdater

Fired when file loading begin

Parameters

openDeleteModalUpdater

Toggle active map control panel

Parameters

removeNotificationUpdater

Remove a notification

Parameters

setExportDataTypeUpdater

Set data format for exporting data

Parameters

setExportDataUpdater

Whether to including data in map config, toggle between true or false

Parameters

setExportFilteredUpdater

Whether to export filtered data, true or false

Parameters

setExportImageDataUri

Set exportImage.setExportImageDataUri to a image dataUri

Parameters

setExportImageSetting

Set exportImage.legend to true or false

Parameters

    • $1.payload

setExportSelectedDatasetUpdater

Set selected dataset for export

Parameters

showExportDropdownUpdater

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

Parameters

startExportingImage

Set exportImage.exporting to true

Parameters

toggleMapControlUpdater

Toggle active map control panel

Parameters

    • action.payload.panelId

    • action.payload.index (optional, default 0)

toggleModalUpdater

Show and hide modal dialog

Parameters

toggleSidePanelUpdater

Toggle active side panel

Parameters

toggleSplitMapUpdater

Handles toggle map split and reset all map control index to 0

Parameters

  • state

DEFAULT_EXPORT_HTML

Properties

setUserMapboxAccessTokenUpdater

whether to export a mapbox access to HTML single page

Parameters

Updaters for uiState reducer. Can be used in your root reducer to directly modify kepler.gl's state. Read more about

Action:

state uiState

action

action.payload

Returns nextState

Action:

state uiState

Returns nextState

Type:

selectedDataset Default: '',

dataType Default: 'csv',

filtered Default: true,

config deprecated

data used in modal config export. Default: false

Type:

ratio Default: 'SCREEN',

resolution Default: 'ONE_X',

legend Default: false,

imageDataUri Default: '',

exporting Default: false

error Default: false

Type:

visibleLayers Default: {show: true, active: false}

mapLegend Default: {show: true, active: false}

toggle3d Default: {show: true}

splitMap Default: {show: true}

Action:

state uiState

Returns nextState

Type:

readOnly Default: false

activeSidePanel Default: 'layer'

currentModal ( | null) Default: 'addData'

datasetKeyToRemove ( | null) Default: null

visibleDropdown ( | null) Default: null

exportImage Default:

exportData Default:

mapControls Default:

activeMapIndex defines which map the user clicked on. Default: 0

Action:

error

Returns nextState

Action:

state uiState

Returns nextState

Action:

state uiState

action

action.payload dataset id

Returns nextState

Action:

state uiState

action

action.payload id of the notification to be removed

Returns nextState

Action:

state uiState

action

action.payload one of 'text/csv'

Returns nextState

Action:

state uiState

Returns nextState

Action:

state uiState

action

action.payload

Returns nextState

Action:

state uiState

action

action.payload export image data uri

Returns nextState

Action:

state uiState

$1

Returns nextState

Action:

state uiState

action

action.payload dataset id

Returns nextState

Action:

state uiState

action

action.payload id of the dropdown

Returns nextState

Action:

state uiState

Returns nextState

Action:

state uiState

action action

action.payload map control panel id, one of the keys of:

Returns nextState

Action:

state uiState

action

action.payload ( | null) id of modal to be shown, null to hide modals. One of:-

Returns nextState

Action:

state uiState

action

action.payload ( | null) id of side panel to be shown, one of layer, filter, interaction, map. close side panel if null

Returns nextState

Action:

Returns nextState

Type:

exportMapboxAccessToken Default: null, this is used when we provide a default mapbox token for users to take advantage of

userMapboxToken Default: '', mapbox token provided by user through input field

Action:

state uiState

action

action.payload

Returns nextState

Using updaters
Object
Object
Object
Object
Object
Object
Object
string
string
boolean
boolean
boolean
Object
string
string
boolean
string
boolean
boolean
Object
Object
Object
Object
Object
Object
Object
Object
boolean
string
string
string
string
number
Object
Object
Object
Object
Object
Object
string
Object
Object
Object
String
Object
Object
Object
string
Object
Object
Object
Object
Object
boolean
Object
Object
Object
string
Object
Object
Object
Object
Object
Object
string
Object
Object
Object
string
Object
Object
Object
Object
Object
Object
Object
Object
string
DATA_TABLE_ID
DELETE_DATA_ID
ADD_DATA_ID
EXPORT_IMAGE_ID
EXPORT_DATA_ID
ADD_MAP_STYLE_ID
Object
Object
Object
string
Object
Object
Object
string
string
Object
Object
string
Object
uiStateUpdaters
addNotificationUpdater
cleanupExportImage
DEFAULT_EXPORT_DATA
Properties
DEFAULT_EXPORT_IMAGE
Properties
DEFAULT_MAP_CONTROLS_FEATURES
Properties
hideExportDropdownUpdater
INITIAL_UI_STATE
Properties
loadFilesErrUpdater
loadFilesUpdater
openDeleteModalUpdater
removeNotificationUpdater
setExportDataTypeUpdater
setExportDataUpdater
setExportFilteredUpdater
setExportImageDataUri
setExportImageSetting
setExportSelectedDatasetUpdater
showExportDropdownUpdater
startExportingImage
toggleMapControlUpdater
toggleModalUpdater
toggleSidePanelUpdater
toggleSplitMapUpdater
DEFAULT_EXPORT_HTML
Properties
setUserMapboxAccessTokenUpdater
Object
DEFAULT_EXPORT_IMAGE
Object
DEFAULT_EXPORT_DATA
Object
DEFAULT_MAP_CONTROLS
string
DEFAULT_MAP_CONTROLS
addNotification
cleanupExportImage
hideExportDropdown
loadFilesErr
loadFiles
openDeleteModal
removeNotification
setExportDataType
setExportData
setExportFiltered
setExportImageDataUri
setExportImageSetting
setExportSelectedDataset
showExportDropdown
startExportingImage
toggleMapControl
toggleModal
toggleSidePanel
toggleSplitMap
setUserMapboxAccessToken