<commit_before>window.BaseFactWheelView = Backbone.View.extend({
  tagName: "div",
  className: "wheel",

  defaults: {
    dimension: 16,
    radius: 16,
    minimalVisiblePercentage: 15,
    defaultStroke: {
      opacity: 0.2,
      width: 9
    },
    hoverStroke: {
      opacity: 0.5,
      width: 11
    },
    userOpinionStroke: {
      opacity: 1.0
    }
  },

  template: "facts/_fact_wheel",

  initialize: function (options) {
    this.options = $.extend({}, this.defaults, options);

    this.opinionTypeRaphaels = {};
  },

  render: function () {
    var self = this;
    var offset = 0;

    this
      .$el.html('<div class="html_container"></div>').find('.html_container')
      .html( this.templateRender(this.model.toJSON()) );

    this.canvas = Raphael(this.el,
                          this.options.dimension * 2 + 12,
                          this.options.dimension * 2 + 12);

    this.bindCustomRaphaelAttributes();

    this.calculateDisplayablePercentages();

    this.model.opinionTypes.each(function(opinionType) {
      self.createOrAnimateArc(opinionType, offset);

      offset += opinionType.get("displayPercentage");
    });

    this.bindTooltips();

    return this;
  },

  reRender: function () {
    var self = this;
    var offset = 0;

    this
      .$el.find('.html_container')
      .html( this.tmpl.render(this.model.toJSON()));

    this.calculateDisplayablePercentages();

    this.model.opinionTypes.each(function(opinionType) {
      self.createOrAnimateArc(opinionType, offset);

      offset += opinionType.get("displayPercentage");
    });

    this.bindTooltips();

    return this;
  },

  createOrAnimateArc: function (opinionType, percentageOffset) {
    var opacity = opinionType.get('is_user_opinion') ? this.options.userOpinionStroke.opacity : this.options.defaultStroke.opacity;
    // Our custom Raphael arc attribute
    var arc = [opinionType.get('displayPercentage'), percentageOffset, this.options.radius];

    if ( ! this.opinionTypeRaphaels[opinionType.get("type")] ) {
      this.createArc(opinionType, arc, opacity);<commit_msg>Fixed a refactor bug!<commit_after>window.BaseFactWheelView = Backbone.View.extend({
  tagName: "div",
  className: "wheel",

  defaults: {
    dimension: 16,
    radius: 16,
    minimalVisiblePercentage: 15,
    defaultStroke: {
      opacity: 0.2,
      width: 9
    },
    hoverStroke: {
      opacity: 0.5,
      width: 11
    },
    userOpinionStroke: {
      opacity: 1.0
    }
  },

  template: "facts/_fact_wheel",

  initialize: function (options) {
    this.options = $.extend({}, this.defaults, options);

    this.opinionTypeRaphaels = {};
  },

  render: function () {
    var self = this;
    var offset = 0;

    this
      .$el.html('<div class="html_container"></div>').find('.html_container')
      .html( this.templateRender(this.model.toJSON()) );

    this.canvas = Raphael(this.el,
                          this.options.dimension * 2 + 12,
                          this.options.dimension * 2 + 12);

    this.bindCustomRaphaelAttributes();

    this.calculateDisplayablePercentages();

    this.model.opinionTypes.each(function(opinionType) {
      self.createOrAnimateArc(opinionType, offset);

      offset += opinionType.get("displayPercentage");
    });

    this.bindTooltips();

    return this;
  },

  reRender: function () {
    var self = this;
    var offset = 0;

    this
      .$el.find('.html_container')
      .html( this.templateRender(this.model.toJSON()) );

    this.calculateDisplayablePercentages();

    this.model.opinionTypes.each(function(opinionType) {
      self.createOrAnimateArc(opinionType, offset);

      offset += opinionType.get("displayPercentage");
    });

    this.bindTooltips();

    return this;
  },

  createOrAnimateArc: function (opinionType, percentageOffset) {
    var opacity = opinionType.get('is_user_opinion') ? this.options.userOpinionStroke.opacity : this.options.defaultStroke.opacity;
    // Our custom Raphael arc attribute
    var arc = [opinionType.get('displayPercentage'), percentageOffset, this.options.radius];

    if ( ! this.opinionTypeRaphaels[opinionType.get("type")] ) {
      this.createArc(opinionType, arc, opacity);
{'fraction_non_alphanumeric': 0.13526340768865686, 'fraction_numerical': 0.010915994304698624, 'mean_word_length': 2.9245810055865924, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2132806', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1266, 'n_words': 226}