Skip to content

Commit 2bf7aa8

Browse files
authored
Merge pull request #1338 from ropensci/v1.41.0
plotly.js v1.41.3
2 parents 417a404 + 71b5e95 commit 2bf7aa8

File tree

7 files changed

+22
-7
lines changed

7 files changed

+22
-7
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
## IMPROVEMENTS
99

10-
* Upgraded to plotly.js v1.40.1.
10+
* Upgraded to plotly.js v1.41.3.
1111
* The `orca()` function now supports conversion of much larger figures (#1322) and works without a mapbox api token (#1314).
1212

1313
## BUG FIXES

R/plotly.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ typedArrayPolyfill <- function() {
446446
plotlyMainBundle <- function() {
447447
htmltools::htmlDependency(
448448
"plotly-main",
449-
version = "1.40.1",
449+
version = "1.41.3",
450450
src = depPath("plotlyjs"),
451451
script = "plotly-latest.min.js",
452452
all_files = FALSE

R/sysdata.rda

1.91 KB
Binary file not shown.

R/utils.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,13 @@ verify_key_type <- function(p) {
723723
for (i in seq_along(keys)) {
724724
k <- keys[[i]]
725725
if (is.null(k)) next
726+
if ("select" %in% p$x$layout$clickmode && "plotly_click" %in% p$x$highlight$on) {
727+
warning(
728+
"`layout.clickmode` = 'select' is not designed to work well with ",
729+
"the R package's linking framework (i.e. crosstalk support).",
730+
call. = FALSE
731+
)
732+
}
726733
# does it *ever* make sense to have a missing key value?
727734
uk <- uniq(k)
728735
if (length(uk) == 1) {

inst/htmlwidgets/lib/plotlyjs/locales/cy.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-animate-highlight.R

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
context("highlighting and animation")
22

33
m <- crosstalk::SharedData$new(mtcars, ~vs)
4+
p <- plot_ly(m, x = ~wt, y = ~mpg) %>% add_markers()
45

56
test_that("SharedData produces key/set in plot_ly", {
6-
m <- crosstalk::SharedData$new(mtcars, ~vs)
7-
p <- plot_ly(m, x = ~wt, y = ~mpg) %>% add_markers()
87
tr <- plotly_build(p)$x$data[[1]]
9-
108
expect_true(all(tr$key == m$key()))
119
expect_identical(tr$set, m$groupName())
1210
expect_false(tr$`_isNestedKey` %||% FALSE)
1311
expect_false(tr$`_isSimpleKey` %||% FALSE)
1412
})
1513

14+
test_that("Warning is thrown when clickmode='select' is used with crosstalk", {
15+
expect_warning(
16+
plotly_build(layout(p, clickmode = "select")),
17+
"not designed to work well"
18+
)
19+
})
20+
1621
test_that("SharedData produces key/set in ggplotly", {
1722
p <- ggplot(m, aes(x = wt, y = mpg)) + geom_point()
1823
tr <- plotly_build(p)$x$data[[1]]
@@ -24,6 +29,8 @@ test_that("SharedData produces key/set in ggplotly", {
2429
expect_false(tr$`_isSimpleKey` %||% FALSE)
2530
})
2631

32+
33+
2734
test_that("crosstalk keys are inherited in a layer with inherit = FALSE", {
2835

2936
p <- txhousing %>%

0 commit comments

Comments
 (0)