phetsims / projectile-data-lab

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

CODAP wrapper - Unchecking a quantity should hide associated collection attribute #335

Closed matthew-blackman closed 3 months ago

matthew-blackman commented 4 months ago

When a column is dragged to the left side of the data table, it becomes a 'collection attribute' rather than an attribute of the raw data. This can be nested in multiple layers, with collections of collections of collections, etc.

When a quantity is unchecked in the PDL/PSD/CODAP wrappers, it currently does not get removed from the data table if the quantity is a collection attribute. This can lead to strange behavior if the box is checked again.

Here is an example of a disjointed state that can come from this:

Screen Shot 2024-05-31 at 11 45 32 AM

To reproduce the above state:

  1. In the CODAP data table, drag the Launcher column to the left to make it a collection attribute.
  2. Collect some data
  3. Uncheck the box for 'Launcher' in the sim side-menu.
  4. Re-check the box for launcher.

Collections can also be nested, so we should make sure to solve this recursively.

matthew-blackman commented 3 months ago

This has been fixed and will be tested in QA. Nice work!