@@ -60,7 +60,6 @@ class InteractionTrack extends TrackBase {
60
60
showBlocks : true ,
61
61
blockHeight : 3 ,
62
62
thickness : 1 ,
63
- color : "rgb(180,25,137)" ,
64
63
alpha : 0.02 ,
65
64
logScale : true ,
66
65
}
@@ -74,11 +73,11 @@ class InteractionTrack extends TrackBase {
74
73
super . init ( config )
75
74
76
75
// Backward compatibility hack, arcOrientation was previously a boolean, now a string
77
- if ( config . arcOrientation === false ) {
76
+ if ( config . arcOrientation === false ) {
78
77
this . arcOrientation = "DOWN"
79
- } else if ( config . arcOrientation === true ) {
78
+ } else if ( config . arcOrientation === true ) {
80
79
this . arcOrientation = "UP"
81
- } else if ( config . arcOrientation ) {
80
+ } else if ( config . arcOrientation ) {
82
81
this . arcOrientation = config . arcOrientation . toUpperCase ( )
83
82
} else {
84
83
this . arcOrientation = "UP"
@@ -141,7 +140,7 @@ class InteractionTrack extends TrackBase {
141
140
}
142
141
143
142
get supportsWholeGenome ( ) {
144
- return typeof this . featureSource . supportsWholeGenome === 'function' ? this . featureSource . supportsWholeGenome ( ) : true ;
143
+ return typeof this . featureSource . supportsWholeGenome === 'function' ? this . featureSource . supportsWholeGenome ( ) : true
145
144
}
146
145
147
146
async getFeatures ( chr , start , end ) {
@@ -394,8 +393,17 @@ class InteractionTrack extends TrackBase {
394
393
// }
395
394
396
395
const counterClockwise = direction
397
- const color = feature . color || this . color
398
- ctx . strokeStyle = color
396
+
397
+ let color
398
+ if ( typeof this . color === 'function' ) {
399
+ color = this . color ( feature )
400
+ } else {
401
+ color = this . color || feature . color || DEFAULT_ARC_COLOR
402
+ }
403
+
404
+ const strokeColor = this . config . useScore ? getAlphaColor ( color , scoreShade ( feature . score ) ) : color
405
+
406
+ ctx . strokeStyle = strokeColor
399
407
ctx . lineWidth = feature . thickness || this . thickness || 1
400
408
401
409
if ( true === ctx . isSVG ) {
0 commit comments