EJS has pre-written actions, the most frequently used are _play(), _pause(), _step(), and _reset().
In many of my EJS simulations I add a button 'Clear Traces', which on clicking invokes the action _view.resetTraces()
As far as I can tell, there is no 'resetTraces' in EJsS.
I have created a combination of two screenshots. See the attached image, EJsS_EJS_actions.png
The left column is all of the pre-written actions that are available in the EJsS environment, the column on the right is the list of pre-written actions available in the EJS environment.
Is the absence of a pre-written clearTraces() action intentional, or is it a regression that at some point in the future will be corrected?
Let me give this request for information one more try.
I have in the meantime verified the that Lagrange point simulation does run. The Javascript version produces the same orbital motion as the Java version does, so that's in the bag.
However, for this type of simulation ability to clear traces is a necessity. The fun of it is that you try a simulation run, then you clear the traces, and you do some tweaking of the initial conditions and see how that makes a difference.
At present the only way to clear the traces is to reload the entire webpage.
As a shot to nothing I tried whether the 'Maximum' attribute of the 'trace' element offers a possibility. To that end I created a variable 'secTraceMaxPoints' for the 'Maximum' field, and this custom method:
function clearTraces() { secTraceMaxPoints = 0; secTraceMaxPoints = 1023; }
Well, invoking that function had no effect, the trace wasn't cleared.
Is there anything else I can try to achieve the goal of having the ability to clear the traces?
The view should update automatically if these functions are called from a user action or from the Evolution page. If not, you may need to update the view for the changes to take effect.
_view._update();
You can see how these functions are used in the accelerometer example: