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

Was this helpful?

  1. Docs
  2. API Reference
  3. Reducers

vis-state

Previousui-stateNextProcessors

Last updated 5 months ago

Was this helpful?

Table of Contents

visStateUpdaters

Examples

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

const composedReducer = (state, action) => {
 switch (action.type) {
   case 'CLICK_BUTTON':
     return {
       ...state,
       keplerGl: {
         ...state.keplerGl,
         foo: {
            ...state.keplerGl.foo,
            visState: visStateUpdaters.enlargeFilterUpdater(
              state.keplerGl.foo.visState,
              {idx: 0}
            )
         }
       }
     };
 }
 return reducers(state, action);
};

export default composedReducer;

addFilterUpdater

Add a new filter

Parameters

addLayerUpdater

Add a new layer

Parameters

applyCPUFilterUpdater

When select dataset for export, apply cpu filter to selected dataset

Parameters

enlargeFilterUpdater

Show larger time filter at bottom for time playback (apply to time filter only)

Parameters

INITIAL_VIS_STATE

Default initial visState

Properties

interactionConfigChangeUpdater

Update interactionConfig

Parameters

layerClickUpdater

Trigger layer click event with clicked object

Parameters

layerHoverUpdater

Trigger layer hover event with hovered object

Parameters

layerTypeChangeUpdater

Update layer type. Previews layer config will be copied if applicable.

Parameters

layerVisConfigChangeUpdater

Update layer visConfig

Parameters

layerVisualChannelChangeUpdater

Update layer visual channel

Parameters

loadFilesErrUpdater

Trigger loading file error

Parameters

    • action.error any

loadFilesUpdater

Trigger file loading dispatch addDataToMap if succeed, or loadFilesErr if failed

Parameters

mapClickUpdater

Trigger map click event, unselect clicked object

Parameters

receiveMapConfigUpdater

Propagate visState reducer with a new configuration. Current config will be override.

Parameters

    • action.payload.config (optional, default {})

    • action.payload.options (optional, default {})

removeDatasetUpdater

Remove a dataset and all layers, filters, tooltip configs that based on it

Parameters

removeFilterUpdater

Remove a filter

Parameters

removeLayerUpdater

remove layer

Parameters

reorderLayerUpdater

Reorder layer

Parameters

resetMapConfigUpdater

reset visState to initial State

Parameters

setFilterPlotUpdater

Set the property of a filter plot

Parameters

setFilterUpdater

Update filter property

Parameters

    • action.value any new value

setMapInfoUpdater

User input to update the info of the map

Parameters

showDatasetTableUpdater

Display dataset table in a modal

Parameters

toggleFilterAnimationUpdater

Start and end filter animation

Parameters

toggleLayerForMapUpdater

Toggle visibility of a layer in a split map

Parameters

toggleSplitMapUpdater

Toggle visibility of a layer for a split map

Parameters

updateAnimationTimeUpdater

Reset animation config current time to a specified value

Parameters

updateFilterAnimationSpeedUpdater

Change filter animation speed

Parameters

updateLayerAnimationSpeedUpdater

Update animation speed with the vertical speed slider

Parameters

updateLayerBlendingUpdater

update layer blending mode

Parameters

updateVisDataUpdater

Add new dataset to visState, with option to load a map config along with the datasets

Parameters

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

Action:

state visState

action action

action.dataId dataset id this new filter is associated with

Returns nextState

Action:

state visState

action action

action.props new layer props

Returns nextState

Action:

state visState

action

action.dataId dataset id

Returns nextState

Action:

state visState

action action

action.idx index of filter to enlarge

Returns nextState

Type:

layers

layerData

layerToBeMerged

layerOrder

filters

filterToBeMerged

datasets

editingDataset

interactionConfig

interactionToBeMerged

layerBlending

hoverInfo

clicked

mousePos

splitMaps a list of objects of layer availabilities and visibilities for each map

layerClasses

animationConfig

editor

Action:

state visState

action action

action.config new config as key value map: {tooltip: {enabled: true}}

Returns nextState

Action:

state visState

action action

action.info Object clicked, returned by deck.gl

Returns nextState

Action:

state visState

action action

action.info Object hovered, returned by deck.gl

Returns nextState

Action:

state visState

action action

action.oldLayer layer to be updated

action.newType new type

Returns nextState

Action:

state visState

action action

action.oldLayer layer to be updated

action.newVisConfig new visConfig as a key value map: e.g. {opacity: 0.8}

Returns nextState

Action:

state visState

action action

action.oldLayer layer to be updated

action.newConfig new visual channel config

action.channel channel to be updated

Returns nextState

Action:

state visState

action action

Returns nextState

Action:

state visState

action action

action.files <> array of fileblob

Returns nextState

Action:

state visState

Returns nextState

Action:

state visState

action action

action.payload map config to be propagated

action.payload.config map config to be propagated

action.payload.option {keepExistingConfig: true | false}

Returns nextState

Action:

state visState

action action

action.key dataset id

Returns nextState

Action:

state visState

action action

action.idx index of filter to b e removed

Returns nextState

Action:

state visState

action action

action.idx index of layer to b e removed

Returns nextState

Action:

state visState

action action

action.order <> an array of layer indexes

Returns nextState

Action:

state visState

Returns nextState

Action:

state visState

action action

action.idx

action.newProp key value mapping of new prop {yAxis: 'histogram'}

Returns nextState

Action:

state visState

action action

action.idx idx of filter to be updated

action.prop prop of filter, e,g, dataId, name, value

datasetId used when updating a prop (dataId, name) that can be linked to multiple datasets

Returns nextState

Action:

state visState

action action

action.info {title: 'hello'}

Returns nextState

Action:

state visState

action action

action.dataId dataset id to show in table

Returns nextState

Action:

state visState

action action

action.idx idx of filter

Returns nextState

Action:

state

action

action.mapIndex index of the split map

action.layerId id of the layer

Returns nextState

Action:

state visState

action action

action.payload ( | ) index of the split map

Returns nextState

Action:

state visState

action action

action.value the value current time will be set to

Returns nextState

Action:

state visState

action action

action.idx idx of filter

action.speed speed to change it to. speed is a multiplier

Returns nextState

Action:

state visState

action action

action.speed the updated speed of the animation

Returns nextState

Action:

state visState

action action

action.mode one of additive, normal and subtractive

Returns nextState

Action:

state visState

action action

action.datasets (<> | ) *required datasets can be a dataset or an array of datasets Each dataset object needs to have info and data property.

action.datasets.info -info of a dataset

action.datasets.info.id id of this dataset. If config is defined, id should matches the dataId in config.

action.datasets.info.label A display name of this dataset

action.datasets.data *required The data object, in a tabular format with 2 properties fields and rows

action.datasets.data.fields <> *required Array of fields,

action.datasets.data.fields.name *required Name of the field,

action.datasets.data.rows <> *required Array of rows, in a tabular format with fields and rows

action.options option object {centerMap: true, keepExistingConfig: false}

action.config map config

Returns nextState

Using updaters
Object
Object
string
Object
Object
Object
Object
Object
Object
Object
string
Object
Object
Object
Number
Object
Object
Array
Array
Array
Array
Array
Array
Array
string
Object
Object
string
Object
Object
Object
Array
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
string
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
string
Object
Object
Object
Object
Object
Object
Array
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
Object
string
Object
Object
Object
Number
Object
Object
Object
Number
Object
Object
Object
Array
Number
Object
Object
Object
Object
Object
Number
Object
Object
Object
Object
Number
string
string
Object
Object
Object
Object
Object
Object
Object
string
Object
Object
Object
Number
Object
Object
Object
Number
string
Object
Object
Object
Number
undefined
Object
Object
Object
Number
Object
Object
Object
Number
Number
Object
Object
Object
Number
Object
Object
Object
string
Object
Object
Object
Array
Object
Object
Object
string
string
Object
Array
Object
string
Array
Array
Object
Object
Object
visStateUpdaters
addFilterUpdater
addLayerUpdater
applyCPUFilterUpdater
enlargeFilterUpdater
INITIAL_VIS_STATE
Properties
interactionConfigChangeUpdater
layerClickUpdater
layerHoverUpdater
layerTypeChangeUpdater
layerVisConfigChangeUpdater
layerVisualChannelChangeUpdater
loadFilesErrUpdater
loadFilesUpdater
mapClickUpdater
receiveMapConfigUpdater
removeDatasetUpdater
removeFilterUpdater
removeLayerUpdater
reorderLayerUpdater
resetMapConfigUpdater
setFilterPlotUpdater
setFilterUpdater
setMapInfoUpdater
showDatasetTableUpdater
toggleFilterAnimationUpdater
toggleLayerForMapUpdater
toggleSplitMapUpdater
updateAnimationTimeUpdater
updateFilterAnimationSpeedUpdater
updateLayerAnimationSpeedUpdater
updateLayerBlendingUpdater
updateVisDataUpdater
addFilter
addLayer
applyCPUFilter
enlargeFilter
interactionConfigChange
onLayerClick
onLayerHover
layerTypeChange
layerVisConfigChange
layerVisualChannelConfigChange
loadFilesErr
loadFiles
onMapClick
receiveMapConfig
removeDataset
removeFilter
removeLayer
reorderLayer
resetMapConfig
setFilterPlot
setFilter
setMapInfo
showDatasetTable
toggleFilterAnimation
toggleLayerForMap
toggleSplitMap
updateAnimationTime
updateFilterAnimationSpeed
updateLayerAnimationSpeed
updateLayerBlending
updateVisData