Molecular structure drawing
MolecularGraph.DRAW_SETTING
— ConstantDRAW_SETTING
Default setting parameters of the molecule drawing canvas.
Required fields
:display_terminal_carbon
(Bool) whether to display terminal C atom or not:double_bond_notation
(Symbol):alongside
: all double bonds are represented as a carbon skeleton and a segment alongside it.:dual
: all double bonds are represented as two equal length parallel segments.:chain
::dual
for chain bonds and:alongside
for ring bonds:terminal
::dual
for terminal bonds (adjacent to degree=1 node) and:alongside
for others (default)
:atomcolor
(Dict{Symbol,Color}) atom symbol and bond colors for organic atoms:defaul_atom_color
(Dict{Symbol,Color}) colors for other atoms
MolecularGraph.atomcolor
— Methodatomcolor(mol::GraphMol; setting=DRAW_SETTING) -> Vector{Color}
Return atom colors for molecule 2D drawing
MolecularGraph.chargesign
— Methodchargesign(charge::Int) -> String
Get a charge sign.
MolecularGraph.draw2d!
— Methoddraw2d!(canvas::Canvas, mol::UndirectedGraph;
setting=copy(DRAW_SETTING), recalculate=false)
Draw molecular image to the canvas.
MolecularGraph.isatomvisible
— Methodisatomvisible(mol::GraphMol; setting=DRAW_SETTING) -> Vector{Bool}
Return whether the atom is visible in the 2D drawing.
MolecularGraph.drawsvg
— Methoddrawsvg(mol::GraphMol, width::Int, height::Int)
Generate molecular structure image as a SVG format string.
width
and height
specifies the size of the image (width and height attribute of svg tag).
MolecularGraph.initcanvas!
— Methodinitcanvas!(canvas::Canvas, mol::GraphMol)
Move and adjust the size of the molecule for drawing.