1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/35a413021c15/
changeset: 35a413021c15
user: jgoecks
date: 2011-08-10 22:42:01
summary: Trackster overview bug fix: always draw for display in visualization and then copy canvas for overview.
affected #: 1 file (220 bytes)
--- a/static/scripts/trackster.js Wed Aug 10 10:47:56 2011 -0400
+++ b/static/scripts/trackster.js Wed Aug 10 16:42:01 2011 -0400
@@ -2032,23 +2032,24 @@
var
key = track._gen_tile_cache_key(view_width, w_scale, 0),
tile = track.tile_cache.get(key);
- if (tile) {
- // Clone tile/canvas because it may need to be used by viz.
- var
- src_canvas = $(tile.canvas.find("canvas")),
- new_canvas = src_canvas.clone(),
- src_ctx = src_canvas.get(0).getContext("2d"),
- tgt_ctx = new_canvas.get(0).getContext("2d"),
- data = src_ctx.getImageData(0, 0, src_ctx.canvas.width, src_ctx.canvas.height);
- // Need to undo offset when placing image data.
- tgt_ctx.putImageData(data, -track.left_offset, (tile.data.dataset_type === "summary_tree" ? SUMMARY_TREE_TOP_PADDING : 0));
- tile = new Tile(-1, resolution, new_canvas);
+
+ // Draw tile if necessary.
+ if (!tile) {
+ tile = track.draw_tile(overview_data, resolution, 0, w_scale);
+ track.tile_cache.set(key, tile);
}
- else {
- tile = track.draw_tile(overview_data, resolution, null, w_scale, null, true);
- track.tile_cache.set(key, tile);
- }
- overview_tile.resolve(tile);
+
+ // Always copy tile because it may need to be used in viz.
+ var
+ src_canvas = $(tile.canvas.find("canvas")),
+ new_canvas = src_canvas.clone(),
+ src_ctx = src_canvas.get(0).getContext("2d"),
+ tgt_ctx = new_canvas.get(0).getContext("2d"),
+ data = src_ctx.getImageData(0, 0, src_ctx.canvas.width, src_ctx.canvas.height);
+ // Need to undo offsets when placing image data.
+ tgt_ctx.putImageData(data, -track.left_offset, (tile.data.dataset_type === "summary_tree" ? SUMMARY_TREE_TOP_PADDING : 0));
+ new_tile = new Tile(-1, resolution, new_canvas);
+ overview_tile.resolve(new_tile);
});
return overview_tile;
@@ -2763,9 +2764,8 @@
* @param tile_index index of tile to be drawn
* @param w_scale base pairs per pixel
* @param ref_seq reference sequence data
- * @param no_offsets set to true when offsets should not be used, such as for overview tile
*/
- draw_tile: function(result, resolution, tile_index, w_scale, ref_seq, no_offsets) {
+ draw_tile: function(result, resolution, tile_index, w_scale, ref_seq) {
var track = this,
tile_low = tile_index * DENSITY * resolution,
tile_high = (tile_index + 1) * DENSITY * resolution,
@@ -2819,7 +2819,7 @@
var canvas = this.view.canvas_manager.new_canvas();
canvas.width = width + left_offset;
// Extra padding at top of summary tree
- canvas.height = required_height + (!no_offsets ? SUMMARY_TREE_TOP_PADDING : 0);
+ canvas.height = required_height + SUMMARY_TREE_TOP_PADDING;
// Get summary tree data if necessary and set max if there is one.
if (result.dataset_type != "summary_tree") {
@@ -2833,9 +2833,7 @@
var painter = new painters.SummaryTreePainter(result, tile_low, tile_high, this.prefs);
var ctx = canvas.getContext("2d");
// Deal with left_offset by translating.
- if (!no_offsets) {
- ctx.translate(left_offset, SUMMARY_TREE_TOP_PADDING);
- }
+ ctx.translate(left_offset, SUMMARY_TREE_TOP_PADDING);
painter.draw(ctx, width, required_height);
return new SummaryTreeTile(tile_index, resolution, canvas, result.data, result.max);
}
@@ -2889,9 +2887,7 @@
if (result.data) {
// Draw features.
- if (!no_offsets) {
- ctx.translate(left_offset, 0);
- }
+ ctx.translate(left_offset, 0);
painter.draw(ctx, width, required_height, slots);
}
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.
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/8797ad3bf9b3/
changeset: 8797ad3bf9b3
user: jgoecks
date: 2011-08-10 16:47:56
summary: Trackster bug fixes: (a) provide additional vars for drawing histograms; and (b) ensure that FeatureTrack tiles cover track-tile background even when no data is present.
affected #: 1 file (5 bytes)
--- a/static/scripts/trackster.js Tue Aug 09 16:16:03 2011 -0400
+++ b/static/scripts/trackster.js Wed Aug 10 10:47:56 2011 -0400
@@ -168,11 +168,12 @@
* Init constants & functions used throughout trackster.
*/
var
- // Drawing constants; track height is (constant) height of track, and feature height is the
- // height of individual features within tracks. Feature height, then, should always be less
- // than track height.
- CHAR_HEIGHT_PX = 9, // FIXME: font size may not be static
- ERROR_PADDING = 20, // Padding at the top of tracks for error messages
+ // Minimum height of a track's contents; this must correspond to the .track-content's minimum height.
+ MIN_TRACK_HEIGHT = 16,
+ // FIXME: font size may not be static
+ CHAR_HEIGHT_PX = 9,
+ // Padding at the top of tracks for error messages
+ ERROR_PADDING = 20,
SUMMARY_TREE_TOP_PADDING = CHAR_HEIGHT_PX + 2,
// Maximum number of rows un a slotted track
MAX_FEATURE_DEPTH = 100,
@@ -2110,7 +2111,7 @@
if (drawn_tiles.length === tile_count) {
// All tiles have been drawn.
clearInterval(intervalId);
- track.postdraw_actions(drawn_tiles, clear_after);
+ track.postdraw_actions(drawn_tiles, width, w_scale, clear_after);
}
}, 50);
@@ -2125,7 +2126,7 @@
* Actions to be taken after draw has been completed. Draw is completed when all tiles have been
* drawn/fetched and shown.
*/
- postdraw_actions: function(tiles, clear_after) {
+ postdraw_actions: function(tiles, width, w_scale, clear_after) {
var track = this;
//
@@ -2558,7 +2559,7 @@
* Actions to be taken after draw has been completed. Draw is completed when all tiles have been
* drawn/fetched and shown.
*/
- postdraw_actions: function(tiles, clear_after) {
+ postdraw_actions: function(tiles, width, w_scale, clear_after) {
TiledTrack.prototype.postdraw_actions.call(this, tiles, clear_after);
var track = this;
@@ -2601,7 +2602,7 @@
var tile = tiles[i];
tile.canvas.remove();
track.delayed_draw(true, track._gen_tile_cache_key(width, w_scale, tile.index), tile.index,
- tile.resolution, parent_element, w_scale, [], { max: global_max });
+ tile.resolution, tile.canvas.parent(), w_scale, [], { max: global_max });
}
}
}
@@ -2873,7 +2874,7 @@
// Create painter, and canvas of sufficient size to contain all features
// HACK: ref_seq will only be defined for ReadTracks, and only the ReadPainter accepts that argument
var painter = new (this.painter)(filtered, tile_low, tile_high, this.prefs, mode, ref_seq);
- var required_height = painter.get_required_height(slots_required);
+ var required_height = Math.max(MIN_TRACK_HEIGHT, painter.get_required_height(slots_required));
var canvas = this.view.canvas_manager.new_canvas();
canvas.width = width + left_offset;
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.
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/2d626f5b66d4/
changeset: 2d626f5b66d4
user: dan
date: 2011-08-08 22:16:46
summary: Fix for unit tests for converting of #/pound
affected #: 1 file (5 bytes)
--- a/lib/galaxy/util/__init__.py Mon Aug 08 16:00:35 2011 -0400
+++ b/lib/galaxy/util/__init__.py Mon Aug 08 16:16:46 2011 -0400
@@ -197,7 +197,7 @@
>>> par.get('price', 0)
0
>>> par.symbols # replaces unknown symbols with X
- ['alpha', '__lt____gt__', 'XrmXX!']
+ ['alpha', '__lt____gt__', 'XrmX__pd__!']
>>> par.flatten() # flattening to a list
[('status', 'on'), ('symbols', 'alpha'), ('symbols', '__lt____gt__'), ('symbols', 'XrmX__pd__!')]
"""
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.