Skip to content

Simple graph package written in Go using D3 for visualization

Notifications You must be signed in to change notification settings

fjukstad/gographer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gographer

Simple graph package for go. Uses d3js for visualization and websockets for communication.

Run the test visualization

go run test_graph/visualization.go

and visit localhost:8080 in your browser

Using it

Import it:

import "github.com/fjukstad/gographer"

Using it:

graph = gographer.New();
// (ID, NodeStringID, GroupName, Size)
graph.AddNode( 1, "NodeStringID", "GroupName", 1 )
graph.AddNode( 2, "NodeStringID", "GroupName", 1 )

// (Source, Target, EdgeID, weight )
grap.AddEdge( 1, 2, 0, 1 )
graph.AddEdge( 2, 1, 100, 15 )

graph.DumpJSON( "graph.json" )
http.ListenAndServe( ":8080", http.FileServer( http.Dir( "." ) ) )

Open localhost:8080 in a webbrowser to view the graph. Have a look at localhost:8080/canvas.html for the visualization using the HTML canvas element for rendering. Visit localhost:8080/cytoscape.html for a visualization using the cytoscape.js library.

Modify the d3js implementation and visualization to your preferences.

Files

  • gographer.go contains source code to get started with a graph library
  • visualizer.go contains source code to host the visualizations
  • root_serve_dir/index.html contains the empty shell for the visualization
  • root_serve_dir/js/ contains source code for the visualization
  • root_serve_dir/css/ contains css files for visualization
  • graph.json contains the output from gographer.go (graph).

About

Simple graph package written in Go using D3 for visualization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •