Skip to content

Commit

Permalink
Panel-based Datashader dashboard (#676)
Browse files Browse the repository at this point in the history
* Removed outdated Bokeh dashboard directory and associated descriptions
* Removed outdated ParamNB dashboard example
* Added Panel-based dashboard
  • Loading branch information
jbednar committed Jan 28, 2019
1 parent ae72d23 commit cd033d5
Show file tree
Hide file tree
Showing 12 changed files with 403 additions and 894 deletions.
31 changes: 1 addition & 30 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,33 +77,4 @@ with an unreliable connection (e.g. if you see `Loading BokehJS ...` but never
BOKEH_RESOURCES=inline jupyter notebook --NotebookApp.iopub_data_rate_limit=100000000
```

## Dashboard

An example interactive dashboard using
[bokeh server](http://bokeh.pydata.org/en/latest/docs/user_guide/server.html)
integrated with a datashading pipeline.

To start, launch it with one of the supported datasets specified:

```
python dashboard/dashboard.py -c dashboard/nyc_taxi.yml
python dashboard/dashboard.py -c dashboard/census.yml
python dashboard/dashboard.py -c dashboard/opensky.yml
python dashboard/dashboard.py -c dashboard/osm.yml
```

The '.yml' configuration file sets up the dashboard to use one of the
datasets downloaded above. You can write similar configuration files
for working with other datasets of your own, while adding features to
`dashboard.py` itself if needed to support them.

For most of these datasets, if you have less than 16GB of RAM on your
machine, you will want to add the "-o" option before "-c" to tell it
to work out of core instead of loading all data into memory. However,
doing so will make interactive use substantially slower than if
sufficient memory were available.

To launch multiple dashboards at once, you'll need to add "-p 5001"
(etc.) to select a unique port number for the web page to use for
communicating with the Bokeh server. Otherwise, be sure to kill the
server process before launching another instance.
See dashboard.ipynb in this directory for a Datashder dashboard for viewing data.
246 changes: 246 additions & 0 deletions examples/dashboard.ipynb

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions examples/dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
sources:
osm-1b:
description: 1-billion-point OpenStreetMap GPS dataset
driver: parquet
args:
urlpath: '{{ CATALOG_DIR }}/data/osm-1billion.snappy.parq'
columns: ['x','y']
metadata:
fields:
counts:
label: GPS coordinates
plot:
xlim: !!python/tuple [-8240227, -8231284]
ylim: !!python/tuple [ 4974203, 4979238]
kind: points
plots:
counts:
label: 1 billion OpenStreetMap GPS locations
x: x
y: y

nyc_taxi:
description: Large version of nyc taxi dataset
driver: parquet
args:
urlpath: '{{ CATALOG_DIR }}/data/nyc_taxi_wide.parq'
columns: ['dropoff_x','dropoff_y','pickup_x','pickup_y',
'dropoff_hour','pickup_hour','passenger_count']
metadata:
fields:
counts:
label: Ride counts
passenger_count:
label: Passenger Count
dropoff_hour:
label: Drop-off Hour
pickup_hour:
label: Pick-up Hour
plot:
xlim: !!python/tuple [-8240227.037, -8231283.905]
ylim: !!python/tuple [4974203.152, 4979238.441]
kind: points
hover_cols: ['dropoff_hour', 'pickup_hour', 'passenger_count']
plots:
dropoff:
label: NYC Taxi Dropoffs
x: dropoff_x
y: dropoff_y
pickup:
label: NYC Taxi Pickups
x: pickup_x
y: pickup_y

nyc_taxi_50k:
description: Small version of nyc taxi dataset
driver: parquet
args:
urlpath: '{{ CATALOG_DIR }}/data/nyc_taxi_50k.parq'
columns: ['dropoff_x','dropoff_y','pickup_x','pickup_y',
'dropoff_hour','pickup_hour','passenger_count']
metadata:
fields:
counts:
label: Ride counts
passenger_count:
label: Passenger Count
dropoff_hour:
label: Drop-off Hour
pickup_hour:
label: Pick-up Hour
plot:
xlim: !!python/tuple [-8240227.037, -8231283.905]
ylim: !!python/tuple [4974203.152, 4979238.441]
kind: points
hover_cols: ['dropoff_hour', 'pickup_hour', 'passenger_count']
plots:
dropoff:
label: NYC Taxi Dropoffs
x: dropoff_x
y: dropoff_y
pickup:
label: NYC Taxi Pickups
x: pickup_x
y: pickup_y

census:
description: US Census Synthetic Data
driver: parquet
args:
urlpath: '{{ CATALOG_DIR }}/data/census.snappy.parq'
metadata:
fields:
counts:
label: Counts
race:
label: Race
# this doesn't work, but I think something like it might.
# labels:
# w: White
# b: Black
# a: Asian
# h: Hispanic
# o: Other
plot:
x: easting
y: northing
xlim: !!python/tuple [-13914936, -7235767]
ylim: !!python/tuple [2632019, 6446276]
kind: points
plots:
people:
label: US Census Synthetic people
race:
label: US Census Synthetic race
c: race
cmap:
w: blue
b: green
a: red
h: orange
o: saddlebrown

opensky:
description: OpenSky Flight Paths
driver: netcdf
args:
urlpath: '{{ CATALOG_DIR }}/data/opensky.h5'
chunks: {}
metadata:
fields:
counts:
label: Counts
ascending:
label: Ascending vs. Descending
cat_colors:
True: blue
False: red
cat_names:
True: Ascending
False: Descending
plot:
xlim: !!python/tuple [-2000000, 2500000]
ylim: !!python/tuple [4100000, 7800000]
kind: points
x: longitude
y: latitude
plots:
flight_paths:
label: OpenSky Flight Paths
35 changes: 0 additions & 35 deletions examples/dashboard/census.yml

This file was deleted.

Loading

0 comments on commit cd033d5

Please sign in to comment.