Graphx Visualization

前端 未结 4 2004
误落风尘
误落风尘 2021-01-31 12:48

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 G

4条回答
  •  甜味超标
    2021-01-31 13:06

    So you can do something like this

    1. Save to gexf (graph interchange format) Code from Manning | Spark GraphX in Action
    def toGexf[VD,ED](g:Graph[VD,ED]) : String = {
        "\n" +
        "\n" +
        "  \n" +
        "    \n" +
        g.vertices.map(v => "      \n").collect.mkString +
        "    \n" +
        "    \n" +
        g.edges.map(e => "      \n").collect.mkString +
        "    \n" +
        "  \n" +
        ""
    }
    
    1. Use the GEXF plugin in linkurious.js to load the file

    Example: http://gregroberts.github.io

提交回复
热议问题