The default value for histogramModeProperty is 'cylinder', see base type PlinkoProbabilityCommonView.
But Lab screen needs a different default value ('counter) for this Property. Here's how it currently solves this problem. In the constructor, it does this:
reset: function() {
PlinkoProbabilityCommonView.prototype.reset.call( this );
this.viewProperties.histogramModeProperty.set( 'counter' );
}
This is a bad way to handle this, because it works correctly only if the order of statements in reset is as shown above. Switch the order and it's wrong.
The correct way to handle this is to provide option histogramMode for PlinkoProbabilityCommonView, default it to 'cylinder', and set it to 'counter' for the Lab screen.
The default value for
histogramModeProperty
is'cylinder'
, see base type PlinkoProbabilityCommonView.But Lab screen needs a different default value (
'counter
) for this Property. Here's how it currently solves this problem. In the constructor, it does this:And in
reset
, it does this:This is a bad way to handle this, because it works correctly only if the order of statements in
reset
is as shown above. Switch the order and it's wrong.The correct way to handle this is to provide option
histogramMode
forPlinkoProbabilityCommonView
, default it to'cylinder'
, and set it to'counter'
for the Lab screen.