Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chrieke/streamlit-keplergl
🗾 Streamlit Component for rendering kepler.gl maps
https://github.com/chrieke/streamlit-keplergl
geospatial kepler keplergl streamlit streamlit-components
Last synced: 4 days ago
JSON representation
🗾 Streamlit Component for rendering kepler.gl maps
- Host: GitHub
- URL: https://github.com/chrieke/streamlit-keplergl
- Owner: chrieke
- License: mit
- Created: 2021-06-18T01:31:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-23T21:46:05.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T18:27:03.752Z (11 days ago)
- Topics: geospatial, kepler, keplergl, streamlit, streamlit-components
- Language: Python
- Homepage:
- Size: 717 KB
- Stars: 64
- Watchers: 3
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# streamlit-keplergl
[![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://share.streamlit.io/chrieke/streamlit-keplergl/main/examples/streamlit-keplergl-example.py)
[![PyPi](https://img.shields.io/pypi/v/streamlit-keplergl)](https://pypi.org/project/streamlit-keplergl/)**🗾 Streamlit component for rendering [kepler.gl](https://docs.kepler.gl/docs/keplergl-jupyter#2-add-data) maps
in a streamlit app.**---
🎈 Live Demo 🎈---
## Installation
```bash
pip install streamlit-keplergl
```## Usage
```python
import streamlit as st
from streamlit_keplergl import keplergl_static
from keplergl import KeplerGlst.write("This is a kepler.gl map in streamlit")
map_1 = KeplerGl()
keplergl_static(map_1)
```**Use within a streamlit column etc:**
```python
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](https://github.com/chrieke/streamlit-keplergl/blob/main/examples/streamlit-keplergl-example-with-config.py).
But if your map contains data, you can use the `center_map` parameter, see
[example](https://github.com/chrieke/streamlit-keplergl/blob/main/examples/streamlit-keplergl-example-with-data.py).**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](https://docs.kepler.gl/docs/keplergl-jupyter#2-add-data) documentation
for general info on usage of kepler.gl in Python.