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
5 changed files
with
119 additions
and
71 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,46 @@ | ||
define([ | ||
'dojo/_base/declare', | ||
'dojo/_base/array', | ||
'dojo/_base/lang', | ||
'JBrowse/View/FeatureGlyph/Alignment' | ||
], | ||
function( | ||
declare, | ||
array, | ||
lang, | ||
Alignment | ||
) { | ||
return declare(Alignment, { | ||
|
||
renderFeature( context, fRect ) { | ||
this.renderConnector( context, fRect ); | ||
this.renderSegments( context, fRect ); | ||
}, | ||
|
||
renderSegments( context, fRect ) { | ||
const f1 = dojo.clone(fRect); | ||
const f2 = dojo.clone(fRect); | ||
f1.f = fRect.f.f1 | ||
f2.f = fRect.f.f2 | ||
this.inherited(arguments, [context, f1]) | ||
this.inherited(arguments, [context, f2]) | ||
}, | ||
|
||
renderConnector( context, fRect ) { | ||
// connector | ||
var connectorColor = this.getStyle( fRect.f, 'connectorColor' ); | ||
if( connectorColor ) { | ||
context.fillStyle = connectorColor; | ||
var connectorThickness = this.getStyle( fRect.f, 'connectorThickness' ); | ||
context.fillRect( | ||
fRect.rect.l, // left | ||
Math.round(fRect.rect.t+(fRect.rect.h-connectorThickness)/2), // top | ||
fRect.rect.w, // width | ||
connectorThickness | ||
); | ||
} | ||
} | ||
|
||
}); | ||
}); | ||
|
This file was deleted.
Oops, something went wrong.
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,50 @@ | ||
define([ | ||
'dojo/_base/declare', | ||
'dojo/_base/array', | ||
'dojo/_base/lang', | ||
'JBrowse/View/FeatureGlyph/Alignment' | ||
], | ||
function( | ||
declare, | ||
array, | ||
lang, | ||
Alignment | ||
) { | ||
return declare([Segments, Alignment], { | ||
|
||
renderFeature( context, fRect ) { | ||
this.renderConnector( context, fRect ); | ||
this.renderSegments( context, fRect ); | ||
}, | ||
|
||
layoutFeature(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; | ||
}, | ||
renderConnector( context, fRect ) { | ||
// connector | ||
var connectorColor = this.getStyle( fRect.f, 'connectorColor' ); | ||
if( connectorColor ) { | ||
context.fillStyle = connectorColor; | ||
var connectorThickness = this.getStyle( fRect.f, 'connectorThickness' ); | ||
context.fillRect( | ||
fRect.rect.l, // left | ||
Math.round(fRect.rect.t+(fRect.rect.h-connectorThickness)/2), // top | ||
fRect.rect.w, // width | ||
connectorThickness | ||
); | ||
} | ||
} | ||
|
||
}); | ||
}); | ||
|
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