JSFiddle - React, Tailwind, and code Playground
by Simon Raper
HTML
<div id="content">
<svg width="500" height="500">
<path d="M 100 350 q 150 -300 300 0" stroke="blue"
stroke-width="5" fill="none" />
</svg>
</div>
JavaScript
var tree_data = {
"name": "root",
"children": [{
"name": "purpledog.com"
}, {
"name": "squishedfish.co.uk"
}, {
"name": "blogs",
"children": [{
"name": "political",
"children": [{
"name": "flatbat.com"
}, {
"name": "netfrog.co.uk"
}]
}, {
"name": "squarespider.com"
}
]
}]
};
var width = 500,
height = 500;
var svg = d3.select("#content").append("svg")
.attr("width", width)
.attr("height", height)
.append("g")
.attr("transform", "translate(40,0)")
var cluster = d3.layout.tree()
.size([height, width - 160]);
var nodes = cluster.nodes(tree_data),
links = cluster.links(nodes);
var diagonal = d3.svg.diagonal()
.projection(function (d) {
return [d.y, d.x];
});