d3treeR
is an R htmlwidget for d3.js treemaps. It is designed to integrate seamlessly with the R treemap
package or work with traditional nested JSON hierarchies.
Please see the Building Widgets post Week 29 | d3treeR v2 for a discussion.
library(treemap)
library(d3treeR)
# example 1 from ?treemap
data(GNI2010)
d3tree2(
treemap(
GNI2010
,index=c("continent", "iso3")
,vSize="population"
,vColor="GNI"
,type="value"
)
, rootname = "World"
)
library(d3treeR)
d3tree2(
"http://bl.ocks.org/mbostock/raw/1093025/flare.json"
, celltext = "name"
)