@@ -14,12 +14,10 @@ class DirectedGraphTracer extends Tracer {
1414 constructor ( name ) {
1515 super ( name ) ;
1616
17- this . color = {
18- selected : '#2962ff' ,
19- visited : '#f50057' ,
20- left : '#616161' ,
21- default : '#bdbdbd'
22- } ;
17+ this . selectColor = '#2962ff' ;
18+ this . visitedColor = '#f50057' ;
19+ this . leftColor = '#616161' ;
20+ this . defaultColor = '#bdbdbd' ;
2321
2422 if ( this . isNew ) initView ( this ) ;
2523 }
@@ -59,7 +57,7 @@ class DirectedGraphTracer extends Tracer {
5957 case 'leave' :
6058 var visit = step . type == 'visit' ;
6159 var targetNode = this . graph . nodes ( this . n ( step . target ) ) ;
62- var color = visit ? this . color . visited : this . color . left ;
60+ var color = visit ? this . visitedColor : this . leftColor ;
6361 targetNode . color = color ;
6462 if ( step . source !== undefined ) {
6563 var edgeId = this . e ( step . source , step . target ) ;
@@ -137,7 +135,7 @@ class DirectedGraphTracer extends Tracer {
137135 x : .5 + Math . sin ( currentAngle ) / 2 ,
138136 y : .5 + Math . cos ( currentAngle ) / 2 ,
139137 size : 1 ,
140- color : this . color . default ,
138+ color : this . defaultColor ,
141139 weight : 0
142140 } ) ;
143141
@@ -149,7 +147,7 @@ class DirectedGraphTracer extends Tracer {
149147 id : this . e ( i , j ) ,
150148 source : this . n ( i ) ,
151149 target : this . n ( j ) ,
152- color : this . color . default ,
150+ color : this . defaultColor ,
153151 size : 1 ,
154152 weight : refineByType ( value )
155153 } ) ;
@@ -162,7 +160,7 @@ class DirectedGraphTracer extends Tracer {
162160 id : this . e ( i , j ) ,
163161 source : this . n ( i ) ,
164162 target : this . n ( j ) ,
165- color : this . color . default ,
163+ color : this . defaultColor ,
166164 size : 1 ,
167165 weight : refineByType ( G [ i ] [ j ] )
168166 } ) ;
@@ -210,10 +208,10 @@ class DirectedGraphTracer extends Tracer {
210208 var tracer = this ;
211209
212210 this . graph . nodes ( ) . forEach ( function ( node ) {
213- node . color = tracer . color . default ;
211+ node . color = tracer . defaultColor ;
214212 } ) ;
215213 this . graph . edges ( ) . forEach ( function ( edge ) {
216- edge . color = tracer . color . default ;
214+ edge . color = tracer . defaultColor ;
217215 } ) ;
218216 }
219217
0 commit comments