class_docstr: Edge drawer implementation that draws undirected edges as
  straight lines and directed edges by varying the alpha value
  of the specified edge color between the source and the destination.
class_docstr_tok: ["Edge","drawer","implementation","that","draws","undirected","edges","as","straight","lines","and","directed","edges","by","varying","the","alpha","value","of","the","specified","edge","color","between","the","source","and","the","destination","."]
code: def draw_directed_edge(self, edge, src_vertex, dest_vertex):
      if src_vertex == dest_vertex:  # TODO
          return self.draw_loop_edge(edge, src_vertex)
  
      src_pos, dest_pos = src_vertex.position, dest_vertex.position
      ctx = self.context
  
      # Set up the gradient
      lg = cairo.LinearGradient(
          src_pos[0], src_pos[1], dest_pos[0], dest_pos[1]
      )
      edge_color = edge.color[:3] + self.alpha_at_src
      edge_color_end = edge_color[:3] + self.alpha_at_dest
      lg.add_color_stop_rgba(0, *edge_color)
      lg.add_color_stop_rgba(1, *edge_color_end)
  
      # Draw the edge
      ctx.set_source(lg)
      ctx.set_line_width(edge.width)
      ctx.move_to(*src_pos)
      ctx.line_to(*dest_pos)
      ctx.stroke()
  
imports: from math import atan2, cos, pi, sin
  from igraph.drawing.baseclasses import AbstractEdgeDrawer
  from igraph.drawing.colors import clamp
  from igraph.drawing.metamagic import AttributeCollectorBase
  from igraph.drawing.utils import euclidean_distance, get_bezier_control_points_for_curved_edge, intersect_bezier_curve_and_circle
  from .utils import find_cairo
label_desc: Use image node_id 2 for calling the AlphaVaryingEdgeDrawer obj's underlying member method code with example usage: obj.draw_directed_edge(edge, src_vertex, dest_vertex) and returns: self