class documentation

抽象类,作为绘制 igraph.Graph 的任何内容的基础类。

静态方法 ensure_layout 确保layoutLayout实例的辅助方法。如果不是,该方法将尝试根据以下规则将其转换为Layout
方法 draw 抽象方法,必须在派生类中实现。
静态方法 _determine_edge_order 返回给定图的边必须绘制的顺序,假设相关的关键字参数(edge_orderedge_order_by)在 kwds 中以字典形式给出。如果既没有 edge_order...
静态方法 _determine_vertex_order 返回给定图的顶点必须绘制的顺序,假设相关的关键字参数(vertex_ordervertex_order_by)在 kwds 中以字典形式给出。如果两者都没有...
@staticmethod
def ensure_layout(layout, graph=None): (source)

辅助方法,确保layoutLayout的一个实例。如果不是,该方法将尝试根据以下规则将其转换为Layout

  • If layout is a string, it is assumed to be a name of an igraph layout, and it will be passed on to the layout method of the given graph if graph is not None.
  • If layout is None and graph has a "layout" attribute, call this same function with the value of that attribute.
  • If layout is None and graph does not have a "layout" attribute, the layout method of graph will be invoked with no parameters, which will call the default layout algorithm.
  • Otherwise, layout will be passed on to the constructor of Layout. This handles lists of lists, lists of tuples and such.

如果 layout 已经是一个 Layout 实例,它仍然会被复制并返回一个副本。这是因为图形绘制器可以为了其目的而转换布局,我们不希望这种转换传播回调用者。

@staticmethod
def _determine_edge_order(graph, kwds): (source)

返回给定图的边需要绘制的顺序,假设相关的关键字参数(edge_orderedge_order_by)在 kwds 中以字典形式给出。如果 kwds 中既没有 edge_order 也没有 edge_order_by,则此函数返回 None,表示图形绘制器可以自由选择最方便的边顺序。

@staticmethod
def _determine_vertex_order(graph, kwds): (source)

返回给定图的顶点必须绘制的顺序,假设相关的关键字参数(vertex_ordervertex_order_by)在 kwds 中以字典形式给出。如果 kwds 中既没有 vertex_order 也没有 vertex_order_by,此函数返回 None 以表示图形绘制器可以自由选择最方便的顶点顺序。