phetsims / projectile-motion

"Projectile Motion" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
15 stars 13 forks source link

Factor out airResistanceCheckbox and dragCoefficient readout to separate Node #225

Closed zepumph closed 2 years ago

zepumph commented 4 years ago

From #219 this grouping will help factor out code from the intro and vectors screen while achieving phet-io instrumentation goals.

zepumph commented 4 years ago

Review comment:

Group airResistanceCheckbox, airResistanceText, and dragCoefficientReadout into airResistanceControl or simply airResistance. (@kathy-phet do you have a preference for the name?)

zepumph commented 4 years ago

I factored out these components in the above commit. I ended up naming the new control AirResistanceControl so that is what I named the phet-io element as well. Let me know if you would like to see something else.

Furthermore I simplified some of the children tandem names. I think it is a bit clearer, but please let me know if you would like them to be something else.

arouinfar commented 3 years ago

@zepumph AirResistanceControl is great! One thing that is a little unclear is airResistanceControl.text. Could it be renamed title or titleNode (if it is indeed a Node)? Otherwise, everything looks good.

zepumph commented 3 years ago

I went with titleText, since it is a Text (a subtype of Node). This seemed better to me because in addition to getting the visibleProperty from Node, it also has a textProperty which comes from Text, In general, I have found that this suffix can help describe what component parts the PhET-iO element has. What do you think?

arouinfar commented 2 years ago

airResistanceControl.titleText.textProperty looks great, closing.