<commit_before>elation.require(['janusweb.janusbase'], function() {
  elation.component.add('janusweb.elements.linesegments', {
    positions: [],
    colors: [],
    metadata: [],
    linewidth: 1,
    depth_write: true,
    depth_test: true,

    create() {
      
  setTimeout(() => {
      let lines = this.getElementsByTagName('line');
      for (let i = 0; i < lines.length; i++) {
        this.positions.push(lines[i].v1, lines[i].v2);
        if (lines[i].c1 && lines[i].c2) {
          this.colors.push(lines[i].c1, lines[i].c2);
        } else if (lines[i].col && lines[i].col !== lines[i].defaultcolor) {
          this.colors.push(lines[i].col, lines[i].col);
        } else {
          this.colors.push(this.col, this.col);
        }
      }
      this.updateLine();
  }, 0);

      this.updateLine();
    },
    updateLine() {
      if (this.positions.length > 0) {
        if (!this.geometry) {
          let geo = new THREE.BufferGeometry();
          let lineobj = new THREE.LineSegments(geo, new THREE.LineBasicMaterial({
            vertexColors: THREE.VertexColors,
            opacity: this.opacity,
            transparent: (this.opacity < 1),
            depthWrite: this.depth_write,
            depthTest: this.depth_test,
            linewidth: this.linewidth,
          }));
          this.objects['3d'].add(lineobj);
          if (this.pickable || this.collidable) {
            //this.colliders.add(lineobj.clone());
          }
          lineobj.userData.thing = this;
          this.geometry = geo;<commit_msg>Line segment transparency/fog/renderOrder fixes<commit_after>elation.require(['janusweb.janusbase'], function() {
  elation.component.add('janusweb.elements.linesegments', {
    positions: [],
    colors: [],
    metadata: [],
    linewidth: 1,
    depth_write: true,
    depth_test: true,
    fog: true,

    create() {
      
  setTimeout(() => {
      let lines = this.getElementsByTagName('line');
      for (let i = 0; i < lines.length; i++) {
        this.positions.push(lines[i].v1, lines[i].v2);
        if (lines[i].c1 && lines[i].c2) {
          this.colors.push(lines[i].c1, lines[i].c2);
        } else if (lines[i].col && lines[i].col !== lines[i].defaultcolor) {
          this.colors.push(lines[i].col, lines[i].col);
        } else {
          this.colors.push(this.col, this.col);
        }
      }
      this.updateLine();
  }, 0);

      this.updateLine();
    },
    updateLine() {
      if (this.positions.length > 0) {
        if (!this.geometry) {
          let geo = new THREE.BufferGeometry();
          let lineobj = new THREE.LineSegments(geo, new THREE.LineBasicMaterial({
            vertexColors: THREE.VertexColors,
            opacity: this.opacity,
            transparent: (this.transparent !== null ? this.transparent : this.opacity < 1),
            depthWrite: this.depth_write,
            depthTest: this.depth_test,
            linewidth: this.linewidth,
            fog: this.fog,
          }));
          lineobj.renderOrder = this.renderorder;
          this.objects['3d'].add(lineobj);
          if (this.pickable || this.collidable) {
            //this.colliders.add(lineobj.clone());
          }
          lineobj.userData.thing = this._target || this;
          this.geometry = geo;
{'fraction_non_alphanumeric': 0.15499847141546927, 'fraction_numerical': 0.007337205747477835, 'mean_word_length': 2.095553453169347, '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': '342305', 'n_tokens_mistral': 1042, 'n_tokens_neox': 1014, 'n_words': 176}