'Is there a way to make directional line with geographic data in Hvplot

I'm using hvplot to make flow representations. So far, looking in the documentation, I haven't found ways to direct the lines. I'm using the line representation, as you can see in the code below

flowDs = pd.DataFrame([
  {'id':0,'origin':Point(-44.6077,-19.8601), 'timeOrigin':datetime(2018,1,1,12,0,0),'destination':Point(-44.4321,-19.8866), 'timeDestination':datetime(2018,1,1,12,6,0),'inflow':45,'outflow':30,},
  {'id':1,'origin':Point(-46.6388,-23.5489), 'timeOrigin':datetime(2018,1,1,12,6,0),'destination':Point(-44.4321,-19.8866), 'timeDestination':datetime(2018,1,1,12,10,0),'inflow':60,'outflow':20,},
  {'id':2,'origin':Point(-47.9292,-15.7801), 'timeOrigin':datetime(2018,1,1,12,10,0),'destination':Point(-44.4321,-19.8866), 'timeDestination':datetime(2018,1,1,12,15,0),'inflow':15,'outflow':30,},
  {'id':3,'origin':Point(-43.2096,-22.9035), 'timeOrigin':datetime(2018,1,1,12,15,0),'destination':Point(-44.4321,-19.8866), 'timeDestination':datetime(2018,1,1,12,20,0),'inflow':20,'outflow':40,},
    {'id':4,'origin':Point(-44.6077,-19.8601), 'timeOrigin':datetime(2018,1,2,12,0,0),'destination':Point(-44.4321,-19.8866), 'timeDestination':datetime(2018,1,1,12,6,0),'inflow':45,'outflow':30,},
  {'id':5,'origin':Point(-46.6388,-23.5489), 'timeOrigin':datetime(2018,1,2,12,6,0),'destination':Point(-44.4321,-19.8866), 'timeDestination':datetime(2018,1,1,12,10,0),'inflow':60,'outflow':20,},
  {'id':6,'origin':Point(-47.9292,-15.7801), 'timeOrigin':datetime(2018,1,2,12,10,0),'destination':Point(-44.4321,-19.8866), 'timeDestination':datetime(2018,1,1,12,15,0),'inflow':15,'outflow':30,},
]).set_index('id')

flowDs["avgFlow"] = flowDs["inflow"] - flowDs["outflow"]
listLines = [LineString([row["origin"],row["destination"]]) for _, row in flowDs.iterrows()]
flowDs["line"] = listLines

geoFlowDf = gpd.GeoDataFrame(flowDs,geometry = flowDs.line)
geoFlowDf.hvplot(geo=True,tiles=True,hover_cols=["id","avgFlow"], alpha=0.5,line_width=holoviews.dim("avgFlow")*0.3)

This is the result:

enter image description here

Is there any way to direct the lines, or another better way to represent a flow or trajectory?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source