Skip to content

Instantly share code, notes, and snippets.

@do-me
Created March 4, 2025 20:32
Show Gist options
  • Save do-me/c2bb92277d306cf99b743139b3d2c8de to your computer and use it in GitHub Desktop.
Save do-me/c2bb92277d306cf99b743139b3d2c8de to your computer and use it in GitHub Desktop.
Simple pydeck deck.gl Lineplot layer
import pydeck as pdk
df = pd.read_json("https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/line/heathrow-flights.json")
INITIAL_VIEW_STATE = pdk.ViewState(latitude=47.65, longitude=7, zoom=4.5, max_zoom=16, pitch=50, bearing=0)
line_layer = pdk.Layer(
"LineLayer",
df,
get_source_position="start",
get_target_position="end",
get_color=[255, 255, 0],
get_width=10,
highlight_color=[255, 255, 0],
picking_radius=10,
auto_highlight=True,
pickable=True,
)
layers = [line_layer]
r = pdk.Deck(layers=layers, initial_view_state=INITIAL_VIEW_STATE)
r.to_html("line_layer.html")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment