<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Jupyter Blog - Voilà</title><link href="https://jasongrout.github.io/medium-archive/pelican/" rel="alternate"/><link href="https://jasongrout.github.io/medium-archive/pelican/feeds/tag-voila.atom.xml" rel="self"/><id>https://jasongrout.github.io/medium-archive/pelican/</id><updated>2023-09-25T14:54:00+00:00</updated><subtitle>The Project Jupyter blog: news, releases, and community stories, archived from blog.jupyter.org.</subtitle><entry><title>Voilà 0.5.0 : Homecoming</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2023/voila-0-5-0-homecoming/" rel="alternate"/><published>2023-09-25T14:54:00+00:00</published><updated>2023-09-25T14:54:00+00:00</updated><author><name>Duc Trung Le</name></author><id>tag:jasongrout.github.io,2023-09-25:/medium-archive/pelican/posts/2023/voila-0-5-0-homecoming/</id><summary type="html">&lt;p&gt;Voila 0.5.0 is here!&lt;/p&gt;
</summary><content type="html">&lt;h2 id="voila-050-homecoming"&gt;Voilà &lt;strong&gt;0.5.0:&lt;/strong&gt; Homecoming&lt;/h2&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/voila-0-5-0-homecoming/images/001-1_Oqkkz64NWqTFoS45sfprGQ.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Voilà&lt;/strong&gt;&lt;/em&gt; turns Jupyter notebooks into standalone web applications and dashboards. It provides a simple way for Jupyter users to share their work. For a detailed introduction to Jupyter’s Voilà subproject, you can check out this earlier &lt;a href="/posts/2019/and-voila/"&gt;blog post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Up until the previous version, Voilà relied on custom JavaScript code to load extension assets and handle kernel connection. However, this approach had drawbacks since it only supported the now outdated Jupyter Notebook 6 extensions.&lt;/p&gt;
&lt;p&gt;Following the launch of &lt;a href="/posts/2023/announcing-jupyter-notebook-7/"&gt;Jupyter Notebook 7&lt;/a&gt;, it is now Voilà’s turn to join the JupyterLab family. In Version 0.5.0, the front-end of Voilà has been rebuilt from scratch using JupyterLab 4.0 components, just like in the case of Notebook 7. A JupyterLab plugin-based application replaces the current custom extension loader approach. This transition enables Voilà to leverage all the latest features and enhancements available upstream.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="new-features-in-voila-050"&gt;New features in Voilà 0.5.0&lt;/h2&gt;
&lt;h3 id="extension-loading-system"&gt;Extension loading system&lt;/h3&gt;
&lt;p&gt;As of Version 0.5.0, Voilà uses the same prebuilt extension system as JupyterLab. The extension assets are loaded from local paths rather than relying on a CDN, resulting in a significant enhancement to Voilà’s extension compatibility with the rest of the JupyterLab ecosystem. This change also avoids making requests for external services. Additionally, users can now develop extensions for Voilà using the same approach as for JupyterLab extensions.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="A Voila dashboard with top bar extension and custom JupyterLab theme." src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/voila-0-5-0-homecoming/images/002-1_W1dHdjWC0CYoLjCWXXxU2w.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;A Voila dashboard with &lt;a href="https://github.com/voila-dashboards/voila-topbar"&gt;top bar extension&lt;/a&gt; and &lt;a href="https://github.com/timkpaine/jupyterlab_miami_nights"&gt;custom JupyterLab theme&lt;/a&gt;.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id="mimetype-rendering-mechanism"&gt;Mimetype rendering mechanism&lt;/h3&gt;
&lt;p&gt;In 0.5.0, the logic for rendering cell outputs containing mimetypes has been revised, moving away from relying on &lt;code&gt;nbconvert&lt;/code&gt; and instead depending on JupyterLab mimetype renderers. This change adds support for a wide range of custom JupyterLab renderers such as &lt;code&gt;jupyterlab-fasta&lt;/code&gt;, &lt;code&gt;vega&lt;/code&gt;, &lt;code&gt;jupyterlab-geojson&lt;/code&gt;, etc.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Rendering mimetypes data in Voila" src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/voila-0-5-0-homecoming/images/003-1_WWRmwTs5v_U8HL27JzY7Uw.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Rendering mimetypes data in Voila&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id="new-tree-page"&gt;New tree page&lt;/h3&gt;
&lt;p&gt;The default tree page in Voilà has transitioned into a JupyterLab-based application incorporating the file browser widget. While the Jinja-based tree page remains available, users must opt for it using either the &lt;code&gt;--classic-tree&lt;/code&gt; CLI option or by appending &lt;code&gt;?classic-tree=True&lt;/code&gt;to the query string.&lt;/p&gt;
&lt;p&gt;The new tree page in Voilà supports JupyterLab custom themes, whereas the classic tree page is limited to light and dark themes.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="New tree page with a custom theme." src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/voila-0-5-0-homecoming/images/004-1_Yp5wC6yCRbCNejKtKZV8Ww.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;New tree page with a &lt;a href="https://github.com/martinRenou/jupyterlab-night"&gt;custom theme&lt;/a&gt;.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id="token-based-authentication-system"&gt;Token-based authentication system&lt;/h3&gt;
&lt;p&gt;Depending on the identity provider of &lt;code&gt;jupyter-server&lt;/code&gt; 2, Voilà now supports token authentication but is disabled by default.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To start Voilà with auto-generated token:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;voila&lt;span class="w"&gt; &lt;/span&gt;--token&lt;span class="w"&gt; &lt;/span&gt;...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;To start Voilà with a personalized token:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;voila&lt;span class="w"&gt; &lt;/span&gt;--token&lt;span class="o"&gt;=&lt;/span&gt;my-secret-token&lt;span class="w"&gt; &lt;/span&gt;...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;hr&gt;
&lt;h2 id="installing-voila"&gt;Installing Voilà&lt;/h2&gt;
&lt;p&gt;Voila is available on both &lt;code&gt;PyPI&lt;/code&gt; and &lt;code&gt;conda-forge&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# Install with pip&lt;/span&gt;
pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;voila

&lt;span class="c1"&gt;# Install with mamba&lt;/span&gt;
mamba&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;-c&lt;span class="w"&gt; &lt;/span&gt;conda-forge&lt;span class="w"&gt; &lt;/span&gt;voila
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can try Voilà online using &lt;a href="https://voila-dashboards-voila-huggingface.hf.space/"&gt;this link&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;The contributions to Voilà by &lt;a href="https://github.com/QuantStack"&gt;&lt;strong&gt;QuantStack&lt;/strong&gt;&lt;/a&gt; are supported by &lt;a href="http://www.techatbloomberg.com/"&gt;&lt;strong&gt;Bloomberg&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="about-the-contributors"&gt;About the Contributors&lt;/h2&gt;
&lt;p&gt;Voilà is an official Jupyter subproject, it has resulted from the collective efforts of &lt;a href="https://github.com/voila-dashboards/voila/graphs/contributors"&gt;numerous contributors&lt;/a&gt;. Below, we highlight the primary contributors for this release:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/voila-0-5-0-homecoming/images/005-0_x5BSQzmN_DVAFLc5.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/jtpio"&gt;&lt;strong&gt;Jeremy Tuloup&lt;/strong&gt;&lt;/a&gt; is a Technical Director at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt; and a Jupyter Distinguished Contributor. Maintainer and contributor of JupyterLab, Jupyter Notebook, JupyterLite, Voilà, and projects within the Jupyter ecosystem.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/voila-0-5-0-homecoming/images/006-0_jOsGiBpJ5Qt2t15C.jpg" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/martinRenou"&gt;&lt;strong&gt;Martin Renou&lt;/strong&gt;&lt;/a&gt; is a Project Director at &lt;a href="https://quantstack.net/"&gt;QuantStack&lt;/a&gt; and a Jupyter Distinguished Contributor. Martin works on a variety of projects, from &lt;a href="https://github.com/QuantStack/xtensor"&gt;xtensor&lt;/a&gt; and &lt;a href="https://github.com/QuantStack/xeus-python/"&gt;xeus-python&lt;/a&gt; in C++ to &lt;a href="https://github.com/jupyter-widgets/ipywidgets"&gt;ipywidgets&lt;/a&gt;, &lt;a href="https://github.com/jupyter-widgets/ipyleaflet"&gt;ipyleaflet&lt;/a&gt; and &lt;a href="https://github.com/bqplot/bqplot"&gt;bqplot&lt;/a&gt; in Python and TypeScript.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/voila-0-5-0-homecoming/images/007-1_uSLpGo9pf1l4HIaxPFYysg.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/trungleduc"&gt;&lt;strong&gt;Le Duc Trung&lt;/strong&gt;&lt;/a&gt; is a Scientific Software Developer at QuantStack. He works on several projects within the Jupyter ecosystem, from the main projects like JupyterLab, Voilà, and ipywidgets to various JupyterLab extensions and widgets.&lt;/p&gt;
</content><category term="dashboards"/><category term="Voilà"/></entry><entry><title>Need for Speed: Voilà edition</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2021/need-for-speed-voila-edition/" rel="alternate"/><published>2021-12-10T14:52:00+00:00</published><updated>2021-12-10T14:52:00+00:00</updated><author><name>Duc Trung Le</name></author><id>tag:jasongrout.github.io,2021-12-10:/medium-archive/pelican/posts/2021/need-for-speed-voila-edition/</id><summary type="html">&lt;p&gt;TL;DR: Voilà 0.3.0 is now available!&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/need-for-speed-voila-edition/images/001-1_gSWxQGu60SG5DdH8MIzCjw.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/posts/2019/and-voila/"&gt;Voilà&lt;/a&gt; turns Jupyter notebooks into standalone applications without requiring any modification to the content. You want to share your content with non-technical readers? Just call Voilà with the notebook to turn it into a deployable web application. The simplicity of Voilà comes at a cost: &lt;em&gt;the page load&lt;/em&gt; &lt;em&gt;time.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We set ourselves to fix this Achilles’ heel while preserving the ease-of-use of Voilà. Today we are pleased to announce the release of Voilà 0.3.0, with a focus on performance.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="motivation"&gt;Motivation&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Page load time has a critical impact on user experience of a website.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;According to &lt;a href="https://blog.kissmetrics.com/wp-content/uploads/2011/04/loading-time.pdf"&gt;Kissmetrics&lt;/a&gt;, nearly half of web users expect a site to load in 2 seconds or less, and they tend to abandon a site that is not loaded within 3 seconds.&lt;/p&gt;
&lt;p&gt;In the case of Voilà, a simple dashboard takes around one second to render and more complicated dashboards (involving libraries import, data fetching, and widgets) can easily push users out of their comfort zone. Several efforts have been made to improve the situation, from adding an execution progress indicator to enhancing the rendering technique. The load time of a medium-to-high complexity notebook has not been cut down to a desirable range yet. That is why in the 0.3.0 version, we aimed at addressing the main bottleneck of Voilà: &lt;em&gt;the execution of notebook&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id="preheated-kernels"&gt;Preheated kernels&lt;/h2&gt;
&lt;p&gt;Based upon an excellent idea of the &lt;a href="https://github.com/voila-dashboards/hotpot_km"&gt;hotpot_km&lt;/a&gt; project about the pooling hot-loaded Jupyter kernels, we implemented a new solution called “preheated kernels” to diminish the waiting time for starting a new python kernel and for executing the requested notebook.&lt;/p&gt;
&lt;p&gt;Preheated kernels can be activated just by setting the&lt;code&gt;preheat_kernel&lt;/code&gt; option to &lt;code&gt;True&lt;/code&gt;in the Voilà command line or configuration file. For example, this command will activate preheated kernels feature for the &lt;code&gt;voila.ipynb&lt;/code&gt; notebook with a pool of five kernels:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;voila voila.ipynb --preheat_kernel=True --pool_size=5
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;figure&gt;
&lt;img alt="Speed comparison between Voila 0.3.0 and 0.2.x" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/need-for-speed-voila-edition/images/002-1_djVMI5ujhEq6xVbYJNzuuA.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Speed comparison between Voilà 0.3.0 with preheated kernel and 0.2.16&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Behind the scene, the two following actions are performed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For each notebook, a queue of kernels is created and the notebook is executed in every kernel. When a new client requests a kernel, the oldest preheated kernel of the pool is used and another kernel is started asynchronously to refill the pool.&lt;/li&gt;
&lt;li&gt;The rendered HTML for the notebook is produced in advance for each preheated kernel and directly served to the client upon connection.&lt;/li&gt;
&lt;li&gt;If the kernel pool is empty, Voilà will fall back to starting a new kernel and render the notebook as usual. The advanced configurations of preheated kernels are detailed in &lt;a href="https://voila.readthedocs.io/en/latest/customize.html#preheated-kernels"&gt;Voilà’s official documentation&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="partially-pre-render-notebook"&gt;Partially pre-render notebook&lt;/h2&gt;
&lt;p&gt;To benefit from the acceleration of preheated kernels mode, the notebooks need to be pre-rendered before users connect to Voilà. But in many real-world applications, the notebook requires user-specific data, which makes pre-rendering impossible. To overcome this limit, Voilà offers a feature to handle the most used method for providing user data: the URL query string.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="In preheated kernels mode, Voilà executed the first 4 cells before waiting for the query string from the user." src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/need-for-speed-voila-edition/images/003-1_Gwq82pb0qAInlPUJm_-JYA.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;In preheated kernels mode, Voilà executed the first 4 cells before waiting for the query string from the user.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;In normal mode, Voilà users can get the query string at run time through the &lt;code&gt;QUERY_STRING&lt;/code&gt; environment variable:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;os&lt;/span&gt;
&lt;span class="n"&gt;query_string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;QUERY_STRING&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In preheated kernels mode, users can simply replace the &lt;code&gt;os.getenv&lt;/code&gt; call with the helper &lt;code&gt;get_query_string&lt;/code&gt; from &lt;code&gt;voila.utils&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;voila.utils&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;get_query_string&lt;/span&gt;
&lt;span class="n"&gt;query_string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;get_query_string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;code&gt;get_query_string&lt;/code&gt; will pause the execution of the notebook by the preheated kernel at this cell and wait for an actual user to connect to Voilà, then &lt;code&gt;get_query_string&lt;/code&gt; will return the URL query string and continue the execution of the remaining cells.&lt;/p&gt;
&lt;p&gt;To maximize the benefits of preheated kernels, the user-independent cells should be placed before the &lt;code&gt;get_query_string&lt;/code&gt;call.&lt;/p&gt;
&lt;h2 id="whats-next"&gt;What’s next?&lt;/h2&gt;
&lt;p&gt;There is more in the works to improve Voilà’s performances. Beyond kernel hot pooling, we will improve the performance of rendering Jupyter widgets in the front-end. Several of these improvements will be enabled with the upcoming 8.0 release of ipywidgets, and more optimizations are in the works.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;We would like to thank &lt;a href="https://github.com/vidartf"&gt;Vidar Tonaas Fauske&lt;/a&gt; and &lt;a href="https://github.com/maartenbreddels"&gt;Maarten Breddels&lt;/a&gt; for the prior art on the &lt;a href="https://github.com/voila-dashboards/hotpot_km"&gt;hotpot_km&lt;/a&gt; project, which was an inspiration for this work in core Voilà.&lt;/p&gt;
&lt;h2 id="about-the-author"&gt;About the author&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/trungleduc"&gt;Duc Trung Le&lt;/a&gt; is a Scientific Software Developer at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt;. He works on several projects within the Jupyter ecosystem, from the main projects like JupyterLab, Voilà, ipywidgets to Jupyter extensions and widgets.&lt;/p&gt;
</content><category term="dashboards"/><category term="Voilà"/></entry><entry><title>Looking at notebooks from a new perspective</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2021/looking-at-notebooks-from-a-new-perspective/" rel="alternate"/><published>2021-10-05T08:33:00+00:00</published><updated>2021-10-05T09:48:00+00:00</updated><author><name>Mariana Meireles</name></author><id>tag:jasongrout.github.io,2021-10-05:/medium-archive/pelican/posts/2021/looking-at-notebooks-from-a-new-perspective/</id><summary type="html">&lt;p&gt;How to better communicate with Jupyter notebooks&lt;/p&gt;
</summary><content type="html">&lt;figure&gt;
&lt;img alt="Illustration by Juliette Taka" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/looking-at-notebooks-from-a-new-perspective/images/001-1_g3OWLubcUFgVIGBfPYztJQ.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Illustration by &lt;a href="http://juliettetaka.com"&gt;Juliette Taka&lt;/a&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Jupyter notebooks are a great tool for practitioners of scientific computing from the research phase of their work to the communication of their results. The interleaving of code and rich text makes notebooks an ideal tool to communicate the complex ideas underlying computational concepts. However, depending on the context, we might want to look at the same source material (the notebook document) with different glasses, to present the content as a slideshow, or to audiences who are not comfortable with code.&lt;/p&gt;
&lt;p&gt;One may also want to provide statically-rendered content rather than a fully-fledged executable notebook for security reasons. For each context, we should be able to adapt the notebook’s aesthetics and behavior to our needs.&lt;/p&gt;
&lt;p&gt;Fortunately, the Jupyter ecosystem offers a broad range of tools to give a new face to notebooks and adjust them to one’s needs.&lt;/p&gt;
&lt;h2 id="panoramic-view-of-visualization-tools-on-the-jupyter-ecosystem"&gt;Panoramic view of visualization tools on the Jupyter ecosystem&lt;/h2&gt;
&lt;p&gt;The two main tools in the Jupyter ecosystem for rendering notebooks in a customized fashion are &lt;strong&gt;nbconvert&lt;/strong&gt; and &lt;strong&gt;Voilà&lt;/strong&gt;. In this post, we go over the differences and similarities between these two tools.&lt;/p&gt;
&lt;p&gt;nbconvert and Voilà have the same conversion process, the main difference lies in the outcome generated by each tool. While nbconvert outputs static, non-interactive documents, Voilà converts your notebook to a fully interactive application and the way it achieves that is by keeping a Jupyter kernel active at all times.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Simplified scheme of nbconvert and Voilà’s internals" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/looking-at-notebooks-from-a-new-perspective/images/002-1_zvARwLB6MAyyb4Q_K4Gx3w.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Simplified scheme of nbconvert and Voilà’s internals&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Whichever is the format you chose to generate your notebook, end-users won’t be able to execute arbitrary code, providing a secure way of sharing your results with others.&lt;/p&gt;
&lt;h3 id="nbconvert"&gt;&lt;strong&gt;nbconvert&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/jupyter/nbconvert"&gt;Nbconvert&lt;/a&gt; converts notebooks to various other formats via &lt;a href="http://jinja.pocoo.org/"&gt;Jinja&lt;/a&gt; templates. It allows you to convert a &lt;code&gt;.ipynb&lt;/code&gt; notebook file into various static formats:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;HTML&lt;/li&gt;
&lt;li&gt;LaTeX&lt;/li&gt;
&lt;li&gt;PDF&lt;/li&gt;
&lt;li&gt;Markdown document&lt;/li&gt;
&lt;li&gt;ReStructured Text&lt;/li&gt;
&lt;li&gt;Executable Script&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;nbconvert is a very versatile tool and can be used not only with the purpose of sharing your code and/or results with peers but also to create tests instances for your Jupyter notebooks and even generate blog posts. You can find more information about its possibilities in the &lt;a href="https://nbconvert.readthedocs.io"&gt;docs&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="voila"&gt;&lt;strong&gt;Voilà&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/voila-dashboards/voila"&gt;Voilà&lt;/a&gt; brings the versatility of nbconvert while allowing you to interact with your code outputs safely both in the Notebook and Lab interface.&lt;/p&gt;
&lt;p&gt;As pointed out before, Voilà keeps a Jupyter kernel instance running at all times. It is language-agnostic and it will run any language supported by Jupyter. Furthermore, as it encapsulates nbconvert, Voilà is capable of converting the notebook to any of its output formats as well as make use of all of the templates that come with nbconvert.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Rendering interactive Matplotlib figures in a web application with Voilà. Source." src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/looking-at-notebooks-from-a-new-perspective/images/003-0_OtsvahHJvfEvcziO.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Rendering interactive Matplotlib figures in a web application with Voilà. &lt;a href="/posts/2019/and-voila/"&gt;Source&lt;/a&gt;.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;You will notice that Voilà expands on the default templates: from simple one-page documents to complex grid-based dashboards and slideshows.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Grid template generated by Voilà" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/looking-at-notebooks-from-a-new-perspective/images/004-1_Fh9khuZcEG98Fz1F-AZ83A.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Grid template generated by Voilà&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="slideshows-with-jupyter"&gt;Slideshows with Jupyter&lt;/h2&gt;
&lt;p&gt;A common use case is to share the results as a slideshow. Let’s look at the different ways to do so.&lt;/p&gt;
&lt;p&gt;The first step to set up your slideshow is to define the mapping between cells and slides. This mapping is saved in the cell metadata of the notebook, and JupyterLab has the appropriate built-in tool to edit this information.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Different kinds of metadata that can be added to a cell on JupyterLab" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/looking-at-notebooks-from-a-new-perspective/images/005-1_7psFVJ14ekqdgi7n3ZwS-Q.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Different kinds of metadata that can be added to a cell on JupyterLab&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The classic notebook offers a similar interface to edit the notebook metadata. Then, to visualize the resulting slideshow, several tools are available:&lt;/p&gt;
&lt;h3 id="rise"&gt;RISE&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/damianavila/RISE"&gt;RISE&lt;/a&gt; is a classic notebook extension that provides a toolbar button to turn the notebook into a slideshow in the main notebook UI.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="RISE from the notebook to slides. Source." src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/looking-at-notebooks-from-a-new-perspective/images/006-0_eDvRenHayEmKFjfN.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;RISE from the notebook to slides. &lt;a href="https://github.com/damianavila/RISE"&gt;Source&lt;/a&gt;.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Unlike the other solutions presented here, RISE slideshows are still executable in the same way as the notebook, which can be a great feature when teaching a class. However, RISE may not be an appropriate tool to share such a slideshow online because it requires giving access to a notebook server.&lt;/p&gt;
&lt;p&gt;Unfortunately, despite the &lt;a href="https://github.com/damianavila/RISE/pull/381"&gt;effort&lt;/a&gt; of the community RISE still doesn’t offer support for JupyterLab.&lt;/p&gt;
&lt;h3 id="nbconvert-1"&gt;&lt;strong&gt;nbconvert&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Another solution is to use the &lt;strong&gt;Reveal&lt;/strong&gt; template of nbconvert, which will use the same cell metadata as RISE to produce a static slideshow.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;nbconvert presentation.ipynb --to html --template reveal
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Unlike with RISE, for which cells remain executable, the outcome of nbconvert is a static HTML file, and only the already-computed outputs will be displayed.&lt;/p&gt;
&lt;h3 id="voila-1"&gt;Voilà&lt;/h3&gt;
&lt;p&gt;Just like with nbconvert, the Reveal template can be used with Voilà with the &lt;strong&gt;&lt;code&gt;--template reveal&lt;/code&gt;&lt;/strong&gt; command-line argument.&lt;/p&gt;
&lt;p&gt;Using Voilà instead of nbconvert will spawn a kernel for each connected user, enabling the use of interactive widgets in the resulting slideshow to interact with the backend.&lt;/p&gt;
&lt;p&gt;Besides, the default behavior of Voilà is to hide input cells and only display markdown cells and output.&lt;/p&gt;
&lt;h3 id="whats-new-dejavu"&gt;What’s new: Déjàvu!&lt;/h3&gt;
&lt;p&gt;Déjàvu is a new utility included in nbconvert 6.2, which simply specifies new default values for several options so as to mimick Voilà’s behavior with respect to hiding input cells and prompt numbers. However, these defaults can still be overwritten by the end-user. You can do it just like you would if you were using nbconvert.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;jupyter dejavu notebook.ipynb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;figure&gt;
&lt;img alt="Déjàvu output (on the left) and Voilà output (on the right)" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/looking-at-notebooks-from-a-new-perspective/images/007-1_DqBf2bE3M7ynUy-Kv0qIbA.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Déjàvu output (on the left) and Voilà output (on the right)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Voilà and Déjàvu’s outputs are identical, although, in the case of Déjàvu, interactions with widgets that require a roundtrip to the kernel will not work. In contrast, we can see the result of the calculation on the Voilà side.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To summarize and wrap up:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Déjàvu supports all of the templates available in Voilà, and even though users don’t have access to interactivity they can still benefit from widgets outputs since they’ll be generated and included on the final file;&lt;/li&gt;
&lt;li&gt;When building a slideshow you can use JupyterLab’s interface to define specific metadata to your cells;&lt;/li&gt;
&lt;li&gt;You can also see your code in Déjàvu’s outputs. Just pass the &lt;code&gt;--show-input&lt;/code&gt; option to the command line.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;Thanks to &lt;a href="http://juliettetaka.com"&gt;Juliette Taka&lt;/a&gt; for creating the illustrations for this blog post.&lt;/p&gt;
&lt;h2 id="about-the-author"&gt;About the author&lt;/h2&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/looking-at-notebooks-from-a-new-perspective/images/008-1_xbhgaimjN9YclTKtIQojGQ.jpg" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;My name is &lt;a href="https://twitter.com/mari_meir"&gt;Mariana Meireles&lt;/a&gt;, I’m a software engineer working for &lt;a href="http://quantstack.net/"&gt;QuantStack&lt;/a&gt;. I care deeply about the impacts that technology has in the world and try my best to be the change I want to see by contributing to open source projects that stand upon libre and diverse standards.&lt;br&gt;
I’m currently focusing on the Jupyter ecosystem and advocating for open science and open knowledge whenever I can.&lt;/p&gt;
</content><category term="visualization"/><category term="Voilà"/></entry><entry><title>Voilà is now a Jupyter subproject</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2019/voila-is-now-an-official-jupyter-subproject/" rel="alternate"/><published>2019-12-29T12:11:00+00:00</published><updated>2019-12-29T12:15:00+00:00</updated><author><name>Sylvain Corlay</name></author><id>tag:jasongrout.github.io,2019-12-29:/medium-archive/pelican/posts/2019/voila-is-now-an-official-jupyter-subproject/</id><summary type="html">&lt;p&gt;It is a great pleasure to announce that the Voilà project has been incorporated as a Jupyter subproject. Voilà will now be subject to the…&lt;/p&gt;
</summary><content type="html">&lt;blockquote&gt;
&lt;p&gt;It is a great pleasure to announce that the Voilà project has been incorporated as a Jupyter subproject. Voilà will now be subject to the &lt;a href="https://github.com/jupyter/governance/blob/master/governance.md"&gt;Jupyter governance&lt;/a&gt; and &lt;a href="https://github.com/jupyter/governance/blob/master/conduct/code_of_conduct.md"&gt;code of conduct&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For reference, the Jupyter Enhancement Proposal (JEP) for the Voilà incorporation is available &lt;a href="https://github.com/jupyter/enhancement-proposals/pull/42"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="what-is-voila"&gt;What is Voilà?&lt;/h3&gt;
&lt;p&gt;Voilà helps you communicate insights, by transforming a Jupyter Notebook into a stand-alone web application you can share. It gives you control over what your readers experience in a secure and customizable interactive dashboard.&lt;/p&gt;
&lt;p&gt;The easiest way to get started with Voilà is to install it via &lt;code&gt;pip&lt;/code&gt; or &lt;code&gt;conda&lt;/code&gt; and type &lt;code&gt;voila some_notebook.ipynb&lt;/code&gt; to turn the said notebook into a dashboard.&lt;/p&gt;
&lt;p&gt;Besides, Voilà includes a templating system that allows to overload the behavior of the front-end. Using this templating system, Voilà can be used to create&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;slideshows (with voila-reveal)&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;
&lt;img alt="A Voilà slideshow created with the voila-reveal template." src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/voila-is-now-an-official-jupyter-subproject/images/001-1_mp59BtUkz046smQek2-BFA.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;A Voilà slideshow created with the voila-reveal template.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;ul&gt;
&lt;li&gt;dashboards (with voila-gridstack)&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;
&lt;img alt="A Voilà Dashboard based on the voila-gridstack template." src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/voila-is-now-an-official-jupyter-subproject/images/002-1_P447LmtfAnhIcCol6q6FBw.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;A Voilà Dashboard based on the voila-gridstack template.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id="why-moving-voila-under-the-jupyter-governance"&gt;Why moving Voilà under the Jupyter governance?&lt;/h3&gt;
&lt;p&gt;While the project was initially started by QuantStack, the team now comprises developers from Bloomberg, UC Berkeley, JP Morgan, and Cal Poly San Luis Obispo. OVH has been supportive of the project by kindly providing the free hosting of the gallery on their infrastructure.&lt;/p&gt;
&lt;p&gt;We believe that the &lt;em&gt;&lt;strong&gt;multi-stakeholder&lt;/strong&gt;&lt;/em&gt; nature of the Voilà project is well-suited for the Jupyter organization.&lt;/p&gt;
&lt;p&gt;The Voilà project is largely built upon Jupyter subprojects and standards.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The standard &lt;strong&gt;notebook file format&lt;/strong&gt; is the main entry point to Voilà.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;nbconvert&lt;/strong&gt; is used for the conversion to progressively-rendered HTML.&lt;/li&gt;
&lt;li&gt;naturally, we use &lt;strong&gt;jupyter_client&lt;/strong&gt; for handling the execution of notebook cells&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;jupyter_server&lt;/strong&gt; is the default back-end.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JupyterHub&lt;/strong&gt; is at the foundation of the voila-gallery project.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JupyterLab&lt;/strong&gt; components (mime renderers, input and output areas) are used in the front-end implementation. Voilà also includes a preview JupyterLab extension.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ipywidgets&lt;/strong&gt; and custom jupyter widget libraries such as bqplot, ipyvolume, ipyleaflets provide the bulk of the interactivity of Voilà applications.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Voilà is more a &lt;em&gt;remix&lt;/em&gt; of existing Jupyter components (with changes to enable that use case) than a completely new application.&lt;/p&gt;
&lt;h3 id="resources"&gt;Resources&lt;/h3&gt;
&lt;p&gt;Should you be interested in Voilà, feel free to try it on Binder or locally! You can also engage with the developer community during our public team meetings and the various GitHub repositories of the project:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the Voilà &lt;strong&gt;GitHub repository&lt;/strong&gt; is available here: &lt;a href="https://github.com/voila-dashboards/voila"&gt;https://github.com/voila-dashboards/voila&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;Documentation&lt;/strong&gt; is hosted on &lt;em&gt;Read the Docs&lt;/em&gt;: &lt;a href="https://voila.readthedocs.io"&gt;https://voila.readthedocs.io&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;Team Compass&lt;/strong&gt; holds the calendar for the public developer meetings, as well as the meeting minutes: &lt;a href="https://voila-dashboards.github.io"&gt;https://voila-dashboards.github.io&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;Announcement&lt;/strong&gt; of the first Voilà release was published on this blog: &lt;a href="/posts/2019/and-voila/"&gt;https://blog.jupyter.org/and-voilà-f6a2c08a4a93&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="acknowledgements"&gt;&lt;strong&gt;Acknowledgements&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Voilà was started by the team of open-source developers at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt; as a separate project, but with the full intent to incorporate it into Jupyter. The initial project development at QuantStack was funded by &lt;a href="https://twitter.com/techatbloomberg"&gt;Bloomberg&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Now, Voilà contributors work in many institutions, including UC Berkeley, Cal Poly San Luis Obispo, JP Morgan, and Faculty (formerly ASI Data Science).&lt;/li&gt;
&lt;li&gt;The Voilà Gallery is kindly hosted by &lt;a href="https://www.ovh.com/"&gt;OVH&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/voila-is-now-an-official-jupyter-subproject/images/003-1_ZrMs1GjNdEYhsbqese6xVA.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
</content><category term="dashboards"/><category term="visualization"/><category term="Voilà"/></entry><entry><title>Configure your dashboards with Voilà gridstack template</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2019/voila-gridstack-template/" rel="alternate"/><published>2019-11-11T14:03:00+00:00</published><updated>2019-11-11T14:03:00+00:00</updated><author><name>Bartosz Telenczuk</name></author><id>tag:jasongrout.github.io,2019-11-11:/medium-archive/pelican/posts/2019/voila-gridstack-template/</id><summary type="html">&lt;p&gt;The new Voilà gridstack template simplifies creating dynamic and flexible dashboard layouts.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Voilà is a new dashboarding solution from Jupyter ecosystem. It provides an easy-to-use tool to convert your Jupyter notebooks into standalone web applications. If you have not used it before, you can learn more about Voilà from this &lt;a href="/posts/2019/and-voila/"&gt;blog post.&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="and-voila-the-dashboard-templates"&gt;And voilà… the dashboard templates&lt;/h3&gt;
&lt;p&gt;To create interactive and engaging dashboards, you can add &lt;a href="https://github.com/bloomberg/bqplot"&gt;graphs&lt;/a&gt;, &lt;a href="https://github.com/jupyter-widgets/ipywidgets"&gt;interactive widgets&lt;/a&gt;, &lt;a href="https://github.com/jupyter-widgets/ipyleaflet"&gt;maps&lt;/a&gt; etc. to your notebook. Voilà will turn them into interactive applications by stripping any code and displaying the outputs in the order they appear in the notebook. If you need more flexibility over the position of the cell outputs, you can use one of the &lt;a href="/posts/2019/introducing-templates-for-jupyter-widget-layouts/"&gt;widget layout templates&lt;/a&gt; defined in the ipywidgets library. If this is not enough, with Voilà you can even turn your notebooks into &lt;a href="/posts/2019/a-slideshow-template-for-voila-apps/"&gt;interactive presentations.&lt;/a&gt; Would you also like to re-configure your dashboards the drag-and-drop way? Et voilà, the gridstack template.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/voila-gridstack-template/images/001-1_Pl6z5oPeFixFjxMEYzEpIA.mp4" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;h3 id="creating-ad-hoc-dashboards-with-gridstack"&gt;Creating ad-hoc dashboards with gridstack&lt;/h3&gt;
&lt;p&gt;If you have never used layout templates and just want to use Voilà with your existing notebooks, you can consider the new &lt;a href="https://github.com/voila-dashboards/voila-gridstack"&gt;gridstack template&lt;/a&gt; for Voilà dashboards. Simply run the following command with the path to your notebook:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;voila --template=gridstack my_notebook.ipynb --VoilaConfiguration.resources=&amp;#39;{“gridstack”: {“show_handles”: True}}&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will open a dashboard created from your notebook in a brower. By default the output cells of the notebook are laid out vertically. But you can move and resize them freely by dragging one of the handles in the corners of the cells.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="An example notebook rendered with Voilà gridstack template. The layout was configured by dragging and resizing the cells of the notebook. The notebook was downloaded from LIGO project:" src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/voila-gridstack-template/images/002-1_J_f7YGDoufB7bBw_Ik7HuA.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;An example notebook rendered with Voilà gridstack template. The layout was configured by dragging and resizing the cells of the notebook. The notebook was downloaded from LIGO project: &lt;a href="https://github.com/losc-tutorial/Data_Guide"&gt;https://github.com/losc-tutorial/Data_Guide&lt;/a&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id="positioning-widgets-with-metadata"&gt;Positioning widgets with metadata&lt;/h3&gt;
&lt;p&gt;When you are done with configuring your dashboard, Voilà enables you to persist it and a create static layout of the widgets. To achieve that you will need to edit manually the notebook metadata, but we are also planning to release a tool that will simplify the process.&lt;/p&gt;
&lt;p&gt;For example, you can add the following attributes to one of the cells (to edit the cell metadata, you need to activate the “Edit metadata” button from the View -&amp;gt; Cell toolbar menu of your notebook):&lt;/p&gt;
&lt;figure&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;extensions&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;jupyter_dashboards&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;version&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;views&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;grid_default&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;col&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;height&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;hidden&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;row&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;width&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;report_default&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;trusted&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;Example metadata&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;In Jupyter lab ≥ 1.0 you can edit the metadata using “Advanced Tools” section of “Notebook tools” sidebar (wrench icon).&lt;/p&gt;
&lt;p&gt;Then you can start Voilà with the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;voila --template=gridstack my_notebook.ipynb&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This should open your dashboard with cells in the specified positions and of specified sizes.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Final layout of the dashboard configured with cell metadata. The cells are not movable in this dashboard." src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/voila-gridstack-template/images/003-1_-mUCyFUfu2JxnuzTMK0aNg.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Final layout of the dashboard configured with cell metadata. The cells are not movable in this dashboard.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id="supporting-legacy-notebooks"&gt;Supporting legacy notebooks&lt;/h3&gt;
&lt;p&gt;The metadata follow the &lt;a href="https://jupyter-dashboards-layout.readthedocs.io/en/latest/metadata.html"&gt;specification&lt;/a&gt; of the legacy &lt;em&gt;jupyter-dashboards&lt;/em&gt; project, which was an earlier solution for creating interactive dashboards. Unfortunately, the project is not maintained any more and it won’t work with the recent installations of Jupyter. However, you can open your notebooks created with &lt;em&gt;jupyter-dashboards&lt;/em&gt; &lt;strong&gt;without changes&lt;/strong&gt; with Voilà gridstack template to achieve identical rendering and give a second life to your Jupyter dashboards.&lt;/p&gt;
&lt;p&gt;(To compare the outputs, you can open the notebook with &lt;a href="https://mybinder.org/v2/gh/btel/jupyter-dashboards-binder/master"&gt;binder&lt;/a&gt; that provisions the &lt;em&gt;jupyter-dashboards&lt;/em&gt; ecosystem installed in an old version of Anaconda (2017). You can also use its design tool to lay out your widgets visually and save the cell metadata usable with Voilà gridstack template).&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Design tool implemented in legacy jupyter-dashboards project." src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/voila-gridstack-template/images/004-1_NNMhrJSc49KE-AF5HoFGTw.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Design tool implemented in legacy jupyter-dashboards project.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id="how-to-install"&gt;How to install&lt;/h3&gt;
&lt;p&gt;If you want to try out the template yourself, please install it now with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;pip install voila-gridstack&lt;/code&gt; (for pip users) or&lt;/p&gt;
&lt;p&gt;&lt;code&gt;conda install voila-gridstack&lt;/code&gt; (for conda/anaconda users).&lt;/p&gt;
&lt;p&gt;You can also try out the interactive examples with our &lt;a href="https://mybinder.org/v2/gh/voila-dashboards/voila-gridstack/master?urlpath=/voila/tree/examples"&gt;gridstack binder&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And if you have any questions or want to share your experience please reach out on our &lt;a href="https://gitter.im/QuantStack/Lobby"&gt;Gitter chat.&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="credits"&gt;Credits&lt;/h3&gt;
&lt;p&gt;The development Voilà and gridstack template was initiated by the amazing team at &lt;a href="https://github.com/QuantStack"&gt;QuantStack&lt;/a&gt; that also provided financial and brain-power support.&lt;/p&gt;
&lt;h3 id="about-the-author"&gt;About the author&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://datascience.telenczuk.pl"&gt;Bartosz Telenczuk&lt;/a&gt; is a seasoned Python developer and a data scientist. He is an ardent user of Jupyter ecosystem and frequent contributor to open source software; among his projects is the &lt;a href="https://svgutils.readthedocs.io/en/latest/"&gt;svgutils&lt;/a&gt; library for composing SVG files in Python.&lt;/p&gt;
</content><category term="dashboards"/><category term="Voilà"/></entry><entry><title>A slideshow template for Voilà apps</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-slideshow-template-for-voila-apps/" rel="alternate"/><published>2019-10-29T10:32:00+00:00</published><updated>2019-10-29T14:11:00+00:00</updated><author><name>Marianne Corvellec</name></author><id>tag:jasongrout.github.io,2019-10-29:/medium-archive/pelican/posts/2019/a-slideshow-template-for-voila-apps/</id><summary type="html">&lt;p&gt;Voilà can now serve your interactive dashboards in a slideshow format.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Last June, QuantStack &lt;a href="/posts/2019/and-voila/"&gt;announced&lt;/a&gt; the first release of &lt;a href="https://github.com/voila-dashboards/voila"&gt;Voilà&lt;/a&gt;, a solution to turn Jupyter notebooks into &lt;em&gt;standalone web applications&lt;/em&gt;. Voilà enforces &lt;em&gt;security&lt;/em&gt; (preventing arbitrary code execution) while preserving &lt;em&gt;interactivity&lt;/em&gt; (supporting interactive widgets for Jupyter notebooks, including roundtrips to the kernel). A recent addition to the ever-teeming &lt;a href="https://jupyter.org"&gt;Jupyter&lt;/a&gt; ecosystem, Voilà is flexible, extensible, and language-agnostic (running any Jupyter kernel, such as Python, R, Julia, C++).&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Voilà logo." src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-slideshow-template-for-voila-apps/images/001-1_JLepfTuigc_h1Gfy768BWg.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;A dashboarding solution based on Jupyter.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="getting-started-with-voila"&gt;Getting started with Voilà&lt;/h2&gt;
&lt;p&gt;Voilà is available as a Python package on &lt;a href="https://github.com/conda-forge/voila-feedstock"&gt;conda-forge&lt;/a&gt; and &lt;a href="https://pypi.org/project/voila"&gt;PyPI&lt;/a&gt;. After installing Voilà in their environment, Jupyter notebook users will see a new button in the toolbar, a button reading “Voila” with a display icon. Clicking this button will take you to a Voilà web app served &lt;a href="https://voila.readthedocs.io/en/stable/using.html#as-a-jupyter-server-extension"&gt;with the notebook server&lt;/a&gt;.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Screenshot of Jupyter notebook interface showing Voila button in toolbar." src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-slideshow-template-for-voila-apps/images/002-1_rQ6byMkg3MIOpOS0dvWOig.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Voilà use case as a Jupyter server extension.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Alternatively, you can use Voilà to create a standalone &lt;a href="https://www.tornadoweb.org"&gt;Tornado&lt;/a&gt; application. From the terminal, run &lt;code&gt;$ voila index.ipynb&lt;/code&gt; to turn notebook &lt;code&gt;index.ipynb&lt;/code&gt; into a web app. Note that you don’t launch nor run the Jupyter notebook yourself. At this point, Voilà serves the app locally.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Screencast of Voilà app (default template)." src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-slideshow-template-for-voila-apps/images/003-1_x-8g5Ux5j4wPmwI5TYSWkw.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Jupyter notebook turned Voilà app (&lt;a href="https://github.com/mkcor/voila-reveal-example"&gt;source&lt;/a&gt;).&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Of course, the full value of sharing these apps (typically analytics web apps, data dashboards) comes from &lt;em&gt;deploying&lt;/em&gt; them. Voilà apps can come into play at different steps of a data science workflow, from the initial step of &lt;em&gt;exploring data&lt;/em&gt; all the way to the final step of &lt;em&gt;communicating results&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id="styling-voila-apps-with-layout-templates"&gt;Styling Voilà apps with layout templates&lt;/h2&gt;
&lt;p&gt;Now, you may want to customize the &lt;em&gt;layout&lt;/em&gt; of your app, especially if it is somewhat complex. For example, you can make results more readable by splitting them and using different tab panes or boxes. This you can already achieve with the &lt;code&gt;voila-gridstack&lt;/code&gt; template, also available from either &lt;a href="https://github.com/conda-forge/voila-gridstack-feedstock"&gt;conda-forge&lt;/a&gt; or &lt;a href="https://pypi.org/project/voila-gridstack"&gt;PyPI&lt;/a&gt; (still in beta).&lt;/p&gt;
&lt;p&gt;Templates are written in &lt;a href="https://jinja.palletsprojects.com"&gt;Jinja&lt;/a&gt; and use the &lt;code&gt;metadata&lt;/code&gt; field of the notebook cells. Practically, a Voilà template is a folder which lives under &lt;code&gt;PREFIX/share/jupyter/voila/templates/&lt;/code&gt;. The system of &lt;em&gt;custom templates&lt;/em&gt; is actually where the &lt;em&gt;extensibility&lt;/em&gt; of Voilà shines most. Here, we introduce &lt;a href="https://github.com/voila-dashboards/voila-reveal"&gt;voila-reveal&lt;/a&gt;, a &lt;em&gt;slideshow&lt;/em&gt; template for Voilà. It builds off of &lt;a href="https://github.com/damianavila/RISE"&gt;RISE&lt;/a&gt;, which itself builds off of &lt;a href="http://lab.hakim.se/reveal-js"&gt;reveal.js&lt;/a&gt;. The credit goes to Maarten Breddels for initiating development a few months ago.&lt;/p&gt;
&lt;h2 id="rendering-voila-apps-as-slideshows"&gt;Rendering Voilà apps as slideshows&lt;/h2&gt;
&lt;p&gt;With RISE, you can instantly turn your Jupyter notebook into a slideshow. Besides, if you share it within a &lt;a href="https://mybinder.readthedocs.io/en/latest/introduction.html#what-is-a-binder"&gt;binder&lt;/a&gt;, collaborators can readily view it in their web browser, with no need for a local setup. They can enjoy the interactive controls, if any. They are expected to run code though (&lt;a href="https://mybinder.org/v2/gh/damianavila/RISE/master?filepath=examples%2FREADME.ipynb"&gt;example&lt;/a&gt;), which may not be suitable if they are non-technical. And, even if they are, you may want to prevent arbitrary code execution.&lt;/p&gt;
&lt;p&gt;With Voilà and its new &lt;code&gt;reveal&lt;/code&gt; template, you can achieve this by sharing your RISE slideshow as a standalone web application. How so? Ever since &lt;a href="https://medium.com/@mjspeck/presenting-code-using-jupyter-notebook-slides-a8a3c3b59d67"&gt;Jupyter notebook slides&lt;/a&gt;, it has been possible to author or edit a Jupyter notebook with slideshow-related information on each cell. In principle, we could also add (or edit) these cell metadata manually (or automatically) by post-processing the JSON.&lt;/p&gt;
&lt;p&gt;Our custom slideshow template &lt;code&gt;voila-reveal&lt;/code&gt; leverages these very cell metadata (namely, subfield &lt;code&gt;slideshow&lt;/code&gt; of field &lt;code&gt;metadata&lt;/code&gt;). It handles them the exact same way &lt;a href="https://github.com/jupyter/nbconvert/blob/cda5ec4bd062a9ba01a799575942d87a509a771f/nbconvert/exporters/slides.py"&gt;nbconvert&lt;/a&gt; does when generating slideshow HTML from a notebook. It also passes default values to specific resources required by &lt;code&gt;reveal&lt;/code&gt;. These &lt;code&gt;reveal&lt;/code&gt;-required resources are: &lt;code&gt;scroll&lt;/code&gt;, &lt;code&gt;theme&lt;/code&gt;, and &lt;code&gt;transition&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To use the slideshow template with Voilà, install the &lt;code&gt;voila-reveal&lt;/code&gt; package: &lt;code&gt;$ conda install voila-reveal&lt;/code&gt; or &lt;code&gt;$ pip install voila-reveal&lt;/code&gt;. This will create and populate the &lt;code&gt;PREFIX/share/jupyter/voila/templates/reveal/&lt;/code&gt; folder. At the command line, serve the &lt;code&gt;index.ipynb&lt;/code&gt; notebook as a standalone app with the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;voila&lt;span class="w"&gt; &lt;/span&gt;index.ipynb&lt;span class="w"&gt; &lt;/span&gt;--template&lt;span class="o"&gt;=&lt;/span&gt;reveal
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;… and voilà!&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Screencast of Voilà app in slideshow format showing zoom transition (configured)." src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-slideshow-template-for-voila-apps/images/004-1_Pg6UNndYe0TIfRIeXy3RvA.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Voilà app rendered as a slideshow with slide transitions configured to zoom in and out (&lt;a href="https://github.com/mkcor/voila-reveal-example"&gt;source&lt;/a&gt;).&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="configuring-templates-at-the-command-line"&gt;Configuring templates at the command line&lt;/h2&gt;
&lt;p&gt;You can overwrite the above-mentioned resource defaults by passing additional options. For instance, the default value of &lt;code&gt;transition&lt;/code&gt; is &lt;code&gt;&amp;quot;fade&amp;quot;&lt;/code&gt;. To get the &lt;code&gt;&amp;quot;zoom&amp;quot;&lt;/code&gt; behaviour, we could use the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;voila&lt;span class="w"&gt; &lt;/span&gt;index.ipynb&lt;span class="w"&gt; &lt;/span&gt;--template&lt;span class="o"&gt;=&lt;/span&gt;reveal&lt;span class="w"&gt; &lt;/span&gt;--VoilaConfiguration.resources&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;{&amp;#39;reveal&amp;#39;: {&amp;#39;transition&amp;#39;: &amp;#39;zoom&amp;#39;}}&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Admittedly, it is verbose and cumbersome. Another possibility is to specify (here, &lt;code&gt;reveal&lt;/code&gt;-specific) resources in a &lt;em&gt;configuration file&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id="configuring-templates-with-a-json-file"&gt;Configuring templates with a JSON file&lt;/h2&gt;
&lt;p&gt;Write your configuration file, named &lt;code&gt;conf.json&lt;/code&gt;, with the following structure:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;traitlet_configuration&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;resources&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;reveal&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;scroll&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;theme&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;simple&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;transition&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;zoom&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then, it is enough to run &lt;code&gt;$ voila index.ipynb --template=reveal&lt;/code&gt; to get slide transitions zoomed in and out; Voilà picks up the config file, as long as it lives under &lt;code&gt;PREFIX/share/jupyter/voila/templates/reveal/&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In the above &lt;a href="https://github.com/mkcor/voila-reveal-example"&gt;demo&lt;/a&gt; screencast, we showcase a scatter plot and a scatter matrix of the “iris” dataset made with &lt;a href="https://plot.ly/python/plotly-express"&gt;Plotly Express&lt;/a&gt; and customizable with &lt;a href="https://ipywidgets.readthedocs.io"&gt;ipywidgets&lt;/a&gt; dropdowns. To display the Python code for these plots, run&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;voila&lt;span class="w"&gt; &lt;/span&gt;index.ipynb&lt;span class="w"&gt; &lt;/span&gt;--template&lt;span class="o"&gt;=&lt;/span&gt;reveal&lt;span class="w"&gt; &lt;/span&gt;--strip_sources&lt;span class="o"&gt;=&lt;/span&gt;False
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To turn on scrollbars, so you can view the plots entirely, run&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;voila&lt;span class="w"&gt; &lt;/span&gt;index.ipynb&lt;span class="w"&gt; &lt;/span&gt;--template&lt;span class="o"&gt;=&lt;/span&gt;reveal&lt;span class="w"&gt; &lt;/span&gt;--strip_sources&lt;span class="o"&gt;=&lt;/span&gt;False&lt;span class="w"&gt; &lt;/span&gt;--VoilaConfiguration.resources&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;{&amp;#39;reveal&amp;#39;: {&amp;#39;scroll&amp;#39;: True}}&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or edit the &lt;code&gt;scroll&lt;/code&gt; value in the configuration file!&lt;/p&gt;
&lt;h2 id="coming-next"&gt;Coming next&lt;/h2&gt;
&lt;p&gt;At the moment, you must specify the template upon launching Voilà. We would like to be able to toggle between different templates on the fly (without restarting the app). To this end, we shall support template specification as a URL parameter. We shall make &lt;em&gt;template selection&lt;/em&gt; available from the Jupyter interface as well.&lt;/p&gt;
&lt;h2 id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;The development of &lt;code&gt;voila-reveal&lt;/code&gt; is entirely supported by &lt;a href="https://github.com/QuantStack"&gt;QuantStack&lt;/a&gt;. The author would like to thank Jeremy Tuloup, Johan Mabille, and Sylvain Corlay for their valuable feedback on this piece.&lt;/p&gt;
&lt;h2 id="about-the-author"&gt;About the author&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/mkcor"&gt;Marianne Corvellec&lt;/a&gt; is an independent scientific software developer. She is also an independent researcher affiliated with &lt;a href="https://igdore.org"&gt;IGDORE&lt;/a&gt;. She holds a PhD in statistical physics from Ecole Normale Supérieure de Lyon, France.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-slideshow-template-for-voila-apps/images/005-1_ZrMs1GjNdEYhsbqese6xVA.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
</content><category term="dashboards"/><category term="Voilà"/></entry><entry><title>A Gallery of Voilà Examples</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-gallery-of-voila-examples/" rel="alternate"/><published>2019-07-09T10:53:00+00:00</published><updated>2020-01-21T14:00:00+00:00</updated><author><name>Jeremy Tuloup</name></author><id>tag:jasongrout.github.io,2019-07-09:/medium-archive/pelican/posts/2019/a-gallery-of-voila-examples/</id><summary type="html">&lt;p&gt;Voilà is one of the latest addition to the Jupyter ecosystem, and can be used to turn notebooks into standalone applications and…&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;strong&gt;Voilà&lt;/strong&gt; is one of the &lt;a href="/posts/2019/and-voila/"&gt;latest addition to the Jupyter ecosystem&lt;/a&gt; and can be used to turn notebooks into standalone applications and dashboards.&lt;/p&gt;
&lt;p&gt;Today we are pleased to introduce the Voilà Gallery, a collection of examples built with Voilà.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-gallery-of-voila-examples/images/001-1_w-xt2hmqBRHfjZl6ljZyxQ.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;h2 id="the-voila-gallery"&gt;The Voilà Gallery&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://voila-gallery.org"&gt;Voilà Gallery&lt;/a&gt; is a &lt;strong&gt;collection of live dashboards built with Voilà and Jupyter widgets&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The goal of the gallery is to provide &lt;strong&gt;inspiration&lt;/strong&gt; to Jupyter users who want to convert their notebooks into web applications. Most of the examples rely on widget libraries such as &lt;a href="https://github.com/jupyter-widgets/ipywidgets"&gt;ipywidgets&lt;/a&gt;, &lt;a href="https://github.com/jupyter-widgets/ipyleaflet"&gt;ipyleaflet&lt;/a&gt;, &lt;a href="https://github.com/maartenbreddels/ipyvolume"&gt;ipyvolume&lt;/a&gt;, &lt;a href="https://github.com/bloomberg/bqplot"&gt;bqplot&lt;/a&gt; and &lt;a href="https://github.com/matplotlib/jupyter-matplotlib"&gt;ipympl&lt;/a&gt;, and showcase how to build complex web applications entirely based on notebooks.&lt;/p&gt;
&lt;p&gt;The landing page of the gallery lists all the available examples. Each entry contains can be used to launch the example and includes a button to view the source.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="The Voilà Gallery landing page" src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-gallery-of-voila-examples/images/002-1_8uW288G8hxihn-PkSJMCrQ.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The Voilà Gallery landing page&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Launch Example&lt;/em&gt; will bring you to the &lt;strong&gt;interactive application&lt;/strong&gt;. Under the hood, a notebook server running &lt;code&gt;voila&lt;/code&gt; and a live kernel are started.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;
&lt;img alt="GPX Viewer is an application built with Voilà" src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-gallery-of-voila-examples/images/003-1_6WMGnuNAAToGvOooOvvmLg.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;GPX Viewer is an application built with Voilà&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;View Source&lt;/em&gt; will let you have a look at the source notebook used to create the example. This is useful to learn more about the inner workings of each dashboard.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="adding-your-own-example"&gt;Adding your own example&lt;/h2&gt;
&lt;p&gt;The source for the public gallery is available on GitHub: &lt;a href="https://github.com/voila-gallery/voila-gallery.github.io"&gt;https://github.com/voila-gallery/voila-gallery.github.io&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;All the examples shown in the gallery come from the &lt;a href="https://github.com/voila-gallery/voila-gallery.github.io/blob/master/_data/gallery.yaml"&gt;gallery.yaml&lt;/a&gt; file, which is automatically rendered on the landing page at &lt;a href="https://voila-gallery.org/"&gt;voila-gallery.org&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can contribute a new example to the gallery by following &lt;a href="https://github.com/voila-gallery/voila-gallery.github.io#contributing-new-examples"&gt;these steps&lt;/a&gt;, which consist in adding a new entry to the &lt;code&gt;gallery.yaml&lt;/code&gt; file and opening a new pull request. The gallery will pick up the new example shortly after it has been added.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-gallery-of-voila-examples/images/004-1_ZBnVhXXLOglYNLCyvf_Wdw.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/voila-gallery"&gt;voila-gallery&lt;/a&gt; organization on GitHub already contains a few examples that you can use as a starting point.&lt;/p&gt;
&lt;h2 id="deploying-your-own-gallery"&gt;Deploying your own gallery&lt;/h2&gt;
&lt;p&gt;The gallery can also be deployed as a plugin for &lt;a href="https://tljh.jupyter.org/"&gt;The Littlest JupyterHub (TLJH),&lt;/a&gt; which is a JupyterHub distribution meant to be used on a single server.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/voila-dashboards/tljh-voila-gallery"&gt;plugin&lt;/a&gt; makes use of the &lt;a href="https://jupyterhub.readthedocs.io/en/stable/_static/rest-api/index.html"&gt;JupyterHub REST API&lt;/a&gt; to create a new JupyterHub service and to launch the examples.&lt;/p&gt;
&lt;p&gt;You can actually deploy your own gallery by following &lt;a href="https://github.com/voila-dashboards/tljh-voila-gallery#install"&gt;the instructions in the README&lt;/a&gt;. Within a few minutes, you will have a Voilà gallery running on your own server. You could even run it on a private instance.&lt;/p&gt;
&lt;h2 id="whats-next"&gt;What’s next?&lt;/h2&gt;
&lt;p&gt;We are still iterating on the content of the gallery to add some variety to the types of application that can be created using widgets, Jupyter notebooks and Voilà.&lt;/p&gt;
&lt;p&gt;If you have authored an interesting dashboard and would like to share it with the rest of the world, feel free to open a pull request to add it to the list of examples!&lt;/p&gt;
&lt;h2 id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;We are very grateful to &lt;a href="https://ovh.com/"&gt;OVH&lt;/a&gt; for hosting the Voilà Gallery on their servers.&lt;/p&gt;
&lt;p&gt;Thanks to &lt;a href="https://twitter.com/yuvipanda"&gt;Yuvi Panda&lt;/a&gt; and &lt;a href="https://twitter.com/pascalbugnion"&gt;Pascal Bugnion&lt;/a&gt; for initially starting the Voilà Gallery project, and &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt; for kindly sponsoring the development.&lt;/p&gt;
&lt;p&gt;The development of Voilà at QuantStack is funded by &lt;a href="https://twitter.com/techatbloomberg"&gt;Bloomberg&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/a-gallery-of-voila-examples/images/005-1_F0IS2B1XS6NCxp0Eh7linQ.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
</content><category term="Voilà"/></entry><entry><title>And voilà!</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/" rel="alternate"/><published>2019-06-11T17:42:00+00:00</published><updated>2021-01-08T08:38:00+00:00</updated><author><name>QuantStack</name></author><id>tag:jasongrout.github.io,2019-06-11:/medium-archive/pelican/posts/2019/and-voila/</id><summary type="html">&lt;p&gt;… from Jupyter notebooks to standalone applications and dashboards&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;strong&gt;… from Jupyter notebooks to standalone applications and dashboards&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The goal of Project Jupyter is to improve the workflows of researchers, educators, scientists, and other practitioners of scientific computing, from the &lt;em&gt;&lt;strong&gt;exploratory phase&lt;/strong&gt;&lt;/em&gt; of their work to the &lt;em&gt;&lt;strong&gt;communication&lt;/strong&gt;&lt;/em&gt; of the results.&lt;/p&gt;
&lt;p&gt;But interactive notebooks are not the best communication tool for all audiences. While they have proven invaluable to provide a &lt;em&gt;narrative&lt;/em&gt; alongside the source, they are not ideal to address &lt;em&gt;&lt;strong&gt;non-technical readers&lt;/strong&gt;&lt;/em&gt;, who may be put off by the presence of code cells, or the need to run the notebook to see the results. Finally, following the order as the code often results in the most interesting content to be at the &lt;em&gt;&lt;strong&gt;end&lt;/strong&gt;&lt;/em&gt; of the document.&lt;/p&gt;
&lt;p&gt;Another challenge with sharing notebooks is the &lt;em&gt;&lt;strong&gt;security&lt;/strong&gt;&lt;/em&gt; model. How can we offer the interactivity of a notebook making use of e.g. Jupyter widgets without allowing arbitrary code execution by the end user?&lt;/p&gt;
&lt;p&gt;We set ourselves to solve these challenges, and we are happy to announce the first release of &lt;em&gt;&lt;strong&gt;Voilà&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/images/001-1_c1xwFRqy99o8nLVxDSqNZg.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Voilà&lt;/strong&gt;&lt;/em&gt; turns Jupyter notebooks into standalone web applications.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Voilà supports &lt;em&gt;&lt;strong&gt;Jupyter interactive widgets&lt;/strong&gt;&lt;/em&gt;, including the roundtrips to the kernel.&lt;/li&gt;
&lt;li&gt;Voilà &lt;em&gt;&lt;strong&gt;does not permit arbitrary code execution&lt;/strong&gt;&lt;/em&gt; by consumers of dashboards.&lt;/li&gt;
&lt;li&gt;Built upon Jupyter standard protocols and file formats, Voilà works with any Jupyter kernel (C++, Python, Julia), making it a &lt;em&gt;&lt;strong&gt;language-agnostic&lt;/strong&gt;&lt;/em&gt; dashboarding system.&lt;/li&gt;
&lt;li&gt;Voilà is extensible. It includes a flexible &lt;em&gt;&lt;strong&gt;template system&lt;/strong&gt;&lt;/em&gt; to produce rich application layouts.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="installation-and-first-time-use"&gt;&lt;strong&gt;Installation and first-time use&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Voilà can be installed from pypi:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install voila
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or conda-forge:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;conda install voila -c conda-forge
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Upon installation, several components are installed, one of which is the &lt;code&gt;voila&lt;/code&gt; command-line utility. You can try it by typing &lt;code&gt;voila notebook.ipynb&lt;/code&gt;. It results in the browser opening to a new tornado application showing markdown cells, rich outputs, and interactive widgets.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="From a notebook to a standalone web application" src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/images/002-1_imDFJcYj8k-apbrvIK9ZVQ.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;From a notebook to a standalone web application&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;As you can see in the screencast, Jupyter interactive widgets remain fully functional even when they require computation by the kernel.&lt;/p&gt;
&lt;p&gt;You can immediately try out some of the command-line options to Voilà&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;with &lt;code&gt;--strip_sources=False&lt;/code&gt;, input cells will be included in the resulting web application (as read-only pygment snippets).&lt;/li&gt;
&lt;li&gt;with &lt;code&gt;--theme=dark&lt;/code&gt;, Voilà will make use of the dark JupyterLab theme, which will apply to code cells, widgets and all other visible components.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;
&lt;img alt="Making use of the dark theme and including input cells" src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/images/003-1_ce142q3rm3TgJZVNEgGWcw.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Making use of the dark theme and including input cells&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Note that code is only shown, voilà does not allow users to edit or execute arbitrary code.&lt;/p&gt;
&lt;h2 id="voilas-execution-model"&gt;Voilà’s execution model&lt;/h2&gt;
&lt;p&gt;The execution model of Voilà is the following: upon connection to a notebook URL, Voilà launches the kernel for that notebook, and runs all the cells as it populates the notebook model with the outputs.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="The execution model of Voilà" src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/images/004-1_KZj7rmVqAHmY1b-P-QMPLw.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The execution model of Voilà&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;After the execution, the associated kernel is not shut down. The notebook is converted to HTML and served to the user. The rendered HTML includes JavaScript that establishes a connection to the kernel. Jupyter interactive widgets referred in cell outputs are rendered and connected to their counterpart in the kernel. The kernel is only shut down when the user closes their browser tab.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The current version of Voilà only responds to the initial GET request when all the cells have finished running, which may take a long time, but there is&lt;/em&gt; &lt;a href="https://github.com/QuantStack/voila/pull/133"&gt;&lt;em&gt;ongoing work&lt;/em&gt;&lt;/a&gt; &lt;em&gt;on enabling progressive rendering, which should make it into a release soon.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;An important aspect of this execution model is that the front-end does not determine what code is run by the backend. In fact, unless specified otherwise (with option &lt;code&gt;--strip-sources=False&lt;/code&gt;), the source of the rendered notebook does not even make it to the front-end. The instance of the &lt;code&gt;jupyter_server&lt;/code&gt; instantiated by Voilà actually disallows execute requests by default.&lt;/p&gt;
&lt;h2 id="support-for-custom-interactive-widgets"&gt;Support for custom interactive widgets&lt;/h2&gt;
&lt;p&gt;Voilà can render custom Jupyter widget libraries, including (but not limited to) &lt;a href="https://github.com/bloomberg/bqplot"&gt;bqplot&lt;/a&gt;, &lt;a href="https://github.com/jupyter-widgets/ipyleaflet"&gt;ipyleafet&lt;/a&gt;, &lt;a href="https://github.com/maartenbreddels/ipyvolume"&gt;ipyvolume&lt;/a&gt;, &lt;a href="https://github.com/matplotlib/jupyter-matplotlib/"&gt;ipympl&lt;/a&gt;, &lt;a href="https://github.com/QuantStack/ipysheet"&gt;ipysheet&lt;/a&gt;, &lt;a href="https://github.com/plotly/plotly.py"&gt;plotly&lt;/a&gt;, &lt;a href="https://github.com/maartenbreddels/ipywebrtc"&gt;ipywebrtc&lt;/a&gt;, etc.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Including bqplot figures with Voilà" src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/images/005-1_iBz5dUYHT5N9dbymPKTGCg.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Including &lt;a href="https://github.com/bloomberg/bqplot"&gt;bqplot&lt;/a&gt; figures with Voilà&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Together with &lt;a href="https://github.com/matplotlib/jupyter-matplotlib/"&gt;ipympl&lt;/a&gt;, Voilà is actually a simple means to render interactive matplotlib figures in a standalone web application:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Rendering interactive matplotlib figures in a web application with voilà" src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/images/006-1_e3k8ZgJoCp0Pm-yZ5Xr0Xg.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Rendering interactive matplotlib figures in a web application with voilà&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="voila-is-language-agnostic"&gt;Voilà is language-agnostic&lt;/h2&gt;
&lt;p&gt;Voilà can be used to produce applications with any Jupyter kernel. The following screencast shows how Voilà can be used to produce a simple dashboard in C++ making use of leaflet.js maps, with the &lt;a href="https://github.com/QuantStack/xeus-cling"&gt;xeus-cling&lt;/a&gt; C++ kernel and the &lt;a href="https://github.com/QuantStack/xleaflet"&gt;xleaflet&lt;/a&gt; package.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="A standalone Voilà page making use of the C++ Jupyter kernel, xeus-cling (input cells display enabled)." src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/images/007-1_os2ABw7hEnfd1Dq5pOrTDg.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;A standalone Voilà page making use of the C++ Jupyter kernel, &lt;a href="https://github.com/QuantStack/xeus-cling"&gt;xeus-cling&lt;/a&gt; (input cells display enabled).&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;We hope that Voilà will be a stimulant to other languages (R, Julia, JVM/Java) to provide stronger widgets support.&lt;/p&gt;
&lt;h2 id="richer-layouts-with-voila-templates"&gt;Richer layouts with Voilà templates&lt;/h2&gt;
&lt;p&gt;The main extension point to Voilà is the custom &lt;em&gt;&lt;strong&gt;template system&lt;/strong&gt;&lt;/em&gt;. The HTML served to the end-user is produced from the notebook model by applying a Jinja template, which can be defined by the user.&lt;/p&gt;
&lt;p&gt;An example template for voilà is the &lt;code&gt;voila-gridstack&lt;/code&gt; template, which can be installed from pypi with&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install voila-gridstack
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can try it by typing &lt;code&gt;voila notebook.ipynb --template=gridstack&lt;/code&gt;.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Making use of the Gridstack template to produce a dashboard with bqplot charts" src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/images/008-1_grVVSeKyw7bXYU7fZmHgQQ.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Making use of the Gridstack template to produce a dashboard with &lt;a href="https://github.com/bloomberg/bqplot/"&gt;bqplot&lt;/a&gt; charts&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The &lt;a href="https://github.com/QuantStack/voila-gridstack/"&gt;gridstack Voilà template&lt;/a&gt; makes use of the cell metadata to lay out the application.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A roadmap item for the gridstack Voilà template is to support the entire spec for the deprecated &lt;a href="https://github.com/jupyter/dashboards"&gt;jupyter dashboards&lt;/a&gt; and to create a WYSIWYG editor for these templates in the form of a JupyterLab extension.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Note that &lt;a href="https://github.com/QuantStack/voila-gridstack/"&gt;voila-gridstack&lt;/a&gt; template is still at an early stage of development.&lt;/p&gt;
&lt;h2 id="how-to-make-custom-voila-templates"&gt;How to make custom Voilà templates?&lt;/h2&gt;
&lt;p&gt;A Voilà template is actually a &lt;em&gt;&lt;strong&gt;folder&lt;/strong&gt;&lt;/em&gt; placed in the standard directory&lt;code&gt;PREFIX/share/jupyter/voila/templates&lt;/code&gt; and which may include&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;nbconvert&lt;/code&gt; templates (the jinja templates used to transform the notebook into HTML)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;static&lt;/code&gt; resources&lt;/li&gt;
&lt;li&gt;custom &lt;code&gt;tornado&lt;/code&gt; templates such as &lt;code&gt;404.html&lt;/code&gt; etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All of these are optional. It may also contain a &lt;code&gt;conf.json&lt;/code&gt; file to set up which template to use as a base. The directory structure for a Voilà template is the following:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;PREFIX/share/jupyter/voila/templates/template_name/
|
├── conf.json                # Template configuration file
├── nbconvert_templates/     # Custom nbconvert templates
├── static/                  # Static directory
└── templates/               # Custom tornado templates
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The Voilà template system can be used to completely override the behavior of the front-end. One can make use of modern JavaScript frameworks such as &lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt; or &lt;a href="https://vuejs.org/"&gt;Vue.js&lt;/a&gt; to produce modern UI including Jupyter widgets and outputs.&lt;/p&gt;
&lt;p&gt;Another example template for Voilà is &lt;code&gt;voila-vuetify&lt;/code&gt;, which is built upon vue.js:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="The voila-vuetify template makes use of Vue.js" src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/images/009-1_HtXNf1rq26u9ss8L-Oo6VQ.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The &lt;a href="https://github.com/QuantStack/voila-vuetify"&gt;voila-vuetify&lt;/a&gt; template makes use of Vue.js&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;em&gt;The voila-gridstack and voila-vuetify templates are still at an early stage of development, but will be iterated upon quickly in the next weeks as we are exploring templates.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="a-jupyter-server-extension"&gt;A Jupyter server extension&lt;/h2&gt;
&lt;p&gt;Beyond the &lt;code&gt;voila&lt;/code&gt; command-line utility, the Voilà package also include a Jupyter &lt;em&gt;&lt;strong&gt;server extension&lt;/strong&gt;&lt;/em&gt;, so that Voilà dashboards can be served alongside the Jupyter notebook application.&lt;/p&gt;
&lt;p&gt;When Voilà is installed, a running Jupyter server will serve the Voilà web application under &lt;code&gt;BASE_URL/voila&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="the-jupyter-community-workshop-on-dashboarding"&gt;The Jupyter Community Workshop on Dashboarding&lt;/h2&gt;
&lt;p&gt;From June 3rd to June 6th 2019, a &lt;a href="/posts/2019/jupyter-community-workshop-dashboarding-with-project/"&gt;community workshop on dashboarding&lt;/a&gt; with Project Jupyter took place in Paris. Over thirty Jupyter contributors and community members gathered to discuss dashboarding technologies and hack together.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="The participants to the Paris Jupyter community workshop on dashboarding" src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/images/010-1_6LggiPlUoCSkP2A1aHp_3w.jpeg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The participants to the Paris Jupyter community workshop on dashboarding&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Several dashboarding solutions such as Dash and Panel were presented during the workshop and featured at the &lt;a href="https://www.meetup.com/PyData-Paris/events/261452824/"&gt;PyData Paris Meetup&lt;/a&gt; which was organized on the same week.&lt;/p&gt;
&lt;p&gt;The workshop was also the occasion for several contributors to start working on Voilà. Custom templates, a dashboard gallery, logos and UX mockups for JupyterLab extensions have been developed.&lt;/p&gt;
&lt;p&gt;We will soon publish a more detailed post on the workshop, detailing the many tracks of development that have been explored!&lt;/p&gt;
&lt;h2 id="what-is-coming"&gt;What is coming?&lt;/h2&gt;
&lt;p&gt;There is a lot of planned work around Voilà in the next weeks and months. Current work streams include better &lt;em&gt;&lt;strong&gt;integration with JupyterHub&lt;/strong&gt;&lt;/em&gt; for publicly sharing dashboard between users, as well as &lt;em&gt;&lt;strong&gt;JupyterLab extensions&lt;/strong&gt;&lt;/em&gt; (a &lt;a href="https://github.com/QuantStack/voila/pull/217"&gt;Voilà “preview” extension for notebooks&lt;/a&gt;, and a WYSIWYG editor for dashboard layouts). There are also ongoing discussions with the &lt;a href="https://www.ovh.com/fr/"&gt;OVH&lt;/a&gt; cloud provider (which already supports binder by handling some of its traffic) on hosting a binder-like service dedicated to Voilà dashboards. So stay tuned for more exciting developments!&lt;/p&gt;
&lt;p&gt;Last but not least, we are especially excited about what &lt;em&gt;&lt;strong&gt;you&lt;/strong&gt;&lt;/em&gt; will be building upon Voilà!&lt;/p&gt;
&lt;h2 id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;The development of Voilà and related packages at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt; is sponsored by &lt;a href="http://www.techatbloomberg.com"&gt;&lt;strong&gt;Bloomberg&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We are also grateful to the attendees of the &lt;a href="/posts/2019/jupyter-community-workshop-dashboarding-with-project/"&gt;&lt;strong&gt;Jupyter Community Workshop on Dashboarding&lt;/strong&gt;&lt;/a&gt; for their numerous contributions to Voilà!&lt;/p&gt;
&lt;p&gt;We would like to thank &lt;a href="https://twitter.com/choldgraf"&gt;Chris Holdgraf&lt;/a&gt; for his work on improving documentation, and integration with JupyterHub.&lt;/p&gt;
&lt;p&gt;We should mention &lt;a href="https://twitter.com/yuvipanda"&gt;Yuvi Panda&lt;/a&gt; and &lt;a href="https://twitter.com/pascalbugnion"&gt;Pascal Bugnion&lt;/a&gt; for getting the &lt;code&gt;voila-gallery&lt;/code&gt;project off the ground during the workshop. We are grateful to &lt;a href="https://twitter.com/zrsailer"&gt;Zach Sailer&lt;/a&gt; for his continued work on improving&lt;code&gt;jupyter_server&lt;/code&gt;. We should finally not forget to mention the prior art by &lt;a href="https://twitter.com/pascalbugnion"&gt;Pascal Bugnion&lt;/a&gt; with the Jupyter widgets server which was also an inspiration for Voilà.&lt;/p&gt;
&lt;h2 id="about-the-authors"&gt;About the Authors&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://twitter.com/SylvainCorlay"&gt;&lt;em&gt;Sylvain Corlay&lt;/em&gt;&lt;/a&gt; is the founder and CEO of &lt;a href="https://github.com/QuantStack/"&gt;QuantStack&lt;/a&gt; and a core team member for Project Jupyter.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/maartenbreddels"&gt;Maarten Breddels&lt;/a&gt; is an independent scientific software developer partnering with &lt;a href="https://github.com/QuantStack/"&gt;QuantStack&lt;/a&gt; on numerous projects, and a core developer of Project Jupyter.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2019/and-voila/images/011-1_F0IS2B1XS6NCxp0Eh7linQ.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
</content><category term="dashboards"/><category term="Voilà"/></entry></feed>