I am looking for a way to visualize the graph constructed in Spark's Graphx. As far as I know Graphx doesn't have any visualization methods so I need to export the data from Graphx to another graph library, but I am stuck here. I ran into this website: https://lintool.github.io/warcbase-docs/Spark-Network-Analysis/ but it didn't help. Which library I should use and how to export the graph.
So you can do something like this
def toGexf[VD,ED](g:Graph[VD,ED]) : String = { "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<gexf xmlns=\"http://www.gexf.net/1.2draft\" version=\"1.2\">\n" + " <graph mode=\"static\" defaultedgetype=\"directed\">\n" + " <nodes>\n" + g.vertices.map(v => " <node id=\"" + v._1 + "\" label=\"" + v._2 + "\" />\n").collect.mkString + " </nodes>\n" + " <edges>\n" + g.edges.map(e => " <edge source=\"" + e.srcId + "\" target=\"" + e.dstId + "\" label=\"" + e.attr + "\" />\n").collect.mkString + " </edges>\n" + " </graph>\n" + "</gexf>" }
Example: http://gregroberts.github.io