You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
This is my use case - I have a geodataframe with a bunch of linestring geometry. While I can visualize that with geodataframe.hvplot, I do want to show the network topology (arrows etc), so felt ploting a networkx directed graph might be better. So I used momepy.gdf_to_nx. This either returns a DiGraph or a MultiDiGraph, and converts all columns of the gdf to attributes of the graph. For my purposes a DiGraph seems sufficient. I also want to color the edges and show some attributes on hover (thanks to all the posts on ispection policy and hovertools I am able to achieve this). Since there is a geometry attribute in my initial gdf, I get an error when I visualize this graph - TypeError: '<' not supported between instances of 'LineString' and 'LineString'. Entire stack trace is here.
Describe the solution you'd like
I think there are a few ways to get around this, all with some changes in the from_networkx function:
Ensure we only parse through types which can be compared (and not avoid just list/dict).
Let the user specify edge attributes (as a list and passed in as a kwarg) from the graph to parse into the holoview Graph object.
Additional context
Initially I was using the defaults in momepy.gdf_to_nx and it returns a MultiDiGraph, which stores attributes one level deeper, so supporting that would also involve the keyword approach along with checking the type of graph.
There is a from_networkx function in hvplot.networkx as well as in holoviews graph.py which both seem replicas of each other, so we may have to make changes in the best possible location.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
This is my use case - I have a geodataframe with a bunch of linestring geometry. While I can visualize that with geodataframe.hvplot, I do want to show the network topology (arrows etc), so felt ploting a networkx directed graph might be better. So I used momepy.gdf_to_nx. This either returns a DiGraph or a MultiDiGraph, and converts all columns of the gdf to attributes of the graph. For my purposes a DiGraph seems sufficient. I also want to color the edges and show some attributes on hover (thanks to all the posts on ispection policy and hovertools I am able to achieve this). Since there is a geometry attribute in my initial gdf, I get an error when I visualize this graph - TypeError: '<' not supported between instances of 'LineString' and 'LineString'. Entire stack trace is here.
Describe the solution you'd like
I think there are a few ways to get around this, all with some changes in the from_networkx function:
Additional context
Initially I was using the defaults in momepy.gdf_to_nx and it returns a MultiDiGraph, which stores attributes one level deeper, so supporting that would also involve the keyword approach along with checking the type of graph.
There is a from_networkx function in hvplot.networkx as well as in holoviews graph.py which both seem replicas of each other, so we may have to make changes in the best possible location.
The text was updated successfully, but these errors were encountered: