JavaScript library for interaction with AMBIT instances.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 2 commits ahead of egonw:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
src
.gitignore
LICENSE
README.md
merge_js.sh

README.md

ambit.js

JavaScript library for interaction with AMBIT instances. The API documentation can be found here.

The latest release: Version 0.0.2 DOI

Example use

Besides the steps below, full examples are found on here.

Step 1: include the libraries

<script src="lib/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="lib/purl.js"></script>
<script type="text/javascript" src="src/ambit.js"></script>
<script type="text/javascript" src="src/Substance.js"></script>
<script type="text/javascript" src="src/Bundle.js"></script>
<script type="text/javascript" src="src/Compound.js"></script>

Step 2: define the server (JavaScript code)

var searcher = new Ambit.Substance("https://apps.ideaconsult.net/enanomapper");

Step 3: define a callback function (yes, we're making asynchronouos calls)

var callback = function(success, status, response) {
  document.getElementById("json").innerHTML =
    "<pre>" + JSON.stringify(response, null, '  ') + "</pre>";
};
searcher.list(callback);

Of course, this part requires a properly set up HTML page with an element whose identifier is "json".

Dependencies

The library depends jquery-1.9.1.min.js and purl.js. It can be mashed up with d3.js which is also included in the lib/ folder.

Documentation

Documentation is generated with JSDoc:

npm install jsdoc@"<=3.3.0" # if needed
sh merge_js.sh
./node_modules/.bin/jsdoc -d api src/ambit_dist.js

Inspiration

This library is based on the ideas from Ian Dunlop whom developed ops.js for Open PHACTS.

All releases