ChemPal Documentation - v1.12.0
    Preparing search index...
    • Looks up how an element should be drawn, falling back to a neutral style for anything not in the table (isotope labels, R groups, exotic metals) so an unusual atom renders rather than crashing the scene.

      Parameters

      • symbol: string

        Element symbol from an SDF atom block, e.g. 'C' or 'Cl'

      Returns ElementStyle

      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;
      }