@@ -60,7 +60,6 @@ class InteractionTrack extends TrackBase {
6060        showBlocks : true , 
6161        blockHeight : 3 , 
6262        thickness : 1 , 
63-         color : "rgb(180,25,137)" , 
6463        alpha : 0.02 , 
6564        logScale : true , 
6665    } 
@@ -74,11 +73,11 @@ class InteractionTrack extends TrackBase {
7473        super . init ( config ) 
7574
7675        // Backward compatibility hack, arcOrientation was previously a boolean, now a string 
77-         if ( config . arcOrientation  ===  false )  { 
76+         if   ( config . arcOrientation  ===  false )  { 
7877            this . arcOrientation  =  "DOWN" 
79-         }  else  if ( config . arcOrientation  ===  true )  { 
78+         }  else  if   ( config . arcOrientation  ===  true )  { 
8079            this . arcOrientation  =  "UP" 
81-         }  else  if ( config . arcOrientation )  { 
80+         }  else  if   ( config . arcOrientation )  { 
8281            this . arcOrientation  =  config . arcOrientation . toUpperCase ( ) 
8382        }  else  { 
8483            this . arcOrientation  =  "UP" 
@@ -141,7 +140,7 @@ class InteractionTrack extends TrackBase {
141140    } 
142141
143142    get  supportsWholeGenome ( )  { 
144-         return  typeof  this . featureSource . supportsWholeGenome  ===  'function'  ? this . featureSource . supportsWholeGenome ( )  : true ; 
143+         return  typeof  this . featureSource . supportsWholeGenome  ===  'function'  ? this . featureSource . supportsWholeGenome ( )  : true 
145144    } 
146145
147146    async  getFeatures ( chr ,  start ,  end )  { 
@@ -394,8 +393,17 @@ class InteractionTrack extends TrackBase {
394393                    // } 
395394
396395                    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 
399407                    ctx . lineWidth  =  feature . thickness  ||  this . thickness  ||  1 
400408
401409                    if  ( true  ===  ctx . isSVG )  { 
0 commit comments