<commit_before>(function () { 
/**
 * Options:
 *
 * element - element housing visualization
 *
 */

var D = Flotr.DOM;

function Visualization (options) {
  this.options = options || {};
  this.children = [];
  this.container = null;
  this.rendered = false;
}

Visualization.prototype = {

  render : function (element) {

    var o = this.options;

    if (!o.element) o.element = element;
    element = o.element;

    if (!element) throw 'No element to render within.'

    this.container = D.node('<div class="humble-vis-visualization"></div>');
    D.insert(element, this.container);

    _.each(this.children, function (child) {
      child.render(this.container);
    }, this);

    this.rendered = true;
  },

  add : function (child) {
    this.children.push(child);
    if (this.rendered) child.render(this.container);
    return child;
  }
};

Humble.Vis.Visualization = Visualization;

})();
<commit_msg>Added remove method.<commit_after>(function () { 
/**
 * Options:
 *
 * element - element housing visualization
 *
 */

var D = Flotr.DOM;

function Visualization (options) {
  this.options = options || {};
  this.children = [];
  this.container = null;
  this.rendered = false;
}

Visualization.prototype = {

  render : function (element) {

    var o = this.options;

    if (!o.element) o.element = element;
    element = o.element;

    if (!element) throw 'No element to render within.'

    this.container = D.node('<div class="humble-vis-visualization"></div>');
    D.insert(element, this.container);

    _.each(this.children, function (child) {
      child.render(this.container);
    }, this);

    this.rendered = true;
  },

  add : function (child) {
    this.children.push(child);
    if (this.rendered) child.render(this.container);
    return child;
  },

  remove : function (child) {
    var
      children = this.children,
      index = _.indexOf(children, child);
    if (index) {
      children.splice(index, 1);
      bonzo(child.node).remove();
    }
  }

};

Humble.Vis.Visualization = Visualization;

})();

{'fraction_non_alphanumeric': 0.15594541910331383, 'fraction_numerical': 0.0004873294346978557, 'mean_word_length': 2.9786821705426356, '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': '3350351', 'n_tokens_mistral': 670, 'n_tokens_neox': 641, 'n_words': 142}