1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/47211cedc8d0/ Changeset: 47211cedc8d0 User: Jeremy Goecks Date: 2014-03-25 20:41:40 Summary: Trackster: (a) fix bug when trying to subset from supersets with messages; (b) display vertical placeholder until bugs are resolved. Affected #: 3 files diff -r 4d2f3398ad6d6eebfe084a184bf860dd7c6f9071 -r 47211cedc8d0db9a3d9189bc2d3bfa7e3fe11b86 static/scripts/viz/trackster/tracks.js --- a/static/scripts/viz/trackster/tracks.js +++ b/static/scripts/viz/trackster/tracks.js @@ -1106,6 +1106,10 @@ }); // For vertical alignment, track mouse with simple line. + // Fixes needed for this to work: + // (a) make work with embedded visualizations; + // (b) seems to get stuck on tile overlaps. + /* var mouse_tracker_div = $('<div/>').addClass('mouse-pos').appendTo(parent_element); // Show tracker only when hovering over view. @@ -1125,6 +1129,7 @@ mouse_tracker_div.hide(); } ); + */ this.add_label_track( new LabelTrack( this, { content_div: this.top_labeltrack } ) ); this.add_label_track( new LabelTrack( this, { content_div: this.nav_labeltrack } ) ); @@ -3053,14 +3058,21 @@ var tile_drawn = $.Deferred(); track.tile_cache.set_elt(key, tile_drawn); $.when.apply($, get_tile_data()).then( function() { - // If deferred objects ever show up in tile data, that is likely because a - // Deferred-subsetting interaction failed. Specifically, a Deferred for a superset - // was returned but then couldn't be used). It's not clear whether this will happen - // in practice, and currently the code doesn't handle it. It could probably handle it - // by recursively calling draw_helper. var tile_data = get_tile_data(), tracks_data = tile_data, seq_data; + + // Deferreds may show up here if trying to fetch a subset of data from a superset data chunk + // that cannot be subsetted. This may occur if the superset has a message. If there is a + // Deferred, try again from the top. NOTE: this condition could (should?) be handled by the + // GenomeDataManager in visualization module. + if (_.find(tile_data, function(d) { return util.is_deferred(d); })) { + track.tile_cache.set_elt(key, undefined); + $.when(track.draw_helper(region, w_scale, options)).then(function(tile) { + tile_drawn.resolve(tile); + }); + return; + } // If sequence data is available, subset to get only data in region. if (view.reference_track) { diff -r 4d2f3398ad6d6eebfe084a184bf860dd7c6f9071 -r 47211cedc8d0db9a3d9189bc2d3bfa7e3fe11b86 static/scripts/viz/trackster/util.js --- a/static/scripts/viz/trackster/util.js +++ b/static/scripts/viz/trackster/util.js @@ -1,6 +1,13 @@ define(function(){ /** + * Helper to determine if object is jQuery deferred. + */ +var is_deferred = function ( d ) { + return ('promise' in d); +}; + +/** * Implementation of a server-state based deferred. Server is repeatedly polled, and when * condition is met, deferred is resolved. */ @@ -109,6 +116,7 @@ }; return { + is_deferred: is_deferred, ServerStateDeferred : ServerStateDeferred, get_random_color : get_random_color }; diff -r 4d2f3398ad6d6eebfe084a184bf860dd7c6f9071 -r 47211cedc8d0db9a3d9189bc2d3bfa7e3fe11b86 static/scripts/viz/visualization.js --- a/static/scripts/viz/visualization.js +++ b/static/scripts/viz/visualization.js @@ -86,14 +86,6 @@ }); }; - -/** - * Helper to determine if object is jQuery deferred. - */ -var is_deferred = function ( d ) { - return ('promise' in d); -}; - // --------- Models --------- /** @@ -380,11 +372,10 @@ * Get data from dataset. */ get_data: function(region, mode, resolution, extra_params) { - // Look for entry and return if it's a deferred or if data available is compatible with mode. var entry = this.get_elt(region); if ( entry && - ( is_deferred(entry) || this.get('data_mode_compatible')(entry, mode) ) ) { + ( util_mod.is_deferred(entry) || this.get('data_mode_compatible')(entry, mode) ) ) { return entry; } @@ -405,12 +396,12 @@ // This entry has data in the requested range. Return if data // is compatible and can be subsetted. entry = obj_cache[entry_region.toString()]; - if ( is_deferred(entry) || + if ( util_mod.is_deferred(entry) || ( this.get('data_mode_compatible')(entry, mode) && this.get('can_subset')(entry) ) ) { this.move_key_to_end(entry_region, i); // If there's data, subset it. - if ( !is_deferred(entry) ) { + if ( !util_mod.is_deferred(entry) ) { var subset_entry = this.subset_entry(entry, region); this.set(region, subset_entry); entry = subset_entry; 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.