<commit_before>'use strict';

/**
 * @ngdoc service
 * @name midjaApp.bubbleLayerDefinitionService
 * @description
 * # bubbleLayerDefinitionService
 * Factory in the midjaApp.
 */
angular.module('midjaApp')
  .factory('bubbleLayerDefinitionService', function($q, dataService) {

    return {
      _generateMapnikSQL: generateMapnikSQL,
      _generateCartoCSS: generateCartoCSS,
      build: build
    };

    function BubbleLayerDefinition(regionType, sql, cartocss, allRegionData) {
      var regionCodeAttribute = regionType + '_code';
      this.sql = sql;
      this.cartocss = cartocss;
      this.interactivity = [
        regionCodeAttribute
      ];
      this.getRegionData = function(interactiveData) {
        var regionCode = interactiveData[regionCodeAttribute];
        return allRegionData[regionCode];
      };
    }

    function build(regionType, attribute, locations) {
      return dataService.getAttributesForRegions(
        regionType, [attribute.name], locations
      ).then(function(data) {
        var series = _.map(_.values(data), _.property(attribute.name));
        var buckets = generateBuckets(series)
        var geoTable = regionType + "_2011_aust";
        var regionAttribute = regionType + "_code";
        var regionCodes = _.uniq(_.pluck(locations, 'code')).sort();
        var radiusF = function(region) {
          var v = data[region][attribute.name];
          // Get radius using bucket ranges (min: inclusive, max: exclusive)
          // Last bucket max == max series value, so last bucket if no match.<commit_msg>Update bubble layer to handle missing values<commit_after>'use strict';

/**
 * @ngdoc service
 * @name midjaApp.bubbleLayerDefinitionService
 * @description
 * # bubbleLayerDefinitionService
 * Factory in the midjaApp.
 */
angular.module('midjaApp')
  .factory('bubbleLayerDefinitionService', function($q, dataService) {

    return {
      _generateMapnikSQL: generateMapnikSQL,
      _generateCartoCSS: generateCartoCSS,
      build: build
    };

    function BubbleLayerDefinition(regionType, sql, cartocss, allRegionData) {
      var regionCodeAttribute = regionType + '_code';
      this.sql = sql;
      this.cartocss = cartocss;
      this.interactivity = [
        regionCodeAttribute
      ];
      this.getRegionData = function(interactiveData) {
        var regionCode = interactiveData[regionCodeAttribute];
        return allRegionData[regionCode];
      };
    }

    function build(regionType, attribute, locations) {
      return dataService.getAttributesForRegions(
        regionType, [attribute.name], locations
      ).then(function(data) {
        var series = _.filter(
          _.map(_.values(data), _.property(attribute.name)),
          _.isNumber);
        var buckets = generateBuckets(series)
        var geoTable = regionType + "_2011_aust";
        var regionAttribute = regionType + "_code";
        var regionCodes = _.filter(
          _.uniq(_.pluck(locations, 'code')).sort(),
          _.flow(
            _.propertyOf(data),
            _.property(attribute.name),
            _.isNumber));
        var radiusF = function(region) {
          var v = data[region][attribute.name];
          // Get radius using bucket ranges (min: inclusive, max: exclusive)
          // Last bucket max == max series value, so last bucket if no match.
{'fraction_non_alphanumeric': 0.1048532055122828, 'fraction_numerical': 0.002396644697423607, 'mean_word_length': 2.9007009345794392, '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': '4818427', 'n_tokens_mistral': 904, 'n_tokens_neox': 893, 'n_words': 214}