mode.utils.types.graphs — mode-ng 0.4.0 documentation

# `mode.utils.types.graphs`

Type classes for `mode.utils.graphs`.

class mode.utils.types.graphs.DependencyGraphT(it: Optional[Iterable[_T]] = None, formatter: Optional[GraphFormatterT[_T]] = None)

  Type class for dependency graphs.

  abstract add_arc(obj: _T) → None
  abstract add_edge(A: _T, B: _T) → None
  adjacent: MutableMapping[_T, _T]
  abstract connect(graph: DependencyGraphT) → None
  abstract edges() → Iterable
  abstract to_dot(fh: IO, *, formatter: Optional[GraphFormatterT[_T]] = None) → None
  abstract topsort() → Sequence
  abstract update(it: Iterable) → None
  abstract valency_of(obj: _T) → int

class mode.utils.types.graphs.GraphFormatterT(root: Optional[Any] = None, type: Optional[str] = None, id: Optional[str] = None, indent: int = 0, inw: str = ' ', **scheme: Any)

  Type class for graph formatters.

  abstract FMT(fmt: str, *args: Any, **kwargs: Any) → str
  abstract attr(name: str, value: Any) → str
  abstract attrs(d: Optional[Mapping] = None, scheme: Optional[Mapping] = None) → str
  abstract draw_edge(a: _T, b: _T, scheme: Optional[Mapping] = None, attrs: Optional[Mapping] = None) → str
  abstract draw_node(obj: _T, scheme: Optional[Mapping] = None, attrs: Optional[Mapping] = None) → str
  abstract edge(a: _T, b: _T, **attrs: Any) → str
  edge_scheme: Mapping[str, Any]
  graph_scheme: Mapping[str, Any]
  abstract head(**attrs: Any) → str
  abstract label(obj: _T) → str
  abstract node(obj: _T, **attrs: Any) → str
  node_scheme: Mapping[str, Any]
  scheme: Mapping[str, Any]
  abstract tail() → str
  term_scheme: Mapping[str, Any]
  abstract terminal_node(obj: _T, **attrs: Any) → str