EVE Online 2013: Destroyed value by solar system
by ccpquant
HTML
<script src="http://d3js.org/d3.v3.min.js"></script>
<h1>EVE Online 2013</h1>
<h2>Destroyed value by solar system</h2>
<pre id="csvdata">
name,security,value
Amarr,1,3485.01661847843
Ammold,1,214.558884002827
Amsen,1,55.3127347315507
Bourynes,1,42.1940496642556
Chaven,1,203.888041658197
Cistuvaert,1,48.7171111891477
Duripant,1,40.9330910099232
Emrayur,1,37.7083426068664
Hulm,1,12.7526481427274
Kisogo,1,39.2812579956315
Luminaire,1,470.135568092604
New Caldari,1,431.647320147105
Pator,1,217.914513903191
Ryddinjorn,1,4.8677142351429
Sarum...
CSS
body {
background: #202020;
font-family: Calibri;
font-size: 10px;
}
h1 {
font-size: 40px;
color: #909090;
margin: 2px;
}
h2 {
font-size: 20px;
color: #707070;
margin: 0px;
}
#csvdata {
display: none;
}
.legendTitle
{
fill: #F0F0F0;
}
.legend
{
fill: #303030;
alpha: 0.5;
}
JavaScript
/*
You may use this code for non-commercial purposes only, on the condition that the following copyright notice is displayed prominently on any page where the code appears:
©2014 CCP hf. EVE Online and the EVE logo are the registered trademarks of CCP hf. All rights are reserved worldwide. All other trademarks are the property of their respective owners. EVE Online, the EVE logo, EVE and all associated logos and designs are the intellectual property of CCP hf. All artwork, screenshots, characters, vehicles, storylines, world facts or other recognizable features of the intellectual property relating to these trademarks are likewise the intellectual property of CCP hf.
*/
function parseForBubble(root)
{
var lst = [];
root.forEach(function(n) { lst.push({value:parseInt(n.value), system:n.name,security:parseFloat(n.security) });});
return {children:lst};
}
function plotBubbles(rootSvg, root) {
var totalValue = d3.sum(root, function(d) {return d.value;});
var valueDisplayLimit = totalValue * 0.005;
var node = rootSvg.selectAll("systems")
.data(bubble.nodes(parseForBubble(root)).filter(function(d) { return !d.children; }))
.enter().append("g")
.attr("class", "node")
.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; });
//This adds a title which pops up when a mouse cursor hovers over the node
node.append("title")
.text(function(d) { return d.system + "(" + format(d.security) + '): ' + formatLarge(parseInt(d.value)) + " B" });
//The circle-element of the bubble
node.append("circle")
.attr("r", function(d) { return d.r; })
.style("fill", function(d) { return color(d.security); })
.style("stroke", function(d) {return d3.rgb(color(d.security)).darker(); });
//Text element containing the system name, do some truncating magic(shitmix)...
node.append("text")
.attr("dy", "3px")
...