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 DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: plotly
Title: Create Interactive Web Graphics via Plotly's JavaScript Graphing Library
Version: 2.0.10
Version: 2.0.11
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
email = "[email protected]"),
person("Chris", "Parmer", role = c("aut", "cph"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2.0.11 -- 11 Dec 2015

Fix #250

2.0.10 -- 10 Dec 2015

Fix #225
Expand Down
2 changes: 1 addition & 1 deletion R/ggplotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ gg2list <- function(p) {
tr.attr <- tr[[must.be.equal]]
criteria[[must.be.equal]] <- isTRUE(all.equal(other.attr, tr.attr))
}
if(all(criteria)){
if(all(criteria) && tr$type != "bar"){
can.merge[[other.i]] <- TRUE
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ save_outputs <- function(gg, name) {
res <- RSassign(conn, plotly:::plotlyEnv, "plotlyEnv")
res <- RSeval(conn, "unlockBinding('plotlyEnv', asNamespace('plotly'))")
res <- RSeval(conn, "assign('plotlyEnv', plotlyEnv, pos = asNamespace('plotly'))")
pm <- RSeval(conn, "plotly::plotly_build(gg)")
pm <- RSeval(conn, "tryCatch(plotly::plotly_build(gg), error = function(e) 'plotly build error')")
# it could be that the hash didn't exist, so make sure they're different
if (plot_hash != digest::digest(pm)) {
test_dir <- file.path(this_dir, gsub("\\s+", "-", name))
Expand Down
16 changes: 16 additions & 0 deletions tests/testthat/test-ggplot-stack.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,19 @@ test_that("y value is non-cumulative in stacked bar charts", {
expect_equal(L$data[[2]]$y[2], instructors$number[5])
expect_equal(L$data[[3]]$y[2], instructors$number[6])
})

testd <- data.frame(
group1 = rep(1:3, each = 3),
group2 = LETTERS[1:3],
# We have two 0.2 within each group.
count = c(0.2, 0.2, 0.6)
)

test_that("can stack identical traces", {
p1 <- ggplot(testd, aes(x = factor(group1), y = count,
fill = factor(group2))) +
geom_bar(stat = 'identity', width = 1, position = "stack")
L <- save_outputs(p1, "stack-identical")
expect_equal(length(L$data), 3)
})