Skip to content

Commit

Permalink
update NEWS
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Aug 20, 2019
1 parent 9a407cb commit f84b196
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 76 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ billboarder 0.2.7
* Upgrade billboard library to 1.10.0, see the [release note](https://medium.com/@alberto.park/billboard-js-1-10-release-bubble-dimension-axis-culling-more-132d343a46cc)
* Upgrade billboard library to 1.9.0, see the [release note](https://medium.com/@alberto.park/billboard-js-1-9-release-introducing-plugins-more-636ada3a7881)

## Breaking changes

* Bubbles (when using `size` aesthetic in `bb_scatterplot`) are now computed in JavaScript, argument `range` is deprecated.



billboarder 0.2.6
==================

Expand Down
76 changes: 0 additions & 76 deletions R/bb_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,6 @@ bb_scatterplot <- function(bb, data, mapping = NULL, ...) {
json = json,
type = if (is.null(z)) "scatter" else "bubble"
)
# if (!is.null(z)) {
# data_opt$keys <- list(value = to_show)
# # data_opt$hide <- to_hide
# }

data_axis <- list(
x = list(
Expand Down Expand Up @@ -442,37 +438,11 @@ bb_scatterplot <- function(bb, data, mapping = NULL, ...) {
bb <- .bb_opt2(bb, "axis", data_axis)

if (!is.null(z)) {
# # rescale <- function(x, max = 35) {
# # rng <- range(x, na.rm = TRUE)
# # (x - rng[1]) / (rng[2] - rng[1]) * 34.5 + 0.5
# # }
# if (is.null(args$range)) {
# args$range <- c(10, 40)
# }
# if (is.null(group)) {
# funjs <- paste0(
# "function(d) {",
# "console.log(d);",
# "var z = ", jsonlite::toJSON(x = scales::rescale(data[[z]], to = args$range)), ";",
# "return Math.sqrt(z[d.index] * 2);",
# "}"
# )
# } else {
# funjs <- paste0(
# "function(d) {",
# "var z = ", jsonlite::toJSON(x = split(x = scales::rescale(data[[z]], to = args$range), f = data[[group]])), ";",
# "return Math.sqrt(z[d.id][d.index] * 2);",
# "}"
# )
# }
#
# bb <- .bb_opt2(bb, "bubble", list(maxR = htmlwidgets::JS(funjs)))
bb <- .bb_opt2(bb, "axis", list(x = list(padding = list(right = 0.1))))
}

}


return(bb)
}

Expand Down Expand Up @@ -720,52 +690,6 @@ bb_donutchart <- function(bb, data, mapping = NULL, ...) {




# Helper for creating an histogram
#
# @param bb A \code{billboard} \code{htmlwidget} object.
# @param x A numeric \code{vector}.
# @param breaks Arguments passed to \code{hist}.
# @param ... Arguments for slot
#
# @return A \code{billboard} \code{htmlwidget} object.
# @export
#
# @importFrom graphics hist
#
bb_histogram <- function(bb, x, breaks = "Sturges", ...) {


h <- graphics::hist(x = x, breaks = breaks, plot = FALSE)

json <- list(
data = h$counts,
x = h$breaks
)


data_opt <- list(
json = json,
type = "area-step",
x = "x"
)

bb <- .bb_opt2(bb, "data", data_opt)

bb <- .bb_opt(bb, "area", ...)

bb <- .bb_opt(bb, "line", step = list(type = "step"))

return(bb)
}








#' Helper for creating a line chart
#'
#' @param bb A \code{billboard} \code{htmlwidget} object.
Expand Down

0 comments on commit f84b196

Please sign in to comment.