<commit_before>//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// Formats Raw Data
//-------------------------------------------------------------------

d3plus.ui.titles = function(vars) {
  
  // Calculate total_bar value
  if (!vars.data.app || !vars.title.total.default || vars.type.default == "stacked") {
    vars.data.total = null
  }
  else {
    if (vars.dev.default) d3plus.console.group("Calculating Total Value")
    
    if (vars.dev.default) d3plus.console.time(vars.size.key)
    
    if (vars.data.app instanceof Array) {
      vars.data.total = d3.sum(vars.data.app,function(d){
        return d3plus.variable.value(vars,d,vars.size.key)
      })
    }
    else if (vars.type.default == "rings") {
      if (vars.data.app[vars.focus.default])
        vars.data.total = vars.data.app[vars.focus.default][vars.size.key]
      else {
        vars.data.total = null
      }
    }
    else {
      vars.data.total = d3.sum(d3.values(vars.data.app),function(d){
        return d[vars.size.key]
      })
    }
    
    if (vars.dev.default) d3plus.console.timeEnd(vars.size.key)<commit_msg>total bar now uses vars.data.pool<commit_after>//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// Formats Raw Data
//-------------------------------------------------------------------

d3plus.ui.titles = function(vars) {
  
  // Calculate total_bar value
  if (!vars.data.app || !vars.title.total.default || vars.type.default == "stacked") {
    vars.data.total = null
  }
  else {
    if (vars.dev.default) d3plus.console.group("Calculating Total Value")
    
    if (vars.dev.default) d3plus.console.time(vars.size.key)
    
    if (vars.focus.default && typeof vars.data.app == "object") {
      if (vars.data.app[vars.focus.default])
        vars.data.total = d3plus.variable.value(vars,vars.data.app[vars.focus.default],vars.size.key)
      else {
        vars.data.total = null
      }
    }
    else {
      vars.data.total = d3.sum(vars.data.pool,function(d){
        return d3plus.variable.value(vars,d,vars.size.key)
      })
    }
    
    if (vars.dev.default) d3plus.console.timeEnd(vars.size.key)
{'fraction_non_alphanumeric': 0.26264501160092807, 'fraction_numerical': 0.0069605568445475635, 'mean_word_length': 2.194074074074074, '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': '2799723', 'n_tokens_mistral': 719, 'n_tokens_neox': 713, 'n_words': 100}