fix: newlines in toDot
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
dafe85c6d3
commit
7a896e0fa7
1 changed files with 7 additions and 3 deletions
|
@ -21,7 +21,7 @@ class RankedTree {
|
||||||
let highlight =
|
let highlight =
|
||||||
node === highlightedNode ? ', color="blue", penwidth=3' : "";
|
node === highlightedNode ? ', color="blue", penwidth=3' : "";
|
||||||
result.push(
|
result.push(
|
||||||
`\t"Node(${value})" [label="${value}, ${rank}"${highlight}];`
|
`\t"Node(${value})" [label="${value}, ${rank}"${highlight}];\n`
|
||||||
);
|
);
|
||||||
|
|
||||||
[node.left, node.right]
|
[node.left, node.right]
|
||||||
|
@ -39,7 +39,7 @@ class RankedTree {
|
||||||
result.push(
|
result.push(
|
||||||
`\t"Node(${u.value})" -> "Node(${
|
`\t"Node(${u.value})" -> "Node(${
|
||||||
v.value
|
v.value
|
||||||
})" [label="${nodeDifference(v)}"]`
|
})" [label="${nodeDifference(v)}"];\n`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -47,7 +47,11 @@ class RankedTree {
|
||||||
}
|
}
|
||||||
|
|
||||||
toDot(highlightedNode) {
|
toDot(highlightedNode) {
|
||||||
return ["digraph {", ...this._getUnwrappedGraph(highlightedNode), "}"];
|
return [
|
||||||
|
"digraph {\n",
|
||||||
|
...this._getUnwrappedGraph(highlightedNode),
|
||||||
|
"}\n",
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
toString() {
|
toString() {
|
||||||
|
|
Loading…
Reference in a new issue