<commit_before>App.prototype._pieChart = function( votes ) {
  
  var width = 150,
      height = 150,
      radius = Math.min(width, height) / 2;

  var color = d3.scale.ordinal()
      .range(["#A6A48B", "#938BA6", "#A0AED9", "#666556", "#FFB90A", "#d0743c", "#ff8c00"]);

  var arc = d3.svg.arc()
      .outerRadius(radius - 10)
      .innerRadius(0);

  var pie = d3.layout.pie()
      .sort(null)
      .value(function(d) { return d.count; });

  var svg = d3.select("#pie-chart-votes").append("svg")
      .attr("width", width)
      .attr("height", height)
    .append("g")
      .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");

  var data = [];
  for ( var d in votes ) {
    if (votes[d] > 0) {
      var obj = {"type": d, "count": votes[d]};
      data.push(obj);
    }
  }
  
  data.forEach(function(d) {
    d.count = +d.count;
  });

  var g = svg.selectAll(".arc")
      .data(pie(data))
    .enter().append("g")
      .attr("class", "arc");

  g.append("path")
      .attr("d", arc)
      .style("fill", function(d) { return color(d.data.type); });

  g.append("text")
      .attr("transform", function(d) { return "translate(" + arc.centroid(d) + ")"; })
      .attr("dy", ".35em")
      .attr('class', 'pie-text')
      .style("text-anchor", "middle")
      .text(function(d) { return d.data.type; });

}

App.prototype._partyLinePie = function() {
  var self = this;

  var width = 150,
      height = 150,
      radius = Math.min(width, height) / 2;

  var color = d3.scale.ordinal()
      .range(["#938BA6", "#A6A48B", "#A0AED9", "#666556", "#FFB90A", "#d0743c", "#ff8c00"]);
  var arc = d3.svg.arc()
      .outerRadius(radius - 10)
      .innerRadius(0);

  var pie = d3.layout.pie()
      .sort(null)
      .value(function(d) { return d.count; });

  var svg = d3.select("#pie-chart-party-line").append("svg")
      .attr("width", width)
      .attr("height", height)
    .append("g")
      .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");

  var data = [];
  for ( var d in this.partyLine ) {
    if (self.partyLine[d] > 0) {
      var obj = {"type": d, "count": self.partyLine[d]};
      data.push(obj);
    }
  }
  
  data.forEach(function(d) {
    d.count = +d.count;
  });

  var g = svg.selectAll(".arc")
      .data(pie(data))
    .enter().append("g")
      .attr("class", "arc");

  g.append("path")
      .attr("d", arc)
      .style("fill", function(d) { return color(d.data.type); });

  g.append("text")
      .attr("transform", function(d) { return "translate(" + arc.centroid(d) + ")"; })
      .attr("dy", ".35em")
      .attr('class', 'pie-text')
      .style("text-anchor", "middle")
      .text(function(d) { return d.data.type; });

}<commit_msg>another shot at better colors for the pie charts<commit_after>App.prototype._pieChart = function( votes ) {
  
  var width = 150,
      height = 150,
      radius = Math.min(width, height) / 2;

  var color = d3.scale.ordinal()
      .range(["#4DB8F6", "#2479A9", "#98D4F7", "#666556", "#FFB90A", "#d0743c", "#ff8c00"]);

  var arc = d3.svg.arc()
      .outerRadius(radius - 10)
      .innerRadius(0);

  var pie = d3.layout.pie()
      .sort(null)
      .value(function(d) { return d.count; });

  var svg = d3.select("#pie-chart-votes").append("svg")
      .attr("width", width)
      .attr("height", height)
    .append("g")
      .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");

  var data = [];
  for ( var d in votes ) {
    if (votes[d] > 0) {
      var obj = {"type": d, "count": votes[d]};
      data.push(obj);
    }
  }
  
  data.forEach(function(d) {
    d.count = +d.count;
  });

  var g = svg.selectAll(".arc")
      .data(pie(data))
    .enter().append("g")
      .attr("class", "arc");

  g.append("path")
      .attr("d", arc)
      .style("fill", function(d) { return color(d.data.type); });

  g.append("text")
      .attr("transform", function(d) { return "translate(" + arc.centroid(d) + ")"; })
      .attr("dy", ".35em")
      .attr('class', 'pie-text')
      .style("text-anchor", "middle")
      .text(function(d) { return d.data.type; });

}

App.prototype._partyLinePie = function() {
  var self = this;

  var width = 150,
      height = 150,
      radius = Math.min(width, height) / 2;

  var color = d3.scale.ordinal()
      .range(["#4DB8F6", "#2479A9", "#98D4F7", "#666556", "#FFB90A", "#d0743c", "#ff8c00"]);
  var arc = d3.svg.arc()
      .outerRadius(radius - 10)
      .innerRadius(0);

  var pie = d3.layout.pie()
      .sort(null)
      .value(function(d) { return d.count; });

  var svg = d3.select("#pie-chart-party-line").append("svg")
      .attr("width", width)
      .attr("height", height)
    .append("g")
      .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");

  var data = [];
  for ( var d in this.partyLine ) {
    if (self.partyLine[d] > 0) {
      var obj = {"type": d, "count": self.partyLine[d]};
      data.push(obj);
    }
  }
  
  data.forEach(function(d) {
    d.count = +d.count;
  });

  var g = svg.selectAll(".arc")
      .data(pie(data))
    .enter().append("g")
      .attr("class", "arc");

  g.append("path")
      .attr("d", arc)
      .style("fill", function(d) { return color(d.data.type); });

  g.append("text")
      .attr("transform", function(d) { return "translate(" + arc.centroid(d) + ")"; })
      .attr("dy", ".35em")
      .attr('class', 'pie-text')
      .style("text-anchor", "middle")
      .text(function(d) { return d.data.type; });

}
{'fraction_non_alphanumeric': 0.22585924713584288, 'fraction_numerical': 0.03236952173122386, 'mean_word_length': 2.527902501603592, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '66047', 'n_tokens_mistral': 2180, 'n_tokens_neox': 2055, 'n_words': 404}