If you wish, you can build graphs using a list syntax :
data(economics, package = "ggplot2")
# Construct a list in JSON format
params <- list(
data = list(
x = "x",
json = list(
x = economics$date,
y = economics$psavert
),
type = "spline"
),
legend = list(show = FALSE),
point = list(show = FALSE),
axis = list(
x = list(
type = "timeseries",
tick = list(
count = 20,
fit = TRUE,
format = "%e %b %y"
)
),
y = list(
label = list(
text = "Personal savings rate"
),
tick = list(
format = htmlwidgets::JS("function(x) {return x + '%';}")
)
)
)
)
# Pass the list as parameter
billboarder(params)
billboarder
Overview
This package allow you to use billboard.js, a re-usable easy interface JavaScript chart library, based on D3 v4+.
A proxy method is implemented to smoothly update charts in shiny applications, see below for details.
Installation :
Install from CRAN with:
Install development version grom GitHub with:
For interactive examples & documentation, see
pkgdownsite : https://dreamrs.github.io/billboarder/index.htmlBar / column charts
Simple bar chart :
Multiple categories bar chart :
Stacked bar charts :
Scatter plot
Classic :
You can make a bubble chart using
sizeaes :Pie / Donut charts
Lines charts
Time serie with
Date(and a subchart)Zoom by dragging
Time serie with
POSIXct(and regions)Stacked area chart
Line range
Histogram & density
With a grouping variable :
Density plot with the same data :
Shiny interaction
Some events will trigger Shiny’s inputs in application, such as click. Inputs id associated with
billboardercharts use this pattern :Look at this example, chart id is
mybbchartso you retrieve click withinput$mybbchart_click:Proxy
You can modify existing charts with function
billboarderProxy:To see examples, run :
Raw API
If you wish, you can build graphs using a
listsyntax :