Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
define([ | ||
'dojo/_base/declare', | ||
'dojo/_base/array', | ||
'dojo/_base/lang', | ||
'JBrowse/View/FeatureGlyph/Segments' | ||
], | ||
function( | ||
declare, | ||
array, | ||
lang, | ||
FeatureGlyph | ||
) { | ||
return declare(FeatureGlyph, { | ||
|
||
|
||
//same as parent but without clearRect | ||
renderFeature: function( context, fRect ) { | ||
this.renderConnector( context, fRect ); | ||
this.renderSegments( context, fRect ); | ||
this.renderLabel( context, fRect ); | ||
this.renderDescription( context, fRect ); | ||
this.renderArrowhead( context, fRect ); | ||
}, | ||
|
||
layoutFeature: function(viewArgs, layout, feature) { | ||
var rect = this.inherited(arguments); | ||
if (!rect) { | ||
return rect; | ||
} | ||
var t = Math.abs(feature.get('insert_size')) | ||
|
||
// need to set the top of the inner rect | ||
rect.rect.t = t / (this.config.scaleFactor||1); | ||
rect.t = t / (this.config.scaleFactor||1); | ||
|
||
return rect; | ||
} | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
define( [ | ||
'dojo/_base/declare', | ||
'dojo/_base/lang', | ||
'JBrowse/View/Track/CanvasFeatures', | ||
'JBrowse/Util' | ||
], | ||
function( | ||
declare, | ||
lang, | ||
CanvasFeatures, | ||
Util, | ||
) { | ||
|
||
return declare(CanvasFeatures, { | ||
_defaultConfig: function() { | ||
return Util.deepUpdate(lang.clone(this.inherited(arguments)), { | ||
glyph: 'JBrowse/View/FeatureGlyph/PairedRead', | ||
maxFeatureScreenDensity: 60, | ||
showLabels: false | ||
}); | ||
}, | ||
|
||
// override getLayout to access addRect method | ||
_getLayout: function() { | ||
var layout = this.inherited(arguments); | ||
return declare.safeMixin(layout, { | ||
addRect: function() { | ||
this.pTotalHeight = this.maxHeight; | ||
return 0; | ||
} | ||
}); | ||
} | ||
}); | ||
}); |