What are the best options to visualize a graph defined in GraphML on Mac OSX or Linux ? R + iGraph seems to be a valid solution according to gremlin-users group but I'm wondering if there is any easier solution, ideally a simple "graphml2png" command line application. Any idea ?
I use yEd and it works on Linux, Windows and OSX. Plus it can export to several formats such as PDF, PNG, SVG, BMP, etc
Unfortunately, no command line support AFAIK
I don't have a complete recipe, but I can share my thoughts on it.
Since the graph can be visualized in a lot of ways, you should be able to manage its appearance somehow. Simply drawing nodes and edges without any pre-processing is not a good option - this approach will give you a random bunch of edges and nodes, especially on large graphs.
Here's an example algorithm to get a clean and visually attractive representation of a graph:
- Run some force-directed algorithm on the graph.
- Calculate graph modularity and color each node by its modularity class.
- Change size of each node based on its degree.
- If graph is too big, filter out nodes you're not interested in (probably nodes with low degree).
- Change edges thickness based on their weights.
- Add labels to nodes and edges.
You can do stuff like that with Gephi (in manual mode). They also offer a Gephi Toolkit that should be able to automate such things (unfortunately, I myself didn't try it yet). So I'd try to wrote simple console Java program that uses this toolkit.
Here's an example of a graph visualized with the algorithm above:
© 2022 - 2024 — McMap. All rights reserved.