Kwik Cluster

by westcoast_509

CSS

.node circle {
    fill: #fff;
    stroke: #41F9D0;
    stroke-width: 1.5px;
}
text {
    font: 15px sans-serif;
    /*pointer-events: none;*/
}
.link {
    fill: none;
    stroke: #41F9D0;
    stroke-width: 1.5px;
}

JavaScript

var data = { 
    "node": "",
        "children": [{
        "name": "cat",
            "location": 141470,
            "context": "very cautiously, like a cat on ice. Martha,"
    }, {
        "name": "birds",
            "location": 143666,
            "context": "Marston they were 'noisy birds, and very disturbing."
    }, {
        "name": "birds",
            "location": 193591,
            "context": "minister than a nest of birds .' She and Mrs"
    }, {
        "name": "animals",
            "location": 209662,
            "context": "and Abel bestowed the various animals , she said to Martha"
    }, {
        "name": "bird",
            "location": 209882,
            "context": "a pie; an ill-contrived bird ; and a filthy smelly"
    }, {
        "name": "minorca cockerel",
            "location": 242409,
            "context": "and white hens and the minorca cockerel pecked about the open door"
    }, {
        "name": "butterfly",
            "location": 253492,
            "context": "skirt-fastener -- the golden butterfly , complicated by various hooks"
    }, {
        "name": "dog",
            "location": 279608,
            "context": "'  'Foxy's a bad dog !' came Mrs."
    }, {
        "name": "dog",
            "location": 279753,
            "context": "But she inna a bad dog , Mrs. Marston;"
    }, {
        "name": "cat",
            "location": 351049,
            "context": "take place?' A cat with a mouse was nothing"
    }, {
        "name": "parrot",
            "location": 395707,
            "context": "?'  'Yes, parrot .' 'Be you"
    }]
}

var diameter = 960;

var tree = d3.layout.tree()
    .size([360, diameter / 2 - 200])
    .separation(function (a, b) {
    return (a.parent == b.parent ? 1 : 2) / a.depth;
});

var diagonal = d3.svg.diagonal.radial()
    .projection(function (d) {
    return [d.y, d.x / 180 * Math.PI];
});

var svg = d3.select("body").append("svg")
    .attr("width", diameter)
    .attr("height", diameter - 50)
...