EVE Online 2013: Ships destroyed by solar system (NPC Player deaths excluded)

by ccpquant

HTML

<script src="http://d3js.org/d3.v3.min.js"></script>
<h1>EVE Online 2013</h1>
<h2>Ships destroyed by solar system (excluding death by NPCs)</h2>

<pre id="csvdata">
name,security,value
Amarr,1,63022
Ammold,1,2392
Amsen,1,1120
Bourynes,1,902
Chaven,1,2048
Cistuvaert,1,1801
Duripant,1,3438
Emrayur,1,1174
Hulm,1,658
Kisogo,1,3169
Luminaire,1,7530
New Caldari,1,5739
Pator,1,3709
Ryddinjorn,1,697
Sarum Prime,1,2346
Sehmy,1,827
Todaki,1,2664
Yulai,1,366
Ameinaka,0.99,613
Edmalbrurdus,0.99,117
Ikuchi,0.99,891
Malukker,0.99,24827
Todeko,0.99,198
Abrat,0.98,110
Meves,0.98,785
Sakenta,0.98,199
Aokannitoh,0.97,206
Athinard,0.97,722
Hirtamon,0.97,355
Kakakela,0.97,3624
Kerepa,0.97,54
Todrir,0.97,59
Vullat,0.97,886
Arlek,0.96,241
Arlulf,0.96,442
Bhizheba,0.96,1734
Embod,0.96,33559
Hedion,0.96,1688
Ivar,0.96,956
Leurtmar,0.96,1144
Loguttur,0.96,416
Niyabainen,0.96,3500
Orgron,0.96,218
Safilbab,0.96,44
Urlen,0.96,10722
Alf,0.95,299
Assiad,0.95,110
Blameston,0.95,441
Eystur,0.95,4883
Fildar,0.95,94
Hadaugago,0.95,67562
Hitanishio,0.95,977
Irnal,0.95,197
Jita,0.95,129555
Lustrevik,0.95,5324
Malkalen,0.95,1419
Mattere,0.95,511
Mies,0.95,2971
Onga,0.95,1049
Perimeter,0.95,21881
Tew,0.95,311
Unpas,0.95,4229
Usteli,0.95,583
Yashunen,0.95,427
Claysson,0.94,190
Eletta,0.94,1156
Ethernity,0.94,693
Hatakani,0.94,4435
Mabnen,0.94,674
Magiko,0.94,482
Olbra,0.94,539
Sarekuwa,0.94,1517
Seitam,0.94,105
Shesha,0.94,1716
Algogille,0.93,7492
Erego,0.93,60
Larkugei,0.93,166
Marthia,0.93,289
Mora,0.93,842
Nosodnis,0.93,96
Alenia,0.92,938
Horir,0.92,72
Kassigainen,0.92,2410
Kehour,0.92,750
Laah,0.92,788
Lashkai,0.92,50
Olelon,0.92,180
Stirht,0.92,514
Tennen,0.92,318
Uitra,0.92,122610
Aldilur,0.91,272
Ansila,0.91,428
Arbaz,0.91,1412
Ashab,0.91,5783
Bongveber,0.91,219
Conoban,0.91,32549
Deepari,0.91,74972
Eba,0.91,367
Fora,0.91,257
Hanan,0.91,121
Illuin,0.91,611
Inis-Ilix,0.91,196
Kihtaled,0.91,449
Kor-Azor...

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: 2px;
}

#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)) + " Ships destroyed" });
    
    //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")
       ...