BBOP JS is a cross-platform client (web browsers) and server (NodeJS, Rhino, etc.) JavaScript library. Spun-off from its roots in the Gene Ontology Consortium’s AmiGO 2 software, BBOP JS covers:
- A rich interface to structured Solr servers
- Managers and responders for dealing with may kinds of REST environments.
- Rich (mathematical/set) graph and tree facilities
- Scripting functionality and multiple REPLs
- A set of useful utility functions
- A light templating/replacement facility
- A generic logger facility
- A light and easy-to-use testing framework
- HTML generation and widget sets
- Much much more…
BBOP JS is cleanly coded with namespacing, well tested, and documented. We’re still putting this all together, so please be patient with the current organization…
Currently, the easiest way to use BBOP JS is just to download it off of the CDN and use it locally.
For the latest, try:
Or, for a specific version, try:
- http://cdn.berkeleybop.org/jsapi/bbop_VERSION.js
- http://cdn.berkeleybop.org/jsapi/bbop_VERSION.min.js
Building, tests, documentation, and releases are all handled with make.
These are the required packages on Ubuntu 12.04 LTS Desktop.
- git
- rhino
- make
- rsync
- yui-compressor
- naturaldocs
mkdir -p ~/local/src/git && cd ~/local/src/git git clone git://github.com/kltm/bbop-js.git cd bbop-js
Building is handled with the Makefile. Built files should be deposited in staging/. An overview of the different make commands follows, but most useful one for developer is probably “make test”, which will first bundle the files and deposit them in staging/ before testing them.
make test
This depends on “bundle”.
Run all of the defined tests. The tests themselves run out of the bundle in the staging/ directory.
Basically, just give the exit code results of “make test”. If something goes wrong, you’ll have to run “make test” to see exactly what it was.
Also, since this filters out most of the output and all of the Rhino warning flags are turned on, it can also act like a kind of lint.
Create the documentation and put it in the docs/ directory.
Create the BBOP JS JavaScript libraries (standard and minified) and put them into the staging/ directory.
The same as the above target, but skip trying to minify the files. Only really useful if you can’t figure out how to make yui-compressor run (try clapping harder?).
This depends on “docs” and “bundle”.
This is a developer-only command for uploading the current release to the CDN–without credentials it is useless, but it may be of interest to people who want to do something similar.
BBOP JS contains almost everything that it needs to work on almost any platform. However, there are two exceptions to this.
The first exception is that when contacting a Solr (well, “GOlr” since the schema needs to conform to what BBOP JS expects) HTTP gets must be used, which are not a part of JavaScript. So, to get any useful work done, you must either use one of the provided engines (bbop.golr.manager.jquery, bbop.golr.manager.rhino, etc.) or write your own subclass of bbop.golr.manager. Naturally, if you are going to be using the jQuery engine, you’d need to have a compatible jQuery loaded as well.
The second exception is similar. The drop-in BBOP JS web page widgets that are provided may depend on compatible versions of jQuery and jQuery UI, so you’d need to have compatible version of those downloaded as well.
These two exceptions in BBOP JS are currently tested with:
- jQuery 1.9.1
- jQuery UI 1.10.3
Remember: these only become requirements if you are using the bbop.golr.manager.jquery engine (jQuery required) or one of the provided widgets (jQuery and jQuery UI)–the vast bulk of the library requires no external libraries.
Also, if you are using a different version of jQuery and company than BBOP JS, it should not be a problem since BBOP JS (should) do the proper juggling to make sure to not interfere with your code.
The wiki for this code can be found here. We’ve just started filling it in.
API documentation can be current found here.
A documented demo page going through the basics can be found here.
There are also a very large number of unit tests living in with the libraries–they should be at least semi-documented and give a pretty good idea about how things should work.
Also, AmiGO 2 is pretty much based on BBOP JS and a good place to think about what’s possible.
The current build status of BBOP JS can be found here.
- clean graph (where the remaining good new stuff is), newick_tree
- ignorable _benchmark, _data
- see (currently private) working document