-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtreeRound.html
114 lines (88 loc) · 23.2 KB
/
treeRound.html
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Tree Example</title>
<style>
.node {
cursor: pointer;
}
.node circle {
fill: #fff;
stroke: steelblue;
stroke-width: 3px;
}
.node text {
font: 12px sans-serif;
}
.link {
fill: none;
stroke: #ccc;
stroke-width: 2px;
}
</style>
</head>
<body>
<div id="chart" align="center"></div>
<!-- load the d3.js library -->
<script src="http://d3js.org/d3.v5.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
var dataArr = [{"name": "Fred", "children": [{"name": "Money, Banking, & Finance", "children": [{"name": "Interest Rates", "children": [{"name": "Interest Rates"}, {"name": "Automobile Loan Rates"}, {"name": "Bankers Acceptance Rate"}, {"name": "Certificates of Deposit"}, {"name": "Commercial Paper"}, {"name": "Corporate Bonds"}, {"name": "Credit Card Loan Rates"}, {"name": "Eurodollar Deposits"}, {"name": "FRB Rates - discount, fed funds, primary credit"}, {"name": "Interest Checking Accounts"}, {"name": "Interest Rate Spreads"}, {"name": "Interest Rate Swaps"}, {"name": "LIBOR Rates"}, {"name": "Long-Term Securities"}, {"name": "Money Market Accounts"}, {"name": "Mortgage Rates"}, {"name": "Personal Loan Rates"}, {"name": "Prime Bank Loan Rate"}, {"name": "Saving Accounts"}, {"name": "Treasury Bills"}, {"name": "Treasury Constant Maturity"}, {"name": "Treasury Inflation-Indexed Securities"}]}, {"name": "Exchange Rates", "children": [{"name": "Exchange Rates"}, {"name": "Daily Rates"}, {"name": "Monthly Rates"}, {"name": "Annual Rates"}, {"name": "Trade-Weighted Indexes"}, {"name": "By Country"}]}, {"name": "Monetary Data", "children": [{"name": "Monetary Data"}, {"name": "Monetary Base"}, {"name": "Reserves"}, {"name": "M1 and Components"}, {"name": "M2 and Components"}, {"name": "M2 Minus Small Time Deposits"}, {"name": "M3 and Components"}, {"name": "MZM"}, {"name": "Memorandum Items"}, {"name": "Money Velocity"}, {"name": "Borrowings"}, {"name": "Factors Affecting Reserve Balances"}, {"name": "Securities, Loans, & Other Assets & Liabilities Held by Fed"}]}, {"name": "Financial Indicators", "children": [{"name": "Financial Indicators"}, {"name": "Bond Market Indexes"}, {"name": "Consumer Financial Condition Indexes"}, {"name": "Financial Activity Measures"}, {"name": "Stock Market Indexes"}, {"name": "Volatility Indexes"}]}, {"name": "Banking", "children": [{"name": "Banking"}, {"name": "Commercial Banking"}, {"name": "Condition of Banks"}, {"name": "Consumer Credit"}, {"name": "Delinquencies and Delinquency Rates"}, {"name": "Failures and Assistance Transactions"}, {"name": "8th District Banking Performance"}, {"name": "Mortgage Debt Outstanding"}, {"name": "Net Charge-Offs and Charge-Off Rates"}, {"name": "Securities & Investments"}, {"name": "Senior Loan Officer Survey"}]}, {"name": "Business Lending", "children": [{"name": "Business Lending"}, {"name": "Commercial Paper"}, {"name": "Commercial and Industrial Loans by Time that Pricing Terms Were Set and by Commitment"}, {"name": "Commercial and Industrial Loans Backed by Small Business Association"}, {"name": "Commercial and Industrial Loans Made by All Commercial Banks"}, {"name": "Commercial and Industrial Loans Made by Domestic Banks"}, {"name": "Commercial and Industrial Loans Made by Large Domestic Banks"}, {"name": "Commercial and Industrial Loans Made by Small Domestic Banks"}, {"name": "Commercial and Industrial Loans Made by U.S. Branches and Agencies of Foreign Banks"}, {"name": "Commercial and Industrial Loans Made Under Participation or Syndication"}]}, {"name": "Foreign Exchange Intervention", "children": [{"name": "Foreign Exchange Intervention"}]}]}, {"name": "Population, Employment, & Labor Markets", "children": [{"name": "Current Population Survey (Household Survey)", "children": [{"name": "Current Population Survey (Household Survey)"}, {"name": "Civilian Labor Force"}, {"name": "Civilian Labor Force Participation Rate"}, {"name": "Employment"}, {"name": "Employment Population Ratio"}, {"name": "Unemployment Level"}, {"name": "Unemployment Rate"}, {"name": "Not in Labor Force"}, {"name": "Labor Force Participation Rate"}, {"name": "Multiple Jobholders"}, {"name": "Duration of Unemployment"}, {"name": "Losers and Leavers"}, {"name": "Earnings"}, {"name": "Entrants and Reentrants"}, {"name": "Labor Force Status Flows"}]}, {"name": "Current Employment Statistics (Establishment Survey)", "children": [{"name": "Current Employment Statistics (Establishment Survey)"}, {"name": "Total Nonfarm"}, {"name": "Total Private"}, {"name": "Goods-Producing"}, {"name": "Service-Providing"}, {"name": "Private Service-Providing"}, {"name": "Mining and Logging"}, {"name": "Construction"}, {"name": "Manufacturing"}, {"name": "Durable Goods"}, {"name": "Nondurable Goods"}, {"name": "Trade, Transportation, and Utilities"}, {"name": "Wholesale Trade"}, {"name": "Retail Trade"}, {"name": "Transportation and Warehousing"}, {"name": "Utilities"}, {"name": "Information"}, {"name": "Financial Activities"}, {"name": "Professional and Business Services"}, {"name": "Education and Health Services"}, {"name": "Leisure and Hospitality"}, {"name": "Other Services"}, {"name": "Government"}]}, {"name": "ADP Employment", "children": [{"name": "ADP Employment"}]}, {"name": "Education", "children": [{"name": "Education"}]}, {"name": "Income Distribution", "children": [{"name": "Income Distribution"}]}, {"name": "Job Openings and Labor Turnover (JOLTS)", "children": [{"name": "Job Openings and Labor Turnover (JOLTS)"}, {"name": "Job Openings (Levels and Rates)"}, {"name": "Hires (Levels and Rates)"}, {"name": "Total Separations (Levels and Rates)"}, {"name": "Quits (Levels and Rates)"}, {"name": "Layoffs and Discharges (Levels and Rates)"}, {"name": "Other Separations (Levels and Rates)"}]}, {"name": "Labor Market Conditions", "children": [{"name": "Labor Market Conditions"}]}, {"name": "Population", "children": [{"name": "Population"}, {"name": "Poverty Measures"}, {"name": "Supplemental Nutrition Assistance Program"}]}, {"name": "Productivity & Costs", "children": [{"name": "Productivity & Costs"}, {"name": "Manufacturing"}, {"name": "Business"}, {"name": "Nonfarm Business"}, {"name": "Nonfinancial Corporations"}]}, {"name": "Minimum Wage", "children": [{"name": "Minimum Wage"}]}, {"name": "Weekly Initial Claims", "children": [{"name": "Weekly Initial Claims"}]}, {"name": "Tax Data", "children": [{"name": "Tax Data"}]}]}, {"name": "National Accounts", "children": [{"name": "National Income & Product Accounts", "children": [{"name": "National Income & Product Accounts"}, {"name": "Domestic Capital Account (Saving & Investment)"}, {"name": "Foreign Transactions"}, {"name": "Fixed Assets"}, {"name": "Gross Domestic Income"}, {"name": "GDP/GNP"}, {"name": "Gov't Receipts, Expenditures & Investment"}, {"name": "Health Care Spending"}, {"name": "Imputations"}, {"name": "Industry"}, {"name": "Personal Income & Outlays"}, {"name": "Price Indexes & Deflators"}, {"name": "Private Enterprise Income"}, {"name": "Quantity Indexes"}, {"name": "Effect of ARRA on Selected NIPA Estimates"}]}, {"name": "Federal Government Debt", "children": [{"name": "Federal Government Debt"}]}, {"name": "Flow of Funds", "children": [{"name": "Flow of Funds"}, {"name": "B.101 Balance Sheet of Households and Nonprofit Organizations"}, {"name": "B.103 Balance Sheet of Nonfinancial Corporate Business"}, {"name": "B.104 Balance Sheet of Nonfinancial Noncorporate Business"}, {"name": "D.3 Credit Market Debt Outstanding by Sector"}, {"name": "L.1 Credit Market Debt Outstanding"}, {"name": "L.203 Net Interbank Transactions"}, {"name": "L.208 Debt Securities"}, {"name": "L.214 Loans"}, {"name": "S.1 Total Economy - Current Account"}, {"name": "S.2 Selected Aggregates for Total Economy and Sectors"}, {"name": "S.3 Households and Nonprofit Institutions Serving Households"}, {"name": "S.4 Nonfinancial Noncorporate Business"}, {"name": "S.5 Nonfinancial Corporate Business"}, {"name": "S.6 Financial Business"}, {"name": "S.7 Federal Government"}, {"name": "S.8 State and Local Governments"}, {"name": "S.9 Rest of the World"}]}, {"name": "U.S. Trade & International Transactions", "children": [{"name": "U.S. Trade & International Transactions"}, {"name": "Exports"}, {"name": "Imports"}, {"name": "Income Payments & Receipts"}, {"name": "International Investment Position"}, {"name": "Trade Balance"}, {"name": "U.S. International Finance"}]}]}, {"name": "Production & Business Activity", "children": [{"name": "Business Cycle Expansions & Contractions", "children": [{"name": "Business Cycle Expansions & Contractions"}]}, {"name": "Construction", "children": [{"name": "Construction"}]}, {"name": "Finance Companies", "children": [{"name": "Finance Companies"}]}, {"name": "Health Insurance", "children": [{"name": "Health Insurance"}]}, {"name": "Housing", "children": [{"name": "Housing"}, {"name": "Housing Units Authorized by Building Permits"}, {"name": "Housing Units Authorized, But Not Yet Started"}, {"name": "Housing Starts"}, {"name": "Housing Units Under Construction"}, {"name": "Housing Units Completed"}, {"name": "New Residential Sales"}, {"name": "House Price Indexes"}]}, {"name": "Industrial Production & Capacity Utilization", "children": [{"name": "Industrial Production & Capacity Utilization"}]}, {"name": "Manufacturing", "children": [{"name": "Manufacturing"}, {"name": "Inventories"}, {"name": "New Orders"}, {"name": "Inventory to Shipments"}, {"name": "Unfilled Orders"}, {"name": "Unfilled Orders to Shipments"}, {"name": "Shipments"}]}, {"name": "Retail Trade", "children": [{"name": "Retail Trade"}]}, {"name": "Services", "children": [{"name": "Services"}]}, {"name": "Technology", "children": [{"name": "Technology"}]}, {"name": "Transportation", "children": [{"name": "Transportation"}, {"name": "Motor Vehicles"}]}, {"name": "Wholesale Trade", "children": [{"name": "Wholesale Trade"}]}]}, {"name": "Prices", "children": [{"name": "Commodities", "children": [{"name": "Commodities"}]}, {"name": "Consumer Price Indexes (CPI and PCE)", "children": [{"name": "Consumer Price Indexes (CPI and PCE)"}, {"name": "Food and Beverages"}, {"name": "Housing"}, {"name": "Apparel"}, {"name": "Transportation"}, {"name": "Medical Care"}, {"name": "Recreation"}, {"name": "Education and Communication"}, {"name": "Other Goods and Services"}, {"name": "Commodity and Services Groups"}, {"name": "Special Indexes"}]}, {"name": "Cryptocurrencies", "children": [{"name": "Cryptocurrencies"}]}, {"name": "Employment Cost Index", "children": [{"name": "Employment Cost Index"}, {"name": "Population, Employment, & Labor Markets"}]}, {"name": "Health Care Indexes", "children": [{"name": "Health Care Indexes"}]}, {"name": "House Price Indexes", "children": [{"name": "House Price Indexes"}]}, {"name": "Producer Price Indexes (PPI)", "children": [{"name": "Producer Price Indexes (PPI)"}, {"name": "Commodity Based"}, {"name": "Industry Based"}]}, {"name": "Trade Indexes", "children": [{"name": "Trade Indexes"}, {"name": "Import Price Indexes"}, {"name": "Export Price Indexes"}, {"name": "Services Price Indexes"}]}]}, {"name": "International Data", "children": [{"name": "Countries", "children": [{"name": "Countries"}, {"name": "Afghanistan"}, {"name": "Albania"}, {"name": "Algeria"}, {"name": "American Samoa"}, {"name": "Andorra"}, {"name": "Angola"}, {"name": "Anguilla"}, {"name": "Antigua and Barbuda"}, {"name": "Argentina"}, {"name": "Armenia"}, {"name": "Aruba"}, {"name": "Australia"}, {"name": "Austria"}, {"name": "Azerbaijan"}, {"name": "Bahamas"}, {"name": "Bahrain"}, {"name": "Bangladesh"}, {"name": "Barbados"}, {"name": "Belarus"}, {"name": "Belgium"}, {"name": "Belize"}, {"name": "Benin"}, {"name": "Bermuda"}, {"name": "Bhutan"}, {"name": "Bolivia, Plurinational State of"}, {"name": "Caribbean Netherlands"}, {"name": "Bosnia and Herzegovina"}, {"name": "Botswana"}, {"name": "Brazil"}, {"name": "British Indian Ocean Territory"}, {"name": "Brunei Darussalam"}, {"name": "Bulgaria"}, {"name": "Burkina Faso"}, {"name": "Burundi"}, {"name": "Cambodia"}, {"name": "Cameroon"}, {"name": "Canada"}, {"name": "Cape Verde"}, {"name": "Cayman Islands"}, {"name": "Central African Republic"}, {"name": "Chad"}, {"name": "Chile"}, {"name": "China"}, {"name": "Christmas Island"}, {"name": "Cocos (Keeling) Islands"}, {"name": "Colombia"}, {"name": "Comoros"}, {"name": "Congo, Republic of the"}, {"name": "Congo, Democratic Republic of the"}, {"name": "Cook Islands"}, {"name": "Costa Rica"}, {"name": "C\u00f4te d\u2019Ivoire"}, {"name": "Croatia"}, {"name": "Cuba"}, {"name": "Cura\u00e7ao"}, {"name": "Cyprus"}, {"name": "Czech Republic"}, {"name": "Denmark"}, {"name": "Djibouti"}, {"name": "Dominica"}, {"name": "Dominican Republic"}, {"name": "Ecuador"}, {"name": "Egypt"}, {"name": "El Salvador"}, {"name": "Equatorial Guinea"}, {"name": "Eritrea"}, {"name": "Estonia"}, {"name": "Ethiopia"}, {"name": "Falkland Islands"}, {"name": "Faroe Islands"}, {"name": "Fiji"}, {"name": "Finland"}, {"name": "France"}, {"name": "French Guiana"}, {"name": "French Polynesia"}, {"name": "French Southern Territories"}, {"name": "Gabon"}, {"name": "Republic of the Gambia"}, {"name": "Georgia"}, {"name": "Germany"}, {"name": "Ghana"}, {"name": "Gibraltar"}, {"name": "Greece"}, {"name": "Greenland"}, {"name": "Grenada"}, {"name": "Guadeloupe"}, {"name": "Guam"}, {"name": "Guatemala"}, {"name": "Guinea"}, {"name": "Guinea-Bissau"}, {"name": "Guyana"}, {"name": "Haiti"}, {"name": "Heard Island and McDonald Islands"}, {"name": "Holy See (Vatican City State)"}, {"name": "Honduras"}, {"name": "Hong Kong"}, {"name": "Hungary"}, {"name": "Iceland"}, {"name": "India"}, {"name": "Indonesia"}, {"name": "Iran, Islamic Republic of"}, {"name": "Iraq"}, {"name": "Ireland"}, {"name": "Isle of Man"}, {"name": "Israel"}, {"name": "Italy"}, {"name": "Jamaica"}, {"name": "Japan"}, {"name": "Jordan"}, {"name": "Kazakhstan"}, {"name": "Kenya"}, {"name": "Kiribati"}, {"name": "Korea, Democratic People's Republic of (North Korea)"}, {"name": "Korea, Republic of (South Korea)"}, {"name": "Kuwait"}, {"name": "Kyrgyz Republic"}, {"name": "Lao People's Democratic Republic"}, {"name": "Latvia"}, {"name": "Lebanon"}, {"name": "Lesotho"}, {"name": "Liberia"}, {"name": "Libyan Arab Jamahiriya"}, {"name": "Liechtenstein"}, {"name": "Lithuania"}, {"name": "Luxembourg"}, {"name": "Macao"}, {"name": "Macedonia, Former Yugoslav Republic of"}, {"name": "Madagascar"}, {"name": "Malawi"}, {"name": "Malaysia"}, {"name": "Maldives"}, {"name": "Mali"}, {"name": "Malta"}, {"name": "Marshall Islands"}, {"name": "Martinique"}, {"name": "Mauritania"}, {"name": "Mauritius"}, {"name": "Mayotte"}, {"name": "Mexico"}, {"name": "Micronesia, Federated States of"}, {"name": "Moldova, Republic of"}, {"name": "Monaco"}, {"name": "Mongolia"}, {"name": "Montenegro"}, {"name": "Montserrat"}, {"name": "Morocco"}, {"name": "Mozambique"}, {"name": "Myanmar"}, {"name": "Namibia"}, {"name": "Nauru"}, {"name": "Nepal"}, {"name": "Netherlands"}, {"name": "New Caledonia"}, {"name": "New Zealand"}, {"name": "Nicaragua"}, {"name": "Niger"}, {"name": "Nigeria"}, {"name": "Niue"}, {"name": "Norfolk Island"}, {"name": "Northern Mariana Islands"}, {"name": "Norway"}, {"name": "Oman"}, {"name": "Pakistan"}, {"name": "Palau"}, {"name": "Palestinian Territories"}, {"name": "Panama"}, {"name": "Papua New Guinea"}, {"name": "Paraguay"}, {"name": "Peru"}, {"name": "Philippines"}, {"name": "Pitcairn"}, {"name": "Poland"}, {"name": "Portugal"}, {"name": "Puerto Rico"}, {"name": "Qatar"}, {"name": "Reunion"}, {"name": "Romania"}, {"name": "Russian Federation"}, {"name": "Rwanda"}, {"name": "Saint Helena, Ascension and Tristan da Cunha"}, {"name": "Saint Kitts and Nevis"}, {"name": "Saint Lucia"}, {"name": "Saint Martin, Collectivity of"}, {"name": "Saint Pierre and Miquelon"}, {"name": "Saint Vincent and the Grenadines"}, {"name": "Samoa"}, {"name": "San Marino"}, {"name": "Sao Tome and Principe"}, {"name": "Saudi Arabia"}, {"name": "Senegal"}, {"name": "Serbia"}, {"name": "Seychelles"}, {"name": "Sierra Leone"}, {"name": "Singapore"}, {"name": "Sint Maarten (Dutch part)"}, {"name": "Slovak Republic"}, {"name": "Slovenia"}, {"name": "Solomon Islands"}, {"name": "Somalia"}, {"name": "South Africa"}, {"name": "South Sudan"}, {"name": "Spain"}, {"name": "Sri Lanka"}, {"name": "Sudan"}, {"name": "Suriname"}, {"name": "Svalbard and Jan Mayen"}, {"name": "Swaziland"}, {"name": "Sweden"}, {"name": "Switzerland"}, {"name": "Syrian Arab Republic"}, {"name": "Taiwan"}, {"name": "Tajikistan"}, {"name": "Tanzania, United Republic of"}, {"name": "Thailand"}, {"name": "Timor-Leste"}, {"name": "Togo"}, {"name": "Tokelau"}, {"name": "Tonga"}, {"name": "Trinidad and Tobago"}, {"name": "Tunisia"}, {"name": "Turkey"}, {"name": "Turkmenistan"}, {"name": "Turks and Caicos Islands"}, {"name": "Tuvalu"}, {"name": "Uganda"}, {"name": "Ukraine"}, {"name": "United Arab Emirates"}, {"name": "United Kingdom"}, {"name": "United States"}, {"name": "Uruguay"}, {"name": "Uzbekistan"}, {"name": "Vanuatu"}, {"name": "Venezuela, Bolivarian Republic of"}, {"name": "Viet Nam"}, {"name": "Virgin Islands, British"}, {"name": "Virgin Islands, U.S."}, {"name": "Wallis and Futuna"}, {"name": "Western Sahara"}, {"name": "Yemen, Republic of"}, {"name": "Kosovo"}, {"name": "Zambia"}, {"name": "Zimbabwe"}]}, {"name": "Geography", "children": [{"name": "Geography"}, {"name": "Africa"}, {"name": "Americas"}, {"name": "Asia"}, {"name": "Europe"}, {"name": "Oceania"}, {"name": "World"}]}, {"name": "Indicators", "children": [{"name": "Indicators"}, {"name": "Money, Banking, & Finance"}, {"name": "National Accounts"}, {"name": "Population, Employment, & Labor Markets"}, {"name": "Production & Business Activity"}, {"name": "Prices"}, {"name": "Consumer Price Index"}, {"name": "Work Started"}, {"name": "Consumer opinion surveys"}, {"name": "Business tendency surveys (construction)"}, {"name": "Business tendency surveys (services)"}, {"name": "Business tendency surveys (manufacturing)"}, {"name": "Business tendency surveys (retail trade)"}, {"name": "Business tendency surveys (non-manufacturing)"}]}, {"name": "Institutions", "children": [{"name": "Institutions"}, {"name": "Advanced Economies"}, {"name": "Association of Southeast Asian Nations (ASEAN)"}, {"name": "Bureau of Labor Statistics Asian Newly Industrialized Countries"}, {"name": "Bureau of Labor Statistics Industrialized Countries"}, {"name": "Bureau of Labor Statistics Latin America"}, {"name": "Bureau of Labor Statistics Pacific Rim"}, {"name": "Emerging Markets"}, {"name": "Euro Area"}, {"name": "European Economic Area"}, {"name": "European Union"}, {"name": "Four Big European Countries"}, {"name": "Group of Seven (G7)"}, {"name": "Group of Twenty Finance Ministers and Central Bank Governors (G20)"}, {"name": "International Monetary Fund"}, {"name": "International Organizations"}, {"name": "Major 5 Asia"}, {"name": "NAFTA"}, {"name": "Non-OECD"}, {"name": "OECD Non-member Economies"}, {"name": "OECD Total"}, {"name": "OECD + Non-member Economies"}, {"name": "OECD - Europe"}, {"name": "Unidentified Countries"}, {"name": "Advance Technology Products"}, {"name": "NICS"}]}]}, {"name": "U.S. Regional Data", "children": [{"name": "States", "children": [{"name": "Alabama"}, {"name": "Alaska"}, {"name": "Arizona"}, {"name": "Arkansas"}, {"name": "California"}, {"name": "Colorado"}, {"name": "Connecticut"}, {"name": "Delaware"}, {"name": "District of Columbia"}, {"name": "Florida"}, {"name": "Georgia"}, {"name": "Hawaii"}, {"name": "Idaho"}, {"name": "Illinois"}, {"name": "Indiana"}, {"name": "Iowa"}, {"name": "Kansas"}, {"name": "Kentucky"}, {"name": "Louisiana"}, {"name": "Maine"}, {"name": "Maryland"}, {"name": "Massachusetts"}, {"name": "Michigan"}, {"name": "Minnesota"}, {"name": "Mississippi"}, {"name": "Missouri"}, {"name": "Montana"}, {"name": "Nebraska"}, {"name": "Nevada"}, {"name": "New Hampshire"}, {"name": "New Jersey"}, {"name": "New Mexico"}, {"name": "New York"}, {"name": "North Carolina"}, {"name": "North Dakota"}, {"name": "Ohio"}, {"name": "Oklahoma"}, {"name": "Oregon"}, {"name": "Pennsylvania"}, {"name": "Puerto Rico"}, {"name": "Rhode Island"}, {"name": "South Carolina"}, {"name": "South Dakota"}, {"name": "Tennessee"}, {"name": "Texas"}, {"name": "Utah"}, {"name": "Vermont"}, {"name": "Virgin Islands"}, {"name": "Virginia"}, {"name": "West Virginia"}, {"name": "Washington"}, {"name": "Wisconsin"}, {"name": "Wyoming"}]}, {"name": "Census Regions", "children": [{"name": "Midwest"}, {"name": "Northeast"}, {"name": "South"}, {"name": "West"}]}, {"name": "BEA Regions", "children": [{"name": "Far West"}, {"name": "Great Lakes"}, {"name": "Mideast"}, {"name": "New England"}, {"name": "Plains"}, {"name": "Rocky Mountain"}, {"name": "Southeast"}, {"name": "Southwest"}]}, {"name": "BLS Regions", "children": [{"name": "Midwest Urban"}, {"name": "Northeast Urban"}, {"name": "South Urban"}, {"name": "West Urban"}, {"name": "Population Size Class A (over 1,500,000)"}, {"name": "Population Size Class B/C (between 50,000 and 1,500,000)"}, {"name": "Population Size Class D (under 50,000)"}]}, {"name": "Federal Reserve Districts", "children": [{"name": "Atlanta"}, {"name": "Boston"}, {"name": "Chicago"}, {"name": "Cleveland"}, {"name": "Dallas"}, {"name": "Kansas City"}, {"name": "Minneapolis"}, {"name": "New York"}, {"name": "Philadelphia"}, {"name": "Richmond"}, {"name": "San Francisco"}, {"name": "St. Louis"}]}, {"name": "Freddie Mac Regions", "children": [{"name": "North Central"}, {"name": "Northeast"}, {"name": "Southeast"}, {"name": "Southwest"}, {"name": "West"}]}]}]}];
var data = dataArr[0];
var margin = {top: 20, right: 20, bottom: 20, left: 20},
width = 2000;
var radius = width / 2;
tree = data => d3.tree()
.size([2 * Math.PI, radius])
.separation((a, b) => (a.parent == b.parent ? 1 : 2) / a.depth)
(d3.hierarchy(data))
const root = tree(data);
const svg = d3.select("#chart").append("svg")
.attr("width", width)
.attr("height", width)
.style("width", "100%")
.style("height", "auto")
.style("padding", "10px")
.style("box-sizing", "border-box")
.style("font", "10px sans-serif")
.attr("viewBox", "0 0 4000 4000")
const g = svg.append("g")
.attr("transform", "translate(" + (2000+margin.left) + "," + (2000+margin.top)+ ")");
const link = g.append("g")
.attr("fill", "none")
.attr("stroke", "#555")
.attr("stroke-opacity", 0.4)
.attr("stroke-width", 1.5)
.selectAll("path")
.data(root.links())
.enter().append("path")
.attr("d", d3.linkRadial()
.angle(d => d.x)
.radius(d => d.y));
const node = g.append("g")
.attr("stroke-linejoin", "round")
.attr("stroke-width", 3)
.selectAll("g")
.data(root.descendants().reverse())
.enter().append("g")
.attr("transform", d => `
rotate(${d.x * 180 / Math.PI - 90})
translate(${d.y},0)
`);
node.append("circle")
.attr("fill", d => d.children ? "#555" : "#999")
.attr("r", 2.5);
node.append("text")
.attr("dy", "0.31em")
.attr("x", d => d.x < Math.PI === !d.children ? 6 : -6)
.attr("text-anchor", d => d.x < Math.PI === !d.children ? "start" : "end")
.attr("transform", d => d.x >= Math.PI ? "rotate(180)" : null)
.text(d => d.data.name)
.clone(true).lower()
.attr("stroke", "white");
document.body.appendChild(svg.node());
const box = g.node().getBBox();
</script>
</body>
</html>