fix: switch naming of nodes in dot to just values

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2022-05-05 20:28:58 +02:00
parent 25ace54553
commit b0b712b2f6
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

@ -35,9 +35,8 @@ class RankedTree {
continue;
}
result.push(
`\t"${node.toString()}" [label="${node.value}, ${node.rank}"];`
);
let [value, rank] = [node.value, node.rank];
result.push(`\t"Node(${value})" [label="${value}, ${rank}"];`);
[node.left, node.right]
.filter((child) => child)
@ -52,9 +51,9 @@ class RankedTree {
edges.forEach((vertices) => {
let [u, v] = vertices;
result.push(
`\t"${u.toString()}" -> "${v.toString()}" [label="${nodeDifference(
v
)}"]`
`\t"Node(${u.value})" -> "Node(${
v.value
})" [label="${nodeDifference(v)}"]`
);
});