d3plus: An 'htmlwidget' interface to the d3plus javascript chart...

Description Usage Arguments Author(s) Examples

View source: R/d3plus.R

Description

An 'htmlwidget' interface to the d3plus javascript chart library

This function provides 'D3Plus' methods from R console

Usage

1
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 '100%', '400px', 'auto') or a number, which will be coerced to a string and have 'px' appended.

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

1
2
3
4
5
6
7
8
9
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")

d3plus documentation built on May 2, 2019, 11:05 a.m.