Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/loov/layout
Graph layouting package
https://github.com/loov/layout
wip
Last synced: about 1 month ago
JSON representation
Graph layouting package
- Host: GitHub
- URL: https://github.com/loov/layout
- Owner: loov
- License: mit
- Created: 2017-08-23T15:50:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-26T19:57:44.000Z (almost 3 years ago)
- Last Synced: 2024-06-20T11:17:05.257Z (6 months ago)
- Topics: wip
- Language: Go
- Size: 150 KB
- Stars: 24
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# layout [![GoDoc](https://godoc.org/github.com/loov/layout?status.svg)](https://godoc.org/github.com/loov/layout) [![Go Report Card](https://goreportcard.com/badge/github.com/loov/layout)](https://goreportcard.com/report/github.com/loov/layout)
## Experimental
Current version and API is in experimental stage. Property names may change.
## Installation
The graph layouting can be used as a command-line tool and as a library.
To install the command-line tool:
```
go get -u github.com/loov/layout/cmd/glay
```To install the package:
```
go get -u github.com/loov/layout
```## Usage
Minimal usage:
```
package mainimport (
"os""github.com/loov/layout"
"github.com/loov/layout/format/svg"
)func main() {
graph := layout.NewDigraph()
graph.Edge("A", "B")
graph.Edge("A", "C")
graph.Edge("B", "D")
graph.Edge("C", "D")layout.Hierarchical(graph)
svg.Write(os.Stdout, graph)
}
```![Output](./examples/minimal.png)
See other examples in `examples` folder.
## Quality
Currently the `layout.Hierarchy` algorithm output is significantly worse than graphviz. It is recommended to use `graphviz dot`, if possible.