molfoundry.DGPrintData#
- class molfoundry.DGPrintData(dg)#
Controls how a locked derivation graph is laid out for printing. Every vertex and every hyperedge connector may be duplicated, so a shared vertex can be drawn once per incident hyperedge and a DAG rendered as a tree/forest.
On construction each vertex and each hyperedge has a single duplicate numbered 0, with every hyperedge duplicate wired to duplicate 0 of its source and target vertices, so an unmodified
DGPrintDatareproduces the raw graph.- Parameters:
dg (DG)
- makeDuplicate(e, eDup)#
Create an additional duplicate
eDupof hyperedgee, wired by default to duplicate 0 of each of its source and target vertices.- Parameters:
e (DG.HyperEdge)
eDup (int)
- Return type:
None
- removeDuplicate(e, eDup)#
Remove the duplicate
eDupof hyperedgee.- Parameters:
e (DG.HyperEdge)
eDup (int)
- Return type:
None
- reconnectSource(e, eDup, v, vDupSource)#
Reconnect a source connector of hyperedge
eduplicateeDupthat points to vertexvso it instead points to duplicatevDupTarofv. Whenvis a source ofemore than once, an arbitrary incidence is reconnected.- Parameters:
e (DG.HyperEdge)
eDup (int)
v (DG.Vertex)
vDupSource (int)
- Return type:
None
- reconnectTarget(e, eDup, v, vDupTarget)#
As
reconnectSource(), but for a target (head) connector.- Parameters:
e (DG.HyperEdge)
eDup (int)
v (DG.Vertex)
vDupTarget (int)
- Return type:
None