summaryrefslogtreecommitdiff
path: root/assets/scripts/d3/gender_terms_v0.js
blob: 32052ea9b58d03e9c0554c6ae714ff2b6dee73bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(function() {
  d3.json("/assets/data/legislators-current.json", function(data) {

  d3.select("div#d3gender_terms_v0").selectAll("svg")
    .data(data.legislators)
    .enter()
    .append("svg")
      .attr("width", function(d) { return d.terms.length * 2; })
      .attr("height", function(d) { return d.terms.length * 2; })
    .append("circle")
      .attr("cx", function(d) { return d.terms.length; })
      .attr("cy", function(d) { return d.terms.length; })
      .attr("r", function(d) { return d.terms.length; })
      .style("fill", function(d) { return d.bio.gender === 'F'? "green" : "blue"; });
  });
})();