Skip to content

Commit

Permalink
Update method of removing dot traces to fix issue in Solara.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed May 8, 2024
1 parent 6b5408b commit fdb5ffe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion glue_plotly/viewers/histogram/dotplot_layer_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,13 @@ def _update_visual_attrs_for_trace(self, trace):
def _update_data(self):
old_dots = self._get_dots()
if old_dots:
self.view._remove_traces(old_dots)
with self.view.figure.batch_update():
for trace in old_dots:

Check warning on line 120 in glue_plotly/viewers/histogram/dotplot_layer_artist.py

View check run for this annotation

Codecov / codecov/patch

glue_plotly/viewers/histogram/dotplot_layer_artist.py#L119-L120

Added lines #L119 - L120 were not covered by tests
self.view._remove_trace_index(trace)

dots = traces_for_layer(self.view, self.state, add_data_label=True)
for trace in dots:
trace.update(hoverinfo='all', unselected=dict(marker=dict(opacity=self.state.alpha)))

Check warning on line 125 in glue_plotly/viewers/histogram/dotplot_layer_artist.py

View check run for this annotation

Codecov / codecov/patch

glue_plotly/viewers/histogram/dotplot_layer_artist.py#L124-L125

Added lines #L124 - L125 were not covered by tests
self._dots_id = dots[0].meta if dots else None
self.view.figure.add_traces(dots)

Expand Down

0 comments on commit fdb5ffe

Please sign in to comment.