class_docstr: Displays many line strips of equal length, with the option to add new
  vertex data to one end of the lines.
  
  Parameters
  ----------
  n_lines : int
      The number of independent line strips to draw.
  line_size : int
      The number of samples in each line strip.
  dx : float
      The x distance between samples
  color : array-like
      An array of colors to assign to each line strip.
  pos_offset : array-like
      An array of x, y position offsets to apply to each line strip.
  columns : int
      Arrange line strips into a grid with this number of columns. This
      option is not compatible with *pos_offset*.
  cell_size : tuple
      The x, y distance between cells in the grid.
class_docstr_tok: ["Displays","many","line","strips","of","equal","length",",","with","the","option","to","add","new","vertex","data","to","one","end","of","the","lines",".","Parameters","--","--","--","--","--","n_lines",":","int","The","number","of","independent","line","strips","to","draw",".","line_size",":","int","The","number","of","samples","in","each","line","strip",".","dx",":","float","The","x","distance","between","samples","color",":","array-like","An","array","of","colors","to","assign","to","each","line","strip",".","pos_offset",":","array-like","An","array","of","x",",","y","position","offsets","to","apply","to","each","line","strip",".","columns",":","int","Arrange","line","strips","into","a","grid","with","this","number","of","columns",".","This","option","is","not","compatible","with","*","pos_offset","*",".","cell_size",":","tuple","The","x",",","y","distance","between","cells","in","the","grid","."]
code: def __init__(
      self,
      n_lines,
      line_size,
      dx,
      color=None,
      pos_offset=None,
      columns=None,
      cell_size=None,
  ):
      self._pos_data = None
      self._offset = 0
      self._dx = dx
  
      data = np.zeros((n_lines, line_size), dtype="float32")
      self._pos_tex = gloo.Texture2D(
          data, format="luminance", internalformat="r32f"
      )
      self._index_buf = gloo.VertexBuffer()
      self._data_shape = data.shape
  
      Visual.__init__(
          self, vcode=self.vertex_code, fcode=self.fragment_code
      )
  
      self.shared_program["position"] = self._pos_tex
      self.shared_program["index"] = self._index_buf
      self.shared_program["dx"] = dx
      self.shared_program["pos_size"] = data.shape
      self.shared_program["offset"] = self._offset
  
      # set an array giving the x/y origin for each plot
      if pos_offset is None:
          # construct positions as a grid
          rows = int(np.ceil(n_lines / columns))
          pos_offset = np.empty((rows, columns, 3), dtype="float32")
          pos_offset[..., 0] = (
              np.arange(columns)[np.newaxis, :] * cell_size[0]
          )
          pos_offset[..., 1] = (
              np.arange(rows)[:, np.newaxis] * cell_size[1]
          )
          # limit position texture to the number of lines in case there are
          # more row/column cells than lines
          pos_offset = pos_offset.reshape((rows * columns), 3)[
              :n_lines, :
          ]
      self._pos_offset = gloo.Texture1D(
          pos_offset, internalformat="rgb32f", interpolation="nearest"
      )
      self.shared_program["pos_offset"] = self._pos_offset
  
      if color is None:
          # default to white (1, 1, 1, 1)
          self._color_tex = gloo.Texture1D(
              np.ones((n_lines, 4), dtype=np.float32)
          )
          self.shared_program["color_tex"] = self._color_tex
          self.shared_program.frag["color"] = "v_color"
      else:
          self._color_tex = gloo.Texture1D(color)
          self.shared_program["color_tex"] = self._color_tex
          self.shared_program.frag["color"] = "v_color"
  
      # construct a vertex buffer index containing (plot_n, vertex_n) for
      # each vertex
      index = np.empty(
          (data.shape[0], data.shape[1], 2), dtype="float32"
      )
      index[..., 0] = np.arange(data.shape[0])[:, np.newaxis]
      index[..., 1] = np.arange(data.shape[1])[np.newaxis, :]
      index = index.reshape(
          (index.shape[0] * index.shape[1], index.shape[2])
      )
      self._index_buf.set_data(index)
  
      self._draw_mode = "line_strip"
      self.set_gl_state("translucent", line_width=1)
      self.freeze()
  
file_path: vispy/vispy/visuals/scrolling_lines.py
imports: import numpy
  from .visual import Visual
  from ..None import gloo
label_desc: Use image node_id 1 to create a new ScrollingLinesVisual object from inherited base classes: Visual with example: obj = ScrollingLinesVisual(n_lines, line_size, dx, color, pos_offset, columns, cell_size)