(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)
panel 1.2.3
Click Next through a multistage pipeline, then click previous once reaching the end.
Then previous again does not go to left one, it acts like next was pressed.
# code goes here between backticks
import param
import panel as pn
pn.extension('katex')
pipeline = pn.pipeline.Pipeline()
class Stage1(param.Parameterized):
a = param.Integer(default=2, bounds=(0, 10))
b = param.Integer(default=3, bounds=(0, 10))
@param.output(('c', param.Integer), ('d', param.Integer))
def output(self):
return self.a * self.b, self.a ** self.b
@param.depends('a', 'b')
def view(self):
c, d = self.output()
c_out = pn.pane.LaTeX('${a} * {b} = {c}$'.format(
a=self.a, b=self.b, c=c), styles={'font-size': '2em'})
d_out = pn.pane.LaTeX('${a}^{{{b}}} = {d}$'.format(
a=self.a, b=self.b, d=d), styles={'font-size': '2em'})
return pn.Column(c_out, d_out, margin=(40, 10), styles={'background': '#f0f0f0'})
def panel(self):
return pn.Row(self.param, self.view,)
class Stage1B(param.Parameterized):
a = param.Integer()
@param.output(('c', param.Integer), ('d', param.Integer))
def output(self):
return self.a, 99
@param.depends('a')
def view(self):
c, d = self.output()
c_out = pn.pane.LaTeX('${a}$'.format(
a=self.a), styles={'font-size': '2em'})
d_out = pn.pane.LaTeX('${a} {d}$'.format(
a=self.a, d=d), styles={'font-size': '2em'})
return pn.Column(c_out, d_out, margin=(40, 10), styles={'background': '#f0f0f0'})
def panel(self):
return pn.Row(self.param, self.view,)
class Stage2(param.Parameterized):
c = param.Integer(default=6, bounds=(0, None))
exp = param.Number(default=0.1, bounds=(0, 3))
@param.depends('c', 'exp')
def view(self):
out = pn.pane.LaTeX('${%s}^{%s}={%.3f}$' % (self.c, self.exp, self.c**self.exp),
styles={'font-size': '2em'})
return pn.Column(out, margin=(40, 10), styles={'background': '#f0f0f0'})
def panel(self):
return pn.Row(self.param, self.view)
pipeline.add_stage('Stage 1', Stage1)
pipeline.add_stage('Stage1B', Stage1B)
pipeline.add_stage('Stage 2', Stage2)
pipeline.show()
ALL software version info
(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)
panel 1.2.3
Description of expected behavior and the observed behavior
Click Next through a multistage pipeline, then click previous once reaching the end.
Then previous again does not go to left one, it acts like next was pressed.
Complete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
Screenshots or screencasts of the bug in action