-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea - Convert networkx graph object or a graph in edge list format to a Mapper object #234
Comments
Hey, that’s a great idea! I don’t think the implementation would be too tricky. Are you interested in giving it a shot? It would be a great first time contribution. I don’t have any bandwidth for this myself, but could help with reviews and releasing the changes once they’re implemented. |
I might be interested if I knew more python. I would look into other graphing packages as well but Mapper has great visualization abilities which is very appealing. |
Can you post an example networkx dataset, with what you'd want it to look like? I'm having a hard time imagining, I've never worked with networkx. And do you know javascript? The edge-drawing logic is implemented both in python and also in javascript. Actually I just realized that the javascript PR was never merged. Here it is in javascript. https://github.com/scikit-tda/kepler-mapper/pull/231/files#diff-e18cbd76668f2d81f3de161789979b48d4d0892b76458ad212722d374a22cc39R633-R679 kepler-mapper/kmapper/nerve.py Lines 53 to 65 in 7dc4d0a
Also, fyi, the javascript visualization currently doesn't do anything with edge weights, but it could. |
I made a simple example for a graph with 5 vertices and varying edge weights connecting every vertices. The drawing from networkx shows a complete graph. I would like to be able to play around with the threshold for the edge weight in Mapper to decide when to show two vertices are connected or not. I cannot claim to understand javascript but I think if one adds an if statement to check that the edge weight between nodes i and j is above or below some threshold before line 646, then it will accomplish what I am thinking of. |
This example of an interactive persistence diagram is very close to what I am thinking of. |
How does an "edge weight" relate to kepler-mapper's "min intersection" argument? I suppose actually that your use-case doesn't use kmapper.map at all -- you're just using kmapper.visualize with your own graph (right?). Therefore, you don't have a concept of a "min intersection." It would be helpful to see where you use kmapper functions in your workflow. |
The author of the example told me that the interactivity was just a series of pre-generated persistence diagrams and nothing was updated dynamically.
I should have specified that the vertices in my graph are associated with a real number in [0, M], where M is the max value of all vertex values in the graph. The graph is not complete and the edge weight between 2 vertices is the absolute difference between the 2 vertex values. All the vertices in the graph will be grouped according to their values, say one group for values in [0, a] and another for values in [a, M]. The "min intersection" can be some number delta so that some vertices will belong to the group [a - delta, a+ delta] and those vertices will "connect" the 2 vertices in the Mapper graph. To summarize, edge weight is not directly related to min intersection from my description. I am primarily interested in seeing how the membership of the vertices in the Mapper graph changes with different thresholds on edge weights to decide when 2 vertices in the original graph is connected. Does this help? |
I need to see exactly how and where in your flow you are currently using any code specifically from the kepler-mapper library. I am guessing now that you're just using the plotlyviz stuff, which is totally separate from the .visualize javascript stuff. |
It would be nice if there is a way to turn a networkx graph or a graph in edge list format (something like a list of tuples (I,J,V) or a dataframe with 3 columns for the two vertices and edge weight) into a Mapper object.
I have a weighted graph and I would like to use Mapper to visualize the graph with different thresholds on the edge weights to determine when 2 vertices are connected.
The text was updated successfully, but these errors were encountered: