- visStateUpdaters
- addFilterUpdater
- addLayerUpdater
- applyCPUFilterUpdater
- enlargeFilterUpdater
- INITIAL_VIS_STATE
- 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
Updaters for visState
reducer. Can be used in your root reducer to directly modify kepler.gl's state.
Read more about Using updaters
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;
Add a new filter
- Action:
addFilter
Parameters
state
ObjectvisState
action
Object actionaction.dataId
string datasetid
this new filter is associated with
Returns Object nextState
Add a new layer
- Action:
addLayer
Parameters
Returns Object nextState
When select dataset for export, apply cpu filter to selected dataset
- Action:
applyCPUFilter
Parameters
Returns Object nextState
Show larger time filter at bottom for time playback (apply to time filter only)
- Action:
enlargeFilter
Parameters
Returns Object nextState
Default initial visState
Type: Object
layers
ArraylayerData
ArraylayerToBeMerged
ArraylayerOrder
Arrayfilters
ArrayfilterToBeMerged
Arraydatasets
ArrayeditingDataset
stringinteractionConfig
ObjectinteractionToBeMerged
ObjectlayerBlending
stringhoverInfo
Objectclicked
ObjectmousePos
ObjectsplitMaps
Array a list of objects of layer availabilities and visibilities for each maplayerClasses
ObjectanimationConfig
Objecteditor
Object
Update interactionConfig
- Action:
interactionConfigChange
Parameters
state
ObjectvisState
action
Object actionaction.config
Object new config as key value map:{tooltip: {enabled: true}}
Returns Object nextState
Trigger layer click event with clicked object
- Action:
onLayerClick
Parameters
Returns Object nextState
Trigger layer hover event with hovered object
- Action:
onLayerHover
Parameters
Returns Object nextState
Update layer type. Previews layer config will be copied if applicable.
- Action:
layerTypeChange
Parameters
Returns Object nextState
Update layer visConfig
- Action:
layerVisConfigChange
Parameters
Returns Object nextState
Update layer visual channel
- Action:
layerVisualChannelConfigChange
Parameters
Returns Object nextState
Trigger loading file error
- Action:
loadFilesErr
Parameters
Returns Object nextState
Trigger file loading dispatch addDataToMap
if succeed, or loadFilesErr
if failed
- Action:
loadFiles
Parameters
Returns Object nextState
Trigger map click event, unselect clicked object
- Action:
onMapClick
Parameters
state
ObjectvisState
Returns Object nextState
Propagate visState
reducer with a new configuration. Current config will be override.
- Action:
receiveMapConfig
Parameters
Returns Object nextState
Remove a dataset and all layers, filters, tooltip configs that based on it
- Action:
removeDataset
Parameters
Returns Object nextState
Remove a filter
- Action:
removeFilter
Parameters
Returns Object nextState
remove layer
- Action:
removeLayer
Parameters
Returns Object nextState
Reorder layer
- Action:
reorderLayer
Parameters
Returns Object nextState
reset visState to initial State
- Action:
resetMapConfig
Parameters
state
ObjectvisState
Returns Object nextState
Set the property of a filter plot
- Action:
setFilterPlot
Parameters
Returns Object nextState
Update filter property
- Action:
setFilter
Parameters
state
ObjectvisState
action
Object actiondatasetId
string used when updating a prop (dataId, name) that can be linked to multiple datasets
Returns Object nextState
User input to update the info of the map
- Action:
setMapInfo
Parameters
Returns Object nextState
Display dataset table in a modal
- Action:
showDatasetTable
Parameters
Returns Object nextState
Start and end filter animation
- Action:
toggleFilterAnimation
Parameters
Returns Object nextState
Toggle visibility of a layer in a split map
- Action:
toggleLayerForMap
Parameters
Returns Object nextState
Toggle visibility of a layer for a split map
- Action:
toggleSplitMap
Parameters
Returns Object nextState
Reset animation config current time to a specified value
- Action:
updateAnimationTime
Parameters
state
ObjectvisState
action
Object actionaction.value
Number the value current time will be set to
Returns Object nextState
Change filter animation speed
- Action:
updateFilterAnimationSpeed
Parameters
Returns Object nextState
Update animation speed with the vertical speed slider
- Action:
updateLayerAnimationSpeed
Parameters
Returns Object nextState
update layer blending mode
- Action:
updateLayerBlending
Parameters
state
ObjectvisState
action
Object actionaction.mode
string one ofadditive
,normal
andsubtractive
Returns Object nextState
Add new dataset to visState
, with option to load a map config along with the datasets
- Action:
updateVisData
Parameters
state
ObjectvisState
action
Object actionaction.datasets
(Array<Object> | Object) *required datasets can be a dataset or an array of datasets Each dataset object needs to haveinfo
anddata
property.action.options
Object option object{centerMap: true, keepExistingConfig: false}
action.config
Object map config
Returns Object nextState