A function to initialize a D3plus chart in R
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | d3plus(
data = NULL,
type = c("tree_map", "bar", "line", "scatter", "geo_map", "stacked", "radar",
"sankey", "rings", "network", "box", "bubbles"),
id = NULL,
currency = "US$",
number_text = c("K", "M", "M", "B", "B"),
currency_var = NULL,
percent_var = NULL,
noformat_number_var = NULL,
d3plus_number_format = TRUE,
locale = "en_US",
dictionary = NULL,
width = NULL,
height = NULL,
elementId = NULL,
clean_previous = FALSE
)
|
data |
a data.frame object to create the visualization. |
type |
a name indicating the type of the chart. |
id |
a vector with the id's column names. |
currency |
a name indicating the currency symbol (US$, R$, etc.). |
number_text |
a name to show after the number. Example: c("K", "M", "M", "B", "B"). |
currency_var |
a vector with variable names to apply the currency format. |
percent_var |
a vector with variable names to apply the share format. |
noformat_number_var |
a vector variables names to not apply any formatting. |
d3plus_number_format |
a logical indicating if the d3plus.number.format should be applied to numbers. |
locale |
a name indicating the language to be used |
dictionary |
a named list. The element's name should be the original text and the value should be the new text. |
width |
a number (in pixels) or percent text ("100%") indicating the visualization's width. |
height |
a number (in pixels) or percent text ("100%") indicating the visualization's height. |
elementId |
a name for the visualization's id. |
clean_previous |
a logical indicating whether the visualization is restarted after input update (only for shiny). |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.