File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 8
8
use Fhaculty \Graph \Graph ;
9
9
10
10
/**
11
+ * Trivial Graph Format (TGF) is a really simple format for describing graphs.
12
+ *
13
+ * It consists of a list of vertices, a separator and a list of directed edges
14
+ * as vertex pairs. Each entry can only have a single plain text label assigned
15
+ * which does not support any structured information.
11
16
*
12
17
* @author clue
13
18
* @link http://en.wikipedia.org/wiki/Trivial_Graph_Format
@@ -52,6 +57,12 @@ public function getOutput(Graph $graph)
52
57
return $ output ;
53
58
}
54
59
60
+ /**
61
+ * get label for given $vertex
62
+ *
63
+ * @param Vertex $vertex
64
+ * @return string
65
+ */
55
66
protected function getVertexLabel (Vertex $ vertex )
56
67
{
57
68
// label defaults to the vertex ID
@@ -76,6 +87,12 @@ protected function getVertexLabel(Vertex $vertex)
76
87
return $ label ;
77
88
}
78
89
90
+ /**
91
+ * get label for given $edge
92
+ *
93
+ * @param Edge $edge
94
+ * @return string label (may be empty if there's nothing to be described)
95
+ */
79
96
protected function getEdgeLabel (Edge $ edge )
80
97
{
81
98
$ label = '' ;
You can’t perform that action at this time.
0 commit comments