graphyz

command module
v0.0.0-...-8130d7a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 12 Imported by: 0

README

Graphyz

A simple program for interactive real-time force directed graph layout simulation written with Go and Raylib. Loosely based on the Fruchterman-Reingold algorithm, d3-force, and force atlas 2. Uses the Barnes-Hut algorithm to optimize force calculations.

Work in progress.

Example

Usage

In order to compile you will need to have Go installed and to install the raylib bindings for Go (link in the references). You can then run

go build

and then launch Graphyz from the console:

./graphyz "path/to/you/graph.json"

It currently only accepts graphs in json format with the fields "nodes" and "links". The "nodes" field is an array of nodes which may contain the "name" and "group" fields that determine what is displayed on hover and the color of the nodes, respectively. The "links" field must contain a "source" and a "target" field that have the indices of the respective nodes in the nodes array. Each link can optionally have a "value" field that acts as an edge weight.

Here is a minimal example:

{
    "nodes": [{"name": "John Smith", "group": 0},{"name": "Jane Doe", "group": 1}],
    "links": [{"source": 0, "target": 1, "value": 5}]
}

References

To-do

  • Use GPU instancing to speed up rendering for large graphs
  • Add support for additional graph serialization formats
  • Hot reloading of graphs

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL