phetsims / beers-law-lab

"Beer's Law Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/beers-law-lab
GNU General Public License v3.0
2 stars 9 forks source link

Add units to positionProperty #309

Closed pixelzoom closed 1 year ago

pixelzoom commented 1 year ago

While working on https://github.com/phetsims/beers-law-lab/issues/306, I noticed that positionProperty is missing units in the model.

pixelzoom commented 1 year ago

Done, example below, "cm". Distance/position units are not really important in the Concentration screen, but they are in the Beer's Law screen.

Note that origin (0,0) is at the top-left of the layoutBounds (red rectangle with ?dev). Kind of weird that +y is down, but would be costly to change. Maybe document in PhET-iO Guide?

@arouinfar please review, close if OK.

screenshot_2143
arouinfar commented 1 year ago

Thanks @pixelzoom. The units look good.

Kind of weird that +y is down, but would be costly to change. Maybe document in PhET-iO Guide?

No need to change the coordinate system, but this seems like something that could go in phetioDocumentation. Here's an example from Molecule Polarity:

The position of this atom. (0,0) is at the upper-LEFT, +x is to the right, and +y is DOWN.

pixelzoom commented 1 year ago

This sim has a base class BLLMovable for all things that have a positionProperty. Rather than hunt down every one of those and add (e.g.) "The position of the ruler. (0,0) is at the upper-LEFT, +x is to the right, and +y is DOWN.", I just added one generic description that will appear for all positionProperty -- see screenshot below.

Back to @arouinfar for review.

screenshot_2148
arouinfar commented 1 year ago

Thanks @pixelzoom! The generic positionProperty documentation looks good to me.