Skip to content

Commit e7ea23f

Browse files
committed
Fix xlim reset
1 parent a44dd86 commit e7ea23f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

panel/simdec.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,16 +354,23 @@ def csv_data(
354354
visible=show_n_bins,
355355
)
356356

357-
interactive_xlim = pn.bind(xlim_auto, interactive_decomposition)
357+
interactive_xlim = pn.rx(xlim_auto)(interactive_decomposition)
358358
selector_xlim = pn.widgets.EditableRangeSlider(
359359
name="X-lim",
360360
start=interactive_xlim.rx()[0],
361361
end=interactive_xlim.rx()[1],
362-
value=interactive_xlim,
362+
value=interactive_xlim.rx(),
363363
format="0.0[00]",
364364
step=0.1,
365365
)
366366

367+
368+
def callback_xlim(start, end):
369+
selector_xlim.param.update(dict(value=(start, end)))
370+
371+
372+
selector_xlim.param.watch_values(fn=callback_xlim, parameter_names=["start", "end"])
373+
367374
interactive_states = pn.bind(
368375
states_from_data, interactive_decomposition, interactive_inputs_decomposition
369376
)

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dependencies = [
3737

3838
[project.optional-dependencies]
3939
dashboard = [
40-
"panel>=1.3.8",
40+
"panel>=1.4.5",
4141
"cryptography",
4242
]
4343

@@ -56,6 +56,7 @@ doc = [
5656

5757
dev = [
5858
"simdec[doc,test,dashboard]",
59+
"watchfiles",
5960
"pre-commit",
6061
"hatch",
6162
]

0 commit comments

Comments
 (0)