UK research networks with HoloViews+Bokeh+Datashader¶
Datashader makes it possible to plot very large datasets in a web browser, while Bokeh makes those plots interactive, and HoloViews provides a convenient interface for building these plots. Here, let's use these three programs to visualize an example dataset of 600,000 collaborations between 15000 UK research institutions, previously laid out using a force-directed algorithm by Ian Calvert.
First, we'll import the packages we are using and set up some defaults.
import pandas as pd import holoviews as hv from holoviews import opts from colorcet import fire from datashader.bundling import directly_connect_edges, hammer_bundle from holoviews.operation.datashader import datashade, dynspread from holoviews.operation import decimate from dask.distributed import Client client = Client() hv.notebook_extension('bokeh','matplotlib') decimate.max_samples=20000 dynspread.threshold=0.01 datashade.cmap=fire[40:] sz = dict(width=150,height=150) opts.defaults( opts.RGB(width=400, height=400, xaxis=None, yaxis=None, show_grid=False, bgcolor="black"))