Skip to content

Commit

Permalink
Improved Pipeline subway map styling (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Mar 29, 2019
1 parent 1486a41 commit 85176e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions examples/user_guide/Pipelines.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
"import panel as pn\n",
"import holoviews as hv\n",
"\n",
"pn.extension()"
"pn.extension('katex')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Note: This feature requires param >= 1.8.2 (currently in development).**\n",
"\n",
"The [Param user guide](Param.ipynb) described how to set up classes which declare parameters and link them to some computation or visualization. In this section we will discover how to connect multiple such panels into a ``Pipeline`` to express complex workflows where the output of one stage feeds into the next stage. To start using a ``Pipeline`` let us declare an empty one by instantiating the class:"
]
},
Expand Down Expand Up @@ -72,7 +70,7 @@
" def view(self):\n",
" c, d = self.output()\n",
" return pn.pane.LaTeX('${a} * {b} = {c}$\\n${a}^{{{b}}} = {d}$'.format(\n",
" a=self.a, b=self.b, c=c, d=d))\n",
" a=self.a, b=self.b, c=c, d=d), style={'font-size': '2em'})\n",
"\n",
" def panel(self):\n",
" return pn.Row(self.param, self.view)\n",
Expand Down Expand Up @@ -142,7 +140,8 @@
" \n",
" @param.depends('c', 'exp')\n",
" def view(self):\n",
" return pn.pane.LaTeX('${%s}^{%s}={%.3f}$' % (self.c, self.exp, self.c**self.exp))\n",
" return pn.pane.LaTeX('${%s}^{%s}={%.3f}$' % (self.c, self.exp, self.c**self.exp),\n",
" style={'font-size': '2em'})\n",
"\n",
" def panel(self):\n",
" return pn.Row(self.param, self.view)\n",
Expand Down
4 changes: 2 additions & 2 deletions panel/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ def _make_progress(self):
import holoviews.plotting.bokeh # noqa
stages = len(self._stages)
line = hv.Path([[(0, 0), (stages-1, 0)]]).options(
line_width=10, color='black', backend='bokeh'
line_width=6, color='black', backend='bokeh'
)
vals = np.arange(stages)
active = [1 if v == self._stage else 0 for v in vals]
points = hv.Points((vals, np.zeros(stages), active), vdims=['active']).options(
color_index='active', line_color='black', cmap={0: 'white', 1: 'gray'},
color_index='active', line_color='black', cmap={0: 'white', 1: '#5cb85c'},
show_legend=False, size=20, default_tools=[], tools=['tap'],
nonselection_alpha=1, backend='bokeh'
)
Expand Down

0 comments on commit 85176e9

Please sign in to comment.