# Chemistry

## Overview

Below is a list of chemical-related column widgets.

* [Chemical structure](#chemical-structure) - Display chemical structure from a chemical drawing section
* [SMILES structure](#smiles-structure) - Display chemical structure from SMILES
* Molecular formula
* Image

## Chemical Structure

Use this widget to display the chemical structure from a chemical drawing section. The widget cannot create or draw chemical structures; it can only display chemical structures from chemical drawing sections.

**Readonly view:**

<img src="https://3607108856-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHVg57XIRcjV-Vbubtn%2Fuploads%2Fgit-blob-c32ac82b3e536f3232e96b8a970e35c69f6effd1%2Fwidget-column-chemical-structure-readonly.webp?alt=media" alt="" data-size="original">

**Edit view:**

<img src="https://3607108856-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHVg57XIRcjV-Vbubtn%2Fuploads%2Fgit-blob-4191b74ce4316f2340f6eed1e1ec8ce3e84a0fa8%2Fwidget-column-chemical-structure-edit.webp?alt=media" alt="" data-size="original">

**Form view:**

Not supported

**Configuration**

![](https://3607108856-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHVg57XIRcjV-Vbubtn%2Fuploads%2Fgit-blob-3cb51e5a94eda2f5cb461d6ff17d57c6e343522c%2Fwidget-column-chemical-structure-configuration.webp?alt=media)

```json
{
    "should_auto_update": false, # (optional), default to false. 
    # If true, the widget will perform live calculation
    # If false, the user have to click reload to update the value
    "should_auto_update_when_empty": true, # (optional), default to true. 
    # If true, the widget will perform live calculation when the data is empty
    # If false, the results will not be calculated on default
}
```

**Import value:**

Not supported

## SMILES Structure

This widget uses [Smiles Drawer](https://github.com/reymond-group/smilesDrawer#readme) to draw the chemical structure from SMILES.

**Readonly view:**

<img src="https://3607108856-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHVg57XIRcjV-Vbubtn%2Fuploads%2Fgit-blob-9dc08c8d186af8193fbcfd40659691f8d70fd874%2Fwidget-column-smiles-structure-readonly.webp?alt=media" alt="" data-size="original">

Click the 'Generate SMILES' button to create molecular weight based on the chemical name.

**Edit view:**

<img src="https://3607108856-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHVg57XIRcjV-Vbubtn%2Fuploads%2Fgit-blob-4885f0eac9aabe5746106f8668000b7c63435a72%2Fwidget-column-smiles-structure-edit.webp?alt=media" alt="" data-size="original">

**Form view:**

Same as the edit view.

**Configuration:**

Not supported

**Import value:**

SMILES string.

## Molecular Formula

This widget can:

1. Generate molecular formula from the name
2. Generate molecular weight
3. Generate SMILES (Simplified molecular-input line-entry system)
4. Generate molecular structure

This widget requires the creation of these columns before it can be used. By default, these columns are created automatically in the chemical table.

* molecular\_weight
* SMILES
* molecular\_structure

> Some function of [chemcalc](https://www.npmjs.com/package/chemcalc) is used for this widget.
>
> ChemCalc: a building block for tomorrow’s chemical infrastructure. Patiny, Luc; Borel, Alain Journal of Chemical Information and Modeling 2013. DOI:10.1021/ci300563h

Click the **Generate formula** button to get the molecular formula directly from the name. You can also click **Edit** button to enter the molecular formula manually.

**Edit view:**

![](https://3607108856-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHVg57XIRcjV-Vbubtn%2Fuploads%2Fgit-blob-2c79d716ac2b51024a8d321b47ccc2f9ff58f40a%2Fwidget-column-molecular-formula-edit.webp?alt=media)

**Readonly view:**

Click the **Generate data** button to generate the molecular weight, SMILES, and molecular structure.

![](https://3607108856-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHVg57XIRcjV-Vbubtn%2Fuploads%2Fgit-blob-a936b0a773a3efb6cc001c32cc39f851d1742b94%2Fwidget-column-molecular-formula-readonly.webp?alt=media)

**Form view:**

Same as the edit view

**Configuration**:

![](https://3607108856-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHVg57XIRcjV-Vbubtn%2Fuploads%2Fgit-blob-db79bbc41d964fe2a219c972ec6f4f7ed3588271%2Fwidget-column-molecular-weight-configuration.webp?alt=media)

```json
{
    "should_use_mw": false, # optional, if false, nominal mass will be used.
    "molecular_weight": {"sid":"xxx", "name":"xxx"},
    "SMILES": {"sid":"xxx", "name":"xxx"},
    "molecular_structure": {"sid":"xxx", "name":"xxx"}
}
```

**Import value:**

Formula string.
