Skip to content

Commit

Permalink
Reactivate forced viz updates from sampler broadcasts in hist display…
Browse files Browse the repository at this point in the history
… loop
  • Loading branch information
goodboy committed Dec 15, 2023
1 parent afd0781 commit 3639f36
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions piker/ui/_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,25 +248,27 @@ async def increment_history_view(
# - samplerd could emit the actual update range via
# tuple and then we only enter the below block if that
# range is detected as in-view?
if (
(bf_wut := msg.get('backfilling', False))
):
viz_name, timeframe = bf_wut
if (
match msg:
case {
'backfilling': (viz_name, timeframe),
} if (
viz_name == name

):
log.warning(
f'Forcing HARD REDRAW:\n'
f'name: {name}\n'
f'timeframe: {timeframe}\n'
)
# TODO: only allow this when the data is IN VIEW!
# also, we probably can do this more efficiently
# / smarter by only redrawing the portion of the
# path necessary?
and False
):
log.info(f'Forcing hard redraw -> {name}@{timeframe}')
match timeframe:
case 60:
hist_viz.update_graphics(force_redraw=True)
case 1:
viz.update_graphics(force_redraw=True)
{
60: hist_viz,
1: viz,
}[timeframe].update_graphics(
force_redraw=True
)

# check if slow chart needs an x-domain shift and/or
# y-range resize.
Expand Down

0 comments on commit 3639f36

Please sign in to comment.