🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

git.1-hub.cn/loov/layout

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git.1-hub.cn/loov/layout

v0.0.1
Go
Version published
Created
Source

layout GoDoc Go Report Card

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

Basic usage:

package main

import (
    "os"

    "github.com/loov/layout"
    "github.com/loov/layout/format/svg"
)

func main() {
    graph := layout.NewDigraph()
    graph.Node("A")
    graph.Node("B")
    graph.Node("C")
    graph.Node("D")
    graph.Edge("A", "B")
    graph.Edge("A", "C")
    graph.Edge("B", "D")
    graph.Edge("C", "D")
    graph.Edge("D", "A")

    layout.Hierarchical(graph)

    svg.Write(os.Stdout, graph)
}

Quality

Currently the layout.Hierarchy algorithm output is significantly worse than graphviz. It is recommended to use graphviz dot, if possible.

FAQs

Package last updated on 25 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts