Skip to content

PhyloBox Remote Client

andrewxhill edited this page Dec 12, 2010 · 1 revision

Technical overview for the PhyloBox Remote Client, see examples here.

PhyBox({option1}, {option2});

To embed a new PhyloBox you must first initiate a new PhyloBox object using the call above. Option1 is a string name of the div id on your page you want the tree to be drawn in. Option2 is an options object that details how you want the tree to be drawn. So for a webpage,

 <body>
   <div id="my_tree"></div>
 </body>

You would initiate a new PhyloBox tree in the div ‘my_tree’ with,

myPhyloBox = PhyBox('my_tree');

You can change the look of the tree and the widget by providing an options object. See PhyloBox Widget Options

After initializing the PhyloBox widget, the tree remains undrawn until you call the drawTree method on the myPhyloBox object.

myPhyloBox.drawTree({option1},{option2},{option3});

Option1 is either ‘key’ or ‘url’. This tells the widget whether it is pulling a tree you have already stored on the PhyloBox servers, using ‘key’, or building a new tree from a phyloxml file you have stored on a server, ‘url’. If ‘key’, option2 should be the key of your stored tree. If ‘url’, option2 should be a publicly accessible url to the phyloxml file. If you use ‘url’, the data is cached at PhyloBox, meaning that the phyloxml file only needs to be harvested and parsed once per day by default. You can include a a third option, option3, that overrides the default 1 day caching. Option3 takes an integer from 1 to 43200, and is the number of minutes before the cached data expires and the file is harvested again. This is useful if your phyloxml data changes more often than a day, or very infrequently so harvesting daily is unnecessary. There is a hard limit on the number of times a phyloxml file is harvested daily, when the hard limit is reached it will be cached for a full day before harvesting begins again.