1 // VIEW
  2 
  3 var ImageTrack;
  4 if( !ImageTrack ) ImageTrack = {};
  5 
  6 /**
  7  * Tiled-image track subclass that displays images calculated from
  8  * wiggle data.  Has a scale bar in addition to the images.
  9  * @class
 10  * @constructor
 11  */
 12 ImageTrack.Wiggle = function() {
 13     ImageTrack.apply( this, arguments );
 14 };
 15 
 16 ImageTrack.Wiggle.prototype = new ImageTrack({},{},{});
 17 
 18 /**
 19  * Mixin: Track.YScaleMixin.
 20  */
 21 dojo.mixin( ImageTrack.Wiggle.prototype, Track.YScaleMixin );
 22 
 23 ImageTrack.Wiggle.prototype.updateViewDimensions = function( coords ) {
 24     ImageTrack.prototype.updateViewDimensions.apply( this, arguments );
 25     this.updateYScaleFromViewDimensions( coords );
 26 };
 27 
 28 ImageTrack.Wiggle.prototype.loadSuccess = function() {
 29     ImageTrack.prototype.loadSuccess.apply( this, arguments );
 30 };
 31 
 32 ImageTrack.Wiggle.prototype.makeImageLoadHandler = function( img, blockIndex, blockWidth, composeCallback ) {
 33     return ImageTrack.prototype.makeImageLoadHandler.call(
 34         this,
 35         img,
 36         blockIndex,
 37         blockWidth,
 38         dojo.hitch(this, function() {
 39                        if(! this.yscale )
 40                            this.makeWiggleYScale();
 41                        if( composeCallback )
 42                            composeCallback();
 43                    })
 44     );
 45 };
 46 
 47 ImageTrack.Wiggle.prototype.makeWiggleYScale = function() {
 48     // if we are not loaded yet, we won't have any metadata, so just return
 49     try {
 50         this.min   = this.store.stats.global_min;
 51         this.max   = this.store.stats.global_max;
 52     } catch (x) {
 53         return;
 54     }
 55     this.makeYScale();
 56 };
 57