[Already solved]When dealing with 3D point clouds, there is a problem with the display of the function pydeck_chart()


There is a problem when using the pydeck_chart function in the library to load 3D point cloud information. Maybe it is because the amount of information is too large, resulting in no display in the streamlit window

Steps to reproduce

Code snippet:

DATA_URL = "https://raw.githubusercontent.com/ajduberstein/geo_datasets/master/small_waterfall.csv"
df = pd.read_csv(DATA_URL)

target = [df.x.mean(), df.y.mean(), df.z.mean()]

point_cloud_layer = pdk.Layer(
    get_position=["x", "y", "z"],
    get_color=["r", "g", "b"],
    get_normal=[0, 0, 15],

view_state = pdk.ViewState(target=target, controller=True, rotation_x=15, rotation_orbit=30, zoom=5.3)
view = pdk.View(type="OrbitView", controller=True)

r = pdk.Deck(point_cloud_layer, initial_view_state=view_state, views=[view])


Expected behavior:
Expected output is like this picture:

Actual behavior:

Actual output is like this picture:

Debug info

  • OS version: window 10
  • Browser version: google chrome


According to Streamlit+PyDeck Performance Issues (compared to non-streamlit usage of Pydeck with local data object) ยท Issue #5532 ยท streamlit/streamlit ยท GitHub

using components.html() embed the html into streamlit app

1 Like