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

Options pattern in SliderWithReadout #45

Closed jessegreenberg closed 8 years ago

jessegreenberg commented 8 years ago

In SliderWithReadout, slider options are created as options.slider = _.extend(... Is this intentional? This is creating a new object under options called slider. Would it be better to create a new variable called sliderOptions?

jessegreenberg commented 8 years ago

This issue might be resolved via #42, so that issue should be addressed first.

jessegreenberg commented 8 years ago

Ahh, I see and options.slider is created in SliderControlPanel. options is a nested object. I find this a little confusing because to reference the required values in SliderWithReadout, you need to go through a list of keys like options.slider.tick.step. Instead of creating a complex options object, could the HSlider be created in SliderControlPanel, and passed as a parameter to SliderWithReadout? This might reduce complexity in both files.

pixelzoom commented 8 years ago

SliderControlPanel was replaced with NumberControl in https://github.com/phetsims/plinko-probability/issues/42, so this is no longer an issue. Closing.