mojaie / MolecularGraph.jl

Graph-based molecule modeling toolkit for cheminformatics
MIT License
189 stars 27 forks source link

`isatomvisible` kwarg to allow drawing of carbon atoms? #69

Open SimonEnsemble opened 2 years ago

SimonEnsemble commented 2 years ago

is there a way to not make carbon atoms invisible in the labels?

maybe a kwarg to be added, :make_C_visible for calling this line? https://github.com/mojaie/MolecularGraph.jl/blob/master/src/draw/draw2d.jl#L90

mojaie commented 2 years ago

Thank you for your idea. Now there is no options to do that now, but easy to implement. DRAW_SETTING has :display_terminal_carbon field that indicates whether or not only the end of the carbon chain should be labeled (element label + hydrogen number). Maybe we need more options for that.

The new field would be :display_carbon_label and the values are

SimonEnsemble commented 2 years ago

that would be fantastic!

I also kindly request to add opacity as an optional argument to the drawatomindex! function with opacity=1.0 default. then pass to setatomnote: <rect $(bxy) width="$(size)" height="$(size)" rx="$(size/2)" ry="$(size/2)" fill="$(bc)" opacity="$(opacity)" />

think this looks nicer for when the atom indices overlap the bonds.

image
SimonEnsemble commented 2 years ago

(if you want me to make this PR, let me know...)

mojaie commented 2 years ago

Thank you very much! Yes, there should beopacity=1.0. I’d be happy if you make PR for that.