ChemJS is a bare-bones Chemistry framework built on top of the GraphJS framework. ChemJS uses GraphJS to accomplish low-level representation and search algorithms. ChemJS is intended to be HTML5 WebWorker-compatible and NodeJS-compatible. Algorithms support WebCL computing.
This project was inspired by the ChemDoodle WebComponents project from iChemLabs. ChemJS is a re-purposed version (written from the ground up) designed for more bare-bones, DOM-independent performance with molecular simulation in mind.
ChemJS is currently a work in progress and will share concurrent development with GraphJS, ChemJS, DockJS, and the Social Docking Project.
Step 1: Download the source library (full or minified)
git clone git://github.com/ericjang/chemJS
Step 2: Include the source script in your html, your WebWorker, or NodeJS application.
Step 3: Create and Manipulate Molecules!
var benzene = ChemJS.createMolecule();
ChemJS
└─┬ molecules
├── atoms
├── bonds
├── functional groups (optional)
└── rings (optional)
The ChemJS object provides the highest level scope.
//example:
var foo = ChemJS.createMolecule();
var bar = ChemJS.createMolecule();
ChemJS.molecules;//returns [foo,bar]
createMolecule()
: creates a new molecule object and appends it to the molecules Array.readMOL(string)
: reads in a MOL file and constructs a molecule.
There are several ways to represent the graph abstract data type. Each vertex stores its incident edges, and each edge stores its incident vertices.
//more code goes here
//more code goes here
//example of DockJS extending ChemJS