Skip to content

Commit 3579c41

Browse files
committed
allow C to be visible
1 parent bc2dfb9 commit 3579c41

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/draw/draw2d.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Default setting parameters of the molecule drawing canvas.
2828
`:alongside` for others (default)
2929
- `:atomcolor`(Dict{Symbol,Color}) atom symbol and bond colors for organic atoms
3030
- `:defaul_atom_color`(Dict{Symbol,Color}) colors for other atoms
31+
- `:C_visible`(Bool) if C atoms should be visible
3132
"""
3233
const DRAW_SETTING = Dict(
3334
:display_terminal_carbon => false,
@@ -48,7 +49,8 @@ const DRAW_SETTING = Dict(
4849
:Br => Color(0, 192, 0),
4950
:I => Color(0, 128, 0)
5051
),
51-
:default_atom_color => Color(0, 192, 192)
52+
:default_atom_color => Color(0, 192, 192),
53+
:C_visible => false
5254
)
5355

5456
# For 3d rendering, we use white for hydrogen
@@ -87,7 +89,7 @@ Return whether the atom is visible in the 2D drawing.
8789
mul_ = multiplicity(mol)
8890
mas_ = getproperty.(nodeattrs(mol), :mass)
8991
for i in 1:nodecount(mol)
90-
sym_[i] === :C || continue
92+
(sym_[i] === :C && ! setting[:C_visible]) || continue
9193
chg_[i] == 0 || continue
9294
mul_[i] == 1 || continue
9395
mas_[i] === nothing || continue

0 commit comments

Comments
 (0)