R htmlwidget for d3.js treemaps
Switch branches/tags
Nothing to show
Clone or download
Latest commit ebb833d Feb 6, 2018

README.md

d3treeR

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.

Quick Examples

Using treemap

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"
)

Using JSON

library(d3treeR)
d3tree2(
  "http://bl.ocks.org/mbostock/raw/1093025/flare.json"
  , celltext = "name"
)