Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## IMPROVEMENTS

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

## BUG FIXES
Expand Down
2 changes: 1 addition & 1 deletion R/plotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ typedArrayPolyfill <- function() {
plotlyMainBundle <- function() {
htmltools::htmlDependency(
"plotly-main",
version = "1.40.1",
version = "1.41.3",
src = depPath("plotlyjs"),
script = "plotly-latest.min.js",
all_files = FALSE
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
7 changes: 7 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,13 @@ verify_key_type <- function(p) {
for (i in seq_along(keys)) {
k <- keys[[i]]
if (is.null(k)) next
if ("select" %in% p$x$layout$clickmode && "plotly_click" %in% p$x$highlight$on) {
warning(
"`layout.clickmode` = 'select' is not designed to work well with ",
"the R package's linking framework (i.e. crosstalk support).",
call. = FALSE
)
}
# does it *ever* make sense to have a missing key value?
uk <- uniq(k)
if (length(uk) == 1) {
Expand Down
1 change: 1 addition & 0 deletions inst/htmlwidgets/lib/plotlyjs/locales/cy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions tests/testthat/test-animate-highlight.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
context("highlighting and animation")

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

test_that("SharedData produces key/set in plot_ly", {
m <- crosstalk::SharedData$new(mtcars, ~vs)
p <- plot_ly(m, x = ~wt, y = ~mpg) %>% add_markers()
tr <- plotly_build(p)$x$data[[1]]

expect_true(all(tr$key == m$key()))
expect_identical(tr$set, m$groupName())
expect_false(tr$`_isNestedKey` %||% FALSE)
expect_false(tr$`_isSimpleKey` %||% FALSE)
})

test_that("Warning is thrown when clickmode='select' is used with crosstalk", {
expect_warning(
plotly_build(layout(p, clickmode = "select")),
"not designed to work well"
)
})

test_that("SharedData produces key/set in ggplotly", {
p <- ggplot(m, aes(x = wt, y = mpg)) + geom_point()
tr <- plotly_build(p)$x$data[[1]]
Expand All @@ -24,6 +29,8 @@ test_that("SharedData produces key/set in ggplotly", {
expect_false(tr$`_isSimpleKey` %||% FALSE)
})



test_that("crosstalk keys are inherited in a layer with inherit = FALSE", {

p <- txhousing %>%
Expand Down