Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var level = svg.selectAll(".level")
- .data(data)
- .enter().append("g")
- .attr("transform", function(d, i) { return "translate(" + (i * 200) + "," + Math.pow(2,i)*matchY/2 + ")"; })
- .attr("class", "level");
- var match = level.selectAll(".match")
- .data(function(d) { return d.matches ; })// <-- THIS
- .enter().append("g")
- .attr("transform", function(d, i, j) { return "translate(0," + (Math.pow(2,j)*i*matchY) + ")"; })
- .attr("class", "match");
- var player = match.selectAll(".player")
- .data(function(d) { return d.seeds; })// <-- THIS
- .enter()
- .append("g")
- .attr("transform", function(d, i) { return "translate("+ (playerOffsetX) + "," + (i == 0 ? 0 : (rectY+rectGapY)) + ")"; })
- .attr("class", "player");
- player.append("rect")
- .attr("width", rectX)
- .attr("height", rectY)
- .attr("class", "player");
- player.append("text")
- .attr("x", 3)
- .attr("y", rectY / 2)
- .attr("dy", ".35em")
- .text(function(d) { return getPlayerByIdOrSomethingLikeThat(d); });// <-- THIS
- [
- { source: {...}, target: {...} },
- { source: {...}, target: {...} },
- { source: {...}, target: {...} },
- ...
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement