A lightweight, 3D molecular viewer.

For usage examples, see:

#atom Source

atom :: ChemicalSymbol -> Position -> Atom

Create an atom.

#bond Source

bond :: BondOrder -> AtomId -> AtomId -> Bond

Create a bond.

#chemicalSymbol Source

chemicalSymbol :: GeometryAtom -> ChemicalSymbol

Get the chemical symbol of an atom.

#color Source

color :: ChemicalSymbol -> Int

Get the default color of an element.

#drawMol Source

drawMol :: Scene -> Effect Unit

Draw a scene in a HTML container.

#fromLeft Source

fromLeft :: forall b a. Partial => Either a b -> a

Extract an error result.

#fromRight Source

fromRight :: forall b a. Partial => Either a b -> b

Extract a valid result.

#id Source

id :: GeometryAtom -> AtomId

Get the id of an atom.

#isLeft Source

isLeft :: forall b a. Either a b -> Boolean

Check if you have an error valued result.

#isRight Source

isRight :: forall b a. Either a b -> Boolean

Check if you have a valid result.

#maybeMolecule Source

maybeMolecule :: Array Atom -> Array Bond -> Either String GeometryData

Create GeometryData from explicit atoms and bonds.

The reason this returns an Either, is that the provided bonds maybe be invalid. For example, if you have 3 atoms, but also a bond, which says its connected to an atom with id 50. This is clearly invalid input.

#maybeParseV3000 Source

maybeParseV3000 :: String -> Either String GeometryData

Try to parse the content of V3000 MDL .mol file.

#meshes Source

meshes :: MeshOptions -> GeometryData -> Array Mesh

Create the meshes which compose a molecule.

#position Source

position :: Number -> Number -> Number -> Position

Create a position vector.

#scene Source

scene :: SceneOptions -> Array Mesh -> Scene

Create a three.js scene.

#show Source

show :: ChemicalSymbol -> String

Get the chemical symbol as a string.

#size Source

size :: ChemicalSymbol -> Number

Get the default size of an element.