sankey.pyi 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. from matplotlib.axes import Axes
  2. from collections.abc import Callable, Iterable
  3. from typing import Any
  4. from typing_extensions import Self # < Py 3.11
  5. import numpy as np
  6. __license__: str
  7. __credits__: list[str]
  8. __author__: str
  9. __version__: str
  10. RIGHT: int
  11. UP: int
  12. DOWN: int
  13. # TODO typing units
  14. class Sankey:
  15. diagrams: list[Any]
  16. ax: Axes
  17. unit: Any
  18. format: str | Callable[[float], str]
  19. scale: float
  20. gap: float
  21. radius: float
  22. shoulder: float
  23. offset: float
  24. margin: float
  25. pitch: float
  26. tolerance: float
  27. extent: np.ndarray
  28. def __init__(
  29. self,
  30. ax: Axes | None = ...,
  31. scale: float = ...,
  32. unit: Any = ...,
  33. format: str | Callable[[float], str] = ...,
  34. gap: float = ...,
  35. radius: float = ...,
  36. shoulder: float = ...,
  37. offset: float = ...,
  38. head_angle: float = ...,
  39. margin: float = ...,
  40. tolerance: float = ...,
  41. **kwargs
  42. ) -> None: ...
  43. def add(
  44. self,
  45. patchlabel: str = ...,
  46. flows: Iterable[float] | None = ...,
  47. orientations: Iterable[int] | None = ...,
  48. labels: str | Iterable[str | None] = ...,
  49. trunklength: float = ...,
  50. pathlengths: float | Iterable[float] = ...,
  51. prior: int | None = ...,
  52. connect: tuple[int, int] = ...,
  53. rotation: float = ...,
  54. **kwargs
  55. ) -> Self: ...
  56. def finish(self) -> list[Any]: ...