visualization

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package visualization implements Aptomi policy & resolution data visualization using network-based diagrams for visjs

Index

Constants

This section is empty.

Variables

View Source
var DependencyResolutionCfgDefault = &DependencyResolutionCfg{
	showTrivialContracts: true,
	showContracts:        false,
}

DependencyResolutionCfgDefault is default graph generation parameters for DependencyResolution

View Source
var PolicyCfgDefault = &PolicyCfg{
	optimizeServicesWithSingleComponent: true,
}

PolicyCfgDefault is default graph generation parameters for Policy

Functions

This section is empty.

Types

type DependencyResolutionCfg

type DependencyResolutionCfg struct {
	// contains filtered or unexported fields
}

DependencyResolutionCfg defines graph generation parameters for DependencyResolution

type Graph

type Graph struct {
	// contains filtered or unexported fields
}

Graph is a data structure for visualizing Aptomi objects in a form of a graph with nodes and edges. It gets created by GraphBuilder. Once created, use GetDataJSON() to get the result and feed into vis.js.

func (*Graph) CalcDelta

func (g *Graph) CalcDelta(baseline *Graph)

CalcDelta takes the current graph and modifies it to contain the difference between this graph and the baseline graph

func (*Graph) GetData

func (g *Graph) GetData() interface{}

GetData returns a struct, which can be fed directly into vis.js as network map

func (*Graph) GetDataJSON

func (g *Graph) GetDataJSON() []byte

GetDataJSON returns a JSON-formatted byte array, which can be fed directly into vis.js as network map

type GraphBuilder

type GraphBuilder struct {
	// contains filtered or unexported fields
}

GraphBuilder allows to visualize Aptomi policy and resolution data as a graph It can also render deltas between two visualizations, showing new and deleted objects between policies and resolution data.

func NewGraphBuilder

func NewGraphBuilder(policy *lang.Policy, resolution *resolve.PolicyResolution, externalData *external.Data) *GraphBuilder

NewGraphBuilder returns a graph builder that visualizes policy and resolution data

func (*GraphBuilder) DependencyResolution

func (b *GraphBuilder) DependencyResolution(cfg *DependencyResolutionCfg) *Graph

DependencyResolution produces policy resolution graph by tracing every dependency and displaying what got allocated

func (*GraphBuilder) Policy

func (b *GraphBuilder) Policy(cfg *PolicyCfg) *Graph

Policy produces just a policy graph without showing any resolution data

type PolicyCfg

type PolicyCfg struct {
	// contains filtered or unexported fields
}

PolicyCfg defines graph generation parameters for Policy

Jump to

Keyboard shortcuts

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