- you have been quite abstract defining your data. Hence I used simple to use osmnx which provides simple way to source nodes and edges
- edges will be LineString, plotly wants a list of lat and lon, hence extraction of co-ordinates and flattening
- have demonstrated
- line trace, clearly this is stretched (as expected) because it does not take into account geometric projections onto linear space
- line mapbox trace
- folium
source some points and connected edges
import osmnx as ox
import plotly.express as px
import numpy as np
# get some edges
gdf = ox.geocode_to_gdf('Topsham, Devon')
G = ox.graph_from_polygon(gdf.loc[0,"geometry"], network_type='drive')
gdf_nodes, gdf_edges = ox.graph_to_gdfs(G)
plotly lines
# plotly lines are arrays of points with each line separated by None
px.line(
x=np.concatenate(
gdf_edges["geometry"].apply(lambda g: [c[1] for c in g.coords] + [None]).values
),
y=np.concatenate(
gdf_edges["geometry"].apply(lambda g: [c[0] for c in g.coords] + [None]).values
),
)

plotly mapbox
px.line_mapbox(
lat=np.concatenate(
gdf_edges["geometry"].apply(lambda g: [c[1] for c in g.coords] + [None]).values
),
lon=np.concatenate(
gdf_edges["geometry"].apply(lambda g: [c[0] for c in g.coords] + [None]).values
),
).update_layout(mapbox={"style":"carto-positron", "zoom":13})

folium (using geopandas)
gdf_edges.explore()
