Skip to content

Commit 9abcba9

Browse files
remove frameOrder warning (#1927)
* remove frameOrder warning * use expect_warning * fix bunch of tests warnings * update expected shinytest (jquery and crosstalk versions) * Apply suggestions from code review Co-authored-by: Carson Sievert <[email protected]> Co-authored-by: Carson Sievert <[email protected]>
1 parent 8201019 commit 9abcba9

22 files changed

+142
-69
lines changed

R/plotly_build.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,10 @@ registerFrames <- function(p, frameMapping = NULL) {
425425
# remove frames from the trace names
426426
for (i in seq_along(p$x$data)) {
427427
tr <- p$x$data[[i]]
428-
if (length(tr[["name"]]) != 1) next
428+
if (length(tr[["name"]]) != 1) {
429+
p$x$data[[i]]$frameOrder <- NULL
430+
next
431+
}
429432
nms <- strsplit(as.character(tr[["name"]]), br())[[1]]
430433
idx <- setdiff(seq_along(nms), tr$frameOrder %||% 0)
431434
p$x$data[[i]]$name <- if (length(idx)) paste(nms[idx], collapse = br()) else NULL

inst/examples/shiny/event_data/tests/shinytest/mytest-expected/001.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@
413413
},
414414
{
415415
"name": "jquery",
416-
"version": "1.11.3",
416+
"version": "3.5.1",
417417
"src": {
418-
"href": "jquery-1.11.3"
418+
"href": "jquery-3.5.1"
419419
},
420420
"meta": null,
421421
"script": "jquery.min.js",
@@ -426,9 +426,9 @@
426426
},
427427
{
428428
"name": "crosstalk",
429-
"version": "1.1.0.1",
429+
"version": "1.1.1",
430430
"src": {
431-
"href": "crosstalk-1.1.0.1"
431+
"href": "crosstalk-1.1.1"
432432
},
433433
"meta": null,
434434
"script": "js/crosstalk.min.js",
Loading

inst/examples/shiny/event_data/tests/shinytest/mytest-expected/002.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,9 @@
430430
},
431431
{
432432
"name": "jquery",
433-
"version": "1.11.3",
433+
"version": "3.5.1",
434434
"src": {
435-
"href": "jquery-1.11.3"
435+
"href": "jquery-3.5.1"
436436
},
437437
"meta": null,
438438
"script": "jquery.min.js",
@@ -443,9 +443,9 @@
443443
},
444444
{
445445
"name": "crosstalk",
446-
"version": "1.1.0.1",
446+
"version": "1.1.1",
447447
"src": {
448-
"href": "crosstalk-1.1.0.1"
448+
"href": "crosstalk-1.1.1"
449449
},
450450
"meta": null,
451451
"script": "js/crosstalk.min.js",
Loading

inst/examples/shiny/event_data/tests/shinytest/mytest-expected/003.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@
434434
},
435435
{
436436
"name": "jquery",
437-
"version": "1.11.3",
437+
"version": "3.5.1",
438438
"src": {
439-
"href": "jquery-1.11.3"
439+
"href": "jquery-3.5.1"
440440
},
441441
"meta": null,
442442
"script": "jquery.min.js",
@@ -447,9 +447,9 @@
447447
},
448448
{
449449
"name": "crosstalk",
450-
"version": "1.1.0.1",
450+
"version": "1.1.1",
451451
"src": {
452-
"href": "crosstalk-1.1.0.1"
452+
"href": "crosstalk-1.1.1"
453453
},
454454
"meta": null,
455455
"script": "js/crosstalk.min.js",
Loading

inst/examples/shiny/event_data/tests/shinytest/mytest-expected/004.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@
435435
},
436436
{
437437
"name": "jquery",
438-
"version": "1.11.3",
438+
"version": "3.5.1",
439439
"src": {
440-
"href": "jquery-1.11.3"
440+
"href": "jquery-3.5.1"
441441
},
442442
"meta": null,
443443
"script": "jquery.min.js",
@@ -448,9 +448,9 @@
448448
},
449449
{
450450
"name": "crosstalk",
451-
"version": "1.1.0.1",
451+
"version": "1.1.1",
452452
"src": {
453-
"href": "crosstalk-1.1.0.1"
453+
"href": "crosstalk-1.1.1"
454454
},
455455
"meta": null,
456456
"script": "js/crosstalk.min.js",
Loading

tests/testthat/test-animate-highlight.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,8 @@ test_that("simple animation targeting works", {
359359

360360
test_that("animation frames are boxed up correctly", {
361361
dallas <- subset(txhousing, city == "Dallas" & month == 1)
362-
p <- ggplot(dallas) +
363-
geom_point(aes(x = volume, y = sales, frame = year))
362+
p <- ggplot(dallas, aes(x = volume, y = sales, frame = year)) +
363+
geom_point()
364364
l <- plotly_build(p)$x
365365

366366
for (i in seq_along(l$frames)) {

0 commit comments

Comments
 (0)