A Julia package for visualizing data using deck.gl, a WebGL-powered framework for visual exploratory data analysis of large datasets.
using Pkg
Pkg.add(url="https://github.com/RallypointOne/DeckGL.jl")using DeckGL
# Sample data (any Tables.jl-compatible source works)
data = (
longitude = [-122.4, -122.5, -122.3, -122.45, -122.35],
latitude = [37.8, 37.7, 37.9, 37.75, 37.85],
size = [100, 200, 150, 180, 120]
)
# Create a scatterplot layer
layer = ScatterplotLayer(
data = data,
get_position = [:longitude, :latitude],
get_radius = :size,
get_fill_color = [255, 140, 0, 200]
)
# Create the deck
deck = Deck(
layer,
initial_view_state = ViewState(longitude=-122.4, latitude=37.8, zoom=11)
)
# Display in notebook or open in browser
open_html(deck)- Tables.jl Integration: Works with DataFrames, NamedTuples, and any Tables.jl-compatible source
- Multiple Display Targets: Jupyter notebooks, VS Code, standalone HTML files
- GPU-Accelerated: Leverages deck.gl's WebGL rendering for large datasets
- Interactive: Pan, zoom, and rotate visualizations
Deck(layers; initial_view_state, map_style, controller)- Top-level visualization containerViewState(; longitude, latitude, zoom, pitch, bearing)- Camera configuration
ScatterplotLayer- Render points/circles at coordinatesArcLayer- Render arcs between source and target pointsLineLayer- Render straight lines between pointsPathLayer- Render paths/polylines from coordinate sequencesPolygonLayer- Render filled/stroked polygonsTextLayer- Render text labels at coordinates
HexagonLayer- Aggregate points into hexagonal bins (3D)GridLayer- Aggregate points into rectangular grid cells (3D)HeatmapLayer- Render density heatmaps
GeoJsonLayer- Render GeoJSON data (points, lines, polygons)
to_json(deck)- Convert to deck.gl JSON specificationto_html(deck)- Generate standalone HTML stringsave_html(deck, path)- Save as HTML fileopen_html(deck)- Open in default browser
Convert GeoInterface-compatible geometries to GeoJSON:
using Shapefile
shp = Shapefile.Table("boundaries.shp")
layer = geojson_layer(shp, get_fill_color=[255, 0, 0, 100])Quick visualization helpers that return a Deck ready to display:
scatter(data, :lng, :lat; radius=:size, color=[255, 140, 0])
arcs(data, [:src_lng, :src_lat], [:dst_lng, :dst_lat])
lines(data, [:from_lng, :from_lat], [:to_lng, :to_lat])
paths(data, :path_column)
polygons(data, :polygon_column)
text(data, :lng, :lat, :label_column)
hexbin(data, :lng, :lat; radius=1000) # 3D hexagonal binning
heatmap(data, :lng, :lat; weight=:value) # Density heatmap
geojson(geojson_data) # GeoJSON visualizationMIT