Thanks to visit codestin.com
Credit goes to github.com

Skip to content

small changes #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fastplotlib/graphics/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ def link(
self.registered_callbacks[event_type].append(callback_data)

if bidirectional:
if event_type in PYGFX_EVENTS:
warn("cannot use bidirectional link for pygfx events")
return

target.link(
event_type=event_type,
target=self,
Expand Down
5 changes: 4 additions & 1 deletion fastplotlib/layouts/_gridplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __init__(

self._starting_size = size

def __getitem__(self, index: Union[Tuple[int, int], str]):
def __getitem__(self, index: Union[Tuple[int, int], str]) -> Subplot:
if isinstance(index, str):
for subplot in self._subplots.ravel():
if subplot.name == index:
Expand Down Expand Up @@ -276,6 +276,9 @@ def show(self):

return self.canvas

def close(self):
self.canvas.close()

def _get_iterator(self):
return product(range(self.shape[0]), range(self.shape[1]))

Expand Down
3 changes: 3 additions & 0 deletions fastplotlib/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,6 @@ def show(self, autoscale: bool = True):
self.canvas.set_logical_size(*self._starting_size)

return self.canvas

def close(self):
self.canvas.close()