<commit_before>import template from './dd_watcher_agg_threshold.html';

class DdWatcherAggThreshold {
  constructor($scope) {
    this.$scope = $scope;
    this.aggThresholdOptions = this.aggThresholdOptions || this.$scope.aggThresholdOptions;
    this.aggThresholdOnSelect = this.aggThresholdOnSelect || this.$scope.aggThresholdOnSelect;
    this.textLimit = this.textLimit || this.$scope.textLimit;

    this.options = ['above', 'below', 'above eq', 'below eq'];
    this.number = this.aggThresholdOptions.n || 5;
    this.selected = this.aggThresholdOptions.direction || 'above';
  }

  handleChange() {
    this.aggThresholdOnSelect({direction: this.selected, n: this.number});<commit_msg>Make condition threshold get the default value 0.<commit_after>import template from './dd_watcher_agg_threshold.html';
import { isNumber } from 'lodash';

class DdWatcherAggThreshold {
  constructor($scope) {
    this.$scope = $scope;
    this.aggThresholdOptions = this.aggThresholdOptions || this.$scope.aggThresholdOptions;
    this.aggThresholdOnSelect = this.aggThresholdOnSelect || this.$scope.aggThresholdOnSelect;
    this.textLimit = this.textLimit || this.$scope.textLimit;

    this.options = ['above', 'below', 'above eq', 'below eq'];
    this.number = isNumber(+this.aggThresholdOptions.n) ? +this.aggThresholdOptions.n : 5;
    this.selected = this.aggThresholdOptions.direction || 'above';
  }

  handleChange() {
    this.aggThresholdOnSelect({direction: this.selected, n: this.number});
{'fraction_non_alphanumeric': 0.13226452905811623, 'fraction_numerical': 0.002004008016032064, 'mean_word_length': 4.874509803921568, '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': '5402315', 'n_tokens_mistral': 449, 'n_tokens_neox': 427, 'n_words': 83}