Title: | Seamless 'D3Plus' Integration |
---|---|
Description: | Provides functions that offer seamless 'D3Plus' integration. The examples provided here are taken from the official 'D3Plus' website <http://d3plus.org>. |
Authors: | Mauricio Vargas [aut,cre], Joshua Kunst [aut], Dave Landry [ctb], Datawheel [cph] |
Maintainer: | Mauricio Vargas <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-10 06:37:45 UTC |
Source: | CRAN |
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.
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.
'D3Plus' networks requiere to specify nodes and links in order to work. This function is useless if d3plus()
is not called first.
'D3Plus' networks requiere to specify nodes and links in order to work. This function is useless if d3plus()
is not called first.
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.
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.
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.
An 'htmlwidget' interface to the d3plus javascript chart library
This function provides 'D3Plus' methods from R console
d3plus(data, width = NULL, height = NULL, elementId = NULL)
d3plus(data, width = NULL, height = NULL, elementId = NULL)
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. |
Mauricio Vargas
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")
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")
The following functions are imported and then re-exported from the d3plus package to avoid listing the magrittr as Depends of d3plus.
Output and render functions for using D3Plus within Shiny applications and interactive Rmd documents.
d3plusOutput(outputId, width = "100%", height = "400px") renderD3plus(expr, env = parent.frame(), quoted = FALSE)
d3plusOutput(outputId, width = "100%", height = "400px") renderD3plus(expr, env = parent.frame(), quoted = FALSE)
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 |