phetsims / fourier-making-waves

"Fourier: Making Waves" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 3 forks source link

Update charts only when expanded? #155

Closed pixelzoom closed 3 years ago

pixelzoom commented 3 years ago

There's nothing to be done here, creating this issue to document decisions.

I considered optimizing charts so that they are updated only when they are visible/expanded. I decided NOT to do that, for the following reasons:

(1) The sim needs to be responsive and run smoothly with all charts expanded. There is little (or arguably, no) value in making the sim "more responsive" when some charts are collapsed.

(2) In the Discrete screen, the "space and time" domain should have consistent animation speed. Having a consistent load makes it easier to have consistent animation speed. Changing the load based on which charts are expanded risks changing the animation speed, requiring a more complicated solution for animation.

(3) Any chart that is not updated while collapsed will contain data that does not reflect the state of the model. That data will be stale and/or incorrect. And that data will appear in the PhET-iO data stream, where is may be confusing. Having correct data in the data stream is preferrable.

(4) There is a significant cost to optimizing charts while they are collapsed. It increases the complexity of the implementation, and it requires more testing by QA to verify that charts are correct after being expanded.