Skip to content

Instantly share code, notes, and snippets.

@xiangze
Forked from satomacoto/README.md
Last active August 29, 2015 13:57
Show Gist options
  • Save xiangze/9720912 to your computer and use it in GitHub Desktop.
Save xiangze/9720912 to your computer and use it in GitHub Desktop.
Visulalized clusters of CRAN packeges dependency network. Genereted by cytoscape 3.0.2 MCODE plugin.

Visulalized clusters of CRAN packeges dependency network (20130927 only connected nodes).

{"directed": false, "graph": [],
"nodes": [
{"id": "ghyp", "weight": 1.0},
{"id": "GeneNet", "weight": 1.0},
{"id": "gWidgetsWWW", "weight": 1.0},
{"id": "IndependenceTests", "weight": 1.0},
{"id": "longitudinal", "weight": 1.0},
{"id": "MSwM", "weight": 1.0},
{"id": "sda", "weight": 1.0},
{"id": "pedantics", "weight": 1.0},
{"id": "spBayes", "weight": 1.0},
{"id": "climdex.pcic", "weight": 1.0},
{"id": "mlDNA", "weight": 1.0},
{"id": "RcmdrPlugin.orloca", "weight": 1.0},
{"id": "RepeatedHighDim", "weight": 1.0},
{"id": "mugnet", "weight": 1.0},
{"id": "catnet", "weight": 1.0},
{"id": "splusTimeDate", "weight": 1.0},
{"id": "XiMpLe", "weight": 1.0},
{"id": "splusTimeSeries", "weight": 1.0},
{"id": "roxyPackage", "weight": 1.0},
{"id": "R2Cuba", "weight": 1.0},
{"id": "multilevel", "weight": 1.0},
{"id": "FRAPO", "weight": 1.0},
{"id": "geotopbricks", "weight": 1.0},
{"id": "ensembleBMA", "weight": 1.0},
{"id": "magic", "weight": 1.0},
{"id": "biglm", "weight": 1.0},
{"id": "multilevelPSA", "weight": 1.0},
{"id": "DBI", "weight": 1.0},
{"id": "objectSignals", "weight": 1.0},
{"id": "PCICt", "weight": 1.0},
{"id": "acs", "weight": 1.0},
{"id": "objectProperties", "weight": 1.0},
{"id": "pcalg", "weight": 1.0},
{"id": "MonetDB.R", "weight": 1.0},
{"id": "miRtest", "weight": 1.0},
{"id": "drc", "weight": 1.0},
{"id": "RcmdrPlugin.EZR", "weight": 1.0},
{"id": "RMySQL", "weight": 1.0},
{"id": "kinship2", "weight": 1.0},
{"id": "Brobdingnag", "weight": 1.0},
{"id": "RPostgreSQL", "weight": 1.0},
{"id": "penalized", "weight": 1.0},
{"id": "EBMAforecast", "weight": 1.0},
{"id": "biganalytics", "weight": 1.0},
{"id": "bigmemory", "weight": 1.0},
{"id": "MALDIquant", "weight": 1.0},
{"id": "lmmlasso", "weight": 1.0},
{"id": "transnet", "weight": 1.0},
{"id": "MALDIquantForeign", "weight": 1.0},
{"id": "arrayhelpers", "weight": 1.0},
{"id": "kernlab", "weight": 1.0},
{"id": "ensembleMOS", "weight": 1.0},
{"id": "kappalab", "weight": 1.0},
{"id": "scales", "weight": 1.0},
{"id": "LeLogicielR", "weight": 1.0},
{"id": "alabama", "weight": 1.0},
{"id": "SemiMarkov", "weight": 1.0},
{"id": "pgs", "weight": 1.0},
{"id": "hyperdirichlet", "weight": 1.0},
{"id": "classify", "weight": 1.0},
{"id": "processdata", "weight": 1.0},
{"id": "pixmap", "weight": 1.0},
{"id": "MM", "weight": 1.0},
{"id": "bcool", "weight": 1.0},
{"id": "truncSP", "weight": 1.0},
{"id": "truncreg", "weight": 1.0},
{"id": "nonparaeff", "weight": 1.0},
{"id": "SODC", "weight": 1.0},
{"id": "mhurdle", "weight": 1.0},
{"id": "MLPAstats", "weight": 1.0},
{"id": "softclassval", "weight": 1.0},
{"id": "untb", "weight": 1.0},
{"id": "planar", "weight": 1.0},
{"id": "psychometric", "weight": 1.0},
{"id": "Oarray", "weight": 1.0},
{"id": "MCMCglmm", "weight": 1.0},
{"id": "orloca", "weight": 1.0},
{"id": "orloca.es", "weight": 1.0},
{"id": "bigtabulate", "weight": 1.0},
{"id": "st", "weight": 1.0},
{"id": "RH2", "weight": 1.0},
{"id": "RSDA", "weight": 1.0},
{"id": "methods", "weight": 1.0},
{"id": "numDeriv", "weight": 1.0},
{"id": "fdrtool", "weight": 1.0},
{"id": "corpcor", "weight": 1.0},
{"id": "proto", "weight": 1.0},
{"id": "xtable", "weight": 1.0},
{"id": "nlme", "weight": 1.0},
{"id": "abind", "weight": 1.0},
{"id": "stringr", "weight": 1.0},
{"id": "pROC", "weight": 1.0},
{"id": "quadprog", "weight": 1.0},
{"id": "chron", "weight": 1.0},
{"id": "psych", "weight": 1.0},
{"id": "reshape2", "weight": 1.0},
{"id": "lpSolve", "weight": 1.0},
{"id": "cubature", "weight": 1.0},
{"id": "partitions", "weight": 1.0},
{"id": "maxLik", "weight": 1.0}
],
"links": [
{"source": 0, "target": 82, "weight": 1.0},
{"source": 0, "target": 83, "weight": 1.0},
{"source": 1, "target": 4, "weight": 1.0},
{"source": 1, "target": 84, "weight": 1.0},
{"source": 1, "target": 85, "weight": 1.0},
{"source": 2, "target": 82, "weight": 1.0},
{"source": 2, "target": 86, "weight": 1.0},
{"source": 3, "target": 87, "weight": 1.0},
{"source": 4, "target": 85, "weight": 1.0},
{"source": 5, "target": 82, "weight": 1.0},
{"source": 5, "target": 88, "weight": 1.0},
{"source": 6, "target": 85, "weight": 1.0},
{"source": 6, "target": 84, "weight": 1.0},
{"source": 7, "target": 38, "weight": 1.0},
{"source": 7, "target": 75, "weight": 1.0},
{"source": 8, "target": 89, "weight": 1.0},
{"source": 8, "target": 24, "weight": 1.0},
{"source": 9, "target": 82, "weight": 1.0},
{"source": 9, "target": 29, "weight": 1.0},
{"source": 10, "target": 90, "weight": 1.0},
{"source": 10, "target": 91, "weight": 1.0},
{"source": 11, "target": 76, "weight": 1.0},
{"source": 11, "target": 77, "weight": 1.0},
{"source": 12, "target": 88, "weight": 1.0},
{"source": 13, "target": 14, "weight": 1.0},
{"source": 13, "target": 82, "weight": 1.0},
{"source": 14, "target": 82, "weight": 1.0},
{"source": 15, "target": 82, "weight": 1.0},
{"source": 16, "target": 82, "weight": 1.0},
{"source": 17, "target": 15, "weight": 1.0},
{"source": 17, "target": 82, "weight": 1.0},
{"source": 18, "target": 16, "weight": 1.0},
{"source": 18, "target": 82, "weight": 1.0},
{"source": 19, "target": 82, "weight": 1.0},
{"source": 20, "target": 88, "weight": 1.0},
{"source": 21, "target": 92, "weight": 1.0},
{"source": 21, "target": 82, "weight": 1.0},
{"source": 22, "target": 90, "weight": 1.0},
{"source": 22, "target": 82, "weight": 1.0},
{"source": 23, "target": 93, "weight": 1.0},
{"source": 24, "target": 89, "weight": 1.0},
{"source": 25, "target": 82, "weight": 1.0},
{"source": 25, "target": 27, "weight": 1.0},
{"source": 26, "target": 94, "weight": 1.0},
{"source": 26, "target": 86, "weight": 1.0},
{"source": 26, "target": 87, "weight": 1.0},
{"source": 27, "target": 82, "weight": 1.0},
{"source": 28, "target": 82, "weight": 1.0},
{"source": 29, "target": 82, "weight": 1.0},
{"source": 30, "target": 82, "weight": 1.0},
{"source": 30, "target": 90, "weight": 1.0},
{"source": 31, "target": 28, "weight": 1.0},
{"source": 31, "target": 82, "weight": 1.0},
{"source": 32, "target": 82, "weight": 1.0},
{"source": 32, "target": 89, "weight": 1.0},
{"source": 33, "target": 82, "weight": 1.0},
{"source": 33, "target": 27, "weight": 1.0},
{"source": 34, "target": 12, "weight": 1.0},
{"source": 34, "target": 85, "weight": 1.0},
{"source": 35, "target": 82, "weight": 1.0},
{"source": 35, "target": 88, "weight": 1.0},
{"source": 35, "target": 24, "weight": 1.0},
{"source": 36, "target": 89, "weight": 1.0},
{"source": 36, "target": 91, "weight": 1.0},
{"source": 37, "target": 27, "weight": 1.0},
{"source": 37, "target": 82, "weight": 1.0},
{"source": 38, "target": 92, "weight": 1.0},
{"source": 39, "target": 82, "weight": 1.0},
{"source": 40, "target": 27, "weight": 1.0},
{"source": 40, "target": 82, "weight": 1.0},
{"source": 41, "target": 82, "weight": 1.0},
{"source": 42, "target": 82, "weight": 1.0},
{"source": 42, "target": 23, "weight": 1.0},
{"source": 42, "target": 89, "weight": 1.0},
{"source": 43, "target": 44, "weight": 1.0},
{"source": 43, "target": 82, "weight": 1.0},
{"source": 44, "target": 82, "weight": 1.0},
{"source": 45, "target": 82, "weight": 1.0},
{"source": 46, "target": 41, "weight": 1.0},
{"source": 46, "target": 82, "weight": 1.0},
{"source": 47, "target": 82, "weight": 1.0},
{"source": 47, "target": 95, "weight": 1.0},
{"source": 48, "target": 82, "weight": 1.0},
{"source": 48, "target": 45, "weight": 1.0},
{"source": 49, "target": 82, "weight": 1.0},
{"source": 50, "target": 82, "weight": 1.0},
{"source": 51, "target": 23, "weight": 1.0},
{"source": 51, "target": 93, "weight": 1.0},
{"source": 52, "target": 50, "weight": 1.0},
{"source": 52, "target": 82, "weight": 1.0},
{"source": 52, "target": 96, "weight": 1.0},
{"source": 52, "target": 92, "weight": 1.0},
{"source": 53, "target": 82, "weight": 1.0},
{"source": 54, "target": 87, "weight": 1.0},
{"source": 54, "target": 3, "weight": 1.0},
{"source": 55, "target": 83, "weight": 1.0},
{"source": 56, "target": 55, "weight": 1.0},
{"source": 56, "target": 83, "weight": 1.0},
{"source": 57, "target": 19, "weight": 1.0},
{"source": 57, "target": 82, "weight": 1.0},
{"source": 58, "target": 82, "weight": 1.0},
{"source": 58, "target": 89, "weight": 1.0},
{"source": 58, "target": 97, "weight": 1.0},
{"source": 59, "target": 82, "weight": 1.0},
{"source": 59, "target": 95, "weight": 1.0},
{"source": 60, "target": 82, "weight": 1.0},
{"source": 60, "target": 95, "weight": 1.0},
{"source": 61, "target": 82, "weight": 1.0},
{"source": 62, "target": 74, "weight": 1.0},
{"source": 62, "target": 82, "weight": 1.0},
{"source": 62, "target": 24, "weight": 1.0},
{"source": 62, "target": 98, "weight": 1.0},
{"source": 63, "target": 82, "weight": 1.0},
{"source": 63, "target": 75, "weight": 1.0},
{"source": 64, "target": 65, "weight": 1.0},
{"source": 64, "target": 82, "weight": 1.0},
{"source": 65, "target": 99, "weight": 1.0},
{"source": 66, "target": 96, "weight": 1.0},
{"source": 66, "target": 94, "weight": 1.0},
{"source": 67, "target": 24, "weight": 1.0},
{"source": 67, "target": 94, "weight": 1.0},
{"source": 68, "target": 65, "weight": 1.0},
{"source": 68, "target": 99, "weight": 1.0},
{"source": 69, "target": 88, "weight": 1.0},
{"source": 69, "target": 61, "weight": 1.0},
{"source": 70, "target": 49, "weight": 1.0},
{"source": 70, "target": 82, "weight": 1.0},
{"source": 71, "target": 39, "weight": 1.0},
{"source": 71, "target": 98, "weight": 1.0},
{"source": 72, "target": 97, "weight": 1.0},
{"source": 72, "target": 95, "weight": 1.0},
{"source": 72, "target": 82, "weight": 1.0},
{"source": 73, "target": 88, "weight": 1.0},
{"source": 73, "target": 20, "weight": 1.0},
{"source": 74, "target": 82, "weight": 1.0},
{"source": 75, "target": 85, "weight": 1.0},
{"source": 76, "target": 82, "weight": 1.0},
{"source": 77, "target": 76, "weight": 1.0},
{"source": 78, "target": 82, "weight": 1.0},
{"source": 78, "target": 44, "weight": 1.0},
{"source": 79, "target": 6, "weight": 1.0},
{"source": 79, "target": 84, "weight": 1.0},
{"source": 80, "target": 82, "weight": 1.0},
{"source": 80, "target": 93, "weight": 1.0},
{"source": 81, "target": 53, "weight": 1.0},
{"source": 81, "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: #aaa;
}
.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("clusterM.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