Interacting with the Dalliance API.

If you retain a reference to the Browser object corresponding to your Dalliance instance, you can call methods on this to interact with the genome browser and integrate it more tightly with your own code.
setLocation([chr], start, end)
Call this to navigate to a specific genomic location. If the specified location is close to the existing location and the width of the requested region is equal to the currently-displayed region (+/- ~0.1%) then the operation is handled as a scroll, otherwise Dalliance will reload data in the new location. If chr is null or undefined, the current chromosome is used.
function moveRight() {
    browser.setLocation(
        browser.chr,
        (browser.viewStart|0) + 1000,
        (browser.viewEnd|0) + 1000
    );
}
addTier(config)
Create a new browser tier using the specified configuration object.
browser.addTier({
    name: 'Repeats',
    desc: 'Repeat annotation from Ensembl 59', 
    bwgURI: 'http://www.biodalliance.org/datasets/repeats.bb',
    stylesheet_uri: 'http://www.biodalliance.org/stylesheets/bb-repeats.xml'
});
removeTier(config)
Remove the first browser tier whose configuration matches the specified configuration object.
browser.removeTier({
    name: 'Repeats',
    desc: 'Repeat annotation from Ensembl 59', 
    bwgURI: 'http://www.biodalliance.org/datasets/repeats.bb',
    stylesheet_uri: 'http://www.biodalliance.org/stylesheets/bb-repeats.xml'
});
(This API may change in future to be better behaved when multiple tracks match the same configuration).
highlightRegion(chr, min, max)
Create a highlight over the specified genomic region.
clearHighlights()
Remove all the highlighted regions.

Event handlers

addViewListener(callback)
Called when the viewed region changes. Parameters passed to the callback are:
browser.addViewListener(function(chr, min, max) {
    var link = document.getElementById('enslink');
    link.href = 'http://www.ensembl.org/Homo_sapiens/Location/View?r=' + 
        chr + ':' + min + '-' + max;
});
addTierListener(callback)
Called when the set or order of tiers changes.
addFeatureListener(callback)
Called when the user clicks on a feature. Parameters passed to the callback are: Note that if you want to display extra information when a feature is clicked, you may be better served by the Feature Info plugin API.
addFeatureHoverListener(callback)
Called when the pointer hovers over a feature. Probably never called on touch-screen devices. The callback parameters are the same as for addFeatureListener.
addInitListener(callback)
Call on a newly-constructed Browser instance. The callback is invoked when initializatin is complete.