Animated a network graph ontop of map?

Hi All,

I see that Plotly has the ability to build a network graph, but I have two additional questions:

  1. Are there examples on how to animate this network graph, so that you can see points moving from one node to another over time?
  2. Can this network graph be superimposed onto a map, where each node represents a set of coordinates?

What would be the best resource to start looking into this?

Thanks!

for the animation you are looking for you can use the intervall component of dash to fire a callback every other intervall of time https://dash.plot.ly/live-updates
for the modification of the points in the map just return a dictionary with the new data component to the mapbox you are displaying {‘data’:[]} the output of the callback should look like this Output(‘map-figure’, ‘figure’),

the function can look something like this
@app.callback(Output(‘map’, ‘figure’),
[Input(‘interval-component’, ‘n_intervals’)])
def update_map(n):
do_stuff()
return {data:[]}

Is this at all possible to do with frames instead of using Dash?

@firestone_500, The answer is positive. You can draw a network on a map and animate the nodes.

I experimented only “node” motion on a map, here [https://plot.ly/~empet/14215] (just click the button Play to see it in action).

2 Likes