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.
Remove the first browser tier whose configuration matches the specified configuration object.
(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:
chr: current sequence name
min: minimum visible position (rounded to int)
max: maximim visible position (rounded to int)
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:
event: the DOM MouseEvent which triggered this callback.
feature: the feature which the user clicked on.
hit: an array of Feature and Group objects representing the clicked feature plus any parents.
tier: the Dalliance tier in which the click occurred.
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.