This class provides functionality for drawing chemical reactions using the skeletal formula of each reactant and product molecule via the Cairo 2D graphics engine. The most common use case is simply:
ReactionDrawer().draw(reaction, format='png', path='reaction.png')
reaction is the
Reaction object to draw. You can also
pass a dict of options to the constructor to affect how the molecules are
draw(reaction, format, path=None)¶
Draw the given reaction using the given image format - pdf, svg, ps, or png. If path is given, the drawing is saved to that location on disk.
This function returns the Cairo surface and context used to create the drawing, as well as a bounding box for the molecule being drawn as the tuple (left, top, width, height).