Skip to content

๐Ÿ—พ Streamlit Component for rendering kepler.gl maps

License

Notifications You must be signed in to change notification settings

chrieke/streamlit-keplergl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

42 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

streamlit-keplergl

Open in Streamlit PyPi

๐Ÿ—พ Streamlit component for rendering kepler.gl maps in a streamlit app.


๐ŸŽˆ Live Demo ๐ŸŽˆ


Installation

pip install streamlit-keplergl

Usage

import streamlit as st
from streamlit_keplergl import keplergl_static
from keplergl import KeplerGl

st.write("This is a kepler.gl map in streamlit")

map_1 = KeplerGl()
keplergl_static(map_1)

Use within a streamlit column etc:

col1 = st.column(1)
with col1:
  keplergl_static(map_1)

Parameters

  • fig: keplergl.KeplerGl map figure.
  • height: Fixed pixel height of the map. Optional, might result in non-optimal layout on some devices. By default the map height is determined by the keplergl figure height.
  • width: Fixed pixel width of the map. Optional, by default the map width adjusts to the streamlit layout.
  • center_map: Centers the map on the current map data, default False.
  • read_only: Disables the side panel for map customization, default False.

More infos

Set map location:
The initial map location is not configured via keplergl_static but via the KeplerGL configuration, see example. But if your map contains data, you can use the center_map parameter, see example.

Static component:
This is a static Streamlit component, thus information from browser interaction can not be passed back from KeplerGL to Python.

Also see the kepler.gl documentation for general info on usage of kepler.gl in Python.