-
Notifications
You must be signed in to change notification settings - Fork 633
Initial support for linked views and animation #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 18 commits
Commits
Show all changes
284 commits
Select commit
Hold shift + click to select a range
6b1b157
rename joe's example
cpsievert 49cd006
place new traces _under_ existing traces to help avoid hover conflicts
cpsievert 70c1429
remove experimental setTimeout; remove code duplication
cpsievert 14fc7ca
set dragmode to lasso only when selecting on plotly_select events
cpsievert 4c84dd3
remove old code
cpsievert a837e2c
Specify crosstalk options with a pure function; rather than an argument
cpsievert 1c5ef7e
small edit
cpsievert 9e51645
merge conflicts
cpsievert 4790c57
change example to reflect new categoryorder behavoir
cpsievert b85a2f1
Merge branch 'master' of github.com:ropensci/plotly into joe/feature/…
cpsievert 20d29ca
dplyr::mutate_ clobbers attributes
cpsievert 57fe000
ensure default colors are preserved
cpsievert b0f980e
Use @daattali's colourpicker and onRender() to set crosstalk selectio…
cpsievert 5831856
Use @daattali's colourpicker and onRender() to set crosstalk selectio…
cpsievert 7a1e023
Merge branch 'joe/feature/crosstalk' of https://github.com/jcheng5/pl…
cpsievert 2aff534
updated examples:
cpsievert 243bb1c
fallback on existing color if selectionColour variable is undefined
cpsievert 0e1245a
only dim original traces
cpsievert 00a5e55
delete traces on clear
cpsievert 45451ce
No need to ungroup
cpsievert 8572406
whoops
cpsievert 7601972
add some commentary to the first crosstalk example
cpsievert 4bb98ee
more sensible crosstalk defaults
cpsievert c54d7f4
prevent autosize default on doubleClick in ggplotly
cpsievert 37109c3
bring back support for event_data()
cpsievert be4447f
fix removeBrush() scoping; fallback on first crosstalk color if no se…
cpsievert 8e597cb
make sure color is always passed as an array
cpsievert 329ff5e
small edits to examples
cpsievert 0350def
small example edits
cpsievert 6932723
Supply trace color default so alpha can be applied. Fixes #658.
cpsievert 841652f
merge conflicts
cpsievert 7811aa0
Merge branch 'master' of github.com:ropensci/plotly into joe/feature/…
cpsievert 45fbdc9
add colourpicker to DESCRIPTION
cpsievert bf05db4
Add gather/gather_ methods; provide a reexports doc page
cpsievert 71cf8a0
add ability to set selections from command line
cpsievert 9951788
need a built plot in crosstalk to access key values
cpsievert dbb3fde
Merge branch 'master' of github.com:ropensci/plotly into joe/feature/…
cpsievert ddb4905
Merge branch 'master' of github.com:ropensci/plotly into joe/feature/…
cpsievert b12ed64
Inform the world about custom crosstalk selection options; selectionC…
cpsievert 102a81a
fix remote
cpsievert 068b76e
Merge branch 'master' of github.com:ropensci/plotly into joe/feature/…
cpsievert 80fe6eb
handle null/undefined color on JS side
cpsievert 84d9946
avoid clashing with relayout event
cpsievert 39d0886
merge conflicts; better logic for showing legend
cpsievert 8af9dfa
test fixes
cpsievert dc5a748
merge conflict
cpsievert 17f4621
make sure ggplotly picks up last plot
cpsievert 20d68bd
document
cpsievert 7aa99fa
Merge branch 'master' of github.com:ropensci/plotly into joe/feature/…
cpsievert 273e026
make sure color is an array
cpsievert 4301eb3
merge conflicts
cpsievert 1eb531a
ensure new selections are plotted on top of old ones
cpsievert bc30031
fix for add_bars() and example
cpsievert 954d726
The context for . should be the data, not the plot
cpsievert 16a4edf
crosstalk() -> highlight()
cpsievert 0b5b3eb
further disambiguate highlight from crosstalk
cpsievert b1ffc56
rename file; document
cpsievert da2eb4a
upgrade to plotly.js v1.17.0
cpsievert 95a09cf
merge conflicts
cpsievert b4e7f1e
fix naming of highlight plot element
cpsievert 8e50c91
merge conflicts
cpsievert eca9af5
key should be considered for 'builtData'
cpsievert 9db0f4d
fix example
cpsievert 4468487
be more careful about removing traces
cpsievert e9e6979
example fixes/improvements
cpsievert 66c3d56
merge conflicts
cpsievert 4db5d69
better subplot examples
cpsievert 042761b
merge conflicts
cpsievert 5118260
Merge branch 'master' of github.com:ropensci/plotly into joe/feature/…
cpsievert 378859f
Merge branch 'master' of github.com:ropensci/plotly into joe/feature/…
cpsievert aa8cf95
Merge branch 'master' into joe/feature/crosstalk
cpsievert c64414d
fix breaking changes brought about by ggproto facets
cpsievert a4666bf
develop against dev version of ggplot2
cpsievert d23e364
merge highlight options in subplot
cpsievert 752c5ae
adding key to the mapping effectively adds the key to group, which is…
cpsievert 04f9ed9
include key in data training
cpsievert c977252
attach tooltip to plot, not p
cpsievert 6149637
ignore data arrays of non-tidy traces. Fixes #737
cpsievert 282c4ed
More careful handling of font when expanding annotation arrays. Fixes…
cpsievert b02d26c
remove offset hack
cpsievert 213d254
merge conflicts
cpsievert ea1fcf1
add crosstalk key to mapping at the _layer_ level
cpsievert b5c2d78
open a bitmap device instead of push/popping viewports
cpsievert 8d74fc0
fix highlight merging
cpsievert f655399
merge conflicts
cpsievert f602ffc
update to plotly.js v1.17.3
cpsievert 22503a3
a very basic animate() function
cpsievert 4c95657
merge conflicts
cpsievert 107e533
merge conflicts
cpsievert fab2db5
oops
cpsievert 4a5a1ec
Merge branch 'master' into joe/feature/crosstalk
cpsievert c5f8c29
Merge branch 'master' into joe/feature/crosstalk
cpsievert 6b2d045
Merge branch 'master' into joe/feature/crosstalk
cpsievert 0bc9809
support new timezone argument, fixes #743
cpsievert 7a46964
Merge branch 'master' into joe/feature/crosstalk
cpsievert 146dfd5
Merge branch 'master' into feature/animate
cpsievert b7b2d56
simplify config()
cpsievert 0ce91ec
control animations via modebar
cpsievert d5b8d2e
first sketch of animation in subplots
cpsievert d192258
remove animate(); implement frame argument
cpsievert f27d615
don't run gapminder
cpsievert 95662bb
missing argument
cpsievert a4b8a10
Merge branch 'master' into joe/feature/crosstalk
cpsievert c0ddca1
sketch idea for run_examples
cpsievert 2d656cf
use traces attr to target specific traces in an animation
cpsievert fc54830
better logic for determining frame targets; better example
cpsievert ae47a1f
Add collaborate/cloud args to config for easy adding/removing
cpsievert c460aa0
conflict
cpsievert db42b89
try harder to find bitmap device and throw warning if none is found
cpsievert d990902
Merge branch 'master' of github.com:ropensci/plotly into joe/feature/…
cpsievert a125979
oops
cpsievert 63ed1ad
better ggally example
cpsievert 911ddb7
Merge branch 'master' into joe/feature/crosstalk
cpsievert 0c34084
implement selectize argument
cpsievert a35a23e
enable persistent selection via selectize; simplify implementation
cpsievert 978c0a3
put selectize before plot
cpsievert 30eb711
enable autocomplete; namespace
cpsievert b90ef21
close after adding an item
cpsievert fd57b12
not clearing vis mapping is bad idea
cpsievert 7064e9c
Merge branch 'master' into joe/feature/crosstalk
cpsievert cbe9b52
merge conflicts
cpsievert 68e5076
get animationOpts() supplying options properly
cpsievert fb635eb
supply config attributes _before_ adding/removing special buttons
cpsievert de2eda6
Merge branch 'master' into feature/animate
cpsievert a6caca1
Merge branch 'master' into joe/feature/crosstalk
cpsievert 9d96154
use moview button for a plot button
cpsievert cec131a
upgrade to plotly.js v1.18.0
cpsievert a5d8326
Use updatemenus for play/pause; add slider by default
cpsievert de91b3b
box up frame[0].traces
cpsievert e28a653
supply ani options to play button; format slider labels
cpsievert ce184c8
translate ids aethestic; add example; better padding
cpsievert f4a20f4
epl example
cpsievert 259b79f
don't call selectize if it isn't needed
cpsievert 7bb1516
merge with animate branch
cpsievert 811fa42
Add a layout method for shiny.tag.list objects
cpsievert 7701dbb
merge conflicts
cpsievert 7888287
merge conflicts
cpsievert 411ed06
oops
cpsievert 56d335a
retrain trace colors with non-animated traces
cpsievert fe642c8
more readable
cpsievert 0d0b138
better example
cpsievert 84bb474
compact all the things
cpsievert 2319137
store all ggplot2 layer info in attrs/visdat; only eval unevaluated a…
cpsievert 7bde621
merge conflicts
cpsievert cab0d01
Merge branch 'feature/animate' into joe/feature/crosstalk
cpsievert c535787
consistent arguments
cpsievert f9f77b3
tour examples
cpsievert ad462eb
ensure trace anchors have a proper default
cpsievert 8c2efe5
30 frames per second
cpsievert 7d51542
merge conflicts
cpsievert 2036ace
use options() when setting plotlyCrosstalkOpts since it's global
cpsievert 68d8153
x.highlight should always exist, with defaults
cpsievert 5e94ae1
document
cpsievert dce5a28
go back to plotting selection traces on top of original
cpsievert 2a3b093
make crosstalk examples demos
cpsievert 51d7893
get rid of redundant app
cpsievert 9906796
move animation examples to demo
cpsievert bd1c8ad
ensure x.highlight.color is not undefined
cpsievert 15277b7
improve example
cpsievert fb3bf56
upgrade to plotlyjs v1.8.1
cpsievert db0e20b
update frames when updating selection
cpsievert 6864492
support selections deriving from arbitary frames
cpsievert 8cf8c4b
highlight arg should be for selected traces; tidy up code
cpsievert 5a09d90
Merge branch 'master' into joe/feature/crosstalk
cpsievert 45966af
dimming logic should be at the trace level
cpsievert 866ed97
have hoverinfo inherit by default
cpsievert 2feeb9a
try modifying frames as a callback
cpsievert c512c15
Revert "try modifying frames as a callback"
cpsievert a78da1f
add to trace target only when necessary
cpsievert 685dc6a
retain the indices of new traces for proper frame targeting/coloring
cpsievert ad8ffff
decrease padding
cpsievert db32f3c
remove unnecessary crosstalkGroups variable
cpsievert c18d3bf
text should reflect selected value, too
cpsievert f829776
support nested keys
cpsievert 5ed45b9
first version of plot_dendro()
cpsievert 08fd6b1
nulls should be a match, too
cpsievert 618fcdd
upgrade to plotlyjs v1.19.1
cpsievert daedf6a
pass ... to subplot()
cpsievert a538229
always use findNestedMatches (for now)
cpsievert 1ac5857
ensure animation frame names are strings
cpsievert 7d57afe
ensure play button respects currentvalue of slider
cpsievert 719a501
plot_dendro doesn't have to be a subplot
cpsievert c8b4d27
can't group by a list-column
cpsievert 3616e70
more consistent naming
cpsievert 350f1e1
set global axis range if necessary in registerFrames(); remove frames…
cpsievert c124677
add xmin arg to dendro
cpsievert 94a3355
frameDuration must be larger than transitionDuration
cpsievert a479378
Merge branch 'master' into joe/feature/crosstalk
cpsievert 958b2c2
frame updating logic seems correct (and faster) now
cpsievert ffb5afe
shorter argument names
cpsievert a229c7c
more correct ordering of frames and formatting of their names
cpsievert 8deea39
supply animation options to slider
cpsievert b6b4844
show number of members in dendrogram
cpsievert ba9f840
don't remove vis mapping attrs
cpsievert f73f078
more fixes for registerFrames
cpsievert 80270b2
retain mapping attrs in subplot
cpsievert 5f1a1f8
fix yanchor of legend title
cpsievert aa71b3a
gather all _unique_ sets...this should significantly updating perform…
cpsievert fcb0b2f
better marker/line/textfont attr inheritance logic
cpsievert d24da07
im pretty confident frame updating is correct now
cpsievert 9f67b18
autosize should default to true and specified height/width should ove…
cpsievert 58be2e2
use new plot signature awesomeness
cpsievert 37a1463
new demo
cpsievert b8498b7
Merge branch 'master' into joe/feature/crosstalk
cpsievert 9bcc1d7
remove redundant demo
cpsievert 622eb39
officially add demos
cpsievert 44779f4
fix yanchor on xaxis titles
cpsievert 9aa81dc
move play button next to slider; remove pause
cpsievert e16868e
fix indexing bug
cpsievert 6d10b16
fix indexing
cpsievert 94f5133
put a map on it
cpsievert 6afc2cc
require htmlwidgets patch
cpsievert 313e19a
fix shiny/ct example
cpsievert 5be46f4
add crosstalk key aes mapping only when identity stat is used
cpsievert 700ddcb
improve dimming logic
cpsievert 493a9bb
pretty sure frame updating is finally correct
cpsievert 27e1cbb
upgrade to plotlyjs v1.19.2
cpsievert 72090f9
document
cpsievert f631f3d
first stab at a dotplot
cpsievert f240cfd
merge conflicts
cpsievert 5e8a34e
add warning about pre-built plots in subplot()
cpsievert 90d7dce
implement keys nested by group
cpsievert d628080
merge conflict
cpsievert b25d7a6
Merge branch 'feature/dotplot' into joe/feature/crosstalk
cpsievert 7dd3c99
key join should respect group and PANEL
cpsievert fd3fff0
showactive false
cpsievert 78c9087
add some special handling for dotplots
cpsievert f98e3ed
try to provide a sensible key default (rownames) for ggmatrix
cpsievert 7459157
add key as a mapping when using identity stat, otherwise use nested keys
cpsievert 9370c74
always add frame to group
cpsievert ebbfec5
note to self
cpsievert 3943fe5
add transparent option to dynamic brush
cpsievert 882165a
some fixes for dotplots; more careful merging
cpsievert caf7980
I suppose key/frame/ids attr assignment should happen inside geom2tra…
cpsievert 442a4b8
must add crosstalk key as a group to preserve it summarise()
cpsievert 0f4b7a1
upgrade to plotly.js v1.20.0
cpsievert 18b4079
test fixes
cpsievert b188a70
forgot supply_defaults specifically designed for non-subplots
cpsievert 626348f
htmlwidgets and ggplot2 now on CRAN
cpsievert f79cea9
Attempt at #796
cpsievert 357da85
automagically shrink/position multiple legends/colorbars
cpsievert 14d3938
introduce a class for distinguishing defaults supplied by the package…
cpsievert 1f8cb7b
sketch out some ideas for a 'transparent color'
cpsievert 4463234
Merge branch 'master' into joe/feature/crosstalk
cpsievert 2ec5bcc
fix silly mistake
cpsievert cf9bf5f
improve animation docs and fix some R CMD check stuff
cpsievert ed8f241
use dev version; update news
cpsievert a29f44f
tour-cog is now a part of pedestrians
cpsievert 36b52ad
more stuff to make R CMD check happy
cpsievert cc74660
remove gather generic for now
cpsievert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,215 @@ | ||
#' Animation options | ||
#' | ||
#' @param p a plotly object. | ||
#' @param frameDuration The duration each frame is shown (in milliseconds). | ||
#' @param transitionDuration The duration of the transition (in milliseconds). | ||
#' @param easing The type of transition easing. See the list of options here | ||
#' \url{https://github.com/plotly/plotly.js/blob/master/src/plots/animation_attributes.js} | ||
#' @param redraw Trigger a redraw of the plot at completion of the transition? | ||
#' A redraw may significantly impact performance, but may be necessary to | ||
#' update plot attributes that can't be transitioned. | ||
#' @param mode Describes how a new animate call interacts with currently-running | ||
#' animations. If `immediate`, current animations are interrupted and | ||
#' the new animation is started. If `next`, the current frame is allowed | ||
#' to complete, after which the new animation is started. If `afterall` | ||
#' all existing frames are animated to completion before the new animation | ||
#' is started. | ||
#' @export | ||
#' @author Carson Sievert | ||
#' @seealso \code{\link{animationSlider}()}, \code{\link{animationButton}()} | ||
#' @examples | ||
#' | ||
#' | ||
#' #' # map a | ||
#' df <- data.frame( | ||
#' x = c(1, 2, 2, 1, 1, 2), | ||
#' y = c(1, 2, 2, 1, 1, 2), | ||
#' z = c(1, 1, 2, 2, 3, 3) | ||
#' ) | ||
#' plot_ly(df) %>% | ||
#' add_markers(x = 1.5, y = 1.5) %>% | ||
#' add_markers(x = ~x, y = ~y, frame = ~z) | ||
#' | ||
#' # works in subplots | ||
#' subplot( | ||
#' plot_ly(df, x = ~x, y = ~y, frame = ~z), | ||
#' plot_ly(df, x = ~x, y = ~y, frame = ~z) | ||
#' ) | ||
#' | ||
#' # set the range in plot_ly() | ||
#' plot_ly(mtcars, x = ~wt, y = ~mpg, frame = ~cyl) %>% | ||
#' layout( | ||
#' xaxis = ~list(range = range(wt)), | ||
#' yaxis = ~list(range = range(mpg)) | ||
#' ) | ||
#' | ||
#' # works the same way with ggplotly | ||
#' | ||
#' \dontrun{ | ||
#' data(gapminder, package = "gapminder") | ||
#' p <- ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, | ||
#' color = continent, frame = year)) + | ||
#' geom_point() + | ||
#' scale_x_log10() | ||
#' ggplotly(p) | ||
#' | ||
#' p2 <- ggplot(gapminder, aes(gdpPercap, lifeExp)) + | ||
#' geom_point(aes(size = pop), alpha = 0.5) + | ||
#' # animations can be specified on the layer level | ||
#' geom_point(aes(size = pop, frame = year), color = "red") + | ||
#' scale_x_log10() | ||
#' ggplotly(p2) | ||
#' } | ||
#' | ||
animationOpts <- function(p, frameDuration = 500, transitionDuration = 500, | ||
easing = "cubic-in-out", redraw = FALSE, | ||
mode = "immediate") { | ||
if (frameDuration < 0) { | ||
stop("frameDuration must be non-negative.", call. = FALSE) | ||
} | ||
if (transitionDuration < 0) { | ||
stop("frameDuration must be non-negative.", call. = FALSE) | ||
} | ||
opts <- list( | ||
transition = list( | ||
duration = transitionDuration, | ||
easing = match.arg(easing, easingOpts()) | ||
), | ||
frame = list( | ||
duration = frameDuration, | ||
redraw = redraw | ||
), | ||
mode = match.arg(mode, c('immediate', 'next', 'afterall')) | ||
) | ||
|
||
# build step will ensure we can access the animation frames | ||
# (required to fill the steps in correctly) | ||
p <- plotly_build(p) | ||
|
||
# overwrite the animation options in the slider/button spec | ||
supply_ani_slider(supply_ani_button(p, opts)) | ||
} | ||
|
||
#' Hide or customize the animation button | ||
#' | ||
#' @param p a plotly object | ||
#' @param hide remove the animation slider? | ||
#' @param ... attributes passed to the sliders object which controls the animation | ||
#' slider \url{https://github.com/plotly/plotly.js/blob/master/src/components/sliders/attributes.js} | ||
#' @export | ||
#' @author Carson Sievert | ||
#' @seealso \code{\link{animationOpts}()}, \code{\link{animationButton}()} | ||
#' | ||
|
||
animationSlider <- function(p, hide = FALSE, ...) { | ||
|
||
p <- plotly_build(p) | ||
isAniSlider <- vapply(p$x$layout$slider, is_ani_slider, logical(1)) | ||
if (hide) { | ||
p$x$layout$slider[isAniSlider] <- NULL | ||
return(p) | ||
} | ||
p$x$layout$slider[[which(isAniSlider)]] <- modify_list( | ||
p$x$layout$slider[[which(isAniSlider)]], list(...) | ||
) | ||
p | ||
|
||
} | ||
|
||
#' Hide or customize the animation button | ||
#' | ||
#' @param p a plotly object | ||
#' @param ... arguments passed to the updatemenus which controls the play/pause | ||
#' button \url{https://github.com/plotly/plotly.js/blob/master/src/components/updatemenus/attributes.js} | ||
#' @export | ||
#' @author Carson Sievert | ||
#' @seealso \code{\link{animationOpts}()}, \code{\link{animationButton}()} | ||
#' | ||
|
||
animationButton <- function(p, ...) { | ||
|
||
p <- plotly_build(p) | ||
isAniButton <- vapply(p$x$layout$updatemenus, is_ani_button, logical(1)) | ||
p$x$layout$updatemenus[[which(isAniButton)]] <- modify_list( | ||
p$x$layout$updatemenus[[which(isAniButton)]], list(...) | ||
) | ||
p | ||
} | ||
|
||
|
||
# supply an animation button if it doesn't exist, | ||
# and _replace_ an existing animation button | ||
supply_ani_button <- function(p, opts = NULL) { | ||
nmenus <- length(p$x$layout$updatemenus) | ||
isAniButton <- vapply(p$x$layout$updatemenus, is_ani_button, logical(1)) | ||
idx <- if (sum(isAniButton) == 1) which(isAniButton) else nmenus + 1 | ||
p$x$layout$updatemenus[[idx]] <- create_ani_button(opts) | ||
p | ||
} | ||
|
||
create_ani_button <- function(opts) { | ||
button <- list( | ||
type = 'buttons', | ||
direction = 'right', | ||
y = 1, | ||
x = 0, | ||
yanchor = 'bottom', | ||
xanchor = 'left', | ||
pad = list(b = 10, l = 10), | ||
buttons = list(list( | ||
label = 'Play', | ||
method = 'animate', | ||
args = list(list()) | ||
), list( | ||
label = 'Pause', | ||
method = 'animate', | ||
args = list(list(), list(mode = "next")) | ||
)) | ||
) | ||
structure(button, class = "aniButton") | ||
} | ||
|
||
is_ani_button <- function(obj) { | ||
class(obj) %in% "aniButton" | ||
} | ||
|
||
# supply an animation slider if it doesn't exist, | ||
# and _replace_ an existing animation slider | ||
supply_ani_slider <- function(p, opts = NULL, ...) { | ||
nsliders <- length(p$x$layout$sliders) | ||
isAniSlider <- vapply(p$x$layout$sliders, is_ani_slider, logical(1)) | ||
idx <- if (sum(isAniSlider) == 1) which(isAniSlider) else nsliders + 1 | ||
p$x$layout$sliders[[idx]] <- create_ani_slider(p$x$frames, opts, ...) | ||
p | ||
} | ||
|
||
create_ani_slider <- function(frames, opts = NULL, ...) { | ||
steps <- lapply(frames, function(f) { | ||
nm <- as.character(f[["name"]]) | ||
args <- list(list(nm)) | ||
args[[2]] <- opts | ||
list(method = "animate", args = args, label = nm) | ||
}) | ||
|
||
slider <- list(...) | ||
slider$visible <- TRUE | ||
slider$steps <- slider[["steps"]] %||% steps | ||
slider$pad$t <- slider$pad[["t"]] %||% 40 | ||
structure(slider, class = "aniSlider") | ||
} | ||
|
||
is_ani_slider <- function(obj) { | ||
class(obj) %in% "aniSlider" | ||
} | ||
|
||
|
||
|
||
easingOpts <- function() { | ||
c('linear', 'quad', 'cubic', 'sin', 'exp', 'circle', 'elastic', 'back', | ||
'bounce', 'linear-in', 'quad-in', 'cubic-in', 'sin-in', 'exp-in', | ||
'circle-in', 'elastic-in', 'back-in', 'bounce-in', 'linear-out', | ||
'quad-out', 'cubic-out', 'sin-out', 'exp-out', 'circle-out', 'elastic-out', | ||
'back-out', 'bounce-out', 'linear-in-out', 'quad-in-out', 'cubic-in-out', | ||
'sin-in-out', 'exp-in-out', 'circle-in-out', 'elastic-in-out', | ||
'back-in-out', 'bounce-in-out') | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pause button does not work for deep historical reasons in plotly.js. See: plotly/plotly.js#1125
To elaborate, empty lists are interpreted as commands to delete items from an object or array, so that the empty list is filtered and replaced with
undefined
. A workaround is to use[[null], {mode: 'next'}]
(I believe undefined works also). Contingent upon plotly/plotly.js#1121, plotly.js will ignore nulls so that the result will be the same.