table.pyi 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. from .artist import Artist
  2. from .axes import Axes
  3. from .backend_bases import RendererBase
  4. from .patches import Rectangle
  5. from .path import Path
  6. from .text import Text
  7. from .transforms import Bbox
  8. from .typing import ColorType
  9. from collections.abc import Sequence
  10. from typing import Any, Literal
  11. class Cell(Rectangle):
  12. PAD: float
  13. def __init__(
  14. self,
  15. xy: tuple[float, float],
  16. width: float,
  17. height: float,
  18. *,
  19. edgecolor: ColorType = ...,
  20. facecolor: ColorType = ...,
  21. fill: bool = ...,
  22. text: str = ...,
  23. loc: Literal["left", "center", "right"] | None = ...,
  24. fontproperties: dict[str, Any] | None = ...,
  25. visible_edges: str | None = ...
  26. ) -> None: ...
  27. def get_text(self) -> Text: ...
  28. def set_fontsize(self, size: float) -> None: ...
  29. def get_fontsize(self) -> float: ...
  30. def auto_set_font_size(self, renderer: RendererBase) -> float: ...
  31. def get_text_bounds(
  32. self, renderer: RendererBase
  33. ) -> tuple[float, float, float, float]: ...
  34. def get_required_width(self, renderer: RendererBase) -> float: ...
  35. def set_text_props(self, **kwargs) -> None: ...
  36. @property
  37. def visible_edges(self) -> str: ...
  38. @visible_edges.setter
  39. def visible_edges(self, value: str | None) -> None: ...
  40. def get_path(self) -> Path: ...
  41. CustomCell = Cell
  42. class Table(Artist):
  43. codes: dict[str, int]
  44. FONTSIZE: float
  45. AXESPAD: float
  46. def __init__(
  47. self, ax: Axes, loc: str | None = ..., bbox: Bbox | None = ..., **kwargs
  48. ) -> None: ...
  49. def add_cell(self, row: int, col: int, *args, **kwargs) -> Cell: ...
  50. def __setitem__(self, position: tuple[int, int], cell: Cell) -> None: ...
  51. def __getitem__(self, position: tuple[int, int]) -> Cell: ...
  52. @property
  53. def edges(self) -> str | None: ...
  54. @edges.setter
  55. def edges(self, value: str | None) -> None: ...
  56. def draw(self, renderer) -> None: ...
  57. def get_children(self) -> list[Artist]: ...
  58. def get_window_extent(self, renderer: RendererBase | None = ...) -> Bbox: ...
  59. def auto_set_column_width(self, col: int | Sequence[int]) -> None: ...
  60. def auto_set_font_size(self, value: bool = ...) -> None: ...
  61. def scale(self, xscale: float, yscale: float) -> None: ...
  62. def set_fontsize(self, size: float) -> None: ...
  63. def get_celld(self) -> dict[tuple[int, int], Cell]: ...
  64. def table(
  65. ax: Axes,
  66. cellText: Sequence[Sequence[str]] | None = ...,
  67. cellColours: Sequence[Sequence[ColorType]] | None = ...,
  68. cellLoc: Literal["left", "center", "right"] = ...,
  69. colWidths: Sequence[float] | None = ...,
  70. rowLabels: Sequence[str] | None = ...,
  71. rowColours: Sequence[ColorType] | None = ...,
  72. rowLoc: Literal["left", "center", "right"] = ...,
  73. colLabels: Sequence[str] | None = ...,
  74. colColours: Sequence[ColorType] | None = ...,
  75. colLoc: Literal["left", "center", "right"] = ...,
  76. loc: str = ...,
  77. bbox: Bbox | None = ...,
  78. edges: str = ...,
  79. **kwargs
  80. ) -> Table: ...