Skip to content

Instantly share code, notes, and snippets.

@mhebrard
Last active June 14, 2016 09:44
Show Gist options
  • Save mhebrard/b560f397b78e252a43a7d2bff1020062 to your computer and use it in GitHub Desktop.
Save mhebrard/b560f397b78e252a43a7d2bff1020062 to your computer and use it in GitHub Desktop.
Pokemon Violin

This representation shows The initial stats of pokemons.

Chart

Violin plot :

  • the box plot represent the quantiles of the distribution (5%,25%,50%,75%,95%)
  • the dot represent the median
  • the violin body represent a kernel density estimation (probability function for the value)

Colors :

Colors are customizable: Violin body, Violin stroke, Box body, Box stroke, In box elements (mean and median), Labels.

Sizes:

Sizes are customizable: Image width and height, figure width and height, violin width and space, box width.

Technics

By default, data are read from the local file stats.json

If needed, you can comment the "Read local file BLOCK" and uncomment the "query pokeAPI BLOCK". Then data will be fetch from pokeAPI (a RESTful API).

Thanks

  • Thanks to Pokemon for the game and all the related data.
  • Thanks to pokeapi for sharing the data.
  • Thanks to D3.js for the graphic library.
  • Thanks to z-m-k for the basic violin plot
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>PokeViolin</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style>
<!--
.axis path, .axis line {
fill: none;
stroke: #000;
stroke-width: 1px;
color-rendering: optimizeQuality !important;
shape-rendering: crispEdges !important;
text-rendering: geometricPrecision !important;
-->
</style>
</head>
<body>
<div id="body">
<h1>Pokemon's stats violin plot</h1>
<div id="chart"></div>
<div id="footer">
<br/>
Thanks to <a href="http://www.pokemon.com/" title="Pokemon" target="_blank">Pokemon</a> for the game and all the related data.<br/>
Thanks to <a href="http://pokeapi.co/" title="PokeAPI" target="_blank">PokeAPI</a> and its authors for sharing the data.<br/>
Thanks to <a href="http://d3js.org/" title="d3.js" target="_blank">Data-Driven Documents</a> and its authors for the graphic library.<br/>
Thanks to <a href="http://bl.ocks.org/z-m-k/5014368" title="zmk" target="_blank">z-m-k</a> for the original display.
</div>
</div>
<script type="text/javascript">
var param={
div:"chart",
margin:{top:10, bottom:20, left:50, right:50},
width:750,
height:300,
catWidth:100,
catSpacing:10,
violinFill:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],
violinStroke:"#000",
boxFill:"#fff",
boxStroke:"#000",
meanColor:"#000",
labelColor:"#000",
resolution:20,
interpolation:'basis',
}
Promise.resolve() //init sequencial action
/**///Read local file BLOCK
.then(function(){
return new Promise(function(ful) {
d3.json("stats.json", function(err,data) {
if(err){ rej("datafile error:",err); }
else {
param.stats=data;
ful("data file read");
}
})
})
})
/**/
/*//query pokeAPI BLOCK
.then(function(){
param.stats={ attack:[], defense:[], hp:[], sp_atk:[], sp_def:[], speed:[]};
return query();
})
*/
.then(function() {
console.log("end",param.stats);
setViolin();
})
//FUNCTIONS FOR QUERY//
function query() {
return Promise.resolve() //init sequencial action
.then(function(){ return pkmnList();}) //get pokemon list
.then(function(ps){ //get pokemon description
var act = ps.map(function(p){ return pkmnDesc(p); });
return Promise.all(act);
})
.then(function(msgs){
return new Promise(function(ful,rej) {
console.log(JSON.stringify(param.stats))
ful("query finished");
})
})
}
function pkmnList() {
return new Promise(function(ful,rej) {
d3.json("http://pokeapi.co/api/v1/pokedex/1/", function(err,data) {
if(err){ rej(Error("Unable to get pokemon:",err)) }
else {
console.log("pkmns",data.pokemon.length);
ful(data.pokemon);
}
})
})
}
function pkmnDesc(p) {
return new Promise(function(ful,rej) {
d3.json("http://pokeapi.co/"+p.resource_uri, function(err,data) {
if(err){ rej(Error("Unable to get description:",err,p)) }
else {
if(data.descriptions.length<1) { //skip alternative entry
ful("stats filled");
}
else {
for(var k in param.stats) { //save stats
param.stats[k].push(data[k]);
};
ful("stats filled");
}
}
})
})
}
//FUNCTIONS FOR CHART//
function setViolin() {
var values = [];
var labels = [];
var max=0;
var min=0;
//map data
for(var k in param.stats) {
//map values
values.push(param.stats[k]);
//map labels
labels.push(k);
//set scale acording to data.
for(var i in param.stats[k]) {
//get max value
var kmax = Math.max.apply(null,param.stats[k]);
max = max<kmax ? kmax : max ;
//get min value
var kmin = Math.min.apply(null,param.stats[k]);
min = min>kmin ? kmin : min ;
}
};
//set fixed scale
//max = 260;
//min = -10;
var color=d3.scale.ordinal().range(param.violinFill).domain(labels);
param.domain=[min,max];
//SVG
var svg = d3.select("#"+param.div)
.append("svg")
.attr("width", param.width)
.attr("height", param.height);
/*//backgroung
svg.append("rect")
.attr("width","100%")
.attr("height","100%")
.attr("fill","#FFF")
.attr("class","mtm-bg")
*/
//Axis
var y = d3.scale.linear()
.range([param.height-param.margin.bottom, param.margin.top])
.domain(param.domain);
var yAxisOut = d3.svg.axis()
.scale(y)
.ticks(5)
.orient("left")
.tickSize(5,0)
svg.append("g")
.attr('class', 'axis')
.attr("transform", "translate("+param.margin.left+",0)")
.call(yAxisOut);
var yAxisIn = d3.svg.axis()
.scale(y)
.ticks(5)
.orient("right")
.tickSize(param.width-param.margin.right-param.margin.left,0)
svg.append("g")
.attr('class', 'axis')
.attr("transform", "translate("+param.margin.left+",0)")
.call(yAxisIn);
/*//line
svg.append("line")
.attr("class", "boxplot")
.attr("x1", param.margin.left)
.attr("x2", param.width-param.margin.right)
.attr("y1", y(0))
.attr("y2", y(0))
.attr("stroke","black")
*/
//Chart
for(var i=0; i<values.length; i++){
values[i]=values[i].sort(d3.ascending)
var g=svg.append("g").attr("transform", "translate("+(i*(param.catWidth+param.catSpacing)+param.margin.left)+",0)");
console.log(color(labels[i]));
addViolin(g, values[i], 0.25,color(labels[i]));
addBoxPlot(g, values[i], .15);
addLabel(g, labels[i]);
}
}
function addViolin(svg, results, imposeMax, col){
var data = d3.layout.histogram()
.bins(param.resolution)
.frequency(0)
(results);
var y = d3.scale.linear()
.range([param.catWidth/2, 0])
.domain([0, Math.max(imposeMax, d3.max(data, function(d) { return d.y; }))]);
var x = d3.scale.linear()
.range([param.height-param.margin.bottom, param.margin.top])
.domain(param.domain)
.nice();
var area = d3.svg.area()
.interpolate(param.interpolation)
.x(function(d) {
if(param.interpolation=="step-before")
return x(d.x+d.dx/2)
return x(d.x);
})
.y0(param.catWidth/2)
.y1(function(d) { return y(d.y); });
var line=d3.svg.line()
.interpolate(param.interpolation)
.x(function(d) {
if(param.interpolation=="step-before")
return x(d.x+d.dx/2)
return x(d.x);
})
.y(function(d) { return y(d.y); });
var gPlus=svg.append("g")
var gMinus=svg.append("g")
gPlus.append("path")
.datum(data)
.attr("class", "area")
.attr("d", area)
.style("fill", col)
.style("stroke","none");
gPlus.append("path")
.datum(data)
.attr("class", "violin")
.attr("d", line)
.style("fill", "none")
.style("stroke", param.violinStroke);
gMinus.append("path")
.datum(data)
.attr("class", "area")
.attr("d", area)
.style("fill", col)
.style("stroke","none");
gMinus.append("path")
.datum(data)
.attr("class", "violin")
.attr("d", line)
.style("fill", "none")
.style("stroke", param.violinStroke);
gPlus.attr("transform", "rotate(90,0,0) translate(0,-"+param.catWidth+")");
gMinus.attr("transform", "rotate(90,0,0) scale(1,-1)");
}
function addBoxPlot(svg, results, boxPlotWidth){
var y = d3.scale.linear()
.range([param.height-param.margin.bottom, param.margin.top])
.domain(param.domain);
var x = d3.scale.linear()
.range([0, param.catWidth])
var left=0.5-boxPlotWidth/2;
var right=0.5+boxPlotWidth/2;
var probs=[0.05,0.25,0.5,0.75,0.95];
for(var i=0; i<probs.length; i++){
probs[i]=y(d3.quantile(results, probs[i]))
}
svg.append("rect")
.attr("class", "boxplot")
.attr("x", x(left))
.attr("width", x(right)-x(left))
.attr("y", probs[3])
.attr("height", -probs[3]+probs[1])
.style("fill", param.boxFill)
.style("stroke", param.boxStroke);
var iS=[0,2,4];
var iSclass=["","median",""];
var iSColor=[param.boxStroke, param.meanColor, param.boxStroke]
for(var i=0; i<iS.length; i++){
svg.append("line")
.attr("class", "boxplot "+iSclass[i])
.attr("x1", x(left))
.attr("x2", x(right))
.attr("y1", probs[iS[i]])
.attr("y2", probs[iS[i]])
.style("fill", iSColor[i])
.style("stroke", iSColor[i]);
}
var iS=[[0,1],[3,4]];
for(var i=0; i<iS.length; i++){
svg.append("line")
.attr("class", "boxplot")
.attr("x1", x(0.5))
.attr("x2", x(0.5))
.attr("y1", probs[iS[i][0]])
.attr("y2", probs[iS[i][1]])
.style("stroke", param.boxStroke);
}
svg.append("circle")
.attr("class", "boxplot mean")
.attr("cx", x(0.5))
.attr("cy", y(d3.mean(results)))
.attr("r", x(boxPlotWidth/5))
.style("fill", param.boxFill)
.style("stroke", param.meanColor);
}
function addLabel(svg,label) {
var y = param.height;
var x = d3.scale.linear().range([0, param.catWidth])
svg.append("text")
.attr("class", "label")
.attr("x", x(0.5))
.attr("y", y)
.attr("dy","-0.5ex")
.attr("text-anchor","middle")
.style("fill", param.labelColor)
.text(label);
}
</script>
</body>
</html>
{"attack":[66,30,63,24,93,76,80,25,5,72,92,70,90,130,85,100,110,70,61,49,112,69,90,106,20,120,62,92,140,85,70,76,123,50,60,95,110,95,130,125,80,55,100,80,50,105,75,80,120,45,65,105,35,100,60,90,83,63,45,60,75,55,93,75,123,110,60,55,80,85,50,88,98,53,53,53,98,77,55,55,25,115,45,100,60,75,105,135,135,60,57,85,80,140,50,65,100,125,53,95,63,100,45,55,67,35,27,60,160,92,72,82,100,100,100,100,120,140,50,30,50,78,108,112,45,65,50,30,95,105,30,87,55,50,65,40,65,60,100,75,75,135,95,85,60,55,40,47,75,80,77,55,50,94,55,85,75,115,30,40,55,55,87,70,110,147,50,40,66,85,90,70,125,86,140,65,75,90,55,58,95,65,97,90,65,105,85,60,69,115,129,90,120,150,125,130,72,120,77,61,78,107,73,45,59,56,63,22,95,36,56,50,81,50,35,52,65,38,82,45,48,65,100,80,48,52,80,110,50,48,72,125,80,92,54,52,74,124,85,110,83,123,109,59,50,77,81,65,100,92,58,75,90,66,70,69,110,100,117,30,131,70,131,60,53,89,50,73,55,121,134,115,85,120,150,80,90,90,81,30,59,120,50,117,115,124,49,85,55,68,134,48,125,90,98,117,103,44,75,105,38,84,60,90,65,105,85,95,100,105,95,65,85,100,80,68,10,60,75,80,30,70,65,40,115,135,80,100,50,100,55,60,63,83,20,45,35,25,90,85,60,80,81,60,90,90,55,47,75,62,57,102,92,41,72,70,76,45,65,80,70,45,50,65,45,80,80,70,95,55,55,80,70,52,82,110,70,50,65,95,20,35,80,100,130,75,62,52,82,56,64,48,30,45,75,100,35,65,60,85,50,70,110,45,80,95,105,35,48,45,40,65,73,105,130,30,50,95,50,55,120,105,90,65,130,85,5,55,95,40,65,45,75,67,45,110,50,95,83,125,48,85,100,125,65,55,130,65,60,40,105,40,70,95,80,120,85,82,64,62,110,46,49,100,64,50,52,84,50,65,80,105,76,30,90,20,35,90,38,58,25,40,30,40,20,75,40,75,80,75,100,50,20,35,30,55,45,70,75,65,65,65,45,85,85,60,80,72,65,33,70,90,80,75,105,110,85,90,100,84,40,65,50,55,105,40,90,80,60,95,120,60,80,95,30,20,35,63,75,80,115,10,85,75,64,84,85,90,130,45,100,65,70,60,120,85,45,70,85,110,35,55,90,35,70,50,40,30,70,50,70,100,55,130,120,95,125,10,95,130,130,40,80,60,71,45,160,45,51,91,20,60,90,120,85,45,65,75,70,110,45,60,60,40,75,50,73,47,73,43,90,120,70,100,85,60,25,100,45,100,60,70,85,115,40,78,55,70,100,95,120,70,80,48,40,41,30,50,25,60,30,35,90,130,23,75,70,50,50,80,60,40,80,64,104,84,150,75,95,90,30,75,55,135,100,89,50,100,75,80,90,100,150,109,68,65,58,104,78,51,85,70,66,86,55,120,75,45,25,85,30,120,125,165,42,15,52,29,94,95,125,90,115,60,70,40,50,80,125,60,55,82,89,92,100,45,65,50],
"defense":[44,50,47,86,67,84,95,45,5,78,108,45,65,95,40,72,70,40,40,56,118,76,110,65,50,65,50,75,130,95,115,86,67,95,110,67,130,125,80,65,70,145,135,70,77,105,130,102,120,70,35,55,45,66,70,90,68,45,55,75,95,45,55,60,65,90,45,39,65,69,37,50,63,48,48,48,63,62,50,85,45,80,43,63,32,85,105,60,130,86,55,40,55,95,40,55,85,75,70,75,90,89,59,99,85,50,60,75,110,65,35,45,100,120,100,100,120,65,62,85,145,103,133,45,70,40,40,50,60,60,40,63,95,50,75,50,65,50,70,45,60,105,85,70,70,45,50,50,80,95,60,70,91,131,40,70,75,80,55,60,55,90,60,40,80,90,30,85,84,50,45,40,60,67,55,85,70,115,75,80,125,105,66,129,50,90,55,65,72,70,90,72,100,120,90,90,90,95,77,65,95,122,55,40,58,41,52,60,67,38,77,43,71,58,40,50,68,39,62,47,76,48,62,60,54,60,100,150,150,66,72,100,86,88,53,67,50,80,70,95,50,75,112,50,35,72,91,65,70,77,57,53,122,70,48,86,76,121,184,35,95,80,95,60,62,77,150,88,52,119,95,105,60,90,50,50,45,45,97,42,85,100,90,70,70,78,49,200,55,83,110,48,70,106,63,80,80,50,90,115,33,78,125,50,65,85,60,82,115,60,95,45,70,125,110,72,55,40,80,50,41,120,65,55,60,80,80,85,40,80,85,44,80,100,55,50,30,50,40,69,55,75,60,30,65,55,40,52,85,67,40,77,87,40,57,73,75,20,60,70,45,35,55,70,35,35,85,55,80,50,25,50,60,48,78,80,45,40,65,95,15,30,50,70,80,35,63,43,83,35,58,65,35,40,110,70,70,55,95,45,45,80,70,55,50,180,75,30,45,160,80,60,70,90,115,50,70,85,95,75,53,79,120,95,120,95,5,115,80,70,95,55,85,60,65,80,35,57,57,100,48,80,95,79,60,50,60,60,70,100,65,35,65,115,100,130,55,100,45,80,90,34,65,100,58,50,43,78,45,64,80,100,64,30,80,30,50,70,38,58,28,15,15,85,65,70,40,85,95,75,115,80,50,40,30,70,50,55,55,45,60,110,45,85,42,60,65,48,90,58,70,140,90,105,65,65,100,85,90,65,40,35,120,45,75,70,50,140,30,95,120,60,90,62,15,35,35,37,37,105,85,10,75,115,50,70,65,130,90,35,100,45,61,40,70,60,35,50,70,90,55,35,70,55,50,70,50,30,70,50,40,60,30,100,75,75,75,230,55,75,80,60,80,60,43,135,100,90,23,63,40,30,140,60,85,45,65,75,100,180,40,75,45,50,60,40,55,55,83,53,20,40,35,70,140,40,35,45,65,80,60,50,40,60,60,73,65,90,60,85,85,105,65,43,55,77,30,100,25,62,32,35,45,60,48,35,130,70,50,80,70,50,90,85,105,105,140,60,100,130,55,100,80,130,200,85,100,90,150,90,80,100,90,105,64,34,44,71,52,53,51,65,68,88,30,70,50,40,41,49,35,79,40,60,118,20,168,45,50,50,100,70,65,79,70,90,34,44,52,60,42,64,116,65,110,48,100,45],
"hp":[55,45,63,57,103,65,50,20,100,68,50,58,68,108,135,74,70,40,48,49,108,69,70,83,45,70,60,90,115,110,70,86,75,85,65,75,65,75,110,68,85,60,45,70,50,80,75,70,100,60,55,85,45,75,70,70,111,65,45,60,75,55,90,75,110,85,45,45,65,60,41,64,75,50,50,50,75,62,50,116,76,80,55,75,45,55,70,110,85,103,67,60,75,105,50,75,120,75,45,105,55,60,30,40,60,45,40,70,110,70,50,60,100,150,100,100,120,75,50,38,58,54,74,55,60,40,55,45,75,60,45,75,70,36,110,65,51,60,80,50,55,70,71,114,100,69,55,50,165,60,70,40,44,74,35,65,75,85,50,60,55,60,46,55,95,76,70,50,109,45,70,80,65,75,105,50,50,65,70,72,70,110,85,91,52,92,55,85,75,79,91,91,100,100,89,125,91,71,100,56,61,88,62,40,59,41,54,45,72,38,85,45,78,62,38,80,78,44,67,54,74,66,123,75,62,78,45,59,60,62,101,65,82,86,53,42,59,89,45,95,70,100,58,77,45,123,58,95,90,78,67,68,65,49,43,56,85,108,95,40,126,85,126,50,50,58,50,71,62,82,91,60,60,77,50,60,1,170,86,30,60,90,40,66,79,95,45,75,70,99,100,76,75,91,75,95,75,62,65,72,44,78,70,65,90,85,79,80,60,65,50,76,72,100,60,86,20,40,95,60,38,120,68,30,73,95,80,95,50,100,55,35,59,79,50,60,40,45,65,60,63,83,55,40,65,60,35,55,50,70,46,81,90,38,61,95,73,115,70,75,140,40,45,60,40,40,75,35,60,60,10,35,65,50,80,90,55,40,65,90,25,40,70,80,90,50,60,39,80,30,58,44,45,40,95,65,25,52,50,35,45,90,60,65,80,50,105,30,60,35,60,60,85,30,55,40,60,95,50,90,50,50,65,40,105,80,250,65,105,30,55,30,60,45,40,70,65,65,65,65,48,130,75,95,130,55,65,65,65,35,80,40,80,55,40,80,50,80,41,60,106,35,45,100,58,100,39,78,40,50,65,85,85,60,85,40,55,70,75,125,50,20,90,55,35,65,55,90,75,90,70,100,70,35,30,75,55,55,75,65,65,95,55,95,60,60,70,48,50,190,100,75,30,65,80,160,90,90,90,61,40,35,50,45,75,65,75,65,45,75,90,90,85,73,45,55,35,45,45,95,115,255,90,100,50,70,70,106,106,40,100,50,78,45,80,60,45,50,70,100,50,35,70,50,60,60,40,40,80,60,70,90,40,70,90,65,80,20,55,90,60,60,80,60,84,30,150,31,64,104,50,72,60,144,50,50,70,50,50,70,40,60,50,60,70,60,65,65,100,70,45,70,130,70,70,60,60,45,80,80,60,50,50,70,45,110,70,75,73,70,63,60,43,50,40,66,40,60,28,70,40,38,61,65,95,44,40,65,50,80,90,70,110,35,55,55,100,45,65,100,43,60,40,80,80,75,80,100,80,80,80,100,105,95,55,45,44,76,64,53,77,60,64,84,40,85,55,59,37,60,40,80,67,97,30,20,60,40,70,45,75,60,64,95,70,20,90,150,100,60,49,71,67,80,75,70,30,55],
"sp_atk":[44,65,41,24,71,54,10,70,15,38,92,40,50,80,40,90,115,35,61,49,68,69,60,86,60,45,62,92,55,80,130,116,95,120,130,125,60,45,70,65,135,75,65,80,95,105,75,80,150,45,60,85,62,60,87,135,92,45,45,60,75,63,70,83,100,45,25,35,35,60,50,88,98,53,53,53,98,50,36,107,67,65,55,80,50,25,50,50,60,60,77,30,25,55,50,65,30,30,40,85,50,55,30,40,77,70,37,110,80,80,35,45,100,100,100,100,120,112,40,55,95,53,83,74,75,80,40,55,65,120,105,87,95,65,125,125,80,40,60,40,75,60,110,85,85,55,65,57,40,70,97,45,24,54,45,75,125,105,65,95,85,145,30,60,70,60,95,40,81,55,15,100,95,106,30,35,35,45,45,103,65,55,105,90,45,125,50,135,114,125,72,90,150,120,115,130,129,120,128,48,56,74,56,62,90,62,83,27,103,32,50,40,74,73,27,90,112,61,46,75,83,62,97,65,63,63,35,45,50,59,99,60,85,68,37,39,35,55,40,40,37,57,48,67,55,99,81,110,110,74,81,83,58,44,50,32,65,81,44,45,131,97,131,60,58,45,50,120,109,69,100,65,50,60,150,40,30,90,81,30,79,150,30,40,125,69,65,55,80,72,95,57,125,130,98,65,70,44,97,54,61,109,115,85,40,40,55,60,70,60,35,92,65,110,50,109,15,40,100,50,30,75,125,40,60,110,80,108,30,60,65,40,65,85,25,90,20,25,45,65,50,70,50,31,61,90,50,40,20,55,40,85,75,50,55,95,81,45,90,65,85,30,75,85,40,35,110,45,60,40,35,50,65,65,95,100,70,40,50,70,105,120,35,50,65,70,80,60,100,25,80,50,20,35,100,80,95,58,120,35,115,70,60,45,40,85,65,100,43,30,60,130,73,25,50,55,80,125,40,60,35,35,85,60,45,30,35,100,40,70,95,70,100,35,100,55,115,100,95,55,48,85,40,60,110,45,95,110,85,90,100,50,80,45,30,55,65,83,50,63,154,35,49,100,80,76,60,109,70,44,59,79,45,36,70,40,55,60,56,76,45,35,40,80,40,95,65,115,90,90,30,60,20,35,30,55,45,40,105,75,130,60,25,65,85,85,90,72,35,33,65,60,55,35,60,65,95,125,125,70,70,65,80,65,105,80,110,40,80,95,60,40,105,85,85,20,35,65,70,40,90,75,115,90,45,65,105,90,110,65,100,85,50,70,110,85,20,50,60,85,25,30,60,25,100,50,30,40,90,60,60,90,30,55,60,55,40,10,35,75,60,40,55,35,71,45,95,30,51,91,20,20,50,40,55,35,55,65,40,60,65,60,100,75,105,85,47,73,73,43,65,95,70,105,85,65,70,45,90,80,60,50,85,115,40,76,95,70,100,55,90,70,50,46,40,61,55,85,45,80,50,65,50,75,23,63,60,95,50,80,75,55,95,74,94,114,100,40,60,45,40,55,35,95,50,55,100,150,75,110,130,100,150,75,45,40,58,104,78,61,55,125,81,111,30,50,40,35,25,60,50,95,30,65,42,10,47,29,94,40,70,60,83,100,70,30,60,90,105,105,42,64,79,65,45,60,45,135],
"sp_def":[56,50,41,86,61,96,45,90,65,42,108,45,55,85,85,72,70,40,40,61,72,86,75,65,120,85,60,85,55,95,90,56,85,115,95,95,65,75,60,115,75,150,135,70,77,105,130,102,100,90,30,50,53,66,78,90,82,45,55,75,95,45,55,60,65,90,45,39,65,69,37,50,63,48,48,48,63,42,30,95,55,55,43,63,32,25,40,65,80,86,55,45,35,65,40,55,85,75,60,75,80,69,39,79,75,50,50,75,110,55,35,45,100,120,100,100,120,65,62,65,105,45,65,45,85,40,40,65,60,60,50,63,110,60,85,60,75,50,70,45,60,105,95,80,105,55,85,50,45,85,60,60,86,116,40,70,95,80,55,60,55,90,40,40,80,70,135,65,99,50,45,60,60,67,55,35,70,115,65,80,75,95,66,72,50,90,55,105,100,80,90,129,120,100,80,90,90,95,128,45,58,75,52,60,70,44,56,30,71,36,77,38,69,54,25,50,154,79,48,98,81,57,81,90,60,65,37,49,150,57,89,70,75,75,46,56,50,80,40,95,50,75,48,63,75,92,87,130,150,63,67,113,75,55,60,36,82,95,46,40,98,80,98,60,63,45,150,89,94,59,100,70,50,90,50,40,30,45,107,42,105,120,55,50,80,71,65,65,60,87,100,62,70,106,63,70,80,50,123,86,43,85,70,45,40,50,60,82,85,70,110,42,70,50,80,66,20,40,110,50,41,130,115,55,60,80,80,70,30,60,85,54,80,105,25,80,20,25,80,79,50,70,70,31,61,80,50,40,30,55,40,75,85,65,55,90,100,25,75,75,50,40,65,75,40,45,90,55,80,55,45,70,65,50,80,80,50,40,50,90,55,70,35,60,85,30,80,50,100,35,65,64,20,35,80,80,55,62,70,35,55,95,60,70,50,45,100,35,90,45,45,75,115,25,50,55,80,65,50,75,110,110,70,45,45,30,105,40,80,25,45,55,85,50,120,80,95,85,85,70,48,95,70,100,95,65,110,95,75,55,70,100,120,45,30,65,65,100,50,80,90,45,65,100,65,96,50,85,45,48,63,83,55,56,80,80,110,60,56,76,55,35,20,105,65,70,45,90,100,100,65,80,50,55,30,95,65,55,85,45,95,130,25,65,42,85,65,48,35,58,65,60,45,65,75,110,125,90,85,70,40,35,80,45,75,140,80,70,50,95,60,40,95,65,65,45,35,55,55,70,75,135,100,115,50,70,85,154,154,55,100,65,61,50,70,60,30,50,70,90,25,30,60,25,50,90,30,50,100,70,40,60,30,80,60,55,95,230,75,75,60,60,55,35,43,90,65,30,23,73,40,30,50,60,55,35,55,65,40,60,40,75,80,85,60,75,75,75,83,53,20,40,35,75,70,45,80,45,110,80,60,50,40,60,75,71,85,105,60,65,55,120,35,41,70,87,30,70,35,82,52,55,50,60,48,33,130,80,50,80,70,50,90,55,75,75,90,30,50,65,65,80,60,90,100,65,200,140,150,130,110,100,90,85,55,34,44,71,52,56,51,105,76,101,30,60,40,40,41,49,70,79,30,50,88,55,138,45,50,50,80,120,63,125,70,90,44,54,52,105,37,59,116,80,55,65,25,95],
"speed":[85,45,74,23,84,105,10,60,30,32,35,42,82,102,5,46,90,60,50,66,47,91,95,85,50,125,40,60,40,50,60,95,95,80,65,83,95,95,80,80,90,40,45,110,91,80,95,40,90,95,85,115,35,115,85,125,39,45,63,83,113,45,55,60,65,80,55,42,60,77,66,106,101,64,64,64,101,65,43,29,24,93,72,116,76,15,20,88,25,50,114,68,35,45,64,69,45,85,42,74,42,112,57,47,116,30,66,90,100,98,65,74,100,90,100,100,120,110,65,30,30,22,32,70,55,65,75,45,115,105,20,98,65,44,30,30,59,75,95,60,103,20,79,30,60,15,40,65,65,50,108,30,10,20,60,40,40,50,20,55,30,80,57,40,50,97,105,25,32,65,50,145,105,60,95,55,48,58,60,97,45,80,65,108,38,98,60,100,104,111,108,108,90,90,101,95,108,99,90,38,57,64,84,60,73,71,97,29,122,57,78,62,126,72,35,89,75,42,43,52,104,52,68,102,68,23,28,35,60,49,29,70,72,73,45,50,35,55,60,55,60,80,109,46,40,58,76,60,80,118,101,60,84,51,38,28,56,95,28,55,99,123,99,30,44,48,50,63,109,71,80,80,125,48,150,30,40,60,43,70,36,100,65,67,111,58,45,30,45,51,61,34,115,77,101,92,92,55,44,68,70,100,55,55,15,40,71,75,90,95,70,91,58,50,45,106,80,30,30,40,60,85,80,60,90,100,80,70,50,50,35,55,58,78,30,70,50,35,75,80,71,101,97,70,100,110,90,41,40,56,50,85,76,65,65,60,100,20,90,90,45,55,30,40,90,70,50,25,30,45,95,120,115,55,85,95,60,90,90,70,90,105,35,45,55,40,60,65,80,72,80,43,45,56,30,105,45,60,70,75,95,70,100,45,25,70,50,80,42,70,40,110,67,50,75,100,140,55,35,30,87,76,60,35,40,25,50,60,90,60,85,85,115,63,90,105,95,93,105,85,48,60,110,81,65,55,65,130,40,35,70,70,100,35,20,45,90,80,50,60,130,20,45,100,80,70,65,100,70,43,58,78,90,50,130,55,85,40,67,67,15,60,15,40,20,95,35,55,50,70,30,50,40,50,30,110,80,85,30,95,110,65,15,35,91,85,85,48,15,33,45,40,55,85,130,30,85,100,90,70,20,65,30,75,45,70,95,70,65,85,50,40,60,85,65,75,35,95,83,100,100,55,115,85,41,51,120,110,90,70,100,95,100,45,80,55,20,40,50,60,15,35,70,15,65,65,30,30,70,50,60,80,85,65,45,85,85,5,115,55,70,35,90,30,48,30,100,40,28,68,20,25,40,50,50,50,70,50,30,50,65,80,65,95,105,95,85,85,55,40,65,95,60,40,20,35,60,10,80,100,60,70,35,55,50,60,70,80,65,70,55,75,35,60,55,23,85,65,40,60,65,50,160,75,23,45,25,65,50,80,45,25,65,32,52,52,90,50,50,55,97,50,30,70,50,36,50,90,50,110,110,100,95,56,31,45,61,108,81,40,65,90,50,60,60,100,80,31,25,60,55,70,58,58,30,80,30,36,66,75,45,40,65,81,70,25,70,80,71,105,85,112,33,68,65,35,40,120]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment