Skip to content

Instantly share code, notes, and snippets.

@githoov githoov/data.json
Last active Mar 31, 2018

Embed
What would you like to do?
{"links": [{"type": "", "target": "Bulletproof Arcade Limited", "source": "PlayFab, Inc."}, {"type": "", "target": "Fluffy Fairy Games GmbH", "source": "PlayFab, Inc."}, {"type": "", "target": "Hubspot, Inc.", "source": "Amplitude Analytics"}, {"type": "", "target": "Bee Square S.L.", "source": "PlayFab, Inc."}, {"type": "", "target": "Starbreeze", "source": "PlayFab, Inc."}, {"type": "", "target": "Seismic Games", "source": "PlayFab, Inc."}, {"type": "", "target": "BoomTV Inc", "source": "PlayFab, Inc."}, {"type": "", "target": "Integrated Direct Marketing", "source": "ThinkSmart Data Services LLC."}, {"type": "", "target": "Integrated Direct Marketing", "source": "Square, Inc."}, {"type": "", "target": "Turner Broadcasting System, Inc.", "source": "Turner Broadcasting System, Inc."}, {"type": "", "target": "Cimpress USA Incorporated", "source": "Cimpress USA Incorporated"}, {"type": "", "target": "Slice & Co", "source": "Kustomer, Inc."}, {"type": "", "target": "Datascan Technologies LLC", "source": "Datascan Technologies LLC"}, {"type": "", "target": "Ppd Development, LP", "source": "Ppd Development, LP"}, {"type": "", "target": "TubeMogul, Inc.", "source": "TubeMogul, Inc."}, {"type": "", "target": "TubeMogul, Inc.", "source": "Adobe"}, {"type": "", "target": "Cardlytics, Inc.", "source": "Cardlytics, Inc."}, {"type": "", "target": "Fidgetly, Inc.", "source": "PlayFab, Inc."}, {"type": "", "target": "Tune, Inc.", "source": "Tune, Inc."}, {"type": "", "target": "Aptus Health", "source": "Tomorrow Networks, LLC"}, {"type": "", "target": "Free Range Games", "source": "PlayFab, Inc."}, {"type": "", "target": "theSkimm", "source": "Localytics"}, {"type": "", "target": "Georgia Pacific", "source": "Georgia-Pacific LLC"}, {"type": "", "target": "iDream Interactive", "source": "PlayFab, Inc."}, {"type": "", "target": "Philips Healthcare", "source": "Philips Healthcare"}, {"type": "", "target": "Placeiq, Inc.", "source": "Placeiq, Inc."}, {"type": "", "target": "Localytics", "source": "Localytics"}, {"type": "", "target": "Wizards of The Coast, Llc.", "source": "PlayFab, Inc."}, {"type": "", "target": "Fox, Inc.", "source": "True X Media"}, {"type": "", "target": "Kemojo Kuhubb Studios Inc (self-service)", "source": "PlayFab, Inc."}, {"type": "", "target": "PlayFab, Inc.", "source": "PlayFab, Inc."}, {"type": "", "target": "PlayDots, Inc.", "source": "Localytics"}, {"type": "", "target": "Boxy Charm (forzalabs)", "source": "Kustomer, Inc."}, {"type": "", "target": "Nanigans, Inc.", "source": "Ruelala, Inc."}, {"type": "", "target": "Arm Insight, Inc.", "source": "Arm Insight, Inc."}, {"type": "", "target": "Instacart Inc.", "source": "Instacart Inc."}, {"type": "", "target": "AutoAttack Games", "source": "PlayFab, Inc."}, {"type": "", "target": "SOASTA, Inc.", "source": "SOASTA, Inc."}, {"type": "", "target": "Stride Software, Inc.", "source": "Snagajob"}, {"type": "", "target": "White Ops", "source": "Videology"}, {"type": "", "target": "White Ops", "source": "TubeMogul, Inc."}, {"type": "", "target": "Dave & Buster\\'s", "source": "PlayFab, Inc."}, {"type": "", "target": "WildCard Games Inc", "source": "PlayFab, Inc."}, {"type": "", "target": "Snagajob", "source": "Snagajob"}, {"type": "", "target": "Office Depot", "source": "Office Depot"}, {"type": "", "target": "Square, Inc.", "source": "ThinkSmart Data Services LLC."}, {"type": "", "target": "Square, Inc.", "source": "Integrated Direct Marketing"}, {"type": "", "target": "Yellowhammer Media Group, Inc.", "source": "Yellowhammer Media Group, Inc."}, {"type": "", "target": "ThinkSmart Data Services LLC.", "source": "Square, Inc."}, {"type": "", "target": "Hashbang Games, LLC", "source": "PlayFab, Inc."}, {"type": "", "target": "Equifax", "source": "Turner Broadcasting System, Inc."}, {"type": "", "target": "BULKHEAD INTERACTIVE LIMITED", "source": "PlayFab, Inc."}, {"type": "", "target": "Cengage Learning, Inc.", "source": "JW Player"}, {"type": "", "target": "Insikt, Inc.", "source": "Insikt, Inc."}, {"type": "", "target": "Boomerang Commerce", "source": "Boomerang Commerce"}, {"type": "", "target": "SNFK", "source": "Lacework"}, {"type": "", "target": "Oddity Studios", "source": "PlayFab, Inc."}, {"type": "", "target": "Asics Digital", "source": "Localytics"}, {"type": "", "target": "Mixmax, Inc.", "source": "Amplitude Analytics"}, {"type": "", "target": "Upday Gmbh & Co.Kg", "source": "Localytics"}, {"type": "", "target": "Miniclip UK Ltd", "source": "PlayFab, Inc."}, {"type": "", "target": "Pennymac Mortgage Investment Trust", "source": "Pennymac Mortgage Investment Trust"}, {"type": "", "target": "Sony Pictures Television Networks Games", "source": "PlayFab, Inc."}, {"type": "", "target": "Vacatia, Inc.", "source": "Vacatia, Inc."}, {"type": "", "target": "Spireon, Inc.", "source": "Spireon, Inc."}, {"type": "", "target": "One Technologies", "source": "One Technologies"}, {"type": "", "target": "Hyper Hippo Productions Ltd", "source": "PlayFab, Inc."}, {"type": "", "target": "Athenahealth, Inc.", "source": "Athenahealth, Inc."}, {"type": "", "target": "Playstudios", "source": "Playstudios"}, {"type": "", "target": "Juniper Networks, Inc.", "source": "Juniper Networks, Inc."}, {"type": "", "target": "Five Bridges Advisors, LLC", "source": "Bitshop, Inc"}, {"type": "", "target": "Tomorrow Networks, LLC", "source": "Aptus Health"}], "nodes": [{"id": "Bulletproof Arcade Limited", "label": "", "name": "Bulletproof Arcade Limited"}, {"id": "Fluffy Fairy Games GmbH", "label": "", "name": "Fluffy Fairy Games GmbH"}, {"id": "Hubspot, Inc.", "label": "", "name": "Hubspot, Inc."}, {"id": "Bee Square S.L.", "label": "", "name": "Bee Square S.L."}, {"id": "Starbreeze", "label": "", "name": "Starbreeze"}, {"id": "Seismic Games", "label": "", "name": "Seismic Games"}, {"id": "BoomTV Inc", "label": "", "name": "BoomTV Inc"}, {"id": "Integrated Direct Marketing", "label": "", "name": "Integrated Direct Marketing"}, {"id": "Turner Broadcasting System, Inc.", "label": "", "name": "Turner Broadcasting System, Inc."}, {"id": "Cimpress USA Incorporated", "label": "", "name": "Cimpress USA Incorporated"}, {"id": "Slice & Co", "label": "", "name": "Slice & Co"}, {"id": "Datascan Technologies LLC", "label": "", "name": "Datascan Technologies LLC"}, {"id": "Kustomer, Inc.", "label": "", "name": "Kustomer, Inc."}, {"id": "Ppd Development, LP", "label": "", "name": "Ppd Development, LP"}, {"id": "TubeMogul, Inc.", "label": "", "name": "TubeMogul, Inc."}, {"id": "Cardlytics, Inc.", "label": "", "name": "Cardlytics, Inc."}, {"id": "Fidgetly, Inc.", "label": "", "name": "Fidgetly, Inc."}, {"id": "Tune, Inc.", "label": "", "name": "Tune, Inc."}, {"id": "Aptus Health", "label": "", "name": "Aptus Health"}, {"id": "Free Range Games", "label": "", "name": "Free Range Games"}, {"id": "theSkimm", "label": "", "name": "theSkimm"}, {"id": "Georgia Pacific", "label": "", "name": "Georgia Pacific"}, {"id": "iDream Interactive", "label": "", "name": "iDream Interactive"}, {"id": "Adobe", "label": "", "name": "Adobe"}, {"id": "Philips Healthcare", "label": "", "name": "Philips Healthcare"}, {"id": "Placeiq, Inc.", "label": "", "name": "Placeiq, Inc."}, {"id": "Localytics", "label": "", "name": "Localytics"}, {"id": "Wizards of The Coast, Llc.", "label": "", "name": "Wizards of The Coast, Llc."}, {"id": "Fox, Inc.", "label": "", "name": "Fox, Inc."}, {"id": "Kemojo Kuhubb Studios Inc (self-service)", "label": "", "name": "Kemojo Kuhubb Studios Inc (self-service)"}, {"id": "PlayFab, Inc.", "label": "", "name": "PlayFab, Inc."}, {"id": "PlayDots, Inc.", "label": "", "name": "PlayDots, Inc."}, {"id": "Lacework", "label": "", "name": "Lacework"}, {"id": "Boxy Charm (forzalabs)", "label": "", "name": "Boxy Charm (forzalabs)"}, {"id": "Nanigans, Inc.", "label": "", "name": "Nanigans, Inc."}, {"id": "Arm Insight, Inc.", "label": "", "name": "Arm Insight, Inc."}, {"id": "Instacart Inc.", "label": "", "name": "Instacart Inc."}, {"id": "Amplitude Analytics", "label": "", "name": "Amplitude Analytics"}, {"id": "AutoAttack Games", "label": "", "name": "AutoAttack Games"}, {"id": "SOASTA, Inc.", "label": "", "name": "SOASTA, Inc."}, {"id": "Stride Software, Inc.", "label": "", "name": "Stride Software, Inc."}, {"id": "White Ops", "label": "", "name": "White Ops"}, {"id": "Dave & Buster\\'s", "label": "", "name": "Dave & \\'s"}, {"id": "True X Media", "label": "", "name": "True X Media"}, {"id": "WildCard Games Inc", "label": "", "name": "WildCard Games Inc"}, {"id": "Ruelala, Inc.", "label": "", "name": "Ruelala, Inc."}, {"id": "Bitshop, Inc", "label": "", "name": "Bitshop, Inc"}, {"id": "Snagajob", "label": "", "name": "Snagajob"}, {"id": "Office Depot", "label": "", "name": "Office Depot"}, {"id": "Square, Inc.", "label": "", "name": "Square, Inc."}, {"id": "Yellowhammer Media Group, Inc.", "label": "", "name": "Yellowhammer Media Group, Inc."}, {"id": "Videology", "label": "", "name": "Videology"}, {"id": "ThinkSmart Data Services LLC.", "label": "", "name": "ThinkSmart Data Services LLC."}, {"id": "Hashbang Games, LLC", "label": "", "name": "Hashbang Games, LLC"}, {"id": "Equifax", "label": "", "name": "Equifax"}, {"id": "BULKHEAD INTERACTIVE LIMITED", "label": "", "name": "BULKHEAD INTERACTIVE LIMITED"}, {"id": "Cengage Learning, Inc.", "label": "", "name": "Cengage Learning, Inc."}, {"id": "Insikt, Inc.", "label": "", "name": "Insikt, Inc."}, {"id": "Boomerang Commerce", "label": "", "name": "Boomerang Commerce"}, {"id": "SNFK", "label": "", "name": "SNFK"}, {"id": "Oddity Studios", "label": "", "name": "Oddity Studios"}, {"id": "Asics Digital", "label": "", "name": "Asics Digital"}, {"id": "Georgia-Pacific LLC", "label": "", "name": "Georgia-Pacific LLC"}, {"id": "Mixmax, Inc.", "label": "", "name": "Mixmax, Inc."}, {"id": "Upday Gmbh & Co.Kg", "label": "", "name": "Upday Gmbh & Co.Kg"}, {"id": "Miniclip UK Ltd", "label": "", "name": "Miniclip UK Ltd"}, {"id": "Pennymac Mortgage Investment Trust", "label": "", "name": "Pennymac Mortgage Investment Trust"}, {"id": "Sony Pictures Television Networks Games", "label": "", "name": "Sony Pictures Television Networks Games"}, {"id": "Vacatia, Inc.", "label": "", "name": "Vacatia, Inc."}, {"id": "Spireon, Inc.", "label": "", "name": "Spireon, Inc."}, {"id": "JW Player", "label": "", "name": "JW Player"}, {"id": "One Technologies", "label": "", "name": "One Technologies"}, {"id": "Hyper Hippo Productions Ltd", "label": "", "name": "Hyper Hippo Productions Ltd"}, {"id": "Athenahealth, Inc.", "label": "", "name": "Athenahealth, Inc."}, {"id": "Playstudios", "label": "", "name": "Playstudios"}, {"id": "Juniper Networks, Inc.", "label": "", "name": "Juniper Networks, Inc."}, {"id": "Five Bridges Advisors, LLC", "label": "", "name": "Five Bridges Advisors, LLC"}, {"id": "Tomorrow Networks, LLC", "label": "", "name": "Tomorrow Networks, LLC"}]}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
.node {}
.link { stroke: #999; stroke-opacity: .6; stroke-width: 1px; }
</style>
</head>
<body>
<svg width="960" height="600"></svg>
<script src="http://d3js.org/d3.v4.min.js" type="text/javascript"></script>
<script src="http://d3js.org/d3-selection-multi.v1.js"></script>
<script type="text/javascript">
var colors = d3.scaleOrdinal(d3.schemeCategory10);
var svg = d3.select("svg"),
width = +svg.attr("width"),
height = +svg.attr("height"),
node,
link;
svg.append('defs').append('marker')
.attrs({'id':'arrowhead',
'viewBox':'-0 -5 10 10',
'refX':13,
'refY':0,
'orient':'auto',
'markerWidth':13,
'markerHeight':13,
'xoverflow':'visible'})
.append('svg:path')
.attr('d', 'M 0,-5 L 10 ,0 L 0,5')
.attr('fill', '#999')
.style('stroke','none');
var simulation = d3.forceSimulation()
.force("link", d3.forceLink().id(function (d) {return d.id;}).distance(100).strength(1))
.force("charge", d3.forceManyBody().strength(Number(-100 + 1.25)))
.force("center", d3.forceCenter(width / 4, height / 4));
d3.json("data.json", function (error, graph) {
if (error) throw error;
update(graph.links, graph.nodes);
})
function update(links, nodes) {
link = svg.selectAll(".link")
.data(links)
.enter()
.append("line")
.attr("class", "link")
.attr('marker-end','url(#arrowhead)')
link.append("title")
.text(function (d) {return d.type;});
edgepaths = svg.selectAll(".edgepath")
.data(links)
.enter()
.append('path')
.attrs({
'class': 'edgepath',
'fill-opacity': 0,
'stroke-opacity': 0,
'id': function (d, i) {return 'edgepath' + i}
})
.style("pointer-events", "none");
edgelabels = svg.selectAll(".edgelabel")
.data(links)
.enter()
.append('text')
.style("pointer-events", "none")
.attrs({
'class': 'edgelabel',
'id': function (d, i) {return 'edgelabel' + i},
'font-size': 10,
'fill': '#aaa'
});
edgelabels.append('textPath')
.attr('xlink:href', function (d, i) {return '#edgepath' + i})
.style("text-anchor", "middle")
.style("pointer-events", "none")
.attr("startOffset", "50%")
.text(function (d) {return d.type});
node = svg.selectAll(".node")
.data(nodes)
.enter()
.append("g")
.attr("class", "node")
.call(d3.drag()
.on("start", dragstarted)
.on("drag", dragged)
);
node.append("circle")
.attr("r", 5)
.style("fill", function (d, i) {return colors(i);})
node.append("title")
.text(function (d) {return d.id;});
node.append("text")
.attr("dy", -3)
.text(function (d) {return d.name+":"+d.label;});
simulation
.nodes(nodes)
.on("tick", ticked);
simulation.force("link")
.links(links);
}
function ticked() {
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 + ")";});
edgepaths.attr('d', function (d) {
return 'M ' + d.source.x + ' ' + d.source.y + ' L ' + d.target.x + ' ' + d.target.y;
});
edgelabels.attr('transform', function (d) {
if (d.target.x < d.source.x) {
var bbox = this.getBBox();
rx = bbox.x + bbox.width / 2;
ry = bbox.y + bbox.height / 2;
return 'rotate(180 ' + rx + ' ' + ry + ')';
}
else {
return 'rotate(0)';
}
});
}
function dragstarted(d) {
if (!d3.event.active) simulation.alphaTarget(0.3).restart()
d.fx = d.x;
d.fy = d.y;
}
function dragged(d) {
d.fx = d3.event.x;
d.fy = d3.event.y;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.