forked from kemia/kemia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
61 lines (41 loc) · 2.22 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Kemia
Kemia is a javascript chemical structure and reaction editor and chemistry toolkit.
To see what it can do, check out the demos at http://kemia.github.com
Using Kemia
<html>
<head>
<script src='http://kemia.github.com/js/kemia.js'/>
<script>
function initPage(){
var smiles = 'N[C@@H](CCC(=O)N[C@@H](CSSC[C@H](NC(=O)CC[C@H](N)C(O)=O)C(=O)NCC(O)=O)C(=O)NCC(O)=O)C(O)=O';
var mol=kemia.io.smiles.SmilesParser.parse(smiles);
kemia.layout.CoordinateGenerator.generate(mol);
var renderer = new kemia.controller.ReactionEditor(goog.dom.getElement('kemia'));
renderer.setModels([mol]);
}
</script>
</head>
<body onload="initPage()">
<fieldset> <legend>Glutathione disulphide</legend>
<div id="kemia" style="width: 100%; height: 400px"></div>
</filedset>
</body>
</html>
Building Kemia
Kemia depends on the Google Closure Library: http://http://code.google.com/closure/library/
It is compiled with the Plovr Closure build tool http://plovr.com/. Plovr is used both to compile the precompiled distribution file, as well as for dynamic compilation during development.
The ant script build.xml includes targets to run Plovr and a slightly modified copy of the plovr.jar is included in the third-party folder. To build Kemia, you will also need Java 1.6+ and ant installed.
The default target for the ant script is a usage guide, so executing 'ant' at the command prompt, in the base kemia directory, will output something like this:
> ant
Main targets:
build-deps rebuild deps.js file
build-docs build the JsDoc documentation
clean delete generated files
compile compile with plovr
run-compile-server run plovr dynamic compilation server
test Start Selenium ; Run Junit tests ; stop Selenium
usage Display main targets by running 'ant -projecthelp'
Default target: usage
Executing "ant compile" will generate the minified and compiled library at build/kemia.js, this contains everything you need to start using Kemia in your webpage.
Developing Kemia
Executing "ant run-compile-server" will start the plovr dynamic compile server, see the Getting Involved Guide at http://kemia.github.com/ for more information.