<commit_before>draft.View = class View extends draft.Element {
  /* render(renderer) {
    this['render' + renderer.toUpperCase()]();
  } */

  get aspectRatio() {
    var width = draft.px(this.prop('width'));
    var height = draft.px(this.prop('height'));

    var gcd = function gcd(a, b) {
      return b ? gcd(b, a % b) : a;
    };

    gcd = gcd(width, height);
    return `${width / gcd}:${height / gcd}`;
  }
};

draft.View.require('size');

draft.Group.mixin({
  view(width, height) {
    return this.push(new draft.View()).size(width, height);
  }
});
<commit_msg>Add default size for draft.View<commit_after>draft.View = class View extends draft.Element {
  /* render(renderer) {
    this['render' + renderer.toUpperCase()]();
  } */

  get aspectRatio() {
    var width = draft.px(this.prop('width'));
    var height = draft.px(this.prop('height'));

    var gcd = function gcd(a, b) {
      return b ? gcd(b, a % b) : a;
    };

    gcd = gcd(width, height);
    return `${width / gcd}:${height / gcd}`;
  }
};

draft.View.require('size');

draft.Group.mixin({
  // TODO: get group bounding box for default size
  view(width = 100, height = 100) {
    return this.push(new draft.View()).size(width, height);
  }
});

{'fraction_non_alphanumeric': 0.1887713588283157, 'fraction_numerical': 0.004882017900732303, 'mean_word_length': 3.086378737541528, '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': '3266044', 'n_tokens_mistral': 442, 'n_tokens_neox': 436, 'n_words': 98}