commit/galaxy-central: jgoecks: Trackster: performance improvements for drawing reference track data.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/c32f70e92aa4/ changeset: c32f70e92aa4 user: jgoecks date: 2013-02-21 20:37:38 summary: Trackster: performance improvements for drawing reference track data. affected #: 2 files diff -r b7b000557d128c537dfeb5bb4a9260853463793b -r c32f70e92aa428dcab3d753ef88a5d255272e4f9 static/scripts/viz/trackster/painters.js --- a/static/scripts/viz/trackster/painters.js +++ b/static/scripts/viz/trackster/painters.js @@ -803,6 +803,7 @@ } } } else { + // Not enough detail to draw sequence data. ctx.fillStyle = block_color; // TODO: This is a pretty hack-ish way to fill rectangle based on mode. ctx.fillRect(s_start, y_center + 4, s_end - s_start, SQUISH_FEATURE_HEIGHT); diff -r b7b000557d128c537dfeb5bb4a9260853463793b -r c32f70e92aa428dcab3d753ef88a5d255272e4f9 static/scripts/viz/trackster/tracks.js --- a/static/scripts/viz/trackster/tracks.js +++ b/static/scripts/viz/trackster/tracks.js @@ -3465,11 +3465,11 @@ */ draw_helper: function(force, region, resolution, parent_element, w_scale, kwargs) { if (w_scale > this.view.canvas_manager.char_width_px) { - this.show_contents(); + this.tiles_div.show(); return TiledTrack.prototype.draw_helper.call(this, force, region, resolution, parent_element, w_scale, kwargs); } else { - this.hide_contents(); + this.tiles_div.hide(); return null; } }, @@ -3480,22 +3480,18 @@ * Draw ReferenceTrack tile. */ draw_tile: function(data, ctx, mode, resolution, region, w_scale) { - if (w_scale > this.view.canvas_manager.char_width_px) { - // Try to subset data. - var subset = this.data_manager.subset_entry(data, region), - seq_data = subset.data; - - // Draw sequence data. - var canvas = ctx.canvas; - ctx.font = ctx.canvas.manager.default_font; - ctx.textAlign = "center"; - for (var c = 0, str_len = seq_data.length; c < str_len; c++) { - ctx.fillText(seq_data[c], Math.floor(c * w_scale), 10); - } - return new Tile(this, region, resolution, canvas, subset); + // Try to subset data. + var subset = this.data_manager.subset_entry(data, region), + seq_data = subset.data; + + // Draw sequence data. + var canvas = ctx.canvas; + ctx.font = ctx.canvas.manager.default_font; + ctx.textAlign = "center"; + for (var c = 0, str_len = seq_data.length; c < str_len; c++) { + ctx.fillText(seq_data[c], Math.floor(c * w_scale), 10); } - - this.hide_contents(); + return new Tile(this, region, resolution, canvas, subset); } }); 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.
participants (1)
-
Bitbucket