Type: | Package |
Title: | Seamless 'D3Plus' Integration |
Version: | 0.1.0 |
Author: | Mauricio Vargas [aut,cre], Joshua Kunst [aut], Dave Landry [ctb], Datawheel [cph] |
Maintainer: | Mauricio Vargas <oec@media.mit.edu> |
Description: | Provides functions that offer seamless 'D3Plus' integration. The examples provided here are taken from the official 'D3Plus' website http://d3plus.org. |
Depends: | htmlwidgets, magrittr |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.0.1 |
NeedsCompilation: | no |
Packaged: | 2017-09-25 04:45:35 UTC; poly |
Repository: | CRAN |
Date/Publication: | 2017-09-25 11:20:51 UTC |
An 'htmlwidget' interface to the d3plus javascript chart library
Description
An 'htmlwidget' interface to the d3plus javascript chart library
This function provides 'D3Plus' methods from R console
Usage
d3plus(data, width = NULL, height = NULL, elementId = NULL)
Arguments
data |
D3Plus need explicit specified data objects formatted as JSON, and this parameter passed it from R. |
width |
Must be a valid CSS unit (like |
height |
Same as width parameter. |
elementId |
Dummy string parameter. Useful when you have two or more charts on the same page. |
Author(s)
Mauricio Vargas
Examples
dta <- data.frame(
id = c("alpha", "alpha", "alpha", "beta", "beta", "beta"),
x = c(4,5,6,4,5,6),
y = c(7,25,13,7,8,13)
)
d3plus() %>% d3p_data(dta) %>% d3p_type("bar")
d3plus() %>% d3p_data(dta) %>% d3p_type("hbar")
d3plus() %>% d3p_data(dta) %>% d3p_type("area")
Pass a tibble or data frame to 'D3Plus' objects
Description
This function provides a 1:1 translation between tibble-like objects in R and JSON structured data needed by 'D3Plus' to display a treemap, barchart or any other 'D3Plus' method. This function is useless if d3plus()
is not called first.
Defines the ids (such as axis) that 'D3Plus' objects require
Description
This function provides a 1:1 translation between column names i an R tibble-like object and ids that 'D3Plus' needs to draw axis, bars, areas, etc. This function is useless if d3plus()
is not called first.
Defines 'D3Plus' axis for network method
Description
'D3Plus' networks requiere to specify nodes and links in order to work. This function is useless if d3plus()
is not called first.
Defines 'D3Plus' axis for network method
Description
'D3Plus' networks requiere to specify nodes and links in order to work. This function is useless if d3plus()
is not called first.
Defines the 'D3Plus' method to use
Description
This function defines if the program will display a treemap, a barchart, an horizontal barchart or other 'D3Plus' method. This function is useless if d3plus()
is not called first.
Defines 'D3Plus' axis for some methods
Description
Some 'D3Plus' methods such as barchart requiere to display which variable to display on the x and y axis, and this function specifies that. This function is useless if d3plus()
is not called first.
Defines 'D3Plus' axis for some methods
Description
Some 'D3Plus' methods such as barchart requiere to display which variable to display on the x and y axis, and this function specifies that. This function is useless if d3plus()
is not called first.
d3plus exported operators and S3 methods
Description
The following functions are imported and then re-exported from the d3plus package to avoid listing the magrittr as Depends of d3plus.
Shiny bindings for 'D3Plus'
Description
Output and render functions for using D3Plus within Shiny applications and interactive Rmd documents.
Usage
d3plusOutput(outputId, width = "100%", height = "400px")
renderD3plus(expr, env = parent.frame(), quoted = FALSE)
Arguments
outputId |
output variable to read from |
width , height |
Must be a valid CSS unit (like |
expr |
An expression that generates a D3Plus object |
env |
The environment in which to evaluate |
quoted |
Is |