Skip to content
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

feat: option to hide side panel #442

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 3 additions & 1 deletion ipyvolume/pylab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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()
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions ipyvolume/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ipyvolume/vue/container.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="ipyvolume-container-root">
<jupyter-widget ref="figure" :widget="figure"></jupyter-widget>
<div class=ipyvolume-container-controls>
<div v-if="show_side_panel" class=ipyvolume-container-controls>
<v-expansion-panels accordion multiple v-model="panels" flat>
<v-expansion-panel>
<v-expansion-panel-header>Legend</v-expansion-panel-header>
Expand Down
Loading