visualization

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: Apache-2.0 Imports: 9 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 ClaimResolutionCfgDefault = &ClaimResolutionCfg{
	showTrivialServices: true,
	showServices:        false,
}

ClaimResolutionCfgDefault is default graph generation parameters for ClaimResolution

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

PolicyCfgDefault is default graph generation parameters for Policy

Functions

This section is empty.

Types

type ClaimResolutionCfg added in v0.1.15

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

ClaimResolutionCfg defines graph generation parameters for ClaimResolution

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) ClaimResolution added in v0.1.15

func (b *GraphBuilder) ClaimResolution(cfg *ClaimResolutionCfg) *Graph

ClaimResolution produces policy resolution graph by tracing every claim and displaying what got allocated

func (*GraphBuilder) ClaimResolutionWithFunc added in v0.1.15

func (b *GraphBuilder) ClaimResolutionWithFunc(cfg *ClaimResolutionCfg, exists func(*resolve.ComponentInstance) bool) *Graph

ClaimResolutionWithFunc produces policy resolution graph by tracing every claim and displaying what got allocated, which checking that instances exist (e.g. in actual state)

func (*GraphBuilder) Object added in v0.1.12

func (b *GraphBuilder) Object(obj runtime.Object) *Graph

Object produces a graph which represents an object

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