Streamlit component for deck.gl visualisation
Project description
streamlit-deckgl
Streamlit component for deck.gl visualisation with bi-directional transport for onClick events.
Installation instructions
pip install streamlit-deckgl
Usage instructions
import streamlit as st
import pydeck as pdk
import pandas as pd
from streamlit_deckgl import st_deckgl
st.write("## Example")
chart_data = pd.DataFrame(
np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4], columns=["lat", "lon"]
)
r = pdk.Deck(
initial_view_state=pdk.ViewState(
latitude=37.76, longitude=-122.4, zoom=11, pitch=50, height=600
),
layers=[
pdk.Layer(
"HexagonLayer",
data=chart_data,
get_position="[lon, lat]",
radius=200,
elevation_scale=4,
elevation_range=[0, 1000],
pickable=True,
extruded=True,
),
pdk.Layer(
"ScatterplotLayer",
data=chart_data,
get_position="[lon, lat]",
get_color="[200, 30, 0, 160]",
get_radius=200,
),
],
tooltip={
"html": "<b>Temperature:</b> {value} °C",
"style": {"backgroundColor": "steelblue", "color": "white"},
},
)
value = st_deckgl(r)
st.write(value)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
streamlit-deckgl-0.1.1.tar.gz
(60.8 kB
view hashes)
Built Distribution
Close
Hashes for streamlit_deckgl-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc679ecc0aa85b5b0188ad2732c2ccb6efc0bb18743a8d3d30a2d987a015d083 |
|
MD5 | 0f8507066d9e962f21d65d1e0aaa3b29 |
|
BLAKE2b-256 | 8b87301662bb4634030ab89294066b600972664fe5afa02575001eec96121a61 |