{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Expand file tree
/
Copy pathoffsetbox.pyi
More file actions
321 lines (297 loc) · 10.4 KB
/
Copy pathoffsetbox.pyi
File metadata and controls
321 lines (297 loc) · 10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
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: ...
You can’t perform that action at this time.
