<commit_before><html>
<head>
  <title>Phase 1</title>
  <script src="lib/lodash.min.js"></script>
  <script src="lib/d3/d3.min.js"></script>
  <script src="lib/jquery-2.1.3.min.js"></script>
</head>
<body>


  <script>
    d3.json('json/committees.json', function(committees){
      var requests = [];
      var committeeData = {};
      _.forEach(committees, function(committee){
        var request = $.getJSON('http://172.16.31.10/hackoregon/http/candidate_sum_by_date/'+committee.committeeId + '/');
        request.then(function(data){
          committeeData[committee.committeeId] = data;
        })
        requests.push(request);
      });
      $.when.apply($, requests).then(function(){
        console.log(committeeData);
      });
    });
  </script>
</body>
</html><commit_msg>initial stab at d3 chart<commit_after><html>
<head>
  <title>Phase 1</title>
  <script src="lib/lodash.min.js"></script>
  <script src="lib/d3/d3.min.js"></script>
  <script src="lib/jquery-2.1.3.min.js"></script>
  <style>
    rect {
        fill: #003300;
    }
  </style>
</head>
<body>


  <script>
    var body = d3.select("body");
    d3.json('json/committees.json', function(committees){
        var requests = [];
        var committeeData = {};
        _.forEach(committees, function(committee){

            var request = $.getJSON('http://172.16.31.10/hackoregon/http/candidate_sum_by_date/'+committee.committeeId + '/');
            request.then(function(data){

                committeeData[committee.committeeId] = data;

                var width = 900;
                var height = 50;

                var x = d3.time.scale().range(([0,width]));
                x.domain([new Date('2012-11-1'), new Date()]);
                var svg = body.append("div");

                var y = d3.scale.linear().range(([0,height]));
                y.domain([0,50000]);

                var svg = d3.select('body')
                    .append("svg")
                    .attr("width", width)
                    .attr("height",height);

                svg.append('g').attr('class','committee')
                    .selectAll('rect.day').data(data)
                    .enter().append('rect').attr('class','day')
                    .attr('x', function(d){
                        // console.log('x',d.tran_date);
                        return x(new Date(d.tran_date));
                    })
                    .attr('y',function(d){
                        // console.log('y',height - y(d.total_in) );
                        return height - y(d.total_in);
                    })
                    .attr('width', 2 )
                    .attr('height',function(d){
                        console.log('height',d.total_in);
                        return y(d.total_in)
                    });

            });

            requests.push(request);

        });

        $.when.apply($, requests).then(function(){
            console.log(committeeData);
        });
    });

  </script>
</body>
</html>
{'fraction_non_alphanumeric': 0.177, 'fraction_numerical': 0.021333333333333333, 'mean_word_length': 1.681858802502234, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4684704', 'n_tokens_mistral': 976, 'n_tokens_neox': 880, 'n_words': 127}