Skip to content

SHanDesign1993/Force-Directed-Graph-Unity-Neo4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Force-Directed-Graph-Unity-Neo4j

Demo Video on Youtube:
IMAGE ALT TEXT HERE

Testing:

  1. Install Neo4j Desktop
  2. Open Unity (ForceDirectedGraphUnity)
  3. check server setting variables in ServerConnector on Graph Object (neo4j ip,user,pwd...etc)
  4. hit RUN!

Structure:

NeoUnity(VS Folder) : defination of Neo4j data class such like Nodes and Relationships

  • Server.cs : connect to Neo4j server and put data value in Node and Relationship class

it produced NeoUnity.dll for unity project below.

ForceDirectedGraph(Unity Folder) : Render force directed graph by neo4j movie data

Frontend(On Graph Object in Scene):

  • ServerConnector.cs: setup data entity(movie and person) , server settings.
  • GraphRenderer.cs : setup UI , Graph settings(relationship line color) , Camera. new Graph and GraphScene in Awake(). and create Nodes and Edges(Relationship) while while receiving the neo4j data.

Backend:

  • SimpleGraphBackend.cs : extend AbstractGraphBackend.cs Interface.
  • SimpleGraphEdge.cs : extend AbstractGraphEdge.cs Interface.
  • SimpleGraphNode.cs : extend AbstractGraphNode.cs Interface.
  • Graph.cs : extend GraphBackendListener.cs .define NewNode and NewEdge
  • GraphScene.cs : set nodes distance by updating SpringJoint Rigidbody SphereCollider component
  • NodeComponent.cs : extend AbstractSceneComponent.cs Interface. Initial Node gameObject.
  • EdgeComponent.cs : extend AbstractSceneComponent.cs Interface. Set LineRenderer between 2 Node gameObjects.
  • FruchtermanReingoldLayout.cs : Calculate Attraction,Repulsion,Gravity physics force between nodes by Fruchterman-Reingold algorithm.

the git repo is only a experimental project. the parameters setting and 1000 Iterations is a rough number to show small amount of nodes. Theoretically, the force-directed graph needs more time (iterations) by different amount level to draw a relatively stable graph. add up the Iterations and decrease speed in FruchtermanReingoldLayout.cs and increase area in GraphRenderer.cs to fit larger graph.

About

Force Directed Graph in Unity with Neo4j movie sample Dataset

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages