Skip to content

Commit

Permalink
improvements to inline documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed Mar 12, 2012
1 parent 2f57554 commit a297623
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 23 deletions.
3 changes: 3 additions & 0 deletions js/FeatureTrack.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// VIEW

/**
* @class
*/
function FeatureTrack( trackMeta, refSeq, browserParams ) {
//trackMeta: object with:
// key: display text track name
Expand Down
12 changes: 12 additions & 0 deletions js/GenomeView.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// VIEW

/**
* @class
*/
function Animation(subject, callback, time) {
//subject: what's being animated
//callback: function to call at the end of the animation
Expand Down Expand Up @@ -59,6 +62,9 @@ Animation.prototype.stop = function() {
this.callback(this);
};

/**
* @class
*/
function Slider(view, callback, time, distance) {
Animation.call(this, view, callback, time);
this.slideStart = view.getX();
Expand All @@ -78,6 +84,9 @@ Slider.prototype.step = function(pos) {
this.subject.setX(newX);
};

/**
* @class
*/
function Zoomer(scale, toScroll, callback, time, zoomLoc) {
Animation.call(this, toScroll, callback, time);
this.toZoom = toScroll.zoomContainer;
Expand Down Expand Up @@ -115,6 +124,9 @@ Zoomer.prototype.step = function(pos) {
this.subject.updateTrackLabels(this.initialX - newLeft);
};

/**
* @class
*/
function GenomeView(elem, stripeWidth, refseq, zoomLevel, browserRoot) {
//all coordinates are interbase

Expand Down
10 changes: 7 additions & 3 deletions js/GridTrack.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// VIEW

// This track draws vertical gridlines, which are divs with height:
// 100%, absolutely positioned at the very top of all the tracks
/**
This track draws vertical gridlines, which are divs with height 100%,
absolutely positioned at the very top of all the tracks.
@class
*/
function GridTrack(name) {
Track.call(this, name, name, true, function() {});
}
Expand Down Expand Up @@ -46,4 +51,3 @@ GridTrack.prototype.renderGridlines = function(block,leftBase,rightBase) {

};


3 changes: 3 additions & 0 deletions js/ImageTrack.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// VIEW

/**
* @class
*/
function ImageTrack(trackMeta, refSeq, browserParams) {
Track.call(this, trackMeta.label, trackMeta.key,
false, browserParams.changeCallback);
Expand Down
6 changes: 5 additions & 1 deletion js/Layout.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// VIEW

/*
/**
* Code for laying out rectangles, given that layout is also happening
* in adjacent blocks at the same time
*
Expand All @@ -10,6 +10,7 @@
* contour spans and give up some packing closeness in exchange for speed
* (the code already merges spans that have the same x-coord and are vertically
* contiguous).
* @class
*/

function Contour(top) {
Expand Down Expand Up @@ -183,6 +184,9 @@ Contour.prototype.getNextTop = function(fit) {
return this.spans[fit.above].top + this.spans[fit.above].height;
};

/**
* @class
*/
function Layout(leftBound, rightBound) {
this.leftBound = leftBound;
this.rightBound = rightBound;
Expand Down
10 changes: 5 additions & 5 deletions js/LazyArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
*/

/**
* Construct a new LazyArray
* @class This class makes it easier to partially load a large JSON array
* Construct a new LazyArray, which partially loads large JSON arrays.
* @class
* @constructor
* @param lazyArrayParams object with:<br>
* @param lazyArrayParams {Object} as:
* <ul>
* <li><code>urlTemplate</code> - for each lazily-loaded array chunk, the chunk number will get substituted for {chunk} in this template, and the result will beused as the URL of the JSON for that array chunk</li>
* <li><code>length</code> - length of the overall array</li>
Expand Down Expand Up @@ -56,7 +56,7 @@ LazyArray.prototype.range = function(start, end, callback, postFun, param) {
var firstChunk = Math.floor(start / this.chunkSize);
var lastChunk = Math.floor(end / this.chunkSize);

if (postFun === undefined) postFun = function() {};
if (postFun === undefined) /** @inner */ postFun = function() {};
var finish = new Finisher(postFun);

for (var chunk = firstChunk; chunk <= lastChunk; chunk++) {
Expand Down Expand Up @@ -124,4 +124,4 @@ LazyArray.prototype._processChunk = function(start, end, chunk,
for (var i = chunkStart; i <= chunkEnd; i++) {
callback(i + firstIndex, this.chunks[chunk][i], param);
}
};
};
9 changes: 7 additions & 2 deletions js/LazyPatricia.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// MODEL

/*
/**
<pre>
Implements a lazy PATRICIA tree.
This class is a map where the keys are strings. The map supports fast
Expand Down Expand Up @@ -49,7 +50,11 @@
the wire (so, no type tags in the JSON to distinguish loaded nodes,
lazy nodes, and leaves) while supporting lazy loading and reasonably
fast lookups.
*/
</pre>
@class
*/

function LazyTrie(rootURL, chunkTempl) {
this.rootURL = rootURL;
Expand Down
23 changes: 17 additions & 6 deletions js/NCList.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
// MODEL

//After
//Alekseyenko, A., and Lee, C. (2007).
//Nested Containment List (NCList): A new algorithm for accelerating
// interval query of genome alignment and interval databases.
//Bioinformatics, doi:10.1093/bioinformatics/btl647
//http://bioinformatics.oxfordjournals.org/cgi/content/abstract/btl647v1
/**
Nested containment list.
@class
After
<pre>
Alekseyenko, A., and Lee, C. (2007).
Nested Containment List (NCList): A new algorithm for accelerating
interval query of genome alignment and interval databases.
Bioinformatics, doi:10.1093/bioinformatics/btl647
</pre>
<a href="http://bioinformatics.oxfordjournals.org/cgi/content/abstract/btl647v1">http://bioinformatics.oxfordjournals.org/cgi/content/abstract/btl647v1</a>
*/

function NCList() {
}
Expand Down
1 change: 1 addition & 0 deletions js/SeqFeatureStore/NCList.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ SeqFeatureStore.NCList.prototype.histogram = function() {
SeqFeatureStore.NCList.prototype.iterate = function( startBase, endBase, origFeatCallback, finishCallback ) {
var that = this;
var accessors = this.attrs.accessors(),
/** @inner */
featCallBack = function( feature, path ) {
that._add_getters( accessors.get, feature );
return origFeatCallback( feature, path );
Expand Down
13 changes: 9 additions & 4 deletions js/SequenceTrack.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// VIEW

/**
* @class
*/
function SequenceTrack(trackMeta, refSeq, browserParams) {
//trackMeta: object with:
// key: display text track name
Expand Down Expand Up @@ -124,10 +127,12 @@ SequenceTrack.prototype.renderSeqDiv = function ( start, end, seq ) {
return container;
};

SequenceTrack.prototype.getRange = function(start, end, callback) {
//start: start coord, in interbase
//end: end coord, in interbase
//callback: function that takes (start, end, seq)
/**
* @param start start coord, in interbase
* @param end end coord, in interbase
* @param callback function that takes ( start, end, seq )
*/
SequenceTrack.prototype.getRange = function( /**Number*/ start, /**Number*/ end, /**Function*/ callback) {
var firstChunk = Math.floor( Math.max(0,start) / this.chunkSize);
var lastChunk = Math.floor((end - 1) / this.chunkSize);
var chunkSize = this.chunkSize;
Expand Down
9 changes: 7 additions & 2 deletions js/StaticTrack.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// VIEW

//This track is for (e.g.) position and sequence information that should
//always stay visible at the top of the view
/**
This track is for (e.g.) position and sequence information that should
always stay visible at the top of the view.
@class
*/

function StaticTrack(name, labelClass, posHeight) {
Track.call(this, name, name, true, function() {});
Expand Down
3 changes: 3 additions & 0 deletions js/Track.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// VIEW

/**
* @class
*/
function Track(name, key, loaded, changeCallback) {
this.name = name;
this.key = key;
Expand Down
7 changes: 7 additions & 0 deletions js/Util.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// MISC

/**
* @namespace
*/

var Util = {};

Util.is_ie = navigator.appVersion.indexOf('MSIE') >= 0;
Expand Down Expand Up @@ -364,6 +368,9 @@ if (!Array.prototype.indexOf)
};
}

/**
* @class
*/
function Finisher(fun) {
this.fun = fun;
this.count = 0;
Expand Down

0 comments on commit a297623

Please sign in to comment.