Class: ChemDisplayTextUtils

Kekule.Render. ChemDisplayTextUtils

new ChemDisplayTextUtils()

Methods about chem information displaying and rich text.
Source:

Methods

(static) createElectronStateDisplayTextSection(charge, radical, partialChargeDecimalsLength, chargeMarkType) → {Object}

Create a rich text section (usually superscript) to display atom charge and radical.
Parameters:
Name Type Description
charge Number
radical Int
partialChargeDecimalsLength Int
chargeMarkType Int
Source:
Returns:
Type
Object

(static) formulaToRichText(formula, showCharge, showRadical, partialChargeDecimalsLength) → {Object}

Convert a chemistry formula to a displayable rich format text label.
Parameters:
Name Type Description
formula Kekule.MolecularFormula
showCharge Bool Whether display formula charge.
showRadical Bool Whether display formula radical.
partialChargeDecimalsLength Int
Source:
Returns:
Type
Object

(static) getChargeDisplayText(charge, radical, partialChargeDecimalsLength, chargeMarkType) → {String}

Returns text to represent atom charge and radical (e.g., 2+).
Parameters:
Name Type Description
charge Number
radical Int
partialChargeDecimalsLength Int
chargeMarkType Int
Source:
Returns:
Type
String

(static) getRadicalDisplayText(radical) → {String}

Returns suitable text to indicate the radical.
Parameters:
Name Type Description
radical Int
Source:
Returns:
Type
String