Skip to content

Commit

Permalink
safe layout to potentially add buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-urban committed Dec 6, 2024
1 parent c020fe1 commit 249d2a0
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,21 @@ def __init__(self, echogramdata, name="Echogram", names = None, figure=None, pro

def show(self):
if self.display_progress:
display(
self.layout = ipywidgets.VBox([
ipywidgets.HBox(children=[self.fig.canvas]),
ipywidgets.HBox([self.progress]),
self.box_sliders,
self.box_buttons,
self.output
)
])
else:
display(
self.layout = ipywidgets.VBox([
ipywidgets.HBox(children=[self.fig.canvas]),
self.box_sliders,
self.box_buttons,
self.output
)
])
display(self.layout)

def init_ax(self, adapt_axis_names=True):
with self.output:
Expand Down Expand Up @@ -288,7 +289,7 @@ def invert_y_axis(self):

for ax in self.axes:
ax.invert_yaxis()
self.fig.canvas.draw()
self.fig.canvas.draw_idle()

def update_view(self, w=None, reset=False):
with self.output:
Expand Down Expand Up @@ -362,7 +363,7 @@ def update_view(self, w=None, reset=False):
m.remove()
self.mapables = self.mapables[:len(self.echogramdata)*3]

self.fig.canvas.draw()
self.fig.canvas.draw_idle()

except Exception as e:
raise (e)
Expand Down

0 comments on commit 249d2a0

Please sign in to comment.