diff options
author | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-24 17:51:38 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-24 17:51:38 +0200 |
commit | 44e73fc84cbb5b94af45626165343263fccf0ce3 (patch) | |
tree | 035347d9dd0e79a4c13539fb31494dc88fb18d70 /container-di/src/main/scala/com/yahoo/container/di/componentgraph | |
parent | 48936d2c44f6780882a18b3706d8e6ecae79b4a5 (diff) |
DotGraph is not in use
Diffstat (limited to 'container-di/src/main/scala/com/yahoo/container/di/componentgraph')
-rw-r--r-- | container-di/src/main/scala/com/yahoo/container/di/componentgraph/core/DotGraph.scala | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/container-di/src/main/scala/com/yahoo/container/di/componentgraph/core/DotGraph.scala b/container-di/src/main/scala/com/yahoo/container/di/componentgraph/core/DotGraph.scala deleted file mode 100644 index 90d9646f284..00000000000 --- a/container-di/src/main/scala/com/yahoo/container/di/componentgraph/core/DotGraph.scala +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.container.di.componentgraph.core - -/** - * Generate dot graph from a ComponentGraph - * - * @author tonytv - * @author gjoranv - * @since 5.1.4 - */ - -object DotGraph { - - def generate(graph: ComponentGraph): String = { - val nodes = graph.nodes map(node) - - val edges = for { - node <- graph.nodes - usedNode <- node.usedComponents - } yield edge(node, usedNode) - - (nodes ++ edges). - mkString( - """|digraph { - | graph [ratio="compress"]; - | """.stripMargin, "\n ", "\n}") - } - - private def label(node: Node) = { - node.label.replace("\n", "\\n") - } - - private def node(node: Node): String = { - <node> - "{node.componentId.stringValue()}"[shape=record, fontsize=11, label="{label(node)}"]; - </node>.text.trim - } - - private def edge(node: Node, usedNode:Node): String = { - <edge> - "{node.componentId.stringValue()}"->"{usedNode.componentId.stringValue()}"; - </edge>.text.trim - - } - -} |