Travis-CI Build Status

billboard

billboard.js for R.

library(billboard)

df <- data.frame(x = 1:10, w = runif(10, 0, 5), y = runif(10, 0, 5), z = runif(10, 0, 5))

df %>%
  b_board(x) %>%
  b_area_spline(w) %>% 
  b_area_spline(y, stack = TRUE) %>% 
  b_area_spline(z, stack= TRUE)

Check the Website

Installation

# install.packages("devtools")
devtools::install_github("JohnCoene/billboard")

Chart types

Examples

Includes but is not limited to:

library(billboard)

mtcars %>% 
  b_board() %>%
  b_spline(wt) %>% 
  b_bar(disp, axis = "y2") %>% 
  b_step(cyl) %>% 
  b_area(qsec) %>% 
  b_scatter(hp, axis = "y2") %>% 
  b_xlabel("Miles per galon") %>% 
  b_color_brewer("Accent") %>% 
  b_tooltip(grouped = TRUE) %>% 
  b_grid_line(9, "Marked") %>% 
  b_grid_line(17, "avg (maybe)", axis = "y") %>% 
  b_region("x", 1, 4,)

Proxies

Features Shiny proxies; functions ending in _p.

Proxies:

Basic Example

See proxy documentation for more details ?b_flow_p

Demo

libary(shiny)
library(billboard)

shinyApp(
  ui = fluidPage(
    selectInput(
      "transform",
      "Change chart type:",
      choices = c("line", "spline", "area", "area-spline", "scatter", "bar"),
      selected = "line"
    ),
    billboardOutput("b_board")
  ),
  server = function(input, output){

  data <- data.frame(y = runif(25, 1, 25))

    output$b_board <- renderBillboard({
      data %>% 
        b_board() %>% 
        b_line(y, name = "Values")
    })

    observeEvent(input$transform, {
      billboardProxy("b_board") %>% 
      b_transform_p(input$transform, "Values")
    })
  }
)

Functions

Customise all the things



JohnCoene/billboard documentation built on May 14, 2019, 2:39 p.m.