phetsims / gas-properties

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

Diffusion Screen: make it possible to hide one type of particles #255

Closed arouinfar closed 5 months ago

arouinfar commented 5 months ago

For #30

It's not possible to limit students to a single type of particle on the Diffusion Screen. @Nancy-Salpepi noted that she usually has students explore how a single type of particles spreads out throughout the container.

In the settingsPanel, we can hide individual rows of controls for variables outside the scope of the lesson's goals. image

However, this prevents exploration of a single type of particles dispersing throughout the container, as we decided to uninsturment numberSpinner.visibleProperty.

An easy solution would be to re-instrument the NumberSpinners for type 2 particles. The UX would be a bit clunky though, as it would require users to hide 4 controls. It's also an imperfect solution because the Data readouts and Center of Mass icon still refer to the hidden particle type.

@pixelzoom could we create a Property that would hide everything associated with type 2 particles? Let's discuss when you return.

pixelzoom commented 5 months ago

For discussion with @arouinfar and @Nancy-Salpepi on 6/11/24, I added diffusionScreen.view.viewProperties.numberOfParticleTypesProperty. It looks like this in Studio:

screenshot_3342

Setting its value to 1 results in the UI looking like the screenshot shown below. Particle type 2 is hidden from the settings panel and Data accordion box, and the icon changes for the "Center of Mass" checkbox.

screenshot_3341

Things that I don't like about this: (1) The empty space in the settings panel. I've tried to center the spinners, but it's difficult (impossible?) because of how the code is structured to facilitate hiding (for example) settingsPanel.massControls. (2) Showing the blue particle icon 6x when there is only one particle type feels redundant. We would never design the UI like this.

pixelzoom commented 5 months ago

Reviewed with @arouinfar and @Nancy-Salpepi, looks good as is. @arouinfar has a note about adding this to examples.md, so we can close.