Graphx Visualization

前端 未结 4 1968
误落风尘
误落风尘 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:11

    you can use either Gephi or d3 from zeppelin. Check D3.js In Action by Elijah Meeks and Spark GraphX in Action by Michael S. Malak

    Give it a go as below from zeppelin in scala and js borrowed from grapxInAction:

    import org.apache.spark.graphx._
    import scala.reflect.ClassTag
    
    def drawGraph[VD:ClassTag,ED:ClassTag](g:Graph[VD,ED]) = {
    
    val u = java.util.UUID.randomUUID
    val v = g.vertices.collect.map(_._1)
    println("""%html
    
    """) }

提交回复
热议问题