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.chargesign
— Methodchargesign(charge::Int) -> String
Get a charge sign.
MolecularGraph.draw2d!
— Methoddraw2d!(canvas::Canvas, mol::UndirectedGraph; kwargs...)
Draw molecular image to the canvas.
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, coords::AbstractArray{Float64}, boundary::Tuple)
Move and adjust the size of the molecule for drawing.