An example of a default Jsme component without any extra properties.
from dash import Dash, html
import dash_bio as dashbio
app = Dash()
app.layout = html.Div([
dashbio.Jsme(),
])
if __name__ == '__main__':
app.run(debug=True)
smiles
The molecule SMILE to display
from dash import Dash, html
import dash_bio as dashbio
app = Dash()
app.layout = html.Div([
dashbio.Jsme(
smiles='O=C(Nc1cccc(Cl)c1)c3cncc4nnc(c2ccc(OC(F)F)cc2)n34',
),
])
if __name__ == '__main__':
app.run(debug=True)
style
Generic style overrides on the plot div
from dash import Dash, html
import dash_bio as dashbio
app = Dash()
app.layout = html.Div([
dashbio.Jsme(
style={'margin': '20px', 'border': 'solid grey 2px'},
),
])
if __name__ == '__main__':
app.run(debug=True)
width
and height
The width and height of the JSME container. Can be set in px, % etc.
from dash import Dash, html
import dash_bio as dashbio
app = Dash()
app.layout = html.Div([
dashbio.Jsme(
width='100%',
height='50vh',
),
])
if __name__ == '__main__':
app.run(debug=True)
options
String that is a comma separated string of JSME options.
The available options are described on the
Wiki Jmol
border
/NOborder
- When in depict mode, displays a border around the molecule.useOpenChemLib
/NOuseOpenChemLib
- Use the OpenChemLib library for SMILES conversion, 2D coordinates computation and SVG export.oldLook
/newLook
- Style of the toolbar buttons and the interface.keepHs
/removeHs
/removeHsC
- Remove hydrogens (all or just those bound to C) when reading a molecule with explicit hydrogens (e.g. from the PubChem database).number
/autonumber
/star
/noStar
- Possibility to mark atoms with a number or a circular highlight. All highlighted atoms will have an atom number equal to 1. The atom numbers will be included in the exported SMILES and MOL.canonize
/NOcanonize
- Keep or suppress SMILES canonicalization and detection of aromaticity.stereo
/NOstereo
- Keep or ignore stereochemistry when generating SMILES.autoEZ
/NOautoEZ
- Inclusion of E,Z stereochemistry when generating SMILES.addNewPart
/NOaddNewPart
- If multipart is enabled, when reading or pasting a new molecule, add it to the existing molecules or replace these.paste
/NOpaste
- Enable or not the paste action, including drop of a MOL/RXN; this can be used together with the depict option to have a read-only depiction.reaction
/NOreaction
- Enable or disable reaction input, and display or not the reaction button.xButton
/NOxButton
- Display or not the X button (left side, under the elements; to insert a nonstandard atom, e.g. any other element)rButton
/NOrButton
- Display or not the R button, to mark connection of substituent with the main scaffold (left side, under the elements)query
/NOquery
- Display or not the query button, which opens a dialog. In query mode, a SMARTS is generated when a SMILES is requested.showDragAndDropSymbolInDepictMode
/NOshowDragAndDropSymbolInDepictMode
- Display or not the drag and drop symbol (blue triangle at lower-right corner) in depict mode.atomMoveButton
/NOatomMoveButton
- Display or not the atom move button.searchInChIkey
/NOsearchInChIkey
- Display or hide the menu item for searching on the web using the current InChIKey.exportSVG
/NOexportSVG
- Display or hide the menu item for exporting SVG (useOpenChemLib must be set).useOCLidCode
/NOuseOCLidCode
- Display or hide the menu item for exporting OCL (useOpenChemLib must be set).exportInChIauxInfo
/NOexportInChIauxInfo
- Display or hide the menu item for exporting InChI AuxInfo.exportInChIkey
/NOexportInChIkey
- Display or hide the menu item for exporting InChIKeyexportInChI
/NOexportInChI
- Display or hide the menu item for exporting InChIhydrogens
/NOhydrogens
- Display or hide hydrogens on heteroatoms.depict
/NOdepict
- Display only the canvas, without any toolbars for editing (useful for display of structure).polarNitro
/NOpolarNitro
- Convert or not nitro (and similar) groups into a nonpolar form.zoom
/NOzoom
- Allow zooming of the drawing area (mouse wheel).toggle
/NOtoggle
- Allow to switch automatically between editing and depict modes.multiPart
/NOmultiPart
- Allow to enter multipart structures (display the NEW button).depictAction
/NOdepictAction
- Allow structure editing in depict mode.from dash import Dash, html
import dash_bio as dashbio
app = Dash()
app.layout = html.Div([
dashbio.Jsme(
options='query useOCLidCode exportInChIauxInfo exportInChIkey \
exportInChI exportSVG searchInChIkey useOpenChemLib paste rButton',
),
])
if __name__ == '__main__':
app.run(debug=True)