Last active
May 4, 2016 02:26
-
-
Save junkwhinger/f3afe90bdf0789f20386 to your computer and use it in GitHub Desktop.
The Hacking Team: Top Senders
This file contains hidden or 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"> | |
<head><h1>The Hacking Team: Top Senders</h1></head> | |
<style> | |
body { | |
font: 10px sans-serif; | |
} | |
.axis { | |
font: 11px sans-serif; | |
} | |
.axis path, | |
.axis line { | |
fill: none; | |
stroke: #000; | |
shape-rendering: crispEdges; | |
} | |
.bar { | |
fill: steelblue; | |
} | |
.barText { | |
fill: white; | |
} | |
</style> | |
<body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
<script> | |
var margin = {top: 20, right: 20, bottom: 30, left: 180}, | |
width = 960 - margin.left - margin.right, | |
height = 500 - margin.top - margin.bottom; | |
var percent = d3.format("0.2%"); | |
var x = d3.scale.linear() | |
.range([0, width]); | |
var y = d3.scale.ordinal() | |
.rangeRoundBands([0, height], .1); | |
var xAxis = d3.svg.axis() | |
.scale(x) | |
.orient("bottom"); | |
var yAxis = d3.svg.axis() | |
.scale(y) | |
.orient("left"); | |
var svg = d3.select("body").append("svg") | |
.attr("width", width + margin.left + margin.right) | |
.attr("height", height + margin.top + margin.bottom) | |
.append("g") | |
.attr("transform", "translate(" + margin.left + "," + margin.top + ")"); | |
var status_dic = { | |
'[email protected]':'Chief of HT Singapore Representative', | |
'[email protected]':'Client', | |
'[email protected]':'Client', | |
'[email protected]':'Client', | |
'[email protected]':'Client', | |
'[email protected]':'Field Application Engineer', | |
'[email protected]':'Chief Technology Officer', | |
'[email protected]':'Operations Manager', | |
'[email protected]':'CEO', | |
'[email protected]':'Sales Manager', | |
'[email protected]':'Key Account Manager', | |
'[email protected]':'QA Manager', | |
'[email protected]':'The Licensing System', | |
'[email protected]':'Field Application Engineer', | |
'[email protected]':'Senior Security Engineer', | |
'[email protected]':'Field Application Engineer', | |
'[email protected]':'Field Application Engineer', | |
'[email protected]':'Security Engineer', | |
'[email protected]':'Senior Security Consultant', | |
'[email protected]':'Chief Operation Officer', | |
'[email protected]':'Chief Information Officer', | |
'[email protected]':'Financial Controller', | |
'[email protected]':'Software Developer', | |
'[email protected]':'Senior Software Developer', | |
'[email protected]':'Senior Software Developer', | |
'[email protected]':'Senior Software Developer', | |
'[email protected]': 'Software Developer', | |
'[email protected]':'Software Developer', | |
'[email protected]':'Key Account Manager', | |
'[email protected]':'VP Business Development', | |
'[email protected]':'Software Developer', | |
'[email protected]':'Field Application Engineer', | |
'[email protected]':'Field Application Engineer', | |
'[email protected]':'Software Development Manager', | |
'[email protected]':'Senior Security Engineer', | |
'[email protected]':'Senior Software Developer', | |
'[email protected]':'Senior Security Engineer', | |
'[email protected]':'Financial Controller', | |
'[email protected]':'undisclosed', | |
'[email protected]':'Senior Software Developer', | |
'[email protected]':'Financial Controller', | |
'[email protected]':'Senior Software Developer', | |
'[email protected]':'Field Application Engineer', | |
'[email protected]':'Field Application Engineer', | |
'[email protected]':'Field Application Engineer', | |
'[email protected]':'Senior Security Engineer', | |
'[email protected]':'Field Application Engineer', | |
'[email protected]':'Administrative Support', | |
'[email protected]':'Administrative Support', | |
'[email protected]':'Field Application Engineer', | |
'[email protected]':'Senior Security Engineer', | |
'[email protected]':'Software Developer', | |
'[email protected]':'Key Account Manager', | |
'[email protected]':'Key Account Manager', | |
'[email protected]':'Senior Software Developer', | |
'[email protected]':'Key Account Manager' | |
} | |
d3.csv("sender_frequency.csv", type, function(error, data) { | |
if (error) throw error; | |
y.domain(data.map(function(d) { return d.sender; })); | |
x.domain([0, d3.max(data, function(d) { return d.freq; })]); | |
svg.append("g") | |
.attr("class", "x axis") | |
.attr("transform", "translate(0," + height + ")") | |
.call(xAxis); | |
svg.append("g") | |
.attr("class", "y axis") | |
.call(yAxis) | |
.append("text") | |
.attr("transform", "rotate(-90)") | |
.attr("y", 6) | |
.attr("dy", ".71em") | |
.style("text-anchor", "end"); | |
svg.selectAll(".bar") | |
.data(data) | |
.enter().append("rect") | |
.attr("class", "bar") | |
.attr("y", function(d) { return y(d.sender); }) | |
.attr("height", y.rangeBand()) | |
.attr("x", 0) | |
.attr("width", function(d) { return x(d.freq); }) | |
.on("mouseover", function(d,i) { | |
d3.select(this) | |
.style("fill", "red") | |
}) | |
.on("mouseout", function(d,i) { | |
d3.select(this) | |
.style("fill", "steelblue") | |
}); | |
svg.selectAll(".barText") | |
.data(data) | |
.enter().append("text") | |
.attr("class", "barText") | |
.attr("x", function(d) { return x(d.freq) - 15; }) | |
.attr("y", function(d) { return y(d.sender) + y.rangeBand()/1.5; }) | |
.attr("text-anchor","end") | |
.text(function(d,i){return d.freq + " / " + status_dic[d.sender]}); | |
}); | |
function type(d) { | |
d.freq = +d.freq; | |
return d; | |
} | |
</script> |
This file contains hidden or 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
sender | freq | |
---|---|---|
[email protected] | 243 | |
[email protected] | 172 | |
[email protected] | 121 | |
[email protected] | 120 | |
[email protected] | 117 | |
[email protected] | 116 | |
[email protected] | 109 | |
[email protected] | 109 | |
[email protected] | 95 | |
[email protected] | 94 | |
[email protected] | 86 | |
[email protected] | 81 | |
[email protected] | 64 | |
[email protected] | 55 | |
[email protected] | 46 | |
[email protected] | 46 | |
[email protected] | 45 | |
[email protected] | 41 | |
[email protected] | 41 | |
[email protected] | 39 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment