1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/fc84a8b469c3/ changeset: fc84a8b469c3 user: jgoecks date: 2012-12-10 22:08:44 summary: Trackster: use tile region in place of tile index for simplicity. affected #: 1 file
diff -r c3acc86490780d1949c4a3abf1263ace7c5ece6c -r fc84a8b469c3181be64083a91d0fc2faae5e73ef static/scripts/viz/trackster/tracks.js --- a/static/scripts/viz/trackster/tracks.js +++ b/static/scripts/viz/trackster/tracks.js @@ -2762,23 +2762,27 @@ } */ }, + /** * Generate a key for the tile cache. * TODO: create a TileCache object (like DataCache) and generate key internally. */ - _gen_tile_cache_key: function(w_scale, tile_index) { - return w_scale + '_' + tile_index; + _gen_tile_cache_key: function(w_scale, tile_region) { + return w_scale + '_' + tile_region; }, + /** * Request that track be drawn. */ request_draw: function(force, clear_after) { this.view.request_redraw(false, force, clear_after, this); }, + /** * Actions to be taken before drawing. */ before_draw: function() {}, + /** * Draw track. It is possible to force a redraw rather than use cached tiles and/or clear old * tiles after drawing new tiles. @@ -2826,7 +2830,8 @@ is_tile = function(o) { return (o && 'track' in o); }; // Draw tiles. while ( ( tile_index * TILE_SIZE * resolution ) < high ) { - var draw_result = this.draw_helper( force, tile_index, resolution, this.tiles_div, w_scale ); + var tile_region = this._get_tile_bounds(tile_index, resolution), + draw_result = this.draw_helper( force, tile_region, resolution, this.tiles_div, w_scale ); if ( is_tile(draw_result) ) { drawn_tiles.push( draw_result ); } else { @@ -2871,10 +2876,9 @@ * Retrieves from cache, draws, or sets up drawing for a single tile. Returns either a Tile object or a * jQuery.Deferred object that is fulfilled when tile can be drawn again. */ - draw_helper: function(force, tile_index, resolution, parent_element, w_scale, kwargs) { + draw_helper: function(force, region, resolution, parent_element, w_scale, kwargs) { var track = this, - key = this._gen_tile_cache_key(w_scale, tile_index), - region = this._get_tile_bounds(tile_index, resolution); + key = this._gen_tile_cache_key(w_scale, region);
// Init kwargs if necessary to avoid having to check if kwargs defined. if (!kwargs) { kwargs = {}; } @@ -3022,7 +3026,7 @@
/** * Returns a genome region that corresponds to a tile at a particular resolution - */ + */ _get_tile_bounds: function(tile_index, resolution) { var tile_low = Math.floor( tile_index * TILE_SIZE * resolution ), tile_length = Math.ceil( TILE_SIZE * resolution ), @@ -3223,11 +3227,10 @@ this.action_icons.param_space_viz_icon.hide(); }, can_draw: Drawable.prototype.can_draw, - draw_helper: function(force, tile_index, resolution, parent_element, w_scale, kwargs) { + draw_helper: function(force, region, resolution, parent_element, w_scale, kwargs) { // FIXME: this function is similar to TiledTrack.draw_helper -- can the two be merged/refactored? var track = this, - key = this._gen_tile_cache_key(w_scale, tile_index), - region = this._get_tile_bounds(tile_index, resolution); + key = this._gen_tile_cache_key(w_scale, region);
// Init kwargs if necessary to avoid having to check if kwargs defined. if (!kwargs) { kwargs = {}; } @@ -3446,9 +3449,9 @@ /** * Only retrieves data and draws tile if reference data can be displayed. */ - draw_helper: function(force, tile_index, resolution, parent_element, w_scale, kwargs) { + draw_helper: function(force, region, resolution, parent_element, w_scale, kwargs) { if (w_scale > this.view.canvas_manager.char_width_px) { - return TiledTrack.prototype.draw_helper.call(this, force, tile_index, resolution, parent_element, w_scale, kwargs); + return TiledTrack.prototype.draw_helper.call(this, force, region, resolution, parent_element, w_scale, kwargs); } else { this.hide_contents();
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
galaxy-commits@lists.galaxyproject.org