4.1.9.4. graph/Printer

class mod.GraphPrinter

This class is used to configure how graphs are visualised.

Warning

Some of these options greatly alter how graphs are depicted and the result may not accurately represent the underlying graph, and may make non-molecules look like molecules.

__init__()

The default constructor enables edges as bonds, raised charges, and raised isotopes.

setMolDefault()

Shortcut for enabling all but thickening and index printing.

setReactionDefault()

Shortcut for enabling all but thickening, index printing and simplification of carbon atoms.

disableAll()

Disable all special printing features.

enableAll()

Enable all special printing features, except typewriter font.

edgesAsBonds

Control whether edges with special labels are drawn as chemical bonds.

Type:

bool

collapseHydrogens

Control whether vertices representing hydrogen atoms are collapsed into their neighbours labels.

Type:

bool

raiseIsotopes

Control whether a vertex label prefix encoding an isotope is written as a superscript to the rest of the label.

Type:

bool

raiseCharges

Control whether a vertex label suffix encoding a charge is written as a superscript to the rest of the label.

Type:

bool

simpleCarbons

Control whether some vertices encoding carbon atoms are depicted without any label.

Type:

bool

thick

Control whether all edges are drawn thicker than normal and all labels are written in bold.

Type:

bool

withColour

Control whether colour is applied to certain elements of the graph which are molecule-like.

Type:

bool

withIndex

Control whether the underlying indices of the vertices are printed.

Type:

bool

withTexttt

Control whether the vertex and edge labels are written with typewriter font.

Type:

bool

withRawStereo

Control whether the vertices and edges are annotated with the raw stereo properties.

Type:

bool

withPrettyStereo

Control whether the vertices and edges are annotated with stylized stereo properties.

Type:

bool

rotation

Rotation of internally computed coordinates.

Type:

int

mirror

Mirror internally computed coordinates in the y-axis.

Type:

bool

withGraphvizCoords

Do not use Open Babel for coordinate generation, but only the Graphviz fallback during post-processing. When setting this to True consider setting simpleCarbons = False` to avoid misleading depictions due to collinear carbon chains.

Type:

bool

graphvizPrefix

The string that will be inserted into generated DOT files, just after the graph declaration. DOT files are only generated when withGraphvizCoords == True.

Type:

str