Skip to content

Instantly share code, notes, and snippets.

@ABSegler
Forked from mbostock/.block
Last active April 11, 2018 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ABSegler/8decedcc598ebd9d3c42 to your computer and use it in GitHub Desktop.
Save ABSegler/8decedcc598ebd9d3c42 to your computer and use it in GitHub Desktop.
Piers Manuscripts Categorized by Textual Variety

Click on any package to zoom in or out.

Each of the white circles represents an individual Piers Plowman manuscript. Circles are ROUGHLY sized proportional to the number of lines of Piers poetry contained in each manuscript. Lines are estimated based on variations accounted for in the Kane editions and can be viewed in the JSON below.

Grades of blue circles represent sub-categories of manuscripts based on the textual contents of each. Categorizations take note both of distinct combinations of A, B, and C text and of differentiations between how much text or how much of each are in a given sample of Piers Plowman.

Forked from Mike Bostock's zoomable circle packing block.

{
"name": "flare",
"children": [
{"name": "ShortText",
"children": [
{
"name": "VisioOnly",
"children": [
{"name": "Z-Text",
"children": [ {"name": "MS_Bodley_851", "size": 1300}]
},
{"name": "A-Text",
"children": [
{"name": "Lincoln's_Inn_No_150", "size": 1900},
{"name": "BL_Harley_MS875", "size": 1950},
{"name": "TrinityCollegeDublin_MS_D.4.12", "size": 1620}
]
}
]
},
{
"name": "VisioVita",
"children": [
{
"name": "ElevenPassus",
"children": [
{
"name": "BA-Hybrid",
"children": [{"name": "BL_Harley_MS3954", "size": 2740}]
},
{
"name": "A-Text",
"children": [
{"name": "Vernon", "size": 2430},
{"name": "SocietyOfAntiquaries_MS_No687", "size": 2570},
{"name": "Bodley_Ashmole_MS1468", "size": 2570},
{"name": "Bodley_Douce_MS323", "size": 2560}
]
}
]
},
{
"name": "TwelvePassus",
"children": [
{"name": "Bodley_Rawlinson_MS137", "size": 2680},
{"name": "UniversityCollegeOxford_MS45", "size": 2510},
{"name": "IngilbyMS_Morgan818", "size": 2650}
]
}
]
}
]
},
{
"name": "LongText",
"children": [
{"name": "B-endings",
"children": [
{"name": "B-Text",
"children": [
{"name": "CambridgeUniLibrary_Dd.1.17", "size": 7310},
{"name": "TrinityCollegeCambridge_B.15.17", "size": 7300},
{"name": "CorpusChristiCollegeOxford_MS201", "size": 7360},
{"name": "Bodley_Laud_MS581", "size": 7300},
{"name": "Bodley_RawlinsonPoet_MS38", "size": 7310},
{"name": "HuntingtonLibrary_Hm128", "size": 7300},
{"name": "BL_Additional_MS35287", "size": 7300},
{"name": "Yates-ThompsonMS_Newnham", "size": 7310},
{"name": "CambridgeUniLibrary_Ll.4.14", "size": 7320},
{"name": "CambridgeUniLibrary_Gg.iv.31", "size": 7310},
{"name": "OrielCollegeOxfordMS45", "size": 7260},
{"name": "BeineckeTakamiyaMS23", "size": 7300}]},
{"name": "B(A)C_Hybrids",
"children": [
{"name": "BL_Additional_MS10754", "size": 7270},
{"name": "MS_Bodley_814", "size": 7300},
{"name": "BL_CottonCaligula_A.xi", "size": 7310}
]
}
]
},
{"name": "BC_ConflatedText",
"children":[
{"name": "HuntingtonLibrary_Hm114", "size": 7800}
]
},
{"name": "C-endings",
"children": [
{"name": "Z(A)C-Text",
"children": [{"name": "Bodley_MS_851", "size": 5710}]},
{"name": "AC_Hybrids",
"children": [
{"name": "VisioSeam",
"children": [{"name": "NatLibWales_733B",
"size": 5530}]},
{"name": "A.XI-C_Seam",
"children": [
{"name": "A.XI-C.XI",
"children": [{"name":"TrinityCollegeCambridge_R.3.14", "size": 6260}]
},
{"name": "A.XI-C.XII",
"children": [
{"name": "olimDukeOfWestminster'sMS", "size": 6250},
{"name": "Chaderton_UniOfLiverpool_F.4.8", "size": 6550},
{"name": "BL_Harley_MS6041", "size": 5950},
{"name": "Bodley_Digby_145", "size": 6260}
]
}
]
}
]
},
{"name": "C-Text",
"children": [
{"name": "TrinityCollegeDublin_MS_D.4.1", "size": 7350},
{"name": "CambridgeUniLibrary_Dd.3.13", "size": 7350},
{"name": "Bodley_LaudMisc_656", "size": 7350},
{"name": "Bodley_Digby_171", "size": 7350},
{"name": "BL_Additional_MS35157", "size": 7350},
{"name": "BL_CottonVespasian_B.xvi", "size": 7360},
{"name": "HuntingtonLibrary_Hm143", "size": 7350},
{"name": "HuntingtonLibrary_Hm137", "size": 7350},
{"name": "Clopton_UoL_S.L.V.17", "size": 7350},
{"name": "CambridgeUniLibrary_Additional_MS4325", "size": 7360},
{"name": "Ilchester_UoL_S.L.V.88", "size": 7450},
{"name": "BL_Additional_MS34779", "size": 7370},
{"name": "Bodley_Digby_102", "size": 7350},
{"name": "BL_Harley_MS2376", "size": 7350},
{"name": "CambridgeUniLibrary_Ff.5.35", "size": 7350},
{"name": "CorpusChristiCollegeCambridge_MS293", "size": 7350},
{"name": "Bodley_Douce_104", "size": 7350},
{"name": "BL_RoyalMS_18.B.xvi", "size": 7360}
]
}
]
}
]
}
]
}
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
cursor: pointer;
}
.node:hover {
stroke: #000;
stroke-width: 1.5px;
}
.node--leaf {
fill: white;
}
.label {
font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif;
text-anchor: middle;
text-shadow: 0 1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff, 0 -1px 0 #fff;
}
.label,
.node--root,
.node--leaf {
pointer-events: none;
}
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var margin = 20,
diameter = 960;
var color = d3.scale.linear()
.domain([-1, 5])
.range(["hsl(152,80%,80%)", "hsl(228,30%,40%)"])
.interpolate(d3.interpolateHcl);
var pack = d3.layout.pack()
.padding(2)
.size([diameter - margin, diameter - margin])
.value(function(d) { return d.size; })
var svg = d3.select("body").append("svg")
.attr("width", diameter)
.attr("height", diameter)
.append("g")
.attr("transform", "translate(" + diameter / 2 + "," + diameter / 2 + ")");
d3.json("flare.json", function(error, root) {
if (error) return console.error(error);
var focus = root,
nodes = pack.nodes(root),
view;
var circle = svg.selectAll("circle")
.data(nodes)
.enter().append("circle")
.attr("class", function(d) { return d.parent ? d.children ? "node" : "node node--leaf" : "node node--root"; })
.style("fill", function(d) { return d.children ? color(d.depth) : null; })
.on("click", function(d) { if (focus !== d) zoom(d), d3.event.stopPropagation(); });
var text = svg.selectAll("text")
.data(nodes)
.enter().append("text")
.attr("class", "label")
.style("fill-opacity", function(d) { return d.parent === root ? 1 : 0; })
.style("display", function(d) { return d.parent === root ? null : "none"; })
.text(function(d) { return d.name; });
var node = svg.selectAll("circle,text");
d3.select("body")
.style("background", color(-1))
.on("click", function() { zoom(root); });
zoomTo([root.x, root.y, root.r * 2 + margin]);
function zoom(d) {
var focus0 = focus; focus = d;
var transition = d3.transition()
.duration(d3.event.altKey ? 7500 : 750)
.tween("zoom", function(d) {
var i = d3.interpolateZoom(view, [focus.x, focus.y, focus.r * 2 + margin]);
return function(t) { zoomTo(i(t)); };
});
transition.selectAll("text")
.filter(function(d) { return d.parent === focus || this.style.display === "inline"; })
.style("fill-opacity", function(d) { return d.parent === focus ? 1 : 0; })
.each("start", function(d) { if (d.parent === focus) this.style.display = "inline"; })
.each("end", function(d) { if (d.parent !== focus) this.style.display = "none"; });
}
function zoomTo(v) {
var k = diameter / v[2]; view = v;
node.attr("transform", function(d) { return "translate(" + (d.x - v[0]) * k + "," + (d.y - v[1]) * k + ")"; });
circle.attr("r", function(d) { return d.r * k; });
}
});
d3.select(self.frameElement).style("height", diameter + "px");
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment