<commit_before>vde.Vis.marks.Line = (function() {
  var line = function(name, groupName) {
    vde.Vis.Mark.call(this, name, groupName);

    this.type = 'rule';
    this.propType = 'rule';

    this.properties = {
      x: {value: 0},
      x2: {value: 200},
      y: {value: 0},
      y2: {value: 200},

      interpolate: {value: 'monotone'},
      tension: {value: 0},

      stroke: {value: '#000000'},
      strokeWidth: {value: 2}
    };

    vde.Vis.callback.register('vis.post_spec', this, this.dummyData);

    this.connectors = {'point': {}};

    return this;
  };

  line.prototype = new vde.Vis.Mark();
  var prototype  = line.prototype;
  var symbol = vde.Vis.marks.Symbol.prototype;

  prototype.spec = function() {
    var propsForType = {
      points: ['x', 'y', 'interpolate', 'tension', 'stroke', 'strokeWidth'],
      path: ['path', 'fill', 'fillOpacity', 'stroke', 'strokeWidth'],
      rule: ['x', 'x2', 'y', 'y2', 'stroke', 'strokeWidth']
    };

    this.type = this.propType == 'points' ? 'line' : this.propType;

    for(var p in this.properties) {
      if(propsForType[this.propType].indexOf(p) == -1)
        delete this.properties[p];
    }

    // this.dummySpec();

    return vde.Vis.Mark.prototype.spec.call(this);
  };

  prototype.defaults = function(prop) {
    var props = this.properties;
    if(['x', 'y'].indexOf(prop) == -1) return;
    var otherProp = (prop == 'x') ? 'y' : 'x';
    if(!props[otherProp].scale) {
      this.bindProperty(otherProp, {
          field: new vde.Vis.Field('index', false, 'linear', this.pipelineName),
          pipelineName: this.pipelineName
        }, true);
    }
  };

  prototype.selected = function() {
    var self = this, item = this.item(vde.iVis.activeItem),
        props = this.properties;
    // var points = this.items().map(function(i) { return self.connectors['point'].coords(i, {disabled: 1}) });

    var mousemove = function() {
      var dragging = vde.iVis.dragging, evt = d3.event;
      if(!dragging || !dragging.prev) return;
      if(vde.iVis.activeMark != self) return;

      var dx = Math.ceil(evt.pageX - dragging.prev[0]),
          dy = Math.ceil(evt.pageY - dragging.prev[1]),
          data = dragging.item.datum.data;

      if(!data || data.disabled) return;

      vde.iVis.ngScope().$apply(function() {<commit_msg>Default to points line. People won't know to switch from a rule<commit_after>vde.Vis.marks.Line = (function() {
  var line = function(name, groupName) {
    vde.Vis.Mark.call(this, name, groupName);

    this.type = 'points';
    this.propType = 'points';

    this.properties = {
      x: {value: 0},
      x2: {value: 200},
      y: {value: 0},
      y2: {value: 200},

      interpolate: {value: 'monotone'},
      tension: {value: 0},

      stroke: {value: '#000000'},
      strokeWidth: {value: 2}
    };

    vde.Vis.callback.register('vis.post_spec', this, this.dummyData);

    this.connectors = {'point': {}};

    return this;
  };

  line.prototype = new vde.Vis.Mark();
  var prototype  = line.prototype;
  var symbol = vde.Vis.marks.Symbol.prototype;

  prototype.spec = function() {
    var propsForType = {
      points: ['x', 'y', 'interpolate', 'tension', 'stroke', 'strokeWidth'],
      path: ['path', 'fill', 'fillOpacity', 'stroke', 'strokeWidth'],
      rule: ['x', 'x2', 'y', 'y2', 'stroke', 'strokeWidth']
    };

    this.type = this.propType == 'points' ? 'line' : this.propType;

    for(var p in this.properties) {
      if(propsForType[this.propType].indexOf(p) == -1)
        delete this.properties[p];
    }

    if(this.type == 'line') this.dummySpec();

    return vde.Vis.Mark.prototype.spec.call(this);
  };

  prototype.defaults = function(prop) {
    var props = this.properties;
    if(['x', 'y'].indexOf(prop) == -1) return;
    var otherProp = (prop == 'x') ? 'y' : 'x';
    if(!props[otherProp].scale) {
      this.bindProperty(otherProp, {
          field: new vde.Vis.Field('index', false, 'linear', this.pipelineName),
          pipelineName: this.pipelineName
        }, true);

      props[otherProp].default = true;
    }
  };

  prototype.selected = function() {
    var self = this, item = this.item(vde.iVis.activeItem),
        props = this.properties;
    // var points = this.items().map(function(i) { return self.connectors['point'].coords(i, {disabled: 1}) });

    var mousemove = function() {
      var dragging = vde.iVis.dragging, evt = d3.event;
      if(!dragging || !dragging.prev) return;
      if(vde.iVis.activeMark != self) return;

      var dx = Math.ceil(evt.pageX - dragging.prev[0]),
          dy = Math.ceil(evt.pageY - dragging.prev[1]),
          data = dragging.item.datum.data;

      if(!data || data.disabled) return;

      vde.iVis.ngScope().$apply(function() {
{'fraction_non_alphanumeric': 0.1804069645479337, 'fraction_numerical': 0.010908328088944829, 'mean_word_length': 2.781126090404441, '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': '3592740', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1610, 'n_words': 341}