diff --git a/DESCRIPTION b/DESCRIPTION index c44e822b8b..62c4b89228 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: plotly Title: Create Interactive Web Graphics via 'plotly.js' -Version: 3.4.4 +Version: 3.4.5 Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"), email = "cpsievert1@gmail.com"), person("Chris", "Parmer", role = c("aut", "cph"), diff --git a/NEWS b/NEWS index 22f4b857c8..40dc7e02d3 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +3.4.5 -- 17 Mar 2016 + +BUGFIX: + +Fixed #514. + 3.4.4 -- 17 Mar 2016 BUGFIX: diff --git a/R/utils.R b/R/utils.R index 3114b6b1c0..82c8ad4737 100644 --- a/R/utils.R +++ b/R/utils.R @@ -138,6 +138,11 @@ add_boxed <- function(x) { x$data[[i]]$error_x$arrayminus <- i(d$error_x$arrayminus) x$data[[i]]$error_y$arrayminus <- i(d$error_y$arrayminus) } + axes <- grep("^[x-y]axis", names(x$layout)) + for (ax in axes) { + x$layout[[ax]]$ticktext <- i(x$layout[[ax]]$ticktext) + x$layout[[ax]]$tickvals <- i(x$layout[[ax]]$tickvals) + } x } diff --git a/tests/testthat/test-ggplot-point.R b/tests/testthat/test-ggplot-point.R index 1384e81ca9..f283983152 100644 --- a/tests/testthat/test-ggplot-point.R +++ b/tests/testthat/test-ggplot-point.R @@ -43,3 +43,12 @@ test_that("can plot on sub-second time scale", { info <- save_outputs(g, "point-size-alpha2") expect_equivalent(info$data[[1]]$x, as.numeric(d$x)) }) + + +test_that("tickvals/ticktext are appropriately boxed", { + d <- data.frame(x = factor(75), y = 10) + p <- qplot(x, y, data = d) + info <- save_outputs(p, "point-box") + expect_true(plotly::to_JSON(info$layout$xaxis$tickvals) == '[1]') + expect_true(plotly::to_JSON(info$layout$xaxis$ticktext) == '["75"]') +})