Skip to content

Commit c47df47

Browse files
committed
Merge pull request #129 from ropensci/marianne-fix-bar-null
Fix bar chart conversion for position="dodge" (barmode="group" in Plotly)
2 parents 51a2b91 + 42e0cb5 commit c47df47

File tree

132 files changed

+34
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+34
-7
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: plotly
22
Type: Package
33
Title: Interactive, publication-quality graphs online.
4-
Version: 0.5.2
4+
Version: 0.5.3
55
Authors@R: c(person("Chris", "Parmer", role = c("aut", "cre"),
66
email = "[email protected]"),
77
person("Scott", "Chamberlain", role = "aut",

NEWS

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
0.5.3 -- 21 October 2014.
2+
3+
Support conversion of geom_bar() with position_dodge().
4+
5+
0.5.2 -- 18 October 2014.
6+
7+
Support aesthetic shape in geom_path() and, hence, geom_line() (conversion).
8+
9+
0.5.1 -- 15 October 2014.
10+
11+
Do not show zero lines by default (as in ggplot2 plots).
12+
13+
0.5.0 -- 15 October 2014.
14+
15+
From now on, version numbers are meaningful again...
16+
Many changes meanwhile, especially support for more geoms.
17+
118
0.4 -- 7 April 2014.
219

320
Re-write geom to trace conversion code.
@@ -22,4 +39,4 @@ For ggplotly:
2239

2340
Merge ggplotly code.
2441

25-
0.3.5
42+
0.3.5

R/trace_generation.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ layer2traces <- function(l, d, misc) {
178178
}
179179
}
180180
name.names <- grep("[.]name$", names(data.params$params), value=TRUE)
181-
if(length(name.names)){
181+
if (length(name.names)) {
182182
for(a.name in name.names){
183183
a <- sub("[.]name$", "", a.name)
184184
a.value <- as.character(data.params$params[[a.name]])
@@ -189,6 +189,8 @@ layer2traces <- function(l, d, misc) {
189189
}
190190
name.list <- data.params$params[name.names]
191191
tr$name <- paste(unlist(name.list), collapse=".")
192+
if (length(unique(name.list)) < 2)
193+
tr$name <- as.character(name.list[[1]])
192194
}
193195

194196
dpd <- data.params$data
@@ -268,6 +270,8 @@ toBasic <- list(
268270
g
269271
},
270272
bar=function(g) {
273+
if (any(is.na(g$prestats.data$x)))
274+
g$prestats.data$x <- g$prestats.data$x.name
271275
g$prestats.data$fill <- g$data$fill[match(g$prestats.data$group, g$data$group)]
272276
g$params$xstart <- min(g$data$xmin)
273277
g$params$xend <- max(g$data$xmax)

run_tests_with_outputs.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ save_outputs <- function(gg, name, ignore_ggplot=FALSE) {
1414
if (!ignore_ggplot) {
1515
ggsave(paste0("test-ggplot-", name, "-ggplot2.png"), plot=gg, w=7, h=5)
1616
}
17-
18-
# save the json
19-
writeLines(getURL(paste0(plotlyUrl, ".json")), paste0("test-ggplot-", name, ".json"))
17+
18+
# Save the json
19+
writeLines(getURL(paste0(plotlyUrl, ".json")), paste0("test-ggplot-", name,
20+
".json"))
2021
}
2122

2223
test_check("plotly")

tests/testthat.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
library(testthat)
22
save_outputs <- function(gg, name, ignore_ggplot=FALSE) {
3-
print(paste("running", name))
3+
print(paste("running", name))
44
}
55
test_check("plotly")
-107 KB
Binary file not shown.
-21.5 KB
Binary file not shown.
-86.2 KB
Binary file not shown.
-21.7 KB
Binary file not shown.
-87 KB
Binary file not shown.

0 commit comments

Comments
 (0)