Skip to content

Commit b6f4d57

Browse files
committed
Merge branch 'master' of https://github.com/ropensci/plotly into carson-cookbook-density
2 parents 16df17c + c0fb0cf commit b6f4d57

File tree

7 files changed

+18
-14
lines changed

7 files changed

+18
-14
lines changed

DESCRIPTION

+1-1
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.6.1
4+
Version: 0.6.2
55
Authors@R: c(person("Chris", "Parmer", role = c("aut", "cre"),
66
email = "[email protected]"),
77
person("Scott", "Chamberlain", role = "aut",

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.6.2 -- 19 May 2015
2+
3+
In geom_bar(stat = "identity"), sum y values if multiple for a given x.
4+
15
0.6.1 -- 5 May 2015
26

37
Add test-cookbook-lines.R and fix bugs that showed up in those tests.

R/plotly-package.r

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#' \itemize{
88
#' \item Package: plotly
99
#' \item Type: Package
10-
#' \item Version: 0.6.1
10+
#' \item Version: 0.6.2
1111
#' \item Date: 2014-03-07
1212
#' \item License: MIT
1313
#' }

R/plotly.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ For more help, see https://plot.ly/R or contact <[email protected]>.")
8282

8383
# public attributes/methods that the user has access to
8484
pub <- list(username=username, key=key, filename="from api", fileopt=NULL,
85-
version="0.6.1")
85+
version="0.6.2")
8686
priv <- list()
8787

8888
pub$makecall <- function(args, kwargs, origin) {

R/trace_generation.R

+10-8
Original file line numberDiff line numberDiff line change
@@ -584,18 +584,20 @@ geom2trace <- list(
584584
# Convert days into milliseconds
585585
x <- as.numeric(x) * 24 * 60 * 60 * 1000
586586
}
587-
# if there is more than one y-value for a particular combination of
587+
# if there is more than one y-value for a particular combination of
588588
# x, PANEL, and group; then take the _max_ y.
589589
data$x <- x
590-
dat <- plyr::ddply(data, c("x", "PANEL", if("group"%in%names(data))"group"),
590+
dat <- plyr::ddply(data, c("x", "PANEL", if ("group" %in% names(data)) "group"),
591591
plyr::summarise, count = max(y))
592-
L <- list(x=dat$x,
593-
y=dat$count,
594-
type="bar",
595-
name=params$name,
596-
marker=list(color=toRGB(params$fill)))
592+
L <- list(x = dat$x,
593+
y = dat$count,
594+
type = "bar",
595+
# text only makes sense if no dimension reduction occurred
596+
text = if (nrow(dat) == nrow(data)) data$text else NULL,
597+
name = params$name,
598+
marker = list(color = toRGB(params$fill)))
597599
if (!is.null(params$colour)) {
598-
L$marker$line <- list(color=toRGB(params$colour))
600+
L$marker$line <- list(color = toRGB(params$colour))
599601
L$marker$line$width <- if (is.null(params$size)) 1 else params$size
600602
}
601603
if (!is.null(params$alpha)) L$opacity <- params$alpha

man/plotly-package.Rd

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ An example of an interactive graph made from the R API: https://plot.ly/~chris/4
1515
\itemize{
1616
\item Package: plotly
1717
\item Type: Package
18-
\item Version: 0.6.1
18+
\item Version: 0.6.2
1919
\item Date: 2014-03-07
2020
\item License: MIT
2121
}

tests/testthat/test-ggplot-bar.R

-2
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,3 @@ test_that("For a given x value, if multiple y exist, sum them. ", {
202202
y <- y[info$traces[[1]]$x]
203203
expect_equal(info$traces[[1]]$y, as.numeric(y))
204204
})
205-
206-

0 commit comments

Comments
 (0)