<commit_before>
var d3         = require('d3')
  , assign     = require('lodash.assign');

var bAxis      = require('./browser-axis.js')
  , bBands     = require('./browser-bands.js')
  , genesTrack = require('../gene-track.js')

var browser = (function() {
  function _constructor(args) {
    var _this = this;
    var options = assign({
      //default options
      target : null,
      width : 1200,
      height : 250,
      gene: 'foxp2',
      specie : 'human',
      region : {
        segment: '7',
        start: '114396300',
        stop: '114593760'
      }
    }, args);

    var domTarget = options.target ? d3.select(options.target) : d3.selection()
      , yOffset = 25
      , svgTarget = null

      , xscale = d3.scale.linear()
        .domain([+options.region.start, +options.region.stop])
        .range([0, options.width])

      , svgTopAxis = bAxis()
        .height(options.height)
        .offset([0, yOffset])
        .scale(xscale)

      , zoomBehaviour = d3.behavior.zoom()
        .x(xscale)
        .scaleExtent([1, 1200])

      , svgCytoBands = bBands(undefined, options.width)
        .scale(xscale)
        .offset([0, yOffset + 1])
        .segment(options.region.segment)

      , svgGenes = genesTrack(xscale)
        .locus(options.region.segment, options.region.start, options.region.stop);

    _this.render = function () {
      domTarget
        .style('width', options.width + 'px')
        .style('height', options.height + 'px')
        .style('border', '1px solid #BDBDBD');

      svgTarget = domTarget
        .append('svg')
        .attr('class', 'genecluster-vis')
        .attr('width', options.width)
        .attr('height', options.height);

      svgTarget.call(zoomBehaviour);
      zoomBehaviour.on('zoom', _this.update);
      zoomBehaviour.on('zoomend', _this.updateend)

      svgTarget
        .append('g')
        .call(svgTopAxis);<commit_msg>constrain zooming<commit_after>
var d3         = require('d3')
  , assign     = require('lodash.assign');

var bAxis      = require('./browser-axis.js')
  , bBands     = require('./browser-bands.js')
  , genesTrack = require('../gene-track.js')

var browser = (function() {
  function _constructor(args) {
    var _this = this;
    var options = assign({
      //default options
      target : null,
      width : 1200,
      height : 250,
      gene: 'foxp2',
      specie : 'human',
      region : {
        segment: '7',
        start: '114396300',
        stop: '114593760'
      }
    }, args);

    var domTarget = options.target ? d3.select(options.target) : d3.selection()
      , yOffset = 25
      , svgTarget = null

      , xscale = d3.scale.linear()
        .domain([+options.region.start, +options.region.stop])
        .range([0, options.width])

      , svgTopAxis = bAxis()
        .height(options.height)
        .offset([0, yOffset])
        .scale(xscale)

      , zoomBehaviour = d3.behavior.zoom()
        .x(xscale)
        .scaleExtent([0.5, 50])

      , svgCytoBands = bBands(undefined, options.width)
        .scale(xscale)
        .offset([0, yOffset + 1])
        .segment(options.region.segment)

      , svgGenes = genesTrack(xscale)
        .locus(options.region.segment, options.region.start, options.region.stop);

    _this.render = function () {
      domTarget
        .style('width', options.width + 'px')
        .style('height', options.height + 'px')
        .style('border', '1px solid #BDBDBD');

      svgTarget = domTarget
        .append('svg')
        .attr('class', 'genecluster-vis')
        .attr('width', options.width)
        .attr('height', options.height);

      svgTarget.call(zoomBehaviour);
      zoomBehaviour.on('zoom', _this.update);
      zoomBehaviour.on('zoomend', _this.updateend)

      svgTarget
        .append('g')
        .call(svgTopAxis);
{'fraction_non_alphanumeric': 0.15479308538501835, 'fraction_numerical': 0.023310633839706652, 'mean_word_length': 2.1851542952460385, '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': '3699750', 'n_tokens_mistral': 1307, 'n_tokens_neox': 1213, 'n_words': 226}