graphstream

Spark GraphX 的数据可视化

萝らか妹 提交于 2021-02-11 18:54:06
概述 Spark GraphX 本身并不提供可视化的支持, 我们通过第三方库 GraphStream 和 Breeze 来实现这一目标 详细 代码下载: http://www.demodashi.com/demo/10644.html Spark 和 GraphX 对并不提供对数据可视化的支持, 它们所关注的是数据处理。但是, 一图胜千言, 尤其是在数据分析时。接下来, 我们构建一个可视化分析图的 Spark 应用。需要用到的第三方库有: GraphStream: 用于画出网络图 BreezeViz: 用户绘制图的结构化信息, 比如度的分布。 这些第三方库尽管并不完美, 而且有些限制, 但是相对稳定和易于使用。 一、安装 GraphStream 和 BreezeViz 因为我们只需要绘制静态网络, 所以下载 core 和 UI 两个 JAR 就可以了。 gs-core-1.2.jar(请看下载的压缩包里的jars.zip) gs-ui-1.2.jar(请看下载的压缩包里的jars.zip breeze 也需要两个 JAR: breeze_2.10-0.9.jar(请看下载的压缩包里的jars.zip breeze-viz_2.10-0.9.jar(请看下载的压缩包里的jars.zip 由于 BreezeViz 是一个 Scala 库, 它依赖了另一个叫做 JfreeChart 的

GraphX学习笔记——可视化

China☆狼群 提交于 2020-08-11 06:29:04
首先自己造了一份简单的社交关系的图 第一份是人物数据,id和姓名,person.txt 1 孙俪 2 邓超 3 佟大为 4 冯绍峰 5 黄晓明 6 angelababy 7 李冰冰 8 范冰冰 第二份是社交关系数据,两个人的id和社交关系,social.txt 1 丈夫 2 2 妻子 1 1 搭档 3 3 同学 4 3 好友 5 5 好友 3 5 妻子 6 5 好友 7 7 好友 8 使用SparkX和GraphStream来处理数据 package graphx import org.apache.spark.{SparkConf, SparkContext} import org.apache.spark.graphx._ import org.apache.spark.rdd.RDD import org.graphstream.graph.implementations.{AbstractEdge, SingleGraph, SingleNode} /** * Created by common on 18-1-22. */ object GraphxLearning { def main(args: Array[String]): Unit = { val conf = new SparkConf().setAppName("GraphX").setMaster(

How to zoom into a GraphStream View?

做~自己de王妃 提交于 2020-06-15 19:27:50
问题 In GraphStream visualizations Graphs can be dense. The enableAutoLayout method gives a global visualization of the Graph and so zooming is needed. How to zoom into a GraphStream View? Graph go=...; Viewer viewer = new Viewer(go, Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD); viewer.enableAutoLayout(); View view = viewer.addDefaultView(false); swingNode.setContent((JComponent) view); 回答1: I tried to find a way to zoom to the mouse cursor using the mouse wheel and stumbled across this thread,

NullPointerException at org.graphstream.algorithm.APSP$APSPInfo.getShortestPathTo - Graphs problem

梦想与她 提交于 2020-04-17 22:54:31
问题 I'm developing an algorithm to find the best route between two airports. I came across the concept of All Pairs Shortest Path (APSP) and the GraphStream library. The content is read from a text file. Each line represents an airline stopover: PEK,LAX,5 ATL,HND,75 ATL,LAX,20 DXB,HND,5 ATL,PEK,10 PEK,HND,40 LAX,DXB,20 ATL,DXB,55 Because it's a problem involving airline tickets, I called the 3rd column "price", but when I tried putting real price values in it, some routes stopped working. Also,

auto-layout in GraphStream, node position

℡╲_俬逩灬. 提交于 2019-12-25 01:40:04
问题 I am using GraphStream, to generate some graphs. I have following questions: When I use auto-layout in the library, is it possible for me to obtain the position information of each node? Can I change the type of edge? e.g. the default edge type is solid line. Can I change edge into dash line, or other type? Thanks. 回答1: For the first question I would advise you check the GraphStream website and especially the FAQ on the subject. For the second question, see the visualisation tutorial as well

Streaming Graph to Gephi using toolkit : NullPointerException

梦想的初衷 提交于 2019-12-14 04:00:02
问题 I'm trying to create a normal graph and stream it to Gephi GUI using the Gephi toolkit. I am following the the toolkit and the streaming plugin tutorials. I am having difficulty getting my code to work because the lookup API is not returning valid values. On debug, I could find that both the Lookup methods below return null values because of which I am having trouble in accessing other methods using these objects. StreamingServer server = Lookup.getDefault().lookup(StreamingServer.class);

Better graph visualization in GraphStream - JAVA

自作多情 提交于 2019-12-13 17:52:10
问题 I am working on GraphStream Library for java. But I am facing a problem here. I tried to query 10,000 records having 2 columns from database. And the graph create 2 nodes and one edge for each row. But when I try to run the program, the graph looks very complicated. See the below image. Here is my code: public class GraphExplore { static Connection conn2; static String result, result2; static int totalRows, i; public static void main(String args[]) throws SQLException { EventQueue.invokeLater

How to draw graph inside swing with GraphStream actually?

℡╲_俬逩灬. 提交于 2019-12-12 21:21:35
问题 I am trying to implement drawing of tutorial graph inside swing, but failing. The code is follows: package tests.graphstream; import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.SwingUtilities; import org.graphstream.graph.Graph; import org.graphstream.graph.implementations.SingleGraph; import org.graphstream.ui.swingViewer.View; import org.graphstream.ui.swingViewer.Viewer; public class Tutorial1_01 { private static Graph graph = new SingleGraph("Tutorial 1"); public