Element symbol from an SDF atom block, e.g. 'C' or 'Cl'
The colour and covalent radius to draw the atom with
elementStyle('O'); // { color: 0xff0d0d, radius: 0.66 }
elementStyle('Xx'); // { color: 0xff1493, radius: 1.5 }
export function elementStyle(symbol: string): ElementStyle {
return ELEMENT_STYLES[symbol] ?? DEFAULT_ELEMENT_STYLE;
}
Looks up how an element should be drawn, falling back to a neutral style for anything not in the table (isotope labels,
Rgroups, exotic metals) so an unusual atom renders rather than crashing the scene.