JLoop | R Documentation |
Creates a custom transition timing function that loops smoothly, i.e. the
value animates from its initial value to the final value then back to the
initial value. It is implemented as a sin function, so it starts and stops
smoothly. JLoop
is passed by name (i.e. without parentheses), whereas
JLoops
must be invoked with a single argument, nCycles
.
JLoop(x)
JLoops(nCycles)
x |
x-value passed to the function automatically. See |
nCycles |
Number of times to loop within the transition. |
A timing function.
JTransition
, JEase
,
JBezier
, JScene
## Not run:
# Loop
JScene(1, 30,
width = JTransition(0, 1, timing = JLoop), # Loop once during the transition
height = JTransition(0, 1, timing = JLoops(3)), # Loop 3 times
plotFn = function(width, height) {
# width values will animate from 0 to 1 then back to 0
# height values will change from 0 to 1 and back 3 times
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.