Skip to content

Commit

Permalink
added support for boolean operations (track masking)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmirob committed Mar 1, 2013
1 parent 86a7b82 commit 5fefdc2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/JBrowse/View/Track/Wiggle/XYPlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ var XYPlot = declare( [WiggleBase, YScaleMixin],
}, this );
},

/* If it's a boolean track, mask accordingly */
_maskBySpans: function( scale, leftBase, rightBase, block, canvas, pixels, dataScale, spans ) {
var context = canvas.getContext('2d');
var canvasHeight = canvas.height;

for ( var index in spans ) {
if (spans.hasOwnProperty(index)) {
var w = Math.ceil(( spans[index].end - spans[index].start ) * scale );
var l = Math.round(( spans[index].start - leftBase ) * scale );
context.clearRect( l, 0, w-1, canvasHeight );
}}
context.globalAlpha = 0.2;
this._drawFeatures( scale, leftBase, rightBase, block, canvas, pixels, dataScale );
},

/**
* Draw anything needed after the features are drawn.
*/
Expand Down

0 comments on commit 5fefdc2

Please sign in to comment.