Visualizing networks with explicit paths

In this section, you will learn how to define a shape for the path that connects the two nodes of your network together. 

The first step is to define a function that will return a quadratic path for us. In order to do this, we use the code shown here:

#Function that outputs the quadratic pathvalues = [value/100. for value in range(100)]def quad_path(start, end, control, values):    return [(1-value)**2*start + 2*(1-value)*value*control + value**2*end for value in values]

Values is a list that contains a range of numbers from 0 to 0.99 which we will use to construct a function that mathematically returns a quadratic path based on the Bezier curve equation. 

The function above takes in four arguments:  ...

Get Hands-On Data Visualization with Bokeh now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.