DotOptions.setNodeAttribute
- DotOptions.setNodeAttribute(node, key, value, verbatim=False)
- Parameters:
node (
int) – the id of the node.key (
str) – the name of a graphviz attribute of the node (letters, digits and underscores).value (
str) – its value.verbatim (
bool) – if True, the value is written as it is (with its own quotes if it needs some), for instance for an HTML label.
- Return type:
None
Example
import pyagrum as gum
bn = gum.fastBN("A->B")
a, b = bn.idFromName("A"), bn.idFromName("B")
options = gum.DotOptions()
options.setNodeAttribute(a, "shape", "box")
print(next(line.strip() for line in bn.toDot(options).splitlines() if line.strip().startswith('"A" [')))
# "A" [tooltip="(0) A", shape="box"];
Class