PointCloudLayer data not displaying in pydeck Dash app

15 hours ago 3
ARTICLE AD BOX

I'm trying to follow this example (https://deckgl.readthedocs.io/en/latest/gallery/point_cloud_layer.html#pointcloudlayer ) to make a 3d point cloud of a large number of points. When I try with my own data, it does not display. What am I doing wrong?

I have a toy version of my own data, code below:

import os import dash import dash_deck from dash import html import pydeck import pandas as pd import numpy as np import xarray as xr mapbox_api_token = os.getenv("MAPBOX_ACCESS_TOKEN") DATA_URL = 'https://github.com/nurgab/datasets_for_github/blob/main/nza.csv?raw=true' df = pd.read_csv(DATA_URL) df_short = df target = [df_short.newtimes.mean(), df_short.lat.mean(), df_short.lon.mean()] point_cloud_layer = pydeck.Layer( "PointCloudLayer", data=DATA_URL, get_position=["newtimes", "lat", "lon"], get_color=['r','g','b'], #["var1", "var1", "var1"], get_normal=[0,0,1], auto_highlight=True, pickable=True, point_size=3, ) view_state = pydeck.ViewState( target=target, controller=True, rotation_x=15, rotation_orbit=30, zoom=5.3 ) view = pydeck.View(type="OrbitView", controller=True) r = pydeck.Deck(point_cloud_layer, initial_view_state=view_state, views=[view]) app = dash.Dash(__name__) app.layout = html.Div( dash_deck.DeckGL(r.to_json(), id="deck-gl", style={"background-color": "#add8e6"}) ) if __name__ == "__main__": app.run(debug=True)

I am able to run the original example code at the link successfully, and with my data the app runs, but there are just no visible data points. Here is the output when I run the above in vscode:

Dash is running on [a local link appears here]

* Serving Flask app '3D_point_cloud_precip_map'

* Debug mode: on

The link is clickable, and opens a window in my browser just like the original code. There are no error messages that display. But no data points are visible. I'm scratching my head a bit. Don't know if I'm scaling things wrong, of I've somehow set my target in the wrong place, or what.

Read Entire Article