Skip to content

Commit

Permalink
Codestyle fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Sep 6, 2023
1 parent 3eb05f6 commit e3928e4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
15 changes: 8 additions & 7 deletions glue_plotly/html_exporters/bqplot/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def activate(self):
v.Card(children=[
v.CardTitle(primary_title=True, children=["Select output filepath"]),
file_chooser,
HBox(children=[ok_btn, close_btn]
)])
HBox(children=[ok_btn, close_btn])
])
]
)

Expand All @@ -49,7 +49,6 @@ def on_selected_change(chooser):
dialog.v_model = True
display(dialog)


def maybe_save_figure(self, filepath):
if exists(filepath):
yes_btn = v.Btn(color='success', children=["Yes"])
Expand All @@ -60,14 +59,17 @@ def maybe_save_figure(self, filepath):
v.Card(children=[
v.CardText(children=["This filepath already exists. Are you sure you want to overwrite it?"]),
HBox(children=[no_btn, yes_btn])
]
)
])
])
]
)

def on_yes_click(button, event, data):
self.save_figure(filepath)
check_dialog.v_model = False

def on_no_click(button, event, data):
check_dialog.v_model = False

yes_btn.on_event('click', on_yes_click)
no_btn.on_event('click', on_no_click)
with self.viewer.output_widget:
Expand All @@ -76,6 +78,5 @@ def on_no_click(button, event, data):
else:
self.save_figure(filepath)


def save_figure(self, filepath):
raise NotImplementedError()
1 change: 0 additions & 1 deletion glue_plotly/html_exporters/bqplot/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ def save_figure(self, filepath):
fig.add_traces(traces)

plot(fig, include_mathjax='cdn', filename=filepath, auto_open=False)

5 changes: 1 addition & 4 deletions glue_plotly/html_exporters/bqplot/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def save_figure(self, filepath):
add_data_label = data_count(layers) > 1

config = layout_config(self.viewer)

ax = axes_data_from_bqplot(self.viewer)
config.update(**ax)
secondary_x = 'xaxis2' in ax
Expand All @@ -43,6 +43,3 @@ def save_figure(self, filepath):
fig.add_traces(traces_to_add)

plot(fig, include_mathjax='cdn', filename=filepath, auto_open=False)



1 change: 1 addition & 0 deletions glue_plotly/html_exporters/bqplot/scatter2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from .base import PlotlyBaseBqplotExport


@viewer_tool
class PlotlyScatter2DBqplotExport(PlotlyBaseBqplotExport):
tool_id = 'save:bqplot_plotly2d'
Expand Down

0 comments on commit e3928e4

Please sign in to comment.