@@ -2456,12 +2456,31 @@ Plotly.relayout = function relayout(gd, astr, val) {
24562456} ;
24572457
24582458/**
2459- * Animate to a keyframe
2459+ * Animate to a frame, sequence of frame, frame group, or frame definition
2460+ *
2461+ * @param {string id or DOM element } gd
2462+ * the id or DOM element of the graph container div
2463+ *
2464+ * @param {string or object or array of strings or array of objects } frameOrGroupNameOrFrameList
2465+ * a single frame, array of frames, or group to which to animate. The intent is
2466+ * inferred by the type of the input. Valid inputs are:
2467+ *
2468+ * - string, e.g. 'groupname': animate all frames of a given `group` in the order
2469+ * in which they are defined via `Plotly.addFrames`.
2470+ *
2471+ * - array of strings, e.g. ['frame1', frame2']: a list of frames by name to which
2472+ * to animate in sequence
2473+ *
2474+ * - object: {data: ...}: a frame definition to which to animate. The frame is not
2475+ * and does not need to be added via `Plotly.addFrames`. It may contain any of
2476+ * the properties of a frame, including `data`, `layout`, and `traces`. The
2477+ * frame is used as provided and does not use the `baseframe` property.
2478+ *
2479+ * - array of objects, e.g. [{data: ...}, {data: ...}]: a list of frame objects,
2480+ * each following the same rules as a single `object`.
24602481 *
2461- * @param {string } name
2462- * name of the keyframe to create
24632482 * @param {object } animationOpts
2464- * configuration for animation
2483+ * configuration for the animation
24652484 */
24662485Plotly . animate = function ( gd , frameOrGroupNameOrFrameList , animationOpts ) {
24672486 gd = getGraphDiv ( gd ) ;
@@ -2664,13 +2683,7 @@ Plotly.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) {
26642683 return frame ;
26652684 }
26662685
2667- // Disambiguate what's been received. The possibilities are:
2668- //
2669- // - group: 'groupname': select frames by group name
2670- // - frames ['frame1', frame2']: a list of frames
2671- // - object: {data: ...}: a single frame itself
2672- // - frames [{data: ...}, {data: ...}]: a list of frames
2673- //
2686+ // Disambiguate what's sort of frames have been received
26742687 var i , frame ;
26752688 var frameList = [ ] ;
26762689 var allFrames = frameOrGroupNameOrFrameList === undefined || frameOrGroupNameOrFrameList === null ;
@@ -2729,15 +2742,23 @@ Plotly.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) {
27292742} ;
27302743
27312744/**
2732- * Create new keyframes
2745+ * Register new frames
2746+ *
2747+ * @param {string id or DOM element } gd
2748+ * the id or DOM element of the graph container div
27332749 *
27342750 * @param {array of objects } frameList
27352751 * list of frame definitions, in which each object includes any of:
2736- * - name: {string} name of keyframe to add
2752+ * - name: {string} name of frame to add
27372753 * - data: {array of objects} trace data
27382754 * - layout {object} layout definition
27392755 * - traces {array} trace indices
2740- * - baseframe {string} name of keyframe from which this keyframe gets defaults
2756+ * - baseframe {string} name of frame from which this frame gets defaults
2757+ *
2758+ * @param {array of integers) indices
2759+ * an array of integer indices matching the respective frames in `frameList`. If not
2760+ * provided, an index will be provided in serial order. If already used, the frame
2761+ * will be overwritten.
27412762 */
27422763Plotly . addFrames = function ( gd , frameList , indices ) {
27432764 gd = getGraphDiv ( gd ) ;
@@ -2815,7 +2836,10 @@ Plotly.addFrames = function(gd, frameList, indices) {
28152836} ;
28162837
28172838/**
2818- * Delete keyframes
2839+ * Delete frame
2840+ *
2841+ * @param {string id or DOM element } gd
2842+ * the id or DOM element of the graph container div
28192843 *
28202844 * @param {array of integers } frameList
28212845 * list of integer indices of frames to be deleted
0 commit comments