Ensuring correct score and team data alignment on ribbon hover.

master
Ben Burlingham 9 years ago
parent 57510aebec
commit 4c87e62116
  1. 12
      index.html
  2. 5
      js/bundle.js
  3. 19
      js/diagram.js

@ -55,13 +55,11 @@
<div class="notes"> <div class="notes">
<h5>TODO</h5> <h5>TODO</h5>
update ribbon hover Check all ribbon hovers for strange ET/P
// STRANGE EXTENDED TIME CHILE-BRAZIL (when? not 1930) - FIX BY HAND? IS BECAUE se1 IS SCORE __GOING INTO__ EXTENDED TIME No finals in 1954 (Germany Hungary)
No finals in 1954 or 1962? No finals in 1962 (Chile Brazil), strange Brazil-Czech
1954 - teams already played eachother (uh oh) Cause: teams already played eachother (uh oh)
Solution: Add "multi" flag to something. Split diagram harder. Redraw chords within arc to have new ones.
fix buoy viz
tweet it! tweet it!
</div> </div>

@ -487,13 +487,16 @@
return (v.t1 === t1.tId || v.t1 === t2.tId) && (v.t2 === t1.tId || v.t2 === t2.tId); return (v.t1 === t1.tId || v.t1 === t2.tId) && (v.t2 === t1.tId || v.t2 === t2.tId);
}); });
var s1 = game.t1 === t1.tId ? game.s1 : game.s2;
var s2 = game.t2 === t2.tId ? game.s2 : game.s1;
var e1 = game.se1 ? '(+' + game.se1 + ' in extended time)' : ''; var e1 = game.se1 ? '(+' + game.se1 + ' in extended time)' : '';
var e2 = game.se2 ? '(+' + game.se2 + ' in extended time)' : ''; var e2 = game.se2 ? '(+' + game.se2 + ' in extended time)' : '';
var p1 = game.sp1 ? '(+' + game.sp1 + ' in penalties)' : ''; var p1 = game.sp1 ? '(+' + game.sp1 + ' in penalties)' : '';
var p2 = game.sp2 ? '(+' + game.sp2 + ' in penalties)' : ''; var p2 = game.sp2 ? '(+' + game.sp2 + ' in penalties)' : '';
return c1 + ': ' + game.s1 + ' ' + e1 + ' ' + p1 + '\n' + c2 + ': ' + game.s2 + ' ' + e2 + ' ' + p2 + '\n' + data.rounds[game.rId]; return c1 + ': ' + s1 + ' ' + e1 + ' ' + p1 + '\n' + c2 + ': ' + s2 + ' ' + e2 + ' ' + p2 + '\n' + data.rounds[game.rId];
}); });
group.append("text").each(function (d) { group.append("text").each(function (d) {

@ -220,17 +220,20 @@ const Diagram = {
const c2 = data.countries[t2.cId]; const c2 = data.countries[t2.cId];
const game = data.tourneys[eventKey].games.find(v => { const game = data.tourneys[eventKey].games.find(v => {
return (v.t1 === t1.tId || v.t1 === t2.tId) && (v.t2 === t1.tId || v.t2 === t2.tId); return (v.t1 === t1.tId || v.t1 === t2.tId) && (v.t2 === t1.tId || v.t2 === t2.tId);
}); });
const e1 = game.se1 ? `(+${game.se1} in extended time)` : ''; const s1 = game.t1 === t1.tId ? game.s1 : game.s2;
const e2 = game.se2 ? `(+${game.se2} in extended time)` : ''; const s2 = game.t2 === t2.tId ? game.s2 : game.s1;
const e1 = game.se1 ? `(+${game.se1} in extended time)` : '';
const e2 = game.se2 ? `(+${game.se2} in extended time)` : '';
const p1 = game.sp1 ? `(+${game.sp1} in penalties)` : ''; const p1 = game.sp1 ? `(+${game.sp1} in penalties)` : '';
const p2 = game.sp2 ? `(+${game.sp2} in penalties)` : ''; const p2 = game.sp2 ? `(+${game.sp2} in penalties)` : '';
return `${c1}: ${game.s1} ${e1} ${p1}\n${c2}: ${game.s2} ${e2} ${p2}\n${data.rounds[game.rId]}`; return `${c1}: ${s1} ${e1} ${p1}\n${c2}: ${s2} ${e2} ${p2}\n${data.rounds[game.rId]}`;
}); });
group.append("text") group.append("text")
.each(function(d) { d.angle = (d.startAngle + d.endAngle) / 2; }) .each(function(d) { d.angle = (d.startAngle + d.endAngle) / 2; })

Loading…
Cancel
Save