mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-06-25 02:04:04 +08:00
networkx: fix and complete functions related to the dot interface (#14600)
This commit is contained in:
@@ -17,16 +17,14 @@ class _SupportsOpen(Protocol[_ModeT_contra, _FileT_co]):
|
||||
|
||||
@_dispatchable
|
||||
def from_agraph(
|
||||
A: AGraph, create_using: Graph[_Node] | type[Graph[_Node]] | None = None
|
||||
) -> Graph[_Node]: ... # type of node cannot be known statically
|
||||
A: AGraph, create_using: Graph[str] | type[Graph[str]] | None = None # TODO: add overloads on `create_using`
|
||||
) -> Graph[str]: ...
|
||||
def to_agraph(N: Graph[_Node]) -> AGraph: ...
|
||||
def write_dot(
|
||||
G: Graph[_Node], path: str | IO[str] | IO[bytes] | _SupportsOpen[OpenTextModeWriting, IO[str] | IO[bytes]]
|
||||
) -> None: ...
|
||||
@_dispatchable
|
||||
def read_dot(
|
||||
path: str | IO[str] | IO[bytes] | _SupportsOpen[OpenTextModeReading, IO[str] | IO[bytes]],
|
||||
) -> Graph[Any]: ... # type of node cannot be known statically
|
||||
def read_dot(path: str | IO[str] | IO[bytes] | _SupportsOpen[OpenTextModeReading, IO[str] | IO[bytes]]) -> Graph[str]: ...
|
||||
def graphviz_layout(
|
||||
G: Graph[_Node], prog: str = "neato", root: str | None = None, args: str = ""
|
||||
) -> dict[_Node, tuple[float, float]]: ...
|
||||
|
||||
@@ -12,7 +12,7 @@ def write_dot(G: Graph[_Node], path: str | PathLike[Any] | SupportsWrite[str]) -
|
||||
@_dispatchable
|
||||
def read_dot(path: str | PathLike[Any] | SupportsRead[str]) -> Graph[str]: ...
|
||||
@_dispatchable
|
||||
def from_pydot(P: Dot): ...
|
||||
def from_pydot(P: Dot) -> Graph[str]: ...
|
||||
def to_pydot(N: Graph[_Node]) -> Dot: ...
|
||||
def graphviz_layout(G: Graph[_Node], prog: str = "neato", root: _Node | None = None): ...
|
||||
def pydot_layout(G: Graph[_Node], prog: str = "neato", root: _Node | None = None): ...
|
||||
def graphviz_layout(G: Graph[_Node], prog: str = "neato", root: _Node | None = None) -> dict[_Node, tuple[float, float]]: ...
|
||||
def pydot_layout(G: Graph[_Node], prog: str = "neato", root: _Node | None = None) -> dict[_Node, tuple[float, float]]: ...
|
||||
|
||||
Reference in New Issue
Block a user