phetsims / sun

User-interface components for PhET simulations, built on top of Scenery.
MIT License
4 stars 12 forks source link

Add the ability to specify per-item properties in a radio-button group. #811

Closed pixelzoom closed 1 year ago

pixelzoom commented 1 year ago

In calculus-grapher, we need the ability to set options for specific radio buttons in a group. Specifically, we need to set the visible option of each radio button based on some criteria, which can later be changed via PhET-iO.

This is not currently supported by RectangularRadioButtonGroup or AquaRadioButtonGroup. My plan is to add options to both RectangularRadioButtonGroupItem and AquaRadioButtonGroupItem. (This is identical to how this feature is supported by VerticalCheckboxGroupItem.)

pixelzoom commented 1 year ago

Done in the above commits. I would have preferred to name these new options RectangularRadioButtonGroupItem.radioButtonOptions and AquaRadioButtonGroupItem.radioButtonOptions. But I went with options, to match VerticalCheckboxGroupItem.options, which I did not have time to attempt to change.

@samreid since you worked on Gorups/Items recently, could you please review? Close if OK.

samreid commented 1 year ago

I reviewed the commits and everything seemed reasonable, closing.