123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- import matplotlib.artist as martist
- from matplotlib.backend_bases import RendererBase, Event, FigureCanvasBase
- from matplotlib.colors import Colormap, Normalize
- import matplotlib.text as mtext
- from matplotlib.figure import Figure
- from matplotlib.font_manager import FontProperties
- from matplotlib.image import BboxImage
- from matplotlib.patches import FancyArrowPatch, FancyBboxPatch
- from matplotlib.transforms import Bbox, BboxBase, Transform
- import numpy as np
- from numpy.typing import ArrayLike
- from collections.abc import Callable, Sequence
- from typing import Any, Literal, overload
- DEBUG: bool
- def bbox_artist(*args, **kwargs) -> None: ...
- def _get_packed_offsets(
- widths: Sequence[float],
- total: float | None,
- sep: float | None,
- mode: Literal["fixed", "expand", "equal"] = ...,
- ) -> tuple[float, np.ndarray]: ...
- class OffsetBox(martist.Artist):
- width: float | None
- height: float | None
- def __init__(self, *args, **kwargs) -> None: ...
- def set_figure(self, fig: Figure) -> None: ...
- def set_offset(
- self,
- xy: tuple[float, float]
- | Callable[[float, float, float, float, RendererBase], tuple[float, float]],
- ) -> None: ...
- @overload
- def get_offset(self, bbox: Bbox, renderer: RendererBase) -> tuple[float, float]: ...
- @overload
- def get_offset(
- self,
- width: float,
- height: float,
- xdescent: float,
- ydescent: float,
- renderer: RendererBase
- ) -> tuple[float, float]: ...
- def set_width(self, width: float) -> None: ...
- def set_height(self, height: float) -> None: ...
- def get_visible_children(self) -> list[martist.Artist]: ...
- def get_children(self) -> list[martist.Artist]: ...
- def get_bbox(self, renderer: RendererBase) -> Bbox: ...
- def get_extent_offsets(
- self, renderer: RendererBase
- ) -> tuple[float, float, float, float, list[tuple[float, float]]]: ...
- def get_extent(
- self, renderer: RendererBase
- ) -> tuple[float, float, float, float]: ...
- def get_window_extent(self, renderer: RendererBase | None = ...) -> Bbox: ...
- class PackerBase(OffsetBox):
- height: float | None
- width: float | None
- sep: float | None
- pad: float | None
- mode: Literal["fixed", "expand", "equal"]
- align: Literal["top", "bottom", "left", "right", "center", "baseline"]
- def __init__(
- self,
- pad: float | None = ...,
- sep: float | None = ...,
- width: float | None = ...,
- height: float | None = ...,
- align: Literal["top", "bottom", "left", "right", "center", "baseline"] = ...,
- mode: Literal["fixed", "expand", "equal"] = ...,
- children: list[martist.Artist] | None = ...,
- ) -> None: ...
- class VPacker(PackerBase): ...
- class HPacker(PackerBase): ...
- class PaddedBox(OffsetBox):
- pad: float | None
- patch: FancyBboxPatch
- def __init__(
- self,
- child: martist.Artist,
- pad: float | None = ...,
- *,
- draw_frame: bool = ...,
- patch_attrs: dict[str, Any] | None = ...,
- ) -> None: ...
- def update_frame(self, bbox: Bbox, fontsize: float | None = ...) -> None: ...
- def draw_frame(self, renderer: RendererBase) -> None: ...
- class DrawingArea(OffsetBox):
- width: float
- height: float
- xdescent: float
- ydescent: float
- offset_transform: Transform
- dpi_transform: Transform
- def __init__(
- self,
- width: float,
- height: float,
- xdescent: float = ...,
- ydescent: float = ...,
- clip: bool = ...,
- ) -> None: ...
- @property
- def clip_children(self) -> bool: ...
- @clip_children.setter
- def clip_children(self, val: bool) -> None: ...
- def get_transform(self) -> Transform: ...
- # does not accept all options of superclass
- def set_offset(self, xy: tuple[float, float]) -> None: ... # type: ignore[override]
- def get_offset(self) -> tuple[float, float]: ... # type: ignore[override]
- def add_artist(self, a: martist.Artist) -> None: ...
- class TextArea(OffsetBox):
- offset_transform: Transform
- def __init__(
- self,
- s: str,
- *,
- textprops: dict[str, Any] | None = ...,
- multilinebaseline: bool = ...,
- ) -> None: ...
- def set_text(self, s: str) -> None: ...
- def get_text(self) -> str: ...
- def set_multilinebaseline(self, t: bool) -> None: ...
- def get_multilinebaseline(self) -> bool: ...
- # does not accept all options of superclass
- def set_offset(self, xy: tuple[float, float]) -> None: ... # type: ignore[override]
- def get_offset(self) -> tuple[float, float]: ... # type: ignore[override]
- class AuxTransformBox(OffsetBox):
- aux_transform: Transform
- offset_transform: Transform
- ref_offset_transform: Transform
- def __init__(self, aux_transform: Transform) -> None: ...
- def add_artist(self, a: martist.Artist) -> None: ...
- def get_transform(self) -> Transform: ...
- # does not accept all options of superclass
- def set_offset(self, xy: tuple[float, float]) -> None: ... # type: ignore[override]
- def get_offset(self) -> tuple[float, float]: ... # type: ignore[override]
- class AnchoredOffsetbox(OffsetBox):
- zorder: float
- codes: dict[str, int]
- loc: int
- borderpad: float
- pad: float
- prop: FontProperties
- patch: FancyBboxPatch
- def __init__(
- self,
- loc: str,
- *,
- pad: float = ...,
- borderpad: float = ...,
- child: OffsetBox | None = ...,
- prop: FontProperties | None = ...,
- frameon: bool = ...,
- bbox_to_anchor: BboxBase
- | tuple[float, float]
- | tuple[float, float, float, float]
- | None = ...,
- bbox_transform: Transform | None = ...,
- **kwargs
- ) -> None: ...
- def set_child(self, child: OffsetBox | None) -> None: ...
- def get_child(self) -> OffsetBox | None: ...
- def get_children(self) -> list[martist.Artist]: ...
- def get_bbox_to_anchor(self) -> Bbox: ...
- def set_bbox_to_anchor(
- self, bbox: BboxBase, transform: Transform | None = ...
- ) -> None: ...
- def update_frame(self, bbox: Bbox, fontsize: float | None = ...) -> None: ...
- class AnchoredText(AnchoredOffsetbox):
- txt: TextArea
- def __init__(
- self,
- s: str,
- loc: str,
- *,
- pad: float = ...,
- borderpad: float = ...,
- prop: dict[str, Any] | None = ...,
- **kwargs
- ) -> None: ...
- class OffsetImage(OffsetBox):
- image: BboxImage
- def __init__(
- self,
- arr: ArrayLike,
- *,
- zoom: float = ...,
- cmap: Colormap | str | None = ...,
- norm: Normalize | str | None = ...,
- interpolation: str | None = ...,
- origin: Literal["upper", "lower"] | None = ...,
- filternorm: bool = ...,
- filterrad: float = ...,
- resample: bool = ...,
- dpi_cor: bool = ...,
- **kwargs
- ) -> None: ...
- stale: bool
- def set_data(self, arr: ArrayLike | None) -> None: ...
- def get_data(self) -> ArrayLike | None: ...
- def set_zoom(self, zoom: float) -> None: ...
- def get_zoom(self) -> float: ...
- def get_children(self) -> list[martist.Artist]: ...
- def get_offset(self) -> tuple[float, float]: ... # type: ignore[override]
- class AnnotationBbox(martist.Artist, mtext._AnnotationBase):
- zorder: float
- offsetbox: OffsetBox
- arrowprops: dict[str, Any] | None
- xybox: tuple[float, float]
- boxcoords: str | tuple[str, str] | martist.Artist | Transform | Callable[
- [RendererBase], Bbox | Transform
- ]
- arrow_patch: FancyArrowPatch | None
- patch: FancyBboxPatch
- prop: FontProperties
- def __init__(
- self,
- offsetbox: OffsetBox,
- xy: tuple[float, float],
- xybox: tuple[float, float] | None = ...,
- xycoords: str
- | tuple[str, str]
- | martist.Artist
- | Transform
- | Callable[[RendererBase], Bbox | Transform] = ...,
- boxcoords: str
- | tuple[str, str]
- | martist.Artist
- | Transform
- | Callable[[RendererBase], Bbox | Transform]
- | None = ...,
- *,
- frameon: bool = ...,
- pad: float = ...,
- annotation_clip: bool | None = ...,
- box_alignment: tuple[float, float] = ...,
- bboxprops: dict[str, Any] | None = ...,
- arrowprops: dict[str, Any] | None = ...,
- fontsize: float | str | None = ...,
- **kwargs
- ) -> None: ...
- @property
- def xyann(self) -> tuple[float, float]: ...
- @xyann.setter
- def xyann(self, xyann: tuple[float, float]) -> None: ...
- @property
- def anncoords(
- self,
- ) -> str | tuple[str, str] | martist.Artist | Transform | Callable[
- [RendererBase], Bbox | Transform
- ]: ...
- @anncoords.setter
- def anncoords(
- self,
- coords: str
- | tuple[str, str]
- | martist.Artist
- | Transform
- | Callable[[RendererBase], Bbox | Transform],
- ) -> None: ...
- def get_children(self) -> list[martist.Artist]: ...
- def set_figure(self, fig: Figure) -> None: ...
- def set_fontsize(self, s: str | float | None = ...) -> None: ...
- def get_fontsize(self) -> float: ...
- def get_tightbbox(self, renderer: RendererBase | None = ...) -> Bbox: ...
- def update_positions(self, renderer: RendererBase) -> None: ...
- class DraggableBase:
- ref_artist: martist.Artist
- got_artist: bool
- mouse_x: int
- mouse_y: int
- background: Any
- @property
- def canvas(self) -> FigureCanvasBase: ...
- @property
- def cids(self) -> list[int]: ...
- def __init__(self, ref_artist: martist.Artist, use_blit: bool = ...) -> None: ...
- def on_motion(self, evt: Event) -> None: ...
- def on_pick(self, evt: Event) -> None: ...
- def on_release(self, event: Event) -> None: ...
- def disconnect(self) -> None: ...
- def save_offset(self) -> None: ...
- def update_offset(self, dx: float, dy: float) -> None: ...
- def finalize_offset(self) -> None: ...
- class DraggableOffsetBox(DraggableBase):
- offsetbox: OffsetBox
- def __init__(
- self, ref_artist: martist.Artist, offsetbox: OffsetBox, use_blit: bool = ...
- ) -> None: ...
- def save_offset(self) -> None: ...
- def update_offset(self, dx: float, dy: float) -> None: ...
- def get_loc_in_canvas(self) -> tuple[float, float]: ...
- class DraggableAnnotation(DraggableBase):
- annotation: mtext.Annotation
- def __init__(self, annotation: mtext.Annotation, use_blit: bool = ...) -> None: ...
- def save_offset(self) -> None: ...
- def update_offset(self, dx: float, dy: float) -> None: ...
|