|
1 | 1 | from typing import *
|
| 2 | + |
2 | 3 | import numpy
|
3 |
| -from ..graphics import * |
4 | 4 | import weakref
|
5 | 5 |
|
| 6 | +from ..graphics import * |
| 7 | + |
6 | 8 |
|
7 | 9 | class GraphicMethodsMixin:
|
8 | 10 | def __init__(self):
|
@@ -70,7 +72,7 @@ def add_heatmap(self, data: Any, vmin: int = None, vmax: int = None, cmap: str =
|
70 | 72 | plot.show()
|
71 | 73 |
|
72 | 74 | """
|
73 |
| - g = HeatmapGraphic(*args, **kwargs) |
| 75 | + g = HeatmapGraphic(data=data, *args, **kwargs) |
74 | 76 | self.add_graphic(g)
|
75 | 77 |
|
76 | 78 | return weakref.proxy(g)
|
@@ -103,7 +105,7 @@ def add_histogram(self, data: numpy.ndarray = None, bins: Union[int, str] = 'aut
|
103 | 105 | passed to Graphic
|
104 | 106 |
|
105 | 107 | """
|
106 |
| - g = HistogramGraphic(*args, **kwargs) |
| 108 | + g = HistogramGraphic(data=data, *args, **kwargs) |
107 | 109 | self.add_graphic(g)
|
108 | 110 |
|
109 | 111 | return weakref.proxy(g)
|
@@ -165,9 +167,7 @@ def add_image(self, data: Any, vmin: int = None, vmax: int = None, cmap: str = '
|
165 | 167 | plot.show()
|
166 | 168 |
|
167 | 169 | """
|
168 |
| - print(args) |
169 |
| - print(kwargs) |
170 |
| - g = ImageGraphic(*args, **kwargs) |
| 170 | + g = ImageGraphic(data=data, *args, **kwargs) |
171 | 171 | self.add_graphic(g)
|
172 | 172 |
|
173 | 173 | return weakref.proxy(g)
|
@@ -286,7 +286,7 @@ def add_line_collection(self, data: List[numpy.ndarray], z_position: Union[List[
|
286 | 286 |
|
287 | 287 |
|
288 | 288 | """
|
289 |
| - g = LineCollection(*args, **kwargs) |
| 289 | + g = LineCollection(data=data, *args, **kwargs) |
290 | 290 | self.add_graphic(g)
|
291 | 291 |
|
292 | 292 | return weakref.proxy(g)
|
@@ -340,7 +340,7 @@ def add_line(self, data: Any, thickness: float = 2.0, colors: Union[str, numpy.n
|
340 | 340 |
|
341 | 341 |
|
342 | 342 | """
|
343 |
| - g = LineGraphic(*args, **kwargs) |
| 343 | + g = LineGraphic(data=data, *args, **kwargs) |
344 | 344 | self.add_graphic(g)
|
345 | 345 |
|
346 | 346 | return weakref.proxy(g)
|
@@ -451,7 +451,7 @@ def add_line_stack(self, data: List[numpy.ndarray], z_position: Union[List[float
|
451 | 451 |
|
452 | 452 |
|
453 | 453 | """
|
454 |
| - g = LineStack(*args, **kwargs) |
| 454 | + g = LineStack(data=data, *args, **kwargs) |
455 | 455 | self.add_graphic(g)
|
456 | 456 |
|
457 | 457 | return weakref.proxy(g)
|
@@ -505,7 +505,7 @@ def add_scatter(self, data: numpy.ndarray, sizes: Union[int, numpy.ndarray, list
|
505 | 505 |
|
506 | 506 |
|
507 | 507 | """
|
508 |
| - g = ScatterGraphic(*args, **kwargs) |
| 508 | + g = ScatterGraphic(data=data, *args, **kwargs) |
509 | 509 | self.add_graphic(g)
|
510 | 510 |
|
511 | 511 | return weakref.proxy(g)
|
@@ -533,7 +533,7 @@ def add_text(self, text: str, position: Tuple[int] = (0, 0, 0), size: int = 10,
|
533 | 533 | name of graphic, passed to Graphic
|
534 | 534 |
|
535 | 535 | """
|
536 |
| - g = TextGraphic(*args, **kwargs) |
| 536 | + g = TextGraphic(text=text, *args, **kwargs) |
537 | 537 | self.add_graphic(g)
|
538 | 538 |
|
539 | 539 | return weakref.proxy(g)
|
|
0 commit comments