<commit_before>import Ember from 'ember';
import Scale from './d3-scale';

const { on, observer } = Ember;

export default Scale.extend({
  init() {
    this.set('scale', d3.scale.linear());
  },

  rangeRoundChanged: on('init', observer('rangeRound.[]', function() {
    this.updateScale('rangeRound');
  })),

  interpolateChanged: on('init', observer('interpolate', function() {
    this.updateScale('interpolate');
  })),

  clampChanged: on('init', observer('clamp', function() {
    this.updateScale('clamp')
  })),

  niceChanged: on('init', observer('nice', function() {
    this.updateScale('nice')
  }))
});<commit_msg>Add support for calling default nice()<commit_after>import Ember from 'ember';
import Scale from './d3-scale';

const { on, observer } = Ember;

export default Scale.extend({
  init() {
    this.set('scale', d3.scale.linear());
  },

  rangeRoundChanged: on('init', observer('rangeRound.[]', function() {
    this.updateScale('rangeRound');
  })),

  interpolateChanged: on('init', observer('interpolate', function() {
    this.updateScale('interpolate');
  })),

  clampChanged: on('init', observer('clamp', function() {
    this.updateScale('clamp')
  })),

  niceChanged: on('init', observer('nice', function() {
    let nice = this.get('nice');

    if(nice) {
      this.get('scale').nice();
      Ember.run.next(this, 'notifyPropertyChange', 'scale');
    }
  })),

  niceTickCountChanged: on('init', observer('niceTickCount', function() {
    this.updateScale('niceTickCount', 'nice')
  }))
});
{'fraction_non_alphanumeric': 0.2, 'fraction_numerical': 0.00261437908496732, 'mean_word_length': 4.527075812274369, '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': '5379180', 'n_tokens_mistral': 500, 'n_tokens_neox': 483, 'n_words': 94}