phetsims / plinko-probability

"Plinko Probability" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 7 forks source link

duplicate Properties in model and view #57

Closed pixelzoom closed 8 years ago

pixelzoom commented 8 years ago

There are duplicate Properties in the model and view, and it's unlikely that this duplication is necessary.

PlinkoProbabilityCommonView:

31 var HISTOGRAM_RADIO_VALUES = [ 'counter', 'cylinder', 'fraction' ]; // values for histogramRadioProperty
32 var BALL_RADIO_VALUES = [ 'oneBall', 'tenBalls', 'allBalls', 'continuous' ]; // values for ballRadioProperty

66 var viewProperties = new PropertySet( {
      histogramRadio: 'cylinder', // {string} see HISTOGRAM_RADIO_VALUES
      ballRadio: 'oneBall', // {string} see BALL_RADIO_VALUES
      ...
    } );

PlinkoProbabilityCommonModel:

21 var HISTOGRAM_MODE_VALUES = [ 'counter', 'cylinder', 'fraction' ]; // values for histogramModeProperty
22 var BALL_MODE_VALUES = [ 'oneBall', 'tenBalls', 'allBalls', 'continuous' ]; // values for ballModeProperty

31 PropertySet.call( this, {
      histogramMode: 'counter', // {string} see HISTOGRAM_MODE_VALUES
      ballMode: 'oneBall', // {string} see BALL_MODE_VALUES
      ...
    } );
pixelzoom commented 8 years ago

histogramModeProperty was defined in the model, but not used anywhere. I removed it in the above commit.

pixelzoom commented 8 years ago

ballRadioProperty was likewise defined in the view, but not used anywhere. I removed it in the above commit.

pixelzoom commented 8 years ago

Duplicate (unused) Properties have been removed, the used Properties have been given better names, and their values are documented and validated.

Closing.