Skip to content

Instantly share code, notes, and snippets.

@satomacoto
Last active December 15, 2015 11:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save satomacoto/5251189 to your computer and use it in GitHub Desktop.
Save satomacoto/5251189 to your computer and use it in GitHub Desktop.
Authors Relationships based upon Not-kanji-hiragana Rubis

Visulalize authors relationships based upon not-hiragana-kanji rubis on Aozorabunko.

{"directed": false, "graph": [], "nodes": [{"id": "\u5c71\u5ddd\u767b\u7f8e\u5b50", "weight": 1.0648685764184713}, {"id": "\u5c0f\u6797\u591a\u559c\u4e8c", "weight": 27.25786535827656}, {"id": "\u30b7\u30e5\u30cb\u30c3\u30c4\u30ec\u30eb\u30a2\u30eb\u30c4\u30fc\u30eb", "weight": 0.3007669470559129}, {"id": "\u5225\u6240\u6885\u4e4b\u52a9", "weight": 0.030539351639220023}, {"id": "\u6b63\u5ca1\u5b50\u898f", "weight": 32.22529414323354}, {"id": "\u30ef\u30eb\u30e9\u30b9\u30de\u30ea\u30fc\u30fb\u30a8\u30b9\u30d7\u30ea\u30fb\u30ec\u30aa\u30f3", "weight": 5.7257923226558285}, {"id": "\u6797\u7530\u6e05\u660e", "weight": 1.005128205128205}, {"id": "\u4e2d\u6ca2\u81e8\u5ddd", "weight": 1.8555048660271665}, {"id": "\u68b6\u4e95\u57fa\u6b21\u90ce", "weight": 33.80959796558405}, {"id": "\u30b9\u30c8\u30c3\u30af\u30c8\u30f3\u30d5\u30e9\u30f3\u30b7\u30b9\u30fb\u30ea\u30c1\u30e3\u30fc\u30c9", "weight": 0.5316961157900244}, {"id": "\u30de\u30eb\u30b5\u30b9\u30c8\u30de\u30b9\u30fb\u30ed\u30d0\u30fc\u30c8", "weight": 11.475838193722275}, {"id": "\u5bfa\u7530\u5bc5\u5f66", "weight": 28.742276588861774}, {"id": "\u76f4\u6728\u4e09\u5341\u4e94", "weight": 55.17201608156298}, {"id": "\u5409\u4e95\u52c7", "weight": 0.13470364924705025}, {"id": "\u30ec\u30cb\u30a8\u30a2\u30f3\u30ea\u30fb\u30c9", "weight": 10.21450089594307}, {"id": "\u658e\u85e4\u8302\u5409", "weight": 37.72034087472972}, {"id": "\u7530\u4e2d\u65e9\u82d7", "weight": 2.6456394869736077}, {"id": "\u30af\u30ed\u30fc\u30c7\u30eb\u30dd\u30fc\u30eb", "weight": 0.12058240270401469}, {"id": "\u6751\u5c71\u69d0\u591a", "weight": 0.141140362561026}, {"id": "\u6cc9\u93e1\u592a\u90ce", "weight": 10.559138898034924}, {"id": "\u6b66\u7530\u7950\u5409", "weight": 2.453791284342544}, {"id": "\u4e95\u4e0a\u5186\u4e86", "weight": 22.98645360152926}, {"id": "\u4e2d\u91cc\u4ecb\u5c71", "weight": 49.25280846239464}, {"id": "\u5c0f\u5ddd\u672a\u660e", "weight": 13.661108821621145}, {"id": "\u7a17\u7530\u963f\u793c", "weight": 2.453791284342544}, {"id": "\u5ca1\u672c\u7dba\u5802", "weight": 59.59269144503138}, {"id": "\u6d77\u91ce\u5341\u4e09", "weight": 78.82667353037955}, {"id": "\u30a2\u30eb\u30c1\u30d0\u30b7\u30a7\u30c3\u30d5\u30df\u30cf\u30a4\u30eb\u30fb\u30da\u30c8\u30ed\u30fc\u30f4\u30a3\u30c1", "weight": 7.046944383312174}, {"id": "\u30c9\u30a4\u30eb\u30a2\u30fc\u30b5\u30fc\u30fb\u30b3\u30ca\u30f3", "weight": 37.02916790904891}, {"id": "\u798f\u7530\u82f1\u5b50", "weight": 11.988603961042328}, {"id": "\u4e2d\u5cf6\u6566", "weight": 55.34132117104546}, {"id": "\u30d6\u30ed\u30a4\u30cb\u30f3\u30b0\u30a8\u30ec\u30aa\u30ce\u30fc\u30ec\u30fb\u30d5\u30a9\u30f3", "weight": 1.7947978608661965}, {"id": "\u5ca1\u672c\u304b\u306e\u5b50", "weight": 62.440563127062376}, {"id": "\u7e54\u7530\u4f5c\u4e4b\u52a9", "weight": 21.624328125162847}, {"id": "\u30db\u30d5\u30de\u30f3\u30a8\u30eb\u30f3\u30b9\u30c8\u30fb\u30c6\u30aa\u30c9\u30fc\u30a2\u30fb\u30a2\u30de\u30fc\u30c7\u30a6\u30b9", "weight": 0.20927442794697587}, {"id": "\u30b3\u30ed\u30ec\u30f3\u30b3\u30a6\u30e9\u30b8\u30df\u30fc\u30eb\u30fb\u30ac\u30e9\u30af\u30c6\u30a3\u30aa\u30ce\u30f4\u30a3\u30c1", "weight": 0.4787097242213141}, {"id": "\u4e0e\u8b1d\u91ce\u6676\u5b50", "weight": 60.07895353630252}, {"id": "\u6176\u61c9\u7fa9\u587e", "weight": 0.09720090300454708}, {"id": "\u677e\u6c38\u5ef6\u9020", "weight": 0.5077834408617182}, {"id": "\u9577\u8c37\u5ddd\u6642\u96e8", "weight": 45.29501807846759}, {"id": "\u30d9\u30eb\u30c8\u30e9\u30f3\u30eb\u30a4", "weight": 0.04369668749709072}, {"id": "\u5ca9\u672c\u7d20\u767d", "weight": 1.8540148810061736}, {"id": "\u592a\u5b89\u4e07\u4fb6", "weight": 2.4537912843425436}, {"id": "\u82a5\u5ddd\u7adc\u4e4b\u4ecb", "weight": 89.75751659838664}, {"id": "\u30d2\u30eb\u30b7\u30e5\u30d5\u30a7\u30eb\u30c9\u30b2\u30aa\u30eb\u30d2", "weight": 0.17596053729830902}, {"id": "\u30b9\u30c8\u30ea\u30f3\u30c9\u30d9\u30ea\u30a2\u30a6\u30b0\u30b9\u30c8", "weight": 0.34917412042132856}, {"id": "\u4e45\u751f\u5341\u862d", "weight": 72.94220667688803}, {"id": "\u5357\u65b9\u718a\u6960", "weight": 21.427766255259094}, {"id": "\u6728\u66ae\u7406\u592a\u90ce", "weight": 6.513079900585658}, {"id": "\u30eb\u30f4\u30a7\u30eb\u30e2\u30fc\u30ea\u30b9", "weight": 2.645639486973608}, {"id": "\u5922\u91ce\u4e45\u4f5c", "weight": 100.76151606303519}, {"id": "\u9ad8\u982d\u4ec1\u5175\u885b", "weight": 1.738660580893184}, {"id": "\u5a66\u4eba\u6587\u5316\u7814\u7a76\u4f1a", "weight": 6.6851086445816055}, {"id": "\u5c0f\u6817\u866b\u592a\u90ce", "weight": 84.99469162675895}, {"id": "\u30eb\u30d6\u30e9\u30f3\u30e2\u30fc\u30ea\u30b9", "weight": 31.884336867520698}, {"id": "\u6b63\u5ca1\u5bb9", "weight": 8.654004872580742}, {"id": "\u5c0f\u9152\u4e95\u4e0d\u6728", "weight": 45.558857495392374}, {"id": "\u5317\u539f\u767d\u79cb", "weight": 51.15424738282401}, {"id": "\u5c0f\u6cc9\u516b\u96f2", "weight": 1.005128205128205}, {"id": "\u67f3\u5b97\u60a6", "weight": 2.654674281830727}, {"id": "\u4e0e\u8b1d\u91ce\u5bdb", "weight": 43.911737346091115}, {"id": "\u68ee\u6797\u592a\u90ce", "weight": 39.67303510566782}, {"id": "\u6cc9\u93e1\u82b1", "weight": 63.125840024626115}, {"id": "\u5e78\u7530\u9732\u4f34", "weight": 34.291106983459876}, {"id": "\u5c0f\u5cf6\u70cf\u6c34", "weight": 39.8957206707807}, {"id": "\u77f3\u5ddd\u5544\u6728", "weight": 60.7378783558682}, {"id": "\u30cf\u30a4\u30c9\u30c0\u30b0\u30e9\u30b9", "weight": 1.7988286328183583}, {"id": "\u5bae\u672c\u767e\u5408\u5b50", "weight": 81.33022465639152}, {"id": "\u6b63\u6728\u4e0d\u5982\u4e18", "weight": 4.4923259783770115}, {"id": "\u590f\u76ee\u6f31\u77f3", "weight": 84.49649976047095}, {"id": "\u9b6f\u8fc5", "weight": 13.508981507259378}, {"id": "\u56fd\u679d\u53f2\u90ce", "weight": 66.80843653850057}, {"id": "\u4e95\u4e0a\u7d05\u6885", "weight": 13.508981507259376}, {"id": "\u6797\u8299\u7f8e\u5b50", "weight": 38.61524619134585}, {"id": "\u4e2d\u8c37\u5b87\u5409\u90ce", "weight": 37.76016008738397}, {"id": "\u30f4\u30a7\u30fc\u30b2\u30e9\u30fc\u30d5\u30e9\u30f3\u30c4\u30fb\u30b2\u30eb\u30cf\u30eb\u30c8", "weight": 1.794797860866197}, {"id": "\u30b1\u30cd\u30c7\u30a3\u30d1\u30c8\u30ea\u30c3\u30af", "weight": 1.798828632818358}, {"id": "\u5742\u53e3\u5b89\u543e", "weight": 47.73563541383455}, {"id": "\u30ad\u30e3\u30ed\u30eb\u30eb\u30a4\u30b9", "weight": 1.0007656967840735}, {"id": "\u30cb\u30e5\u30fc\u30b3\u30e0\u30b7\u30e2\u30f3", "weight": 9.13580647172299}, {"id": "\u6d45\u4e95\u6d0c", "weight": 0.6019898479878885}, {"id": "\u30c7\u30a3\u30b1\u30f3\u30ba\u30c1\u30e3\u30fc\u30eb\u30ba", "weight": 15.039454226588173}, {"id": "\u65b0\u6e21\u6238\u7a32\u9020", "weight": 41.36862864112779}, {"id": "\u6e9d\u53e3\u5065\u4e8c", "weight": 1.8675692415128875}, {"id": "\u6728\u4e0b\u5c1a\u6c5f", "weight": 24.87353144834995}, {"id": "\u5357\u90e8\u4fee\u592a\u90ce", "weight": 6.265093111163928}, {"id": "\u624b\u585a\u5bff\u90ce", "weight": 5.7257923226558285}, {"id": "\u68ee\u9d0e\u5916", "weight": 73.53810607382283}, {"id": "\u30b5\u30de\u30f3\u30a2\u30eb\u30d9\u30fc\u30eb", "weight": 8.951846217534486}, {"id": "\u5897\u7530\u96c5\u5b50", "weight": 1.064868576418471}, {"id": "\u30c1\u30a7\u30b9\u30bf\u30fc\u30c8\u30f3\u30ae\u30eb\u30d0\u30fc\u30c8\u30fb\u30ad\u30fc\u30b9", "weight": 38.688953182215585}, {"id": "\u67f4\u5d0e\u82b3\u592a\u90ce", "weight": 1.738660580893184}, {"id": "\u862d\u90c1\u4e8c\u90ce", "weight": 25.263799175013126}, {"id": "\u5cf6\u5d0e\u85e4\u6751", "weight": 64.3192070908802}, {"id": "\u7532\u8cc0\u4e09\u90ce", "weight": 24.663068513283637}, {"id": "\u4e0a\u7530\u654f", "weight": 24.672272031853144}, {"id": "\u5e73\u6797\u521d\u4e4b\u8f14", "weight": 38.74750461157882}, {"id": "\u7530\u4e2d\u82f1\u5149", "weight": 24.65098745985523}, {"id": "\u5409\u7530\u79c0\u592b", "weight": 13.357499628293391}, {"id": "\u5185\u7530\u9b6f\u5eb5", "weight": 40.33859713118131}, {"id": "\u4f50\u3005\u6728\u76f4\u6b21\u90ce", "weight": 15.615250599390393}, {"id": "\u8c37\u8b72\u6b21", "weight": 83.07334319291843}, {"id": "\u6771\u5065\u800c", "weight": 0.9805752278928022}, {"id": "\u4e18\u4e18\u5341\u90ce", "weight": 24.64231015668209}], "links": [{"source": 0, "target": 89, "weight": 1.0}, {"source": 1, "target": 86, "weight": 1.0}, {"source": 2, "target": 61, "weight": 1.0}, {"source": 3, "target": 93, "weight": 1.0}, {"source": 4, "target": 49, "weight": 1.0}, {"source": 5, "target": 28, "weight": 1.0}, {"source": 5, "target": 56, "weight": 1.0}, {"source": 6, "target": 58, "weight": 1.0}, {"source": 7, "target": 82, "weight": 1.0}, {"source": 7, "target": 46, "weight": 1.0}, {"source": 7, "target": 55, "weight": 1.0}, {"source": 8, "target": 83, "weight": 1.0}, {"source": 9, "target": 25, "weight": 1.0}, {"source": 10, "target": 66, "weight": 1.0}, {"source": 11, "target": 80, "weight": 1.0}, {"source": 12, "target": 86, "weight": 1.0}, {"source": 12, "target": 90, "weight": 1.0}, {"source": 12, "target": 66, "weight": 1.0}, {"source": 13, "target": 87, "weight": 1.0}, {"source": 14, "target": 87, "weight": 1.0}, {"source": 15, "target": 83, "weight": 1.0}, {"source": 16, "target": 29, "weight": 1.0}, {"source": 16, "target": 30, "weight": 1.0}, {"source": 16, "target": 94, "weight": 1.0}, {"source": 16, "target": 49, "weight": 1.0}, {"source": 16, "target": 96, "weight": 1.0}, {"source": 16, "target": 53, "weight": 1.0}, {"source": 16, "target": 85, "weight": 1.0}, {"source": 17, "target": 95, "weight": 1.0}, {"source": 18, "target": 23, "weight": 1.0}, {"source": 19, "target": 89, "weight": 1.0}, {"source": 20, "target": 42, "weight": 1.0}, {"source": 21, "target": 41, "weight": 1.0}, {"source": 22, "target": 91, "weight": 1.0}, {"source": 24, "target": 42, "weight": 1.0}, {"source": 25, "target": 49, "weight": 1.0}, {"source": 25, "target": 34, "weight": 1.0}, {"source": 25, "target": 59, "weight": 1.0}, {"source": 26, "target": 83, "weight": 1.0}, {"source": 27, "target": 43, "weight": 1.0}, {"source": 27, "target": 36, "weight": 1.0}, {"source": 27, "target": 62, "weight": 1.0}, {"source": 28, "target": 102, "weight": 1.0}, {"source": 28, "target": 59, "weight": 1.0}, {"source": 31, "target": 75, "weight": 1.0}, {"source": 32, "target": 38, "weight": 1.0}, {"source": 33, "target": 37, "weight": 1.0}, {"source": 35, "target": 87, "weight": 1.0}, {"source": 36, "target": 80, "weight": 1.0}, {"source": 37, "target": 96, "weight": 1.0}, {"source": 37, "target": 67, "weight": 1.0}, {"source": 38, "target": 87, "weight": 1.0}, {"source": 38, "target": 47, "weight": 1.0}, {"source": 39, "target": 59, "weight": 1.0}, {"source": 40, "target": 95, "weight": 1.0}, {"source": 41, "target": 87, "weight": 1.0}, {"source": 41, "target": 84, "weight": 1.0}, {"source": 44, "target": 69, "weight": 1.0}, {"source": 44, "target": 61, "weight": 1.0}, {"source": 45, "target": 87, "weight": 1.0}, {"source": 48, "target": 56, "weight": 1.0}, {"source": 48, "target": 71, "weight": 1.0}, {"source": 49, "target": 94, "weight": 1.0}, {"source": 49, "target": 50, "weight": 1.0}, {"source": 49, "target": 81, "weight": 1.0}, {"source": 49, "target": 82, "weight": 1.0}, {"source": 49, "target": 100, "weight": 1.0}, {"source": 51, "target": 64, "weight": 1.0}, {"source": 52, "target": 69, "weight": 1.0}, {"source": 52, "target": 54, "weight": 1.0}, {"source": 52, "target": 93, "weight": 1.0}, {"source": 53, "target": 68, "weight": 1.0}, {"source": 53, "target": 80, "weight": 1.0}, {"source": 53, "target": 79, "weight": 1.0}, {"source": 54, "target": 59, "weight": 1.0}, {"source": 56, "target": 86, "weight": 1.0}, {"source": 57, "target": 83, "weight": 1.0}, {"source": 59, "target": 60, "weight": 1.0}, {"source": 59, "target": 93, "weight": 1.0}, {"source": 59, "target": 63, "weight": 1.0}, {"source": 59, "target": 101, "weight": 1.0}, {"source": 59, "target": 84, "weight": 1.0}, {"source": 61, "target": 88, "weight": 1.0}, {"source": 62, "target": 80, "weight": 1.0}, {"source": 62, "target": 83, "weight": 1.0}, {"source": 65, "target": 86, "weight": 1.0}, {"source": 66, "target": 92, "weight": 1.0}, {"source": 66, "target": 74, "weight": 1.0}, {"source": 66, "target": 96, "weight": 1.0}, {"source": 67, "target": 78, "weight": 1.0}, {"source": 70, "target": 72, "weight": 1.0}, {"source": 73, "target": 83, "weight": 1.0}, {"source": 76, "target": 77, "weight": 1.0}, {"source": 76, "target": 98, "weight": 1.0}, {"source": 77, "target": 86, "weight": 1.0}, {"source": 80, "target": 93, "weight": 1.0}, {"source": 83, "target": 97, "weight": 1.0}, {"source": 83, "target": 99, "weight": 1.0}, {"source": 86, "target": 103, "weight": 1.0}, {"source": 87, "target": 89, "weight": 1.0}], "multigraph": false}
<!DOCTYPE html>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v2.min.js?2.9.3"></script>
<style>
.link {
stroke: #ccc;
}
.node text {
fill: #333;
pointer-events: none;
font: 10px sans-serif;
}
body {
fill: #fff;
}
</style>
<body>
<script>
var width = 960,
height = 500,
nodes, _nodes,
links, _links;
var color = d3.scale.category20();
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height)
.append("svg:g")
.call(d3.behavior.zoom().on("zoom", redraw))
.append("svg:g");
svg.append('svg:rect')
.attr('x', -100000)
.attr('y', -100000)
.attr('width', 200000)
.attr('height', 200000);
function redraw() {
svg.attr("transform",
"translate(" + d3.event.translate + ")"
+ " scale(" + d3.event.scale + ")");
}
var force = d3.layout.force()
.gravity(.05)
.distance(100)
.charge(-100)
.size([width, height]);
d3.json("authors.json", function(json) {
nodes = json.nodes;
links = json.links;
update();
});
function update() {
force
.nodes(nodes)
.links(links)
.linkDistance(function(d) { return d.coauthor ? 10 : 50; })
// .charge(function(d) { return -Math.sqrt(d.weight)*10; })
// .gravity(function(d) { return Math.sqrt(d.weight)/100; })
.start();
var link = svg.selectAll(".link")
.data(links)
.enter().append("line")
.attr("class", "link")
.style("stroke", function(d) { return d.coauthor ? "#f77" : "#ccc"; })
.style("stroke-width", function(d) { return Math.sqrt(d.weight); });
var node = svg.selectAll(".node")
.data(nodes)
.enter().append("g")
.attr("class", "node")
.on("click", click)
.call(force.drag);
node.append("circle")
// .attr("r", 4)
.attr("r", function(d) { return Math.sqrt(d.weight) * 5; })
.style("fill", function(d) { return color(d.group); });
node.append("text")
.attr("dx", 12)
.attr("dy", ".35em")
.text(function(d) { return d.id });
force.on("tick", function() {
link.attr("x1", function(d) { return d.source.x; })
.attr("y1", function(d) { return d.source.y; })
.attr("x2", function(d) { return d.target.x; })
.attr("y2", function(d) { return d.target.y; });
node.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; });
});
}
function click(d) {
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment