<commit_before>//global directives go here

angular.module('omniwallet').directive('d3PieChart', function() {
    return {
      template: '<svg></svg>',
      controller: function($scope, $element, $attrs) {

        $scope.chart = {
          width: 300,
          height: 300
        }
        $scope.radius = Math.min($scope.chart.width, $scope.chart.height) / 2

        $element.find('svg').attr('height', $scope.chart.height).attr('width', $scope.chart.width);

        var color = d3.scale.category20()

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

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

        var svg = d3.select("svg")

        $scope.totalsPromise.then(function(successData) {

          var data = [],
            keys = Object.keys($scope.totals);
          keys.forEach(function(e, i) {
            data.push({
              value: $scope.totals[e],
              name: keys[i],
              color: Math.floor(Math.random() * 10)
            });
          });

          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.color);
            })
            .attr('transform', 'translate(150,150)');

          g.append("text")
            .attr("transform", function(d) {
              var c = arc.centroid(d);
              return "translate(" + (150 + c[0]) + "," + (150 + c[1]) + ")";
            })
            .attr("dy", ".35em")
            .style("text-anchor", "middle")
            .text(function(d) {
            return d.data.name;
          });
        });
      }
    }
  }).directive('omTooltip', function() {
    return {
      template: '<small><strong>(?)<strong></small>',
      link: function(scope, iElement, iAttrs, controller) {
        if (iAttrs.text)
          iElement.tooltip({
            title: iAttrs.text,
            placement: 'down',
            container: 'body'
          });
      }
    }
  }).directive('match', [function() {
    return {
      require: 'ngModel',
      link: function(scope, elem, attrs, ctrl) {

        scope.$watch('[' + attrs.ngModel + ', ' + attrs.match + ']', function(value) {
          ctrl.$setValidity('match', value[0] === value[1]);
        }, true);

      }
    }
 }]).directive('autoFocus', function($timeout) {
  return {
    restrict: 'AC',
    scope: {
      'autoFocus': '=autoFocus'
    },
    link: function(scope, element) {
      scope.$watch('autoFocus', function() {
        if(scope.autoFocus) {
          $timeout(function(){
            $(element[0]).focus();
          }, 100);
        }
      });
    }
  };
}).directive('combobox', function(){
  return {
    restrict:'E',
    templateUrl:'/template/combobox/combobox.html',
    scope:{
      optionList: '=',
      modelValue:'=',
      label:'@',
      placeholder:'@',
      valueSelected:'&'
    },
    controller:function($scope){
      $scope.filteredList = $scope.optionList;
      $scope.selectedOption=false;
      
      $scope.filter=function(){
        $scope.filteredList = $scope.optionList.filter(function(option){
          var matcher = new RegExp("^"+$scope.modelValue);
          return matcher.test(option);
        });
      };
      
      $scope.$watch(function(){ return $scope.optionList; },function(options){
        $scope.filteredList = options;
      });
    },
    link: function(scope, element, attr){
      scope.toggle = function(){
        if(!scope.selectedOption)
          $('.dropdown',element).toggleClass('open');
      };

      scope.optionSelected = function(option){
        scope.modelValue = option;
        $('.dropdown',element).removeClass('open');
        scope.valueSelected({category:option});
        scope.selectedOption=false;
      };
      
      element.on('mousedown','a',function(){
        scope.selectedOption = true;
      });
    }
  };
});<commit_msg>Added styling to the list<commit_after>//global directives go here

angular.module('omniwallet').directive('d3PieChart', function() {
    return {
      template: '<svg></svg>',
      controller: function($scope, $element, $attrs) {

        $scope.chart = {
          width: 300,
          height: 300
        }
        $scope.radius = Math.min($scope.chart.width, $scope.chart.height) / 2

        $element.find('svg').attr('height', $scope.chart.height).attr('width', $scope.chart.width);

        var color = d3.scale.category20()

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

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

        var svg = d3.select("svg")

        $scope.totalsPromise.then(function(successData) {

          var data = [],
            keys = Object.keys($scope.totals);
          keys.forEach(function(e, i) {
            data.push({
              value: $scope.totals[e],
              name: keys[i],
              color: Math.floor(Math.random() * 10)
            });
          });

          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.color);
            })
            .attr('transform', 'translate(150,150)');

          g.append("text")
            .attr("transform", function(d) {
              var c = arc.centroid(d);
              return "translate(" + (150 + c[0]) + "," + (150 + c[1]) + ")";
            })
            .attr("dy", ".35em")
            .style("text-anchor", "middle")
            .text(function(d) {
            return d.data.name;
          });
        });
      }
    }
  }).directive('omTooltip', function() {
    return {
      template: '<small><strong>(?)<strong></small>',
      link: function(scope, iElement, iAttrs, controller) {
        if (iAttrs.text)
          iElement.tooltip({
            title: iAttrs.text,
            placement: 'down',
            container: 'body'
          });
      }
    }
  }).directive('match', [function() {
    return {
      require: 'ngModel',
      link: function(scope, elem, attrs, ctrl) {

        scope.$watch('[' + attrs.ngModel + ', ' + attrs.match + ']', function(value) {
          ctrl.$setValidity('match', value[0] === value[1]);
        }, true);

      }
    }
 }]).directive('autoFocus', function($timeout) {
  return {
    restrict: 'AC',
    scope: {
      'autoFocus': '=autoFocus'
    },
    link: function(scope, element) {
      scope.$watch('autoFocus', function() {
        if(scope.autoFocus) {
          $timeout(function(){
            $(element[0]).focus();
          }, 100);
        }
      });
    }
  };
}).directive('combobox', function(){
  return {
    restrict:'E',
    templateUrl:'/template/combobox/combobox.html',
    scope:{
      optionList: '=',
      modelValue:'=',
      label:'@',
      placeholder:'@',
      valueSelected:'&'
    },
    controller:function($scope){
      $scope.filteredList = $scope.optionList;
      $scope.selectedOption=false;
      
      $scope.filter=function(){
        $scope.filteredList = $scope.optionList.filter(function(option){
          var matcher = new RegExp("^"+$scope.modelValue);
          return matcher.test(option);
        });
      };
      
      $scope.$watch(function(){ return $scope.optionList; },function(options){
        $scope.filteredList = options;
      });
    },
    link: function(scope, element, attr){
      scope.open = function(){
          $('.dropdown',element).addClass('open');
      };
      
      scope.close = function(){
        if(!scope.selectedOption)
          $('.dropdown',element).removeClass('open');
      };

      scope.optionSelected = function(option){
        scope.modelValue = option;
        $('.dropdown',element).removeClass('open');
        scope.valueSelected({category:option});
        scope.selectedOption=false;
      };
      
      element.on('mousedown','a',function(){
        scope.selectedOption = true;
      });
      
      $('ul',element).css({
        "max-height": 150,
        "overflow-y": "auto",
        "width":$('input',element).width(),
        "left":$('.input-group-addon',element).width()
      });
    }
  };
});
{'fraction_non_alphanumeric': 0.17874736101337085, 'fraction_numerical': 0.009969505043396668, 'mean_word_length': 1.875885328836425, 'pattern_counts': {'":': 4, '<': 15, '<?xml version=': 0, '>': 15, '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': '3995608', 'n_tokens_mistral': 2600, 'n_tokens_neox': 2524, 'n_words': 406}