Closed matthew-blackman closed 7 months ago
As I mentioned in Slack, sampleIndex (which was renamed to projectileIndex in https://github.com/phetsims/projectile-data-lab/issues/119) was a workaround since CODAP did not allow adding a row with no columns.
We want a new column like "caseIndex" name: 'caseIndex', description: 'The row number of the projectile data', type: 'numeric'
. Or perhaps 'rowNumber'?
On second thought, @matthew-blackman and @catherinecarter and I decided we will always show launcher 1-6 or custom. And will check with Bill about the case index.
It is important to note that the native 'index' column in CODAP cannot be utilized for formulas or plots. Having a duplicated column for something like caseIndex does add value to the integration, despite appearing like a redundant column. Let's add this in addition to the recommendation in https://github.com/phetsims/projectile-data-lab/issues/153#issuecomment-1941862753.
Is it OK if the caseIndex column gets out of sync with the "index" column? Because if someone clears the codap table, the sim+wrapper will not know, and will keep going higher.
I implemented the following:
The caseIndex is computed from the live table, so it will always be in sync even if the user deletes rows. @matthew-blackman can you please review and close if all is well?
@matthew-blackman will swap the column order, everything else seems good.
Nice work @samreid! Reviewed the commits and all looks good. Swapped the column order in above commit, closing.
In the CODAP wrapper, hitting the 'Clear all' button in the sim does not reset the sample index. Let's make sure that after clearing a field, the next projectile landed is sampleNumber 1.