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 DGPrintData reproduces the raw graph.

Parameters:

dg (DG)

property dg: DG#
makeDuplicate(e, eDup)#

Create an additional duplicate eDup of hyperedge e, wired by default to duplicate 0 of each of its source and target vertices.

Parameters:
Return type:

None

removeDuplicate(e, eDup)#

Remove the duplicate eDup of hyperedge e.

Parameters:
Return type:

None

reconnectSource(e, eDup, v, vDupSource)#

Reconnect a source connector of hyperedge e duplicate eDup that points to vertex v so it instead points to duplicate vDupTar of v. When v is a source of e more than once, an arbitrary incidence is reconnected.

Parameters:
Return type:

None

reconnectTarget(e, eDup, v, vDupTarget)#

As reconnectSource(), but for a target (head) connector.

Parameters:
Return type:

None