Black Lives Matter. Please consider donating to Black Girls Code today.

Animated ScatterGeo - with mode:line

Hi all,
I am very new with Plot.ly (literally just started a couple of days ago) & so far loving it.
I want to build a ScatterGeo animated chart with mode:line.

The chart I am trying to build corresponds to visualizing the call distribution model for a global Contact Center.
Calls come from different Countries to a one of a few Contact Centre of the company located in different countries - If there are agents available in the local contact center where the call came to then the call is handled locally - if an agent is not available in the local contact center but there are agents located on another remote contact center - the call is transferred to the agent in the remote contact center.

Countries from where calls are coming + Contact Centers are markers on the Graph.
There are lines between Countries and Contact Centers to signify incoming calls & lines between Contact Centers to signfiy inter-site call transfers.

Now, I have an idea how to represent markers using grid/column reference - but I am struggling to understand how I can build mode:line scattergeo data dict for lines using grid/columns
For markers (Countries + Contact Center) - I will create columns to represent the lat,lon for each frame instance-populate the column with lattitude,longitude for each country+ cc that are active in a frame & refer to them in the latsrc and lonsrc element of the scatter geo.
As per my understanding - in order to draw a line between 2 points on a map.
I will need to create a dictionary of type scater geo & set the lat/lon attributes of this dictionary with a 2 element array (to correspond to the coordinates of the 2 .
The problem is how can construct this object via Grid/Columns - that is because _ will have to create a column for each connection - while I come up with a mechanism to do that - but the number of such connections active in a frame are itself - variable - how can I create a variable number of Scatter Geo dicts - where the number of such dicts depend on the size (no. of elements in) a column.

Hey @faisyou ,
In order to upload the lines via Grid and Columns define the lists of x coordinates, respectively y coordinates (or lon and lat in the case of scattergeo) of the points that are ends of the line segments.
After each pair of coordinates insert a None, to prevent joining consecutive points that usually are not connected.

For example:

xline=[x0, x1, None, x2, x3, None, .... , x60, x61, None]
yline=[y0, y1, None, y2, y3, None, ...., y60, y61, None]

If the lines are displayed at the same time, the list of Columns is defined as follows:

my_columns=[]
my_columns.extend([Column(xline, 'xline'), Column(yline, 'yline')])

If you intend to display each line in a different frame of the animation, then you should name the lists corresponding to each line:

for k in range(np_frames):
    my_columns.extend(Column(xline[3k:3k+3], 'xline{}'.format(k+1)), Column(yline[3k:3k+3], 'yline{}'.format(k+1))])