I haven't been able to find this in the documentation-- maybe searching for wrong terms.
I am creating a bubble plot in JSL. All works well, but I want to be able to control:
- The size of the interpolation step. Bubble plots appear to interpolate motion between actual points. I want to take the interpolation down to zero (just show the actual measured points.)
- How do I start and stop animation from within JSL? I want to generate the plot, then automatically start the animation at time 0 and run once through time Tfinal, i.e. control of the Play/Pause button.
Thanks!
Spent more time looking through the scripting index, and found enough to answer my questions...
First, create the bubble plot as an object:
bp = Bubble Plot(
X( :X ),
Y( :Y ),
Time( :Time ),
ID( :Ball ),
Bubble Size( plotBallD ),
Time Index( 1 ), ...
Important above to set Time Index(1) to make sure the animation starts at first step.
Next, I found the "Go" command:
bp << Go;
This starts the animation from the first frame (or wherever you specified by Time Index.) However, this starts the animation in motion, and continues nonstop.
You can stop the animation with:
bp << Stop;
but you can't tell where you are stopping. I wanted a StartAtFirstStepEndAtLastStep function. To do this, I had to do some manual manipulation:
// ensure we are stopped
bp << Stop;
// reset to first time index (just in case)
bp << Time Index (1);
// wait to be sure processing is caught up
wait(0.5);
// now loop through the steps. Here I assume nSteps.
for (i=1, i<=nSteps, i++,
// specify delay between each step
wait(.1);
// step the display using the Step command
bp << Step;
// Important. Need to update the window here. If you don't, graphics will update in background.
bp << Update Window;
);
That does it! Script runs, and only the actual bubbles for the data at specific timesteps is displayed. This also avoids the other question I initially posed, which was how to adjust the interpolation that JMP does between timesteps to make the animation more smooth. I didn't want that function.
So in the spirit of Answering My Own Question (while wishing I'd done some additional legwork up front), I'm calling this Answered!