From 3d8a875e7d73637a0c73a686b50f494f9280fd3c Mon Sep 17 00:00:00 2001 From: Alexandra Ioan Date: Mon, 1 Jun 2026 16:06:07 +0200 Subject: [PATCH] make graph responsive --- waveform_editor/gui/shape_editor/nice_plotter.py | 7 ++++--- waveform_editor/gui/shape_editor/shape_editor.py | 5 ++++- waveform_editor/gui/waveform_content.py | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/waveform_editor/gui/shape_editor/nice_plotter.py b/waveform_editor/gui/shape_editor/nice_plotter.py index 5a8189f3..470ca53a 100644 --- a/waveform_editor/gui/shape_editor/nice_plotter.py +++ b/waveform_editor/gui/shape_editor/nice_plotter.py @@ -56,6 +56,8 @@ def __init__(self, **params): title="Equilibrium poloidal flux", xlabel="r [m]", ylabel="z [m]", + data_aspect=1, + responsive=True, ) self.nice_settings = settings.nice self.CONTOUR_OPTS = hv.opts.Contours( @@ -80,14 +82,13 @@ def __init__(self, **params): ) self.flux_map_pane = pn.pane.HoloViews( flux_map_overlay, - width=self.WIDTH, - height=self.HEIGHT, + sizing_mode="stretch_both", loading=self.communicator.param.processing, ) profiles_plot = hv.DynamicMap(self._plot_profiles) self.profiles_pane = pn.pane.HoloViews( - profiles_plot, width=self.PROFILE_WIDTH, height=self.PROFILE_HEIGHT + profiles_plot, sizing_mode="stretch_width", min_height=self.PROFILE_HEIGHT ) self.panel_layout = pn.Param( self.param, diff --git a/waveform_editor/gui/shape_editor/shape_editor.py b/waveform_editor/gui/shape_editor/shape_editor.py index b83056e2..2360b2d9 100644 --- a/waveform_editor/gui/shape_editor/shape_editor.py +++ b/waveform_editor/gui/shape_editor/shape_editor.py @@ -129,13 +129,16 @@ def __init__(self, main_gui): menu = pn.Column(buttons, self.terminal, sizing_mode="stretch_width") self.panel = pn.Row( pn.Column( - pn.Row(settings_modal, align="end"), self.nice_plotter.flux_map_pane + pn.Row(settings_modal, align="end"), + self.nice_plotter.flux_map_pane, + sizing_mode="stretch_both", ), pn.Column( menu, options, sizing_mode="stretch_both", ), + sizing_mode="stretch_both", ) def _create_card(self, panel_object, title, is_valid=None, visible=True): diff --git a/waveform_editor/gui/waveform_content.py b/waveform_editor/gui/waveform_content.py index 9af0cdd8..3e629df8 100644 --- a/waveform_editor/gui/waveform_content.py +++ b/waveform_editor/gui/waveform_content.py @@ -41,7 +41,9 @@ def __init__( sizing_mode="stretch_both", visible=is_waveform_page, ) - plasma_page = pn.Column(shape_editor, visible=is_plasma_page) + plasma_page = pn.Column( + shape_editor, sizing_mode="stretch_both", visible=is_plasma_page + ) self._layout = pn.Column(waveform_page, plasma_page, sizing_mode="stretch_both") def __panel__(self):