<commit_before>(function() {
  'use strict';

  function PerspectiveLaneChartController($window, $element, d3, dc, colorbrewer, NdxService, HelperFunctions, Messagebus) {
    this.perspectiveOption = 'sentiment';

    this.initializeChart = function() {
      this.customBubbleChart = dc.dyndomBubbleChart('#'+$element[0].children[0].attributes.id.value);

      //The dimension for the customBubbleChart. We use time for x and group for y,
      //and bin everything in the same group number and day.
      var laneTimeDimension = NdxService.buildDimension(function(d) {
        var time = d3.time.format('%Y%m%d').parse(d.time);

        return [time, HelperFunctions.determineUniqueSources(d)];
      });

      //The group for the customBubbleChart. Weneed the climax score to size
      //the bubbles, the rest is for labeling and hover information. We use a
      //custom reduce funtion here to gather all the info we need.
      var laneClimaxGroup = laneTimeDimension.group().reduce(
        //Add something to our temporary collection
        function(p, v) {
          var keys = Object.keys(v.mentions);
          keys.forEach(function(key) {
            var mention = v.mentions[key];
            p.climax = (p.climax || 0) + v.climax;

            mention.perspective.forEach(function(perspective) {
              var attribution = perspective.attribution;
              var source = perspective.source;

              p.sources[source] = (p.sources[source] || 0) + 1;

              p.perspectives = (p.perspectives || 0) + 1;

              var belief = 0;
              if (attribution.belief === 'confirm') {
                belief += 1;
              } else if (attribution.belief === 'denial') {
                belief -= 1;
              }
              p.belief[source] = (p.belief[source] || 0) + belief;

              var certainty = 0;
              if (attribution.certainty === 'certain') {
                certainty += 1;
              } else if (attribution.certainty === 'uncertain') {
                certainty -= 1;
              }
              p.certainty[source] = (p.certainty[source] || 0) + certainty;

              var possibility = 0;
              if (attribution.possibility === 'likely') {
                possibility += 1;
              } else if (attribution.possibility === 'unlikely') {
                possibility -= 1;
              }
              p.possibility[source] = (p.possibility[source] || 0) + possibility;

              var sentiment = 0;
              if (attribution.sentiment === 'positive') {
                sentiment += 1;
              } else if (attribution.sentiment === 'negative') {
                sentiment -= 1;
              }
              p.sentiment[source] = (p.sentiment[source] || 0) + sentiment;

              var when = 0; //Reversed on request
              if (attribution.when === 'past') {
                when -= 1;
              } else if (attribution.when === 'future') {
                when += 1;
              }
              p.when[source] = (p.when[source] || 0) + when;
            });
          });

          return p;
        },
        //Remove something from our temporary collection, (basically do
        //everything in the add step, but then in reverse).
        function(p, v) {
          var keys = Object.keys(v.mentions);
          keys.forEach(function(key) {<commit_msg>fixed bug with colorscheme<commit_after>(function() {
  'use strict';

  function PerspectiveLaneChartController($window, $element, d3, dc, colorbrewer, NdxService, HelperFunctions, Messagebus) {
    this.perspectiveOption = 'sentiment';

    this.initializeChart = function() {
      this.customBubbleChart = dc.dyndomBubbleChart('#'+$element[0].children[0].attributes.id.value);

      //The dimension for the customBubbleChart. We use time for x and group for y,
      //and bin everything in the same group number and day.
      var laneTimeDimension = NdxService.buildDimension(function(d) {
        var time = d3.time.format('%Y%m%d').parse(d.time);

        return [time, HelperFunctions.determineUniqueSources(d)];
      });

      //The group for the customBubbleChart. Weneed the climax score to size
      //the bubbles, the rest is for labeling and hover information. We use a
      //custom reduce funtion here to gather all the info we need.
      var laneClimaxGroup = laneTimeDimension.group().reduce(
        //Add something to our temporary collection
        function(p, v) {
          var keys = Object.keys(v.mentions);
          keys.forEach(function(key) {
            var mention = v.mentions[key];
            p.climax = (p.climax || 0) + v.climax;

            mention.perspective.forEach(function(perspective) {
              var attribution = perspective.attribution;
              var source = perspective.source;

              p.sources[source] = (p.sources[source] || 0) + 1;

              p.perspectives = (p.perspectives || 0) + 1;

              var belief = 0;
              if (attribution.belief === 'confirm') {
                belief += 1;
              } else if (attribution.belief === 'denial') {
                belief -= 1;
              }
              p.belief[source] = (p.belief[source] || 0) + belief;

              var certainty = 0;
              if (attribution.certainty === 'certain') {
                certainty += 1;
              } else if (attribution.certainty === 'uncertain') {
                certainty -= 1;
              }
              p.certainty[source] = (p.certainty[source] || 0) + certainty;

              var possibility = 0;
              if (attribution.possibility === 'likely') {
                possibility += 1;
              } else if (attribution.possibility === 'unlikely') {
                possibility -= 1;
              }
              p.possibility[source] = (p.possibility[source] || 0) + possibility;

              var sentiment = 0;
              if (attribution.sentiment === 'positive') {
                sentiment += 1;
              } else if (attribution.sentiment === 'negative') {
                sentiment -= 1;
              }
              p.sentiment[source] = (p.sentiment[source] || 0) + sentiment;

              var when = 0; //Reversed on request
              if (attribution.when === 'past') {
                when += 1;
              } else if (attribution.when === 'future') {
                when -= 1;
              }
              p.when[source] = (p.when[source] || 0) + when;
            });
          });

          return p;
        },
        //Remove something from our temporary collection, (basically do
        //everything in the add step, but then in reverse).
        function(p, v) {
          var keys = Object.keys(v.mentions);
          keys.forEach(function(key) {
{'fraction_non_alphanumeric': 0.12118531623175587, 'fraction_numerical': 0.00855078873654725, 'mean_word_length': 1.744336569579288, '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': '3020472', 'n_tokens_mistral': 1948, 'n_tokens_neox': 1803, 'n_words': 485}