Skip to content

Commit 997afea

Browse files
committed
Merge pull request #518 from ropensci/fix/singleTick
Fix/single tick
2 parents 346d964 + 6f129fe commit 997afea

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: plotly
22
Title: Create Interactive Web Graphics via 'plotly.js'
3-
Version: 3.4.4
3+
Version: 3.4.5
44
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
55
email = "cpsievert1@gmail.com"),
66
person("Chris", "Parmer", role = c("aut", "cph"),

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
3.4.5 -- 17 Mar 2016
2+
3+
BUGFIX:
4+
5+
Fixed #514.
6+
17
3.4.4 -- 17 Mar 2016
28

39
BUGFIX:

R/utils.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ add_boxed <- function(x) {
138138
x$data[[i]]$error_x$arrayminus <- i(d$error_x$arrayminus)
139139
x$data[[i]]$error_y$arrayminus <- i(d$error_y$arrayminus)
140140
}
141+
axes <- grep("^[x-y]axis", names(x$layout))
142+
for (ax in axes) {
143+
x$layout[[ax]]$ticktext <- i(x$layout[[ax]]$ticktext)
144+
x$layout[[ax]]$tickvals <- i(x$layout[[ax]]$tickvals)
145+
}
141146
x
142147
}
143148

tests/testthat/test-ggplot-point.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,12 @@ test_that("can plot on sub-second time scale", {
4343
info <- save_outputs(g, "point-size-alpha2")
4444
expect_equivalent(info$data[[1]]$x, as.numeric(d$x))
4545
})
46+
47+
48+
test_that("tickvals/ticktext are appropriately boxed", {
49+
d <- data.frame(x = factor(75), y = 10)
50+
p <- qplot(x, y, data = d)
51+
info <- save_outputs(p, "point-box")
52+
expect_true(plotly::to_JSON(info$layout$xaxis$tickvals) == '[1]')
53+
expect_true(plotly::to_JSON(info$layout$xaxis$ticktext) == '["75"]')
54+
})

0 commit comments

Comments
 (0)