First off, there is something that just looks odd in this code, but the box itself looks okay, so I'm not sure what's going on. Here is the code snippet:
var negativeTranscriptBoxNodes = [];
for ( i = 0; i < transcriptionFactors.length; i++ ) {
tfConfig = transcriptionFactors[ i ];
if ( !tfConfig.isPositive ) {
var negativeTranscriptionBox = new HBox( {
children: [
negativeTranscriptionFactorLabel,
new Spacer( maxWidth - negativeTranscriptionFactorLabelWidth, 0 ),
this.addCreatorNode( new TranscriptionFactorCreatorNode( this, tfConfig ) )
],
spacing: 10
} );
negativeTranscriptBoxNodes.push( positiveTranscriptionBox );
}
}
Note that the loop is creating negativeTranscriptionBox but then is pushing positiveTranscriptionBox onto the list of negativeTrascriptBoxNodes. I'm not sure how this is working, but it looks wrong.
Second, both places where transcription factors are added should probably be done as closures rather than as looks. The code would be a bit cleaner.
First off, there is something that just looks odd in this code, but the box itself looks okay, so I'm not sure what's going on. Here is the code snippet:
Note that the loop is creating
negativeTranscriptionBox
but then is pushingpositiveTranscriptionBox
onto the list ofnegativeTrascriptBoxNodes
. I'm not sure how this is working, but it looks wrong.Second, both places where transcription factors are added should probably be done as closures rather than as looks. The code would be a bit cleaner.