|
|
|
@ -151,12 +151,6 @@ const Diagram = { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// let sortedChords = Diagram.swapGroups(data, "1930", chords, 2, 10);
|
|
|
|
|
// sortedChords = Diagram.swapGroups(data, "1930", chords, 2, 8);
|
|
|
|
|
// [ Romania, Belgium, Serbia, France, US, Mexico, Paraguay, Peru, Uruguay, Chile, Bolivia, Brazil, Argentina ]
|
|
|
|
|
// PROBLEMS: 2-8, 2-10, 2-11
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const arc = d3.arc() |
|
|
|
|
.innerRadius(innerRadius) |
|
|
|
|
.outerRadius(outerRadius); |
|
|
|
@ -235,17 +229,25 @@ const Diagram = { |
|
|
|
|
.each(function(d) { d.angle = (d.startAngle + d.endAngle) / 2; }) |
|
|
|
|
.attr("dy", ".35em") |
|
|
|
|
.attr("transform", function(d) { |
|
|
|
|
return "rotate(" + (d.angle * 180 / Math.PI - 90) + ")" |
|
|
|
|
return "rotate(" + (d.angle * 180 / Math.PI - 91) + ")" |
|
|
|
|
+ "translate(" + (innerRadius + 26) + ")" |
|
|
|
|
+ (d.angle > Math.PI ? "rotate(180)" : ""); |
|
|
|
|
}) |
|
|
|
|
.style("text-anchor", function(d) { return d.angle > Math.PI ? "end" : null; }) |
|
|
|
|
.text(function(d) { |
|
|
|
|
// STRANGE EXTENDED TIME CHILE-BRAZIL (when? not 1930) - FIX BY HAND? IS BECAUE se1 IS SCORE __GOING INTO__ EXTENDED TIME
|
|
|
|
|
|
|
|
|
|
const team = data.tourneys[eventKey].teams[d.index]; |
|
|
|
|
const country = data.countries[team.cId]; |
|
|
|
|
return data.countries[team.cId] + ' ' + team.p; |
|
|
|
|
let metric = ''; |
|
|
|
|
|
|
|
|
|
switch (sort) { |
|
|
|
|
case SORT_TYPES.GOALS: |
|
|
|
|
metric = `(${team.gf})`; |
|
|
|
|
break; |
|
|
|
|
case SORT_TYPES.POPULATION: |
|
|
|
|
metric = `(${Number(team.p).toLocaleString()})`; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return `${data.countries[team.cId]} ${metric}`; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|