INNER CODE UNIT · Go

getGraphElements

pcasteran/terraform-graph-beautifier · cytoscape/writer.go:57

func getGraphElements(graph *tfgraph.Graph, options *RenderingOptions) *Elements {
	// First, copy the graph dependencies as we may need to had some for the module -> module relations.
	deps := make([]*tfgraph.Dependency, len(graph.Dependencies))
	copy(deps, graph.Dependencies)

	// Get the graph nodes.
	var nodes []*Node
	var addElement func(parent *tfgraph.Module, element tfgraph.ConfigElement)
	addElement = func(parent *tfgraph.Module, element tfgraph.ConfigElement) {
		// Add a node for the element.
		node := &Node{
			Data: NodeData{
				ID:    element.GetQualifiedName(),
				Label: element.GetName(),
				Type:  element.GetTfType(),
			},
			Classes: []string{element.GetTfType()},
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…