Code lightly adapted from mbostock. Data from wikipedia.
Last active
August 29, 2015 13:57
-
-
Save sfsheath/9550811 to your computer and use it in GitHub Desktop.
2nd Century Roman Provinces, Etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Imperium Romanorum", | |
"children": [ | |
{ | |
"name": "Urbs Romae", | |
"children": [ | |
{ "name": "Regio I Porta Capena" }, | |
{ "name": "Regio II Caelimontium" }, | |
{ "name": "Regio III Isis et Serapis" }, | |
{ "name": "Regio IV Templum Pacis" }, | |
{ "name": "Regio V Esquiliae" }, | |
{ "name": "Regio VI Alta Semita" }, | |
{ "name": "Regio VII Via Lata" }, | |
{ "name": "Regio VIII Forum Romanum" }, | |
{ "name": "Regio IX Circus Flaminius" }, | |
{ "name": "Regio X Palatium" }, | |
{ "name": "Regio XI Circus Maximus" }, | |
{ "name": "Regio XII Piscina Publica" }, | |
{ "name": "Regio XIII Aventinus" }, | |
{ "name": "Regio XIV Transtiberim" } | |
] | |
},{ | |
"name": "Italia", | |
"children": [ | |
{ "name": "Regio I Latium et Campania" }, | |
{ "name": "Regio II Apulia et Calabria" }, | |
{ "name": "Regio III Lucania et Brutium" }, | |
{ "name": "Regio IV Samnium" }, | |
{ "name": "Regio V Picenum" }, | |
{ "name": "Regio VI Umbria et Ager Gallicus" }, | |
{ "name": "Regio VII Etruria" }, | |
{ "name": "Regio VIII Aemilia" }, | |
{ "name": "Regio IX Liguria" }, | |
{ "name": "Regio X Venetia et Histria" }, | |
{ "name": "Regio XI Transpadana" } | |
] | |
},{ | |
"name": "Senatorial Provinces", | |
"children": [ | |
{ "name": "Sicilia" }, | |
{ "name": "Corsica et Sardinia" }, | |
{ "name": "Narbonensis"}, | |
{ "name": "Baetica"}, | |
{ "name": "Africa Proconsularis"}, | |
{ "name": "Cyrenaica et Creta"}, | |
{ "name": "Cyprus"}, | |
{ "name": "Asia"}, | |
{ "name": "Bithynia et Pontus"}, | |
{ "name": "Macedonia"}, | |
{ "name": "Achaia"}, | |
{ "name": "Epirus"} | |
] | |
}, | |
{ | |
"name": "Imperial Provinces", | |
"children": [ | |
{ "name": "Alpes Maritimae" }, | |
{ "name": "Alpes Cotiae" }, | |
{ "name": "Alpes Poeniae" }, | |
{ "name": "Germania Superior" }, | |
{ "name": "Germania Inferior" }, | |
{ "name": "Belgica" }, | |
{ "name": "Britannia" }, | |
{ "name": "Lugdunensis" }, | |
{ "name": "Aquitania" }, | |
{ "name": "Tarraconensis" }, | |
{ "name": "Lusitania" }, | |
{ "name": "Mauretania Tingitana" }, | |
{ "name": "Mauretania Caesariensis" }, | |
{ "name": "Aegyptus" }, | |
{ "name": "Arabia Petraea" }, | |
{ "name": "Iudaea" }, | |
{ "name": "Syria" }, | |
{ "name": "Mesopotamia" }, | |
{ "name": "Assyria" }, | |
{ "name": "Armenia" }, | |
{ "name": "Cappadocia" }, | |
{ "name": "Cilicia" }, | |
{ "name": "Galatia" }, | |
{ "name": "Lycia et Pamphylia" }, | |
{ "name": "Thracia" }, | |
{ "name": "Moesia Inferior" }, | |
{ "name": "Moesia Superior" }, | |
{ "name": "Dacia" }, | |
{ "name": "Dalmatia" }, | |
{ "name": "Panonia Inferior" }, | |
{ "name": "Panonia Superior" }, | |
{ "name": "Noricum" }, | |
{ "name": "Raetia" } | |
] | |
}, | |
{ | |
"name": "Client States", | |
"children": [ | |
{ "name": "Regnum Bospori","size":30 } | |
] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
.node circle { | |
fill: #fff; | |
stroke: steelblue; | |
stroke-width: 1.5px; | |
} | |
.node { | |
font: 10px sans-serif; | |
} | |
.link { | |
fill: none; | |
stroke: #ccc; | |
stroke-width: 1.5px; | |
} | |
</style> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
var diameter = 960; | |
var tree = d3.layout.tree() | |
.size([360, diameter / 2 - 120]) | |
.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) | |
.append("g") | |
.attr("transform", "translate(" + diameter / 2 + "," + diameter / 2 + ")"); | |
d3.json("E2ndCenturyAD.json", function(error, root) { | |
var nodes = tree.nodes(root), | |
links = tree.links(nodes); | |
var link = svg.selectAll(".link") | |
.data(links) | |
.enter().append("path") | |
.attr("class", "link") | |
.attr("d", diagonal); | |
var node = svg.selectAll(".node") | |
.data(nodes) | |
.enter().append("g") | |
.attr("class", "node") | |
.attr("transform", function(d) { return "rotate(" + (d.x - 90) + ")translate(" + d.y + ")"; }) | |
node.append("circle") | |
.attr("r", 4.5); | |
node.append("text") | |
.attr("dy", ".31em") | |
.attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; }) | |
.attr("transform", function(d) { return d.x < 180 ? "translate(8)" : "rotate(180)translate(-8)"; }) | |
.text(function(d) { return d.name; }); | |
}); | |
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