<commit_before>import Ember from 'ember';
import layout from '../templates/components/dp-circle';

export default Ember.Component.extend({
  layout: layout,

  map: null,

  circle: null,

  _center: null,

  _radius: 500,

  _strokeColor: '#000000',

  _strokeOpacity: 0.8,

  _strokeWeight: 2,

  _fillColor: '#000000',

  _fillOpacity: 0.2,

  center: Ember.computed('_center', {
    get() {
      return this.get('_center');
    },
    set(key, value) {
      const circle = this.get('circle');
      if (circle) {
        circle.setCenter(parseFloat(value));
      }

      this.set('_center');
      return value;
    }
  }),

  radius: Ember.computed('_radius', {
    get() {
      return this.get('_radius');
    },
    set(key, value) {
      const circle = this.get('circle');
      if (circle) {
        circle.setRadius(value);
      }

      this.set('_radius');
      return value;
    }
  }),

  setOption(option) {
    const circle = this.get('circle');
    if (circle) {
      circle.setOptions(option);
    }
  },

  strokeColor: Ember.computed('_strokeColor', {
    get() {
      return this.get('_strokeColor');
    },
    set(key, value) {
      this.setOption({'strokeColor': value});
      this.set('_strokeColor');
      return value;
    }
  }),

  strokeOpacity: Ember.computed('_strokeOpacity', {
    get() {
      return this.get('_strokeOpacity');
    },
    set(key, value) {
      this.setOption({'strokeOpacity': value});
      this.set('_strokeOpacity');
      return value;
    }
  }),

  strokeWeight: Ember.computed('_strokeWeight', {
    get() {
      return this.get('_strokeWeight');
    },
    set(key, value) {
      this.setOption({'strokeWeight': value});
      this.set('_strokeWeight');
      return value;
    }
  }),

  fillColor: Ember.computed('_fillColor', {
    get() {
      return this.get('_fillColor');
    },
    set(key, value) {
      this.setOption({'fillColor': value});
      this.set('_fillColor');
      return value;
    }
  }),

  fillOpacity: Ember.computed('_fillOpacity', {
    get() {
      return this.get('_fillOpacity');
    },
    set(key, value) {
      this.setOption({'fillOpacity': value});
      this.set('_fillOpacity');
      return value;
    }
  }),

  didInsertElement() {
    this.nearestWithProperty('isMap').get('deferredMap').promise.then(map => {
      this.set('map', map);

      const circle = new google.maps.Circle({
        map: this.get('map'),
        center: this.get('center'),
        radius: this.get('radius'),
        strokeColor: this.get('strokeColor'),
        strokeOpacity: this.get('strokeOpacity'),
        strokeWeight: this.get('strokeWeight'),
        fillColor: this.get('fillColor'),
        fillOpacity: this.get('fillOpacity')
      });
      this.set('circle', circle);
    });
  }
});
<commit_msg>Move parse float to radius from circle.<commit_after>import Ember from 'ember';
import layout from '../templates/components/dp-circle';

export default Ember.Component.extend({
  layout: layout,

  map: null,

  circle: null,

  _center: null,

  _radius: 500,

  _strokeColor: '#000000',

  _strokeOpacity: 0.8,

  _strokeWeight: 2,

  _fillColor: '#000000',

  _fillOpacity: 0.2,

  center: Ember.computed('_center', {
    get() {
      return this.get('_center');
    },
    set(key, value) {
      const circle = this.get('circle');
      if (circle) {
        circle.setCenter(value);
      }

      this.set('_center');
      return value;
    }
  }),

  radius: Ember.computed('_radius', {
    get() {
      return this.get('_radius');
    },
    set(key, value) {
      const circle = this.get('circle');
      if (circle) {
        circle.setRadius(parseFloat(value));
      }

      this.set('_radius');
      return value;
    }
  }),

  setOption(option) {
    const circle = this.get('circle');
    if (circle) {
      circle.setOptions(option);
    }
  },

  strokeColor: Ember.computed('_strokeColor', {
    get() {
      return this.get('_strokeColor');
    },
    set(key, value) {
      this.setOption({'strokeColor': value});
      this.set('_strokeColor');
      return value;
    }
  }),

  strokeOpacity: Ember.computed('_strokeOpacity', {
    get() {
      return this.get('_strokeOpacity');
    },
    set(key, value) {
      this.setOption({'strokeOpacity': value});
      this.set('_strokeOpacity');
      return value;
    }
  }),

  strokeWeight: Ember.computed('_strokeWeight', {
    get() {
      return this.get('_strokeWeight');
    },
    set(key, value) {
      this.setOption({'strokeWeight': value});
      this.set('_strokeWeight');
      return value;
    }
  }),

  fillColor: Ember.computed('_fillColor', {
    get() {
      return this.get('_fillColor');
    },
    set(key, value) {
      this.setOption({'fillColor': value});
      this.set('_fillColor');
      return value;
    }
  }),

  fillOpacity: Ember.computed('_fillOpacity', {
    get() {
      return this.get('_fillOpacity');
    },
    set(key, value) {
      this.setOption({'fillOpacity': value});
      this.set('_fillOpacity');
      return value;
    }
  }),

  didInsertElement() {
    this.nearestWithProperty('isMap').get('deferredMap').promise.then(map => {
      this.set('map', map);

      const circle = new google.maps.Circle({
        map: this.get('map'),
        center: this.get('center'),
        radius: this.get('radius'),
        strokeColor: this.get('strokeColor'),
        strokeOpacity: this.get('strokeOpacity'),
        strokeWeight: this.get('strokeWeight'),
        fillColor: this.get('fillColor'),
        fillOpacity: this.get('fillOpacity')
      });
      this.set('circle', circle);
    });
  }
});

{'fraction_non_alphanumeric': 0.1692008486562942, 'fraction_numerical': 0.007072135785007072, 'mean_word_length': 2.5758533501896332, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5975341', 'n_tokens_mistral': 1915, 'n_tokens_neox': 1840, 'n_words': 318}