Attempting to use PeriodicTable to color scatter points in a plot from imported computational chemistry charge density grid data, I noticed that all colors returned an empty string.
r = invert([a["r"] for a in sys["atoms"]])
plot(scatter(x=r[1], y=r[2], z=r[3],
mode="markers", type="scatter3d", legend=false,
marker=attr(color=[a["color"] for a in sys["atoms"]]),
line=attr(color="black", width=3))
)
color
is missing for everything but CobaltAttempting to use PeriodicTable to color scatter points in a plot from imported computational chemistry charge density grid data, I noticed that all colors returned an empty string.
Looking into it, color is only set for Cobalt:
Workaround and proposed solution
As a workaround, I'm using the following list of hex rgb colors (that I got from https://sciencenotes.org/molecule-atom-colors-cpk-colors/) that can be used when plotting.
Conceptually, the
color
field should IMO return the conventional color used to represent the element. This list of colors should be used to set thecolor
of each element, since the colors are missing from https://github.com/Bowserinator/Periodic-Table-JSON/blob/master/PeriodicTableJSON.jsonI'd be happy to PR this.
Partial demonstration of workaround
In my case this looks like this:
then