class_docstr: Mouse editing extension to the Line visual.
  This class adds mouse picking for line points, mouse_move handling for
  dragging existing points, and
  adding new points when clicking into empty space.
class_docstr_tok: ["Mouse","editing","extension","to","the","Line","visual",".","This","class","adds","mouse","picking","for","line","points",",","mouse_move","handling","for","dragging","existing","points",",","and","adding","new","points","when","clicking","into","empty","space","."]
code: def __init__(self, *args, **kwargs):
      scene.visuals.Line.__init__(self, *args, **kwargs)
      self.unfreeze()
      # initialize point markers
      self.markers = scene.visuals.Markers(parent=self)
      self.marker_colors = np.ones((len(self.pos), 4), dtype=np.float32)
      self.markers.set_data(
          pos=self.pos, symbol="s", edge_color="red", size=6
      )
      self.selected_point = None
      self.selected_index = -1
      # snap grid size
      self.gridsize = 10
      self.freeze()
  
file_path: vispy/examples/basics/visuals/line_draw.py
imports: import numpy
  from vispy import app, scene
label_desc: Use image node_id 1 to create a new EditLineVisual object from inherited base classes: scene.visuals with example: obj = EditLineVisual()