<commit_before>var ValueSummary = function (options) {

  var self = this,
    outer  = options.id ? 
      d3.select("#"+options.id).attr("class","valueSummary") :
      d3.select("body").append("div").attr("class","valueSummary");
  
  var inner  = outer.append("div").attr("class","inner");
  
  var width  = parseInt(outer.style("width"),  10),
    height   = parseInt(outer.style("height"), 10) || width;
    radius   = (Math.min(width, height)) / 2;
    margin   = {top:radius/10, bottom:radius/10, left:radius/10, right:radius/10};

    inner.style({width:(radius*2)+"px", height:(radius*2)+"px"});
    radius -= margin.top;
    
  var chart = inner.append('svg')
    .attr("width",  radius*2.3)
    .attr("height", radius*2.3)
    .append("g")
    .attr("transform", "translate(" + (radius+margin.left) + "," + (radius+margin.top) + ")");

  var toggle = outer.append("label").attr("class","xrpToggle");
  var hideXRP = true;
    
    toggle.append("input").attr("type", "checkbox")
      .property("checked", !hideXRP)
      .on('click', function(){
        hideXRP = !d3.select(this).property("checked");
        self.load(null, exchange, true);
      });
      
    toggle.append("b");  
    toggle.append("span").html("include XRP");  
     
  //var color  = d3.scale.category20();
  var color = function (d) {
    var currency = "";
    if (d.data.base) {
      currency = d.data.base.currency;  
    } else if (d.data.currency) {
      currency = d.data.currency;
    }
    
    var colors = {
      'XRP'     : '#346aa9',
      'USD'     : [20,150,30],
      'BTC'     : [240,150,50],
      'EUR'     : [220,210,50],
      'CNY'     : [180,30,35],
      'JPY'     : [140,80,170],
      'CAD'     : [130,100,190],
      'other'   : [110,100,160]
    };
    var c = colors[currency] || colors.other;
    var rank = d.data.rank - 1;
    if (typeof c !== 'string') {
      c[0] -= Math.floor(c[0] * (rank%3*0.1));
      c[1] -= Math.floor(c[1] * (rank%3*0.15));
      c[2] -= Math.floor(c[2] * (rank%3*0.2));
  
       c = 'rgb('+c[0]+','+c[1]+','+c[2]+')';      
    }

    return c;
  }
    
  var arc    = d3.svg.arc()
      .outerRadius(radius*0.9)
      .innerRadius(radius*0.4);
          
  var labelArc = d3.svg.arc()
      .outerRadius(radius*1.15)
      .innerRadius(radius);
  
  //arc paths
  var path          = chart.selectAll("path");    
  var tooltip       = outer.append("div").attr("class","tooltip"); <commit_msg>change color for 'other' currency<commit_after>var ValueSummary = function (options) {

  var self = this,
    outer  = options.id ? 
      d3.select("#"+options.id).attr("class","valueSummary") :
      d3.select("body").append("div").attr("class","valueSummary");
  
  var inner  = outer.append("div").attr("class","inner");
  
  var width  = parseInt(outer.style("width"),  10),
    height   = parseInt(outer.style("height"), 10) || width;
    radius   = (Math.min(width, height)) / 2;
    margin   = {top:radius/10, bottom:radius/10, left:radius/10, right:radius/10};

    inner.style({width:(radius*2)+"px", height:(radius*2)+"px"});
    radius -= margin.top;
    
  var chart = inner.append('svg')
    .attr("width",  radius*2.3)
    .attr("height", radius*2.3)
    .append("g")
    .attr("transform", "translate(" + (radius+margin.left) + "," + (radius+margin.top) + ")");

  var toggle = outer.append("label").attr("class","xrpToggle");
  var hideXRP = true;
    
    toggle.append("input").attr("type", "checkbox")
      .property("checked", !hideXRP)
      .on('click', function(){
        hideXRP = !d3.select(this).property("checked");
        self.load(null, exchange, true);
      });
      
    toggle.append("b");  
    toggle.append("span").html("include XRP");  
     
  //var color  = d3.scale.category20();
  var color = function (d) {
    var currency = "";
    if (d.data.base) {
      currency = d.data.base.currency;  
    } else if (d.data.currency) {
      currency = d.data.currency;
    }
    
    var colors = {
      'XRP'     : '#346aa9',
      'USD'     : [20,150,30],
      'BTC'     : [240,150,50],
      'EUR'     : [220,210,50],
      'CNY'     : [180,30,35],
      'JPY'     : [140,80,170],
      'CAD'     : [130,100,190],
      'other'   : [100, 150, 200]
    };
    var c = colors[currency] || colors.other;
    var rank = d.data.rank - 1;
    if (typeof c !== 'string') {
      c[0] -= Math.floor(c[0] * (rank%3*0.1));
      c[1] -= Math.floor(c[1] * (rank%3*0.15));
      c[2] -= Math.floor(c[2] * (rank%3*0.2));
  
       c = 'rgb('+c[0]+','+c[1]+','+c[2]+')';      
    }

    return c;
  }
    
  var arc    = d3.svg.arc()
      .outerRadius(radius*0.9)
      .innerRadius(radius*0.4);
          
  var labelArc = d3.svg.arc()
      .outerRadius(radius*1.15)
      .innerRadius(radius);
  
  //arc paths
  var path          = chart.selectAll("path");    
  var tooltip       = outer.append("div").attr("class","tooltip"); 
{'fraction_non_alphanumeric': 0.21425661914460284, 'fraction_numerical': 0.04643584521384929, 'mean_word_length': 2.4366689993002097, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3278427', 'n_tokens_mistral': 1904, 'n_tokens_neox': 1787, 'n_words': 298}