Skip to content

Commit

Permalink
Freeze models while updating plot(s) (#6315)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Jul 8, 2024
1 parent 7bc6d11 commit 55856e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 12 additions & 4 deletions holoviews/plotting/bokeh/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,11 +863,19 @@ def hold_render(f):
"""
def wrapper(self, *args, **kwargs):
hold = self.state.hold_render
doc = self.state.document
self.state.hold_render = True
try:
return f(self, *args, **kwargs)
finally:
self.state.hold_render = hold
if doc:
with doc.models.freeze():
try:
return f(self, *args, **kwargs)
finally:
self.state.hold_render = hold
else:
try:
return f(self, *args, **kwargs)
finally:
self.state.hold_render = hold
return wrapper


Expand Down
1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ plotly = ">=4.0"

[feature.py39.dependencies]
python = "3.9.*"
ffmpeg = "<7"

[feature.py310.dependencies]
python = "3.10.*"
Expand Down

0 comments on commit 55856e1

Please sign in to comment.