d3_nest: Convert a 'data.frame' to a 'd3.js' Hierarchy

Description Usage Arguments Value Examples

View source: R/hierarchy.R

Description

Convert a data.frame to a 'd3.js' Hierarchy

Usage

1
d3_nest(data = NULL, value_cols = character(), root = "root", json = TRUE)

Arguments

data

data.frame or data.frame derivative, such as tibble

value_cols

character vector with the names of the columns to use as data

root

character name of the root level of the hierarchy

json

logical to return as JSON

Value

nested data.frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# convert Titanic to a nested d3 hierarchy

# devtools::install_github("timelyportfolio/d3r")
library(d3r)
library(dplyr)

titanic_df <- data.frame(Titanic)
tit_tb <- titanic_df %>%
  select(Class,Age,Survived,Sex,Freq) %>%
  d3_nest(value_cols="Freq", root="titanic")

tit_tb

# see as tibble
titanic_df %>%
  select(Class,Age,Survived,Sex,Freq) %>%
  d3_nest(value_cols="Freq", root="titanic", json=FALSE)

# see the structure with listviewer
tit_tb %>%
  listviewer::jsonedit()
## Not run: 
  library(treemap)
  library(d3r)
  library(dplyr)
  library(tidyr)

  treemap::random.hierarchical.data() %>%
    d3_nest(value_cols = "x")

  # use example from ?treemap
  data(GNI2014)
  treemap(
    GNI2014,
    index=c("continent", "iso3"),
    vSize="population",
    vColor="GNI",
    type="value",
    draw=FALSE
  ) %>%
    {.$tm} %>%
    select(continent,iso3,color,vSize) %>%
    d3_nest(value_cols = c("color", "vSize"))

## End(Not run)

Example output

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

{"children":[{"name":"1st","children":[{"name":"Child","children":[{"name":"No","children":[{"name":"Male","Freq":0,"colname":"Sex"},{"name":"Female","Freq":0,"colname":"Sex"}],"colname":"Survived"},{"name":"Yes","children":[{"name":"Male","Freq":5,"colname":"Sex"},{"name":"Female","Freq":1,"colname":"Sex"}],"colname":"Survived"}],"colname":"Age"},{"name":"Adult","children":[{"name":"No","children":[{"name":"Male","Freq":118,"colname":"Sex"},{"name":"Female","Freq":4,"colname":"Sex"}],"colname":"Survived"},{"name":"Yes","children":[{"name":"Male","Freq":57,"colname":"Sex"},{"name":"Female","Freq":140,"colname":"Sex"}],"colname":"Survived"}],"colname":"Age"}],"colname":"Class"},{"name":"2nd","children":[{"name":"Child","children":[{"name":"No","children":[{"name":"Male","Freq":0,"colname":"Sex"},{"name":"Female","Freq":0,"colname":"Sex"}],"colname":"Survived"},{"name":"Yes","children":[{"name":"Male","Freq":11,"colname":"Sex"},{"name":"Female","Freq":13,"colname":"Sex"}],"colname":"Survived"}],"colname":"Age"},{"name":"Adult","children":[{"name":"No","children":[{"name":"Male","Freq":154,"colname":"Sex"},{"name":"Female","Freq":13,"colname":"Sex"}],"colname":"Survived"},{"name":"Yes","children":[{"name":"Male","Freq":14,"colname":"Sex"},{"name":"Female","Freq":80,"colname":"Sex"}],"colname":"Survived"}],"colname":"Age"}],"colname":"Class"},{"name":"3rd","children":[{"name":"Child","children":[{"name":"No","children":[{"name":"Male","Freq":35,"colname":"Sex"},{"name":"Female","Freq":17,"colname":"Sex"}],"colname":"Survived"},{"name":"Yes","children":[{"name":"Male","Freq":13,"colname":"Sex"},{"name":"Female","Freq":14,"colname":"Sex"}],"colname":"Survived"}],"colname":"Age"},{"name":"Adult","children":[{"name":"No","children":[{"name":"Male","Freq":387,"colname":"Sex"},{"name":"Female","Freq":89,"colname":"Sex"}],"colname":"Survived"},{"name":"Yes","children":[{"name":"Male","Freq":75,"colname":"Sex"},{"name":"Female","Freq":76,"colname":"Sex"}],"colname":"Survived"}],"colname":"Age"}],"colname":"Class"},{"name":"Crew","children":[{"name":"Child","children":[{"name":"No","children":[{"name":"Male","Freq":0,"colname":"Sex"},{"name":"Female","Freq":0,"colname":"Sex"}],"colname":"Survived"},{"name":"Yes","children":[{"name":"Male","Freq":0,"colname":"Sex"},{"name":"Female","Freq":0,"colname":"Sex"}],"colname":"Survived"}],"colname":"Age"},{"name":"Adult","children":[{"name":"No","children":[{"name":"Male","Freq":670,"colname":"Sex"},{"name":"Female","Freq":3,"colname":"Sex"}],"colname":"Survived"},{"name":"Yes","children":[{"name":"Male","Freq":192,"colname":"Sex"},{"name":"Female","Freq":20,"colname":"Sex"}],"colname":"Survived"}],"colname":"Age"}],"colname":"Class"}],"name":"titanic"} 
# A tibble: 1 x 2
          children    name
            <list>   <chr>
1 <tibble [4 x 3]> titanic
{"children":[{"name":"A","children":[{"name":"A.1","children":[{"name":"A.1.a","x":0.2247,"colname":"index3"},{"name":"A.1.b","x":0.1976,"colname":"index3"}],"colname":"index2"},{"name":"A.2","children":[{"name":"A.2.a","x":3.0882,"colname":"index3"},{"name":"A.2.b","x":0.3653,"colname":"index3"},{"name":"A.2.c","x":3.0345,"colname":"index3"},{"name":"A.2.d","x":3.8229,"colname":"index3"}],"colname":"index2"}],"colname":"index1"},{"name":"B","children":[{"name":"B.1","children":[{"name":"B.1.a","x":1.0059,"colname":"index3"},{"name":"B.1.b","x":0.8339,"colname":"index3"}],"colname":"index2"},{"name":"B.2","children":[{"name":"B.2.a","x":3.0211,"colname":"index3"},{"name":"B.2.b","x":0.4005,"colname":"index3"},{"name":"B.2.c","x":2.4217,"colname":"index3"},{"name":"B.2.d","x":0.817,"colname":"index3"}],"colname":"index2"},{"name":"B.3","children":[{"name":"B.3.a","x":0.8443,"colname":"index3"},{"name":"B.3.b","x":0.4442,"colname":"index3"},{"name":"B.3.c","x":0.4056,"colname":"index3"}],"colname":"index2"},{"name":"B.4","children":[{"name":"B.4.a","x":0.7659,"colname":"index3"}],"colname":"index2"},{"name":"B.5","children":[{"name":"B.5.a","x":4.5532,"colname":"index3"},{"name":"B.5.b","x":0.8355,"colname":"index3"},{"name":"B.5.c","x":1.5077,"colname":"index3"}],"colname":"index2"}],"colname":"index1"},{"name":"C","children":[{"name":"C.1","children":[{"name":"C.1.a","x":0.698,"colname":"index3"},{"name":"C.1.b","x":0.5879,"colname":"index3"},{"name":"C.1.c","x":0.2911,"colname":"index3"}],"colname":"index2"}],"colname":"index1"},{"name":"D","children":[{"name":"D.1","children":[{"name":"D.1.a","x":1.3705,"colname":"index3"},{"name":"D.1.b","x":1.0316,"colname":"index3"}],"colname":"index2"},{"name":"D.2","children":[{"name":"D.2.a","x":1.9172,"colname":"index3"},{"name":"D.2.b","x":0.3155,"colname":"index3"},{"name":"D.2.c","x":0.4205,"colname":"index3"},{"name":"D.2.d","x":2.6787,"colname":"index3"},{"name":"D.2.e","x":1.2808,"colname":"index3"}],"colname":"index2"},{"name":"D.3","children":[{"name":"D.3.a","x":0.3514,"colname":"index3"},{"name":"D.3.b","x":2.3203,"colname":"index3"}],"colname":"index2"},{"name":"D.4","children":[{"name":"D.4.a","x":2.2715,"colname":"index3"},{"name":"D.4.b","x":0.3577,"colname":"index3"},{"name":"D.4.c","x":1.0333,"colname":"index3"},{"name":"D.4.d","x":3.0921,"colname":"index3"}],"colname":"index2"}],"colname":"index1"}],"name":"root"} 
{"children":[{"name":"Africa","children":[{"name":"BDI","color":"#FFFFBF","vSize":8988091,"colname":"iso3"},{"name":"BEN","color":"#FFFFBF","vSize":8791832,"colname":"iso3"},{"name":"BFA","color":"#FFFFBF","vSize":15746232,"colname":"iso3"},{"name":"BWA","color":"#F3FAAF","vSize":1990876,"colname":"iso3"},{"name":"CAF","color":"#FFFFBF","vSize":4511488,"colname":"iso3"},{"name":"CIV","color":"#FFFFBF","vSize":20617068,"colname":"iso3"},{"name":"CMR","color":"#FFFFBF","vSize":18879301,"colname":"iso3"},{"name":"COD","color":"#FFFFBF","vSize":68692542,"colname":"iso3"},{"name":"COG","color":"#FBFDB9","vSize":4012809,"colname":"iso3"},{"name":"COM","color":"#FFFFBF","vSize":752438,"colname":"iso3"},{"name":"CPV","color":"#FBFDB9","vSize":429474,"colname":"iso3"},{"name":"DZA","color":"#F7FBB4","vSize":34178188,"colname":"iso3"},{"name":"EGY","color":"#FBFDB9","vSize":83082869,"colname":"iso3"},{"name":"ETH","color":"#FFFFBF","vSize":85237338,"colname":"iso3"},{"name":"GAB","color":"#EFF8AA","vSize":1514993,"colname":"iso3"},{"name":"GHA","color":"#FFFFBF","vSize":23832495,"colname":"iso3"},{"name":"GIN","color":"#FFFFBF","vSize":10057975,"colname":"iso3"},{"name":"GMB","color":"#FFFFBF","vSize":1782893,"colname":"iso3"},{"name":"GNB","color":"#FFFFBF","vSize":1533964,"colname":"iso3"},{"name":"GNQ","color":"#EFF8AA","vSize":650702,"colname":"iso3"},{"name":"KEN","color":"#FFFFBF","vSize":39002772,"colname":"iso3"},{"name":"LBR","color":"#FFFFBF","vSize":3441790,"colname":"iso3"},{"name":"LBY","color":"#F3FAAF","vSize":6310434,"colname":"iso3"},{"name":"LSO","color":"#FFFFBF","vSize":2130819,"colname":"iso3"},{"name":"MAR","color":"#FBFDB9","vSize":34859364,"colname":"iso3"},{"name":"MDG","color":"#FFFFBF","vSize":20653556,"colname":"iso3"},{"name":"MLI","color":"#FFFFBF","vSize":12666987,"colname":"iso3"},{"name":"MOZ","color":"#FFFFBF","vSize":21669278,"colname":"iso3"},{"name":"MRT","color":"#FFFFBF","vSize":3129486,"colname":"iso3"},{"name":"MWI","color":"#FFFFBF","vSize":14268711,"colname":"iso3"},{"name":"NAM","color":"#F7FBB4","vSize":2108665,"colname":"iso3"},{"name":"NER","color":"#FFFFBF","vSize":15306252,"colname":"iso3"},{"name":"NGA","color":"#FBFDB9","vSize":149229090,"colname":"iso3"},{"name":"RWA","color":"#FFFFBF","vSize":10473282,"colname":"iso3"},{"name":"SDN","color":"#FFFFBF","vSize":25946220,"colname":"iso3"},{"name":"SEN","color":"#FFFFBF","vSize":13711597,"colname":"iso3"},{"name":"SLE","color":"#FFFFBF","vSize":6440053,"colname":"iso3"},{"name":"SSD","color":"#FFFFBF","vSize":10625176,"colname":"iso3"},{"name":"STP","color":"#FFFFBF","vSize":212679,"colname":"iso3"},{"name":"SWZ","color":"#FBFDB9","vSize":1123913,"colname":"iso3"},{"name":"TCD","color":"#FFFFBF","vSize":10329208,"colname":"iso3"},{"name":"TGO","color":"#FFFFBF","vSize":6019877,"colname":"iso3"},{"name":"TUN","color":"#FBFDB9","vSize":10486339,"colname":"iso3"},{"name":"TZA","color":"#FFFFBF","vSize":41048532,"colname":"iso3"},{"name":"UGA","color":"#FFFFBF","vSize":32369558,"colname":"iso3"},{"name":"ZAF","color":"#F3FAAF","vSize":49052489,"colname":"iso3"},{"name":"ZMB","color":"#FFFFBF","vSize":11862740,"colname":"iso3"},{"name":"ZWE","color":"#FFFFBF","vSize":12619600,"colname":"iso3"}],"color":"#026C39","vSize":962382035,"colname":"continent"},{"name":"Asia","children":[{"name":"AFG","color":"#FFFFBF","vSize":28400000,"colname":"iso3"},{"name":"ARE","color":"#9FD669","vSize":4798491,"colname":"iso3"},{"name":"ARM","color":"#FBFDB9","vSize":2967004,"colname":"iso3"},{"name":"AZE","color":"#F3FAAF","vSize":8238672,"colname":"iso3"},{"name":"BGD","color":"#FFFFBF","vSize":156050883,"colname":"iso3"},{"name":"BHR","color":"#DCF090","vSize":727785,"colname":"iso3"},{"name":"BRN","color":"#B5DF73","vSize":388190,"colname":"iso3"},{"name":"BTN","color":"#FBFDB9","vSize":691141,"colname":"iso3"},{"name":"CHN","color":"#F3FAAF","vSize":1338612970,"colname":"iso3"},{"name":"CYP","color":"#CEEA84","vSize":531640,"colname":"iso3"},{"name":"GEO","color":"#FBFDB9","vSize":4615807,"colname":"iso3"},{"name":"HKG","color":"#B0DD70","vSize":7061200,"colname":"iso3"},{"name":"IDN","color":"#FBFDB9","vSize":240271522,"colname":"iso3"},{"name":"IND","color":"#FFFFBF","vSize":1166079220,"colname":"iso3"},{"name":"IRN","color":"#F3FAAF","vSize":66429284,"colname":"iso3"},{"name":"IRQ","color":"#F3FAAF","vSize":31129225,"colname":"iso3"},{"name":"ISR","color":"#BAE177","vSize":7233701,"colname":"iso3"},{"name":"JOR","color":"#F7FBB4","vSize":6342948,"colname":"iso3"},{"name":"JPN","color":"#ABDB6D","vSize":127078679,"colname":"iso3"},{"name":"KAZ","color":"#ECF7A4","vSize":15399437,"colname":"iso3"},{"name":"KGZ","color":"#FFFFBF","vSize":5431747,"colname":"iso3"},{"name":"KHM","color":"#FFFFBF","vSize":14494293,"colname":"iso3"},{"name":"KOR","color":"#CEEA84","vSize":48508972,"colname":"iso3"},{"name":"KWT","color":"#92D067","vSize":2691158,"colname":"iso3"},{"name":"LAO","color":"#FFFFBF","vSize":6834942,"colname":"iso3"},{"name":"LBN","color":"#EFF8AA","vSize":4017095,"colname":"iso3"},{"name":"LKA","color":"#FBFDB9","vSize":21324791,"colname":"iso3"},{"name":"MAC","color":"#40AA59","vSize":559846,"colname":"iso3"},{"name":"MMR","color":"#FFFFBF","vSize":48137741,"colname":"iso3"},{"name":"MNG","color":"#F7FBB4","vSize":3041142,"colname":"iso3"},{"name":"MYS","color":"#ECF7A4","vSize":25715819,"colname":"iso3"},{"name":"NPL","color":"#FFFFBF","vSize":28563377,"colname":"iso3"},{"name":"OMN","color":"#E4F39A","vSize":3418085,"colname":"iso3"},{"name":"PAK","color":"#FFFFBF","vSize":176242949,"colname":"iso3"},{"name":"PHL","color":"#FBFDB9","vSize":97976603,"colname":"iso3"},{"name":"QAT","color":"#128948","vSize":833285,"colname":"iso3"},{"name":"SAU","color":"#D3EC87","vSize":28686633,"colname":"iso3"},{"name":"SGP","color":"#86CB66","vSize":4657542,"colname":"iso3"},{"name":"THA","color":"#F7FBB4","vSize":65905410,"colname":"iso3"},{"name":"TJK","color":"#FFFFBF","vSize":7349145,"colname":"iso3"},{"name":"TKM","color":"#F3FAAF","vSize":4884887,"colname":"iso3"},{"name":"TMP","color":"#FBFDB9","vSize":1201542,"colname":"iso3"},{"name":"TUR","color":"#ECF7A4","vSize":76805524,"colname":"iso3"},{"name":"UZB","color":"#FFFFBF","vSize":27606007,"colname":"iso3"},{"name":"VNM","color":"#FFFFBF","vSize":86967524,"colname":"iso3"},{"name":"WBG","color":"#FBFDB9","vSize":4550368,"colname":"iso3"},{"name":"YEM","color":"#FFFFBF","vSize":23822783,"colname":"iso3"}],"color":"#006837","vSize":4033277009,"colname":"continent"},{"name":"Europe","children":[{"name":"ADO","color":"#A6D96A","vSize":79218,"colname":"iso3"},{"name":"ALB","color":"#F7FBB4","vSize":3639453,"colname":"iso3"},{"name":"AUT","color":"#92D067","vSize":8210281,"colname":"iso3"},{"name":"BEL","color":"#99D368","vSize":10414336,"colname":"iso3"},{"name":"BGR","color":"#F3FAAF","vSize":7204687,"colname":"iso3"},{"name":"BIH","color":"#F7FBB4","vSize":4613414,"colname":"iso3"},{"name":"BLR","color":"#F3FAAF","vSize":9648533,"colname":"iso3"},{"name":"CHE","color":"#17934D","vSize":7604467,"colname":"iso3"},{"name":"CZE","color":"#E0F295","vSize":10211904,"colname":"iso3"},{"name":"DEU","color":"#99D368","vSize":82329758,"colname":"iso3"},{"name":"DNK","color":"#72C264","vSize":5500510,"colname":"iso3"},{"name":"ESP","color":"#C9E881","vSize":40525002,"colname":"iso3"},{"name":"EST","color":"#E0F295","vSize":1299371,"colname":"iso3"},{"name":"FIN","color":"#99D368","vSize":5250275,"colname":"iso3"},{"name":"FRA","color":"#A6D96A","vSize":64057792,"colname":"iso3"},{"name":"GBR","color":"#A6D96A","vSize":62262000,"colname":"iso3"},{"name":"GRC","color":"#D9EF8B","vSize":10737428,"colname":"iso3"},{"name":"HRV","color":"#E8F59F","vSize":4489409,"colname":"iso3"},{"name":"HUN","color":"#E8F59F","vSize":9905596,"colname":"iso3"},{"name":"IRL","color":"#9FD669","vSize":4203200,"colname":"iso3"},{"name":"ISL","color":"#9FD669","vSize":306694,"colname":"iso3"},{"name":"ITA","color":"#BAE177","vSize":58126212,"colname":"iso3"},{"name":"KSV","color":"#FBFDB9","vSize":1859203,"colname":"iso3"},{"name":"LTU","color":"#E4F39A","vSize":3555179,"colname":"iso3"},{"name":"LUX","color":"#40AA59","vSize":491775,"colname":"iso3"},{"name":"LVA","color":"#E4F39A","vSize":2231503,"colname":"iso3"},{"name":"MDA","color":"#FBFDB9","vSize":4320748,"colname":"iso3"},{"name":"MKD","color":"#F7FBB4","vSize":2066718,"colname":"iso3"},{"name":"MLT","color":"#DCF090","vSize":405165,"colname":"iso3"},{"name":"MNE","color":"#F3FAAF","vSize":672180,"colname":"iso3"},{"name":"NLD","color":"#8CCD67","vSize":16715999,"colname":"iso3"},{"name":"NOR","color":"#05713C","vSize":4676305,"colname":"iso3"},{"name":"POL","color":"#E8F59F","vSize":38482919,"colname":"iso3"},{"name":"PRT","color":"#D9EF8B","vSize":10707924,"colname":"iso3"},{"name":"ROU","color":"#EFF8AA","vSize":22215421,"colname":"iso3"},{"name":"RUS","color":"#E8F59F","vSize":140041247,"colname":"iso3"},{"name":"SRB","color":"#F7FBB4","vSize":7379339,"colname":"iso3"},{"name":"SVK","color":"#E0F295","vSize":5463046,"colname":"iso3"},{"name":"SVN","color":"#D3EC87","vSize":2005692,"colname":"iso3"},{"name":"SWE","color":"#6CBF63","vSize":9059651,"colname":"iso3"},{"name":"UKR","color":"#FBFDB9","vSize":45700395,"colname":"iso3"}],"color":"#006837","vSize":728669949,"colname":"continent"},{"name":"North America","children":[{"name":"ATG","color":"#E8F59F","vSize":85632,"colname":"iso3"},{"name":"BHS","color":"#DCF090","vSize":309156,"colname":"iso3"},{"name":"BLZ","color":"#F7FBB4","vSize":307899,"colname":"iso3"},{"name":"BMU","color":"#006837","vSize":67837,"colname":"iso3"},{"name":"BRB","color":"#E4F39A","vSize":284589,"colname":"iso3"},{"name":"CAN","color":"#8CCD67","vSize":33487208,"colname":"iso3"},{"name":"CRI","color":"#EFF8AA","vSize":4253877,"colname":"iso3"},{"name":"DMA","color":"#F3FAAF","vSize":72660,"colname":"iso3"},{"name":"DOM","color":"#F7FBB4","vSize":9650054,"colname":"iso3"},{"name":"GRD","color":"#F3FAAF","vSize":90739,"colname":"iso3"},{"name":"GTM","color":"#FBFDB9","vSize":13276517,"colname":"iso3"},{"name":"HND","color":"#FBFDB9","vSize":7792854,"colname":"iso3"},{"name":"HTI","color":"#FFFFBF","vSize":9035536,"colname":"iso3"},{"name":"JAM","color":"#F7FBB4","vSize":2825928,"colname":"iso3"},{"name":"KNA","color":"#E4F39A","vSize":40131,"colname":"iso3"},{"name":"LCA","color":"#F3FAAF","vSize":160267,"colname":"iso3"},{"name":"MEX","color":"#EFF8AA","vSize":111211789,"colname":"iso3"},{"name":"NIC","color":"#FFFFBF","vSize":5891199,"colname":"iso3"},{"name":"PAN","color":"#ECF7A4","vSize":3360474,"colname":"iso3"},{"name":"PRI","color":"#DCF090","vSize":3971020,"colname":"iso3"},{"name":"SLV","color":"#FBFDB9","vSize":7185218,"colname":"iso3"},{"name":"TTO","color":"#DCF090","vSize":1310000,"colname":"iso3"},{"name":"USA","color":"#7FC865","vSize":313973000,"colname":"iso3"},{"name":"VCT","color":"#F3FAAF","vSize":104574,"colname":"iso3"}],"color":"#006837","vSize":528748158,"colname":"continent"},{"name":"Oceania","children":[{"name":"AUS","color":"#66BD63","vSize":21262641,"colname":"iso3"},{"name":"FJI","color":"#F7FBB4","vSize":944720,"colname":"iso3"},{"name":"FSM","color":"#FBFDB9","vSize":107434,"colname":"iso3"},{"name":"KIR","color":"#FBFDB9","vSize":112850,"colname":"iso3"},{"name":"MHL","color":"#F7FBB4","vSize":64522,"colname":"iso3"},{"name":"NZL","color":"#ABDB6D","vSize":4213418,"colname":"iso3"},{"name":"PLW","color":"#ECF7A4","vSize":20796,"colname":"iso3"},{"name":"PNG","color":"#FBFDB9","vSize":6057263,"colname":"iso3"},{"name":"SLB","color":"#FFFFBF","vSize":595613,"colname":"iso3"},{"name":"TON","color":"#F7FBB4","vSize":120898,"colname":"iso3"},{"name":"TUV","color":"#F7FBB4","vSize":10640,"colname":"iso3"},{"name":"VUT","color":"#FBFDB9","vSize":218519,"colname":"iso3"},{"name":"WSM","color":"#FBFDB9","vSize":219998,"colname":"iso3"}],"color":"#006837","vSize":33949312,"colname":"continent"},{"name":"Seven seas (open ocean)","children":[{"name":"MDV","color":"#F3FAAF","vSize":396334,"colname":"iso3"},{"name":"MUS","color":"#EFF8AA","vSize":1284264,"colname":"iso3"},{"name":"SYC","color":"#E8F59F","vSize":87476,"colname":"iso3"}],"color":"#C4E67D","vSize":1768074,"colname":"continent"},{"name":"South America","children":[{"name":"ARG","color":"#E8F59F","vSize":40913584,"colname":"iso3"},{"name":"BOL","color":"#FBFDB9","vSize":9775246,"colname":"iso3"},{"name":"BRA","color":"#ECF7A4","vSize":198739269,"colname":"iso3"},{"name":"CHL","color":"#E4F39A","vSize":16601707,"colname":"iso3"},{"name":"COL","color":"#F3FAAF","vSize":45644023,"colname":"iso3"},{"name":"ECU","color":"#F7FBB4","vSize":14573101,"colname":"iso3"},{"name":"GUY","color":"#FBFDB9","vSize":772298,"colname":"iso3"},{"name":"PER","color":"#F7FBB4","vSize":29546963,"colname":"iso3"},{"name":"PRY","color":"#F7FBB4","vSize":6995655,"colname":"iso3"},{"name":"SUR","color":"#EFF8AA","vSize":481267,"colname":"iso3"},{"name":"URY","color":"#E4F39A","vSize":3494382,"colname":"iso3"},{"name":"VEN","color":"#ECF7A4","vSize":26814843,"colname":"iso3"}],"color":"#006837","vSize":394352338,"colname":"continent"}],"name":"root"} 

d3r documentation built on Jan. 13, 2021, 6:13 p.m.

Related to d3_nest in d3r...