Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions openpmd_viewer/openpmd_timeseries/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,20 @@ def step_bw(b):
# Define widgets
# ---------------

# Slider
# used for both VCR and Slider
iteration_min = self.iterations.min()
iteration_max = self.iterations.max()
step = max( int( (iteration_max - iteration_min) / 20. ), 1 )

# "VCR" controls
play = widgets.Play( description="VCR player",
min=iteration_min, max=iteration_max + step, step=step )

# Slider
slider = widgets.IntSlider( description="iteration",
min=iteration_min, max=iteration_max + step, step=step )
slider.observe( change_iteration, names='value', type='change' )
widgets.jslink((play, 'value'), (slider, 'value'))
set_widget_dimensions( slider, width=500 )

# Forward button
Expand All @@ -317,7 +324,7 @@ def step_bw(b):
button_m.on_click(step_bw)

# Display the time widgets
container = widgets.HBox(children=[button_m, button_p, slider])
container = widgets.HBox(children=[play, button_m, button_p, slider])
display(container)

# Field widgets
Expand Down