Skip to content

Commit

Permalink
avoid accessing app.widgets/_active_widgets entirely
Browse files Browse the repository at this point in the history
* need to check if this adds any performance overhead
  • Loading branch information
kecnry committed Aug 22, 2022
1 parent ca6c18f commit 6899c64
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,9 +1162,6 @@ def vue_relayout(self, *args, **kwargs):
"""
Forces any rendered ``Bqplot`` instances to resize themselves.
"""
def get_widget(ipymodel):
return getattr(self, '_active_widgets', self.widgets).get(ipymodel)

def resize(stack_items):
for stack in stack_items:
for viewer_item in stack.get('viewers'):
Expand All @@ -1182,7 +1179,7 @@ def resize(stack_items):
# resize tray items
for tray_item in self.state.tray_items:
# access the actual plugin object (there is no store for plugins)
tray_obj = get_widget(tray_item['widget'].split('IPY_MODEL_')[1])
tray_obj = widget_serialization['from_json'](tray_item['widget'], None)
for bqplot_fig in tray_obj.bqplot_figs_resize:
bqplot_fig.layout.height = '99.9%'
bqplot_fig.layout.height = '100%'
Expand Down

0 comments on commit 6899c64

Please sign in to comment.