%libraryDependencies += "org.viz.lightning" %% "lightning-scala" % "0.1.6" %update import org.viz.lightning._ import org.apache.spark.graphx._ val lgn = Lightning(host="https://lightning-spark-summit.herokuapp.com" ) lgn.enableNotebook() val source = "/Users/mathisonian/projects/spark-summit/notebooks/data/allen-connectivity.txt" val g = GraphLoader.edgeListFile(sc, source) val links = g.edges.collect().map(e => Array(e.srcId.toInt, e.dstId.toInt)) lgn.force(links) val links = g.edges.collect().map(e => Array(e.srcId.toInt, e.dstId.toInt)) val degrees = g.degrees.sortBy(_._1).collect().map(x => Math.log(x._2)) lgn.force(links, value=degrees, colormap="Lightning") val links = g.edges.collect().map(e => Array(e.srcId.toInt, e.dstId.toInt)) val connectedComponents = g.connectedComponents().vertices.sortBy(_._1).map(_._2.toInt).collect() lgn.force(links, label=connectedComponents)