INNER CODE UNIT · JavaScript

seg

sirius-ms/sirius · lcms2/viewer/viewer.js:194

  const seg = d3.line().x(d=>d[0]).y(d=>d[1])
  let segs=[]
  const segments = svg; 
  for (var i=0; i < data.segments.length; ++i) {
    let s = data.segments[i];
    let a = data.rt[s.left];
    let b = data.rt[s.right];
    segments.append("rect").attr("x", x(a)).attr("y", y(parentMax)).attr("width", x(b)-x(a)).attr("height", y(0)-y(parentMax)).attr("stroke","black").attr("fill","gray").attr("fill-opacity","5%").classed("region",true);
  }

  // Append a path for the line.
  svg.append("path")
      .attr("id", "noisePath")
      .attr("fill", "none")
      .attr("stroke", "gray")
      .attr("stroke-width", 1.5)
      .attr("stroke-dasharray", 2)
      .attr("d", line(noise));

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…