code: def update_cursor(pos):
      global selected, cursor, data, dt, plt
      if selected is None:
          cursor_text.visible = False
          cursor_line.visible = False
          cursor_symbol.visible = False
      else:
          # get data for the selected trace
          trace = data[selected.data_index]
  
          # map the mouse position to data coordinates
          tr = fig.scene.node_transform(selected)
          pos = tr.map(pos)
  
          # get interpolated y coordinate
          x = min(max(pos[0], t[0]), t[-2])
          ind = x / (dt * 1000)
          i = int(np.floor(ind))
          s = ind - i
          y = trace[i] * (1 - s) + trace[i + 1] * s
  
          # update cursor
          cursor_text.text = "x=%0.2f ms, y=%0.2f mV" % (x, y)
          offset = np.diff(tr.map([[0, 0], [10, 0]]), axis=0)[0, 0]
          cursor_text.pos = x + offset, y
          rect = plt.view.camera.rect
          cursor_line.set_data(
              np.array([[x, rect.bottom], [x, rect.top]])
          )
          cursor_symbol.set_data(
              pos=np.array([[x, y]]), symbol="+", face_color="b"
          )
          cursor_text.visible = True
          cursor_line.visible = True
          cursor_symbol.visible = True
  
imports: import numpy
  import vispy.plot
  from vispy.color import get_colormap
  from vispy.io import load_data_file
label_desc: Use image node_id 3 for calling a global function with example usage: update_cursor(pos) without return types