Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Pipeline subway map styling #343

Merged
merged 1 commit into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
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
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