<commit_before>import d3 from 'd3';
import _ from 'underscore';
import Grapher from './grapher';
import * as Helpers from './visualisation_helpers';

/**
 * Renders Length Distribution of all hits per query
 */

class Graph {
  static name() {
    return 'Length Distribution';
  }

  static className() {
    return 'length-distribution collapse';
  }

  static collapseId(props) {
    return 'length_'+props.query.number;
  }

  static dataName(props) {
      return 'length-distribution-'+props.query.id
  }

  constructor($svg_container, props) {
    this.query = props.query;
    this._seq_type = Helpers.get_seq_type(props.algorithm);
    this.svg_container = $svg_container

    this._margin = {top: 30, right: 25, bottom: 55, left: 12.5};
    this.initiate($svg_container.width(), $svg_container.height());
    var test = $('#Collapse_length_'+props.query.number);
    test.removeClass('in');
    test.parent().find('.caption').find('i').
        removeClass('fa-minus-square-o').addClass('fa-plus-square-o');
    test.parent().find('.graph-links').hide();
  }

  initiate(width, height) {
    this._width = width - this._margin.left - this._margin.right;
    this._height = height - this._margin.top - this._margin.bottom;
    this.svg = d3.select(this.svg_container[0]).insert('svg', ':first-child')
        .attr('width', this._width + this._margin.right + this._margin.left)
        .attr('height', this._height + this._margin.top + this._margin.bottom)
        .append('g')<commit_msg>Remove some redundant code<commit_after>import d3 from 'd3';
import _ from 'underscore';
import Grapher from './grapher';
import * as Helpers from './visualisation_helpers';

/**
 * Renders Length Distribution of all hits per query
 */

class Graph {
  static name() {
    return 'Length Distribution';
  }

  static className() {
    return 'length-distribution collapse';
  }

  static collapseId(props) {
    return 'length_'+props.query.number;
  }

  static dataName(props) {
      return 'length-distribution-'+props.query.id
  }

  constructor($svg_container, props) {
    this.query = props.query;
    this._seq_type = Helpers.get_seq_type(props.algorithm);
    this.svg_container = $svg_container

    this._margin = {top: 30, right: 25, bottom: 55, left: 12.5};
    this.initiate($svg_container.width(), $svg_container.height());
  }

  initiate(width, height) {
    this._width = width - this._margin.left - this._margin.right;
    this._height = height - this._margin.top - this._margin.bottom;
    this.svg = d3.select(this.svg_container[0]).insert('svg', ':first-child')
        .attr('width', this._width + this._margin.right + this._margin.left)
        .attr('height', this._height + this._margin.top + this._margin.bottom)
        .append('g')
{'fraction_non_alphanumeric': 0.15295396882928597, 'fraction_numerical': 0.009423704240666908, 'mean_word_length': 3.5098039215686274, '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': '4204932', 'n_tokens_mistral': 895, 'n_tokens_neox': 857, 'n_words': 179}