G = get_largest_component(G, strongly=True)
center_nodes = nx.center(G)
// Bad performance [(node, data) for node, data in G.nodes(data=True) if node in nx.center(G)]
nodes_data = {node: data for node, data in G.nodes(data=True)}
// Arbitrarily choose first node
point = (nodes_data[center_nodes[0]]["y"], nodes_data[center_nodes[0]]["x"])
After Change
// if G was passed-in, use this graph in the plot, centered on the centroid of its nodes
if G is not None:
gdf_nodes = graph_to_gdfs(G, edges=False, node_geometry=True)
lnglat_point = gdf_nodes.unary_union.centroid.coords[0]
point = tuple(reversed(lnglat_point))
// otherwise, get the network by either address or point, whichever was passed-in,
// using a distance multiplier to make sure we get more than enough network