Skip to content

Commit

Permalink
Merge pull request #82 from Carifio24/config
Browse files Browse the repository at this point in the history
Remove viewer modebar via config
  • Loading branch information
Carifio24 authored Jul 19, 2024
2 parents 7c8c6e5 + 00ba041 commit c6c3150
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions glue_plotly/viewers/common/tests/base_viewer_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ def test_unique_class(self):
assert UUID(unique_class[prefix_len:])

assert unique_class in self.viewer.figure._dom_classes

def test_config(self):
config = self.viewer.figure._config
assert config["displayModeBar"] is False
4 changes: 1 addition & 3 deletions glue_plotly/viewers/common/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class PlotlyBaseView(IPyWidgetView):
hovermode=False, hoverdistance=1,
dragmode=False, showlegend=False, grid=None,
newselection=dict(line=dict(dash="dash"), mode='immediate'),
modebar=dict(remove=['toimage', 'zoom', 'pan', 'lasso', 'zoomIn2d',
'zoomOut2d', 'select', 'autoscale', 'resetScale2d',
'resetViews'])
)

allow_duplicate_data = False
Expand All @@ -36,6 +33,7 @@ def __init__(self, session, state=None):

layout = self._create_layout_config()
self.figure = go.FigureWidget(layout=layout)
self.figure._config = self.figure._config = {**self.figure._config, "displayModeBar": False}

self._unique_class = f"glue-plotly-{uuid4().hex}"
self.figure.add_class(self._unique_class)
Expand Down

0 comments on commit c6c3150

Please sign in to comment.