class_docstr: A GraphicsItem that sets its location to a point on a PlotCurveItem.
  Also rotates to be tangent to the curve.
  The position along the curve is a Qt property, and thus can be easily animated.
  
  Note: This class does not display anything; see CurveArrow for an applied example
class_docstr_tok: ["A","GraphicsItem","that","sets","its","location","to","a","point","on","a","PlotCurveItem",".","Also","rotates","to","be","tangent","to","the","curve",".","The","position","along","the","curve","is","a","Qt","property",",","and","thus","can","be","easily","animated",".","Note",":","This","class","does","not","display","anything",";","see","CurveArrow","for","an","applied","example"]
code: def event(self, ev):
      if (
          not isinstance(ev, QtCore.QDynamicPropertyChangeEvent)
          or self.curve() is None
      ):
          return False
  
      if ev.propertyName() == "index":
          index = self.property("index")
          if "QVariant" in repr(index):
              index = index.toInt()[0]
      elif ev.propertyName() == "position":
          index = None
      else:
          return False
  
      (x, y) = self.curve().getData()
      if index is None:
          # print ev.propertyName(), self.property('position').toDouble()[0], self.property('position').typeName()
          pos = self.property("position")
          if "QVariant" in repr(pos):  ## need to support 2 APIs  :(
              pos = pos.toDouble()[0]
          index = (len(x) - 1) * clip_scalar(pos, 0.0, 1.0)
  
      if index != int(index):  ## interpolate floating-point values
          i1 = int(index)
          i2 = clip_scalar(i1 + 1, 0, len(x) - 1)
          s2 = index - i1
          s1 = 1.0 - s2
          newPos = (x[i1] * s1 + x[i2] * s2, y[i1] * s1 + y[i2] * s2)
      else:
          index = int(index)
          i1 = clip_scalar(index - 1, 0, len(x) - 1)
          i2 = clip_scalar(index + 1, 0, len(x) - 1)
          newPos = (x[index], y[index])
  
      p1 = self.parentItem().mapToScene(QtCore.QPointF(x[i1], y[i1]))
      p2 = self.parentItem().mapToScene(QtCore.QPointF(x[i2], y[i2]))
      rads = atan2(p2.y() - p1.y(), p2.x() - p1.x())  ## returns radians
      self.resetTransform()
      if self._rotate:
          self.setRotation(180 + degrees(rads))
      QtWidgets.QGraphicsItem.setPos(self, *newPos)
      return True
  
file_path: pyqtgraph/pyqtgraph/graphicsItems/CurvePoint.py
imports: import weakref
  from math import atan2, degrees
  from ..functions import clip_scalar
  from ..Qt import QtCore, QtWidgets
  from .None import ArrowItem
  from .GraphicsObject import GraphicsObject
label_desc: Use image node_id 4 for calling the CurvePoint obj's underlying member method code with example usage: obj.event(ev) and returns: True, False, False