From b4520a041d9e16406edb79ddc6205ec1b4154bbf Mon Sep 17 00:00:00 2001 From: Iisakki Rotko Date: Wed, 29 Nov 2023 15:24:59 +0100 Subject: [PATCH] feat: option to hide side panel --- ipyvolume/pylab.py | 4 +++- ipyvolume/ui.py | 1 + ipyvolume/vue/container.vue | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ipyvolume/pylab.py b/ipyvolume/pylab.py index c5639aec..e65cddd7 100644 --- a/ipyvolume/pylab.py +++ b/ipyvolume/pylab.py @@ -192,6 +192,7 @@ def figure( controls_vr=False, controls_light=False, debug=False, + show_side_panel=True, **kwargs ): """Create a new figure if no key is given, or return the figure associated with key. @@ -203,6 +204,7 @@ def figure( :param bool controls: show controls or not :param bool controls_vr: show controls for VR or not :param bool debug: show debug buttons or not + :param bool show_side_panel: show side panel (containing legend, misc, and debug) or not :return: :any:`Figure` """ utils.colab_workarounds() @@ -218,7 +220,7 @@ def figure( current.figure = ipv.Figure(width=width, height=height, **kwargs) current.material = None legend = ui.Legend(figure=current.figure) - current.container = ui.Container(figure=current.figure, legend=legend) + current.container = ui.Container(figure=current.figure, legend=legend, show_side_panel=show_side_panel) current.container.children = [] if key is None: diff --git a/ipyvolume/ui.py b/ipyvolume/ui.py index 0ab6799e..ff6f858a 100644 --- a/ipyvolume/ui.py +++ b/ipyvolume/ui.py @@ -22,6 +22,7 @@ class Container(v.VuetifyTemplate): figure = traitlets.Instance(ipyvolume.Figure).tag(sync=True, **widgets.widget_serialization) legend = traitlets.Instance(Legend).tag(sync=True, **widgets.widget_serialization) legend_show = traitlets.Bool(True).tag(sync=True) + show_side_panel = traitlets.Bool(True).tag(sync=True) children = traitlets.List().tag(sync=True, **widgets.widget_serialization) models = traitlets.Any({'figure': {}}).tag(sync=True) panels = traitlets.List(traitlets.CInt(), default_value=[0, 1, 2]).tag(sync=True) diff --git a/ipyvolume/vue/container.vue b/ipyvolume/vue/container.vue index 25c1097c..2c331df4 100644 --- a/ipyvolume/vue/container.vue +++ b/ipyvolume/vue/container.vue @@ -1,7 +1,7 @@