Saturday, April 17, 2021

Battle of the Python Dashboarding Giants: Streamlit vs. Dash vs. Voilà vs. Panel

Programming Language Support

Streamlit: Python only
Dash:
Python, R, Julia
Voilà:
Python, C++, Julia
Panel:
Python only

The Best: Dash & Voilà
The Worst: Streamlit & Panel

Python Graphing Library Support

Streamlit: All of the main Python plotting libraries, including Matplotlib’s Pyplot library, Seaborn, Altair, Vega-Lite, Plotly, Bokeh, PyDeck, and GraphViz. Also provide their own native plotting library with line charts, area charts, bar charts, and maps.
Dash:
Primarily built for use with the ‘plotly.py’ Python graphing library. External libraries exist for alternative plotting libraries — namely Seaborn/Matplotlib, Altair/Vega-Lite, and Bokeh — within Dash, however these libraries are not very robust, and the level of interaction with the outputted graphs is not at the same level as Plotly-produced graphs.
Voilà:
All of the main Python plotting libraries, including Matplotlib’s Pyplot library, Seaborn, Altair, Plotly, Bokeh, PyDeck, and GraphViz.
Panel:
All of the main Python plotting libraries — Matplotlib, Seaborn, Altair, Plotly, Bokeh, PyDeck, GraphViz, and even the R ‘ggplot’ library.

The Best: Streamlit or Voilà
The Worst:
Dash

Multi-Page Application Support

Streamlit: Not explicitly or out of the box, but potential workarounds can be found on the Streamlit support forum.
Dash:
Explicitly supports multi-page applications.
Voilà:
Not explicitly or out of the box, with potential workarounds not really akin to a multi-page applications.
Panel:
Explicitly supports multi-page applications, and can do so in multiple different ways — such as using Tabs, Pipelines, and Templates. Panel enables sharing of state between application pages, leading to the creation of complex multi-page applications.

The Best: Panel or Dash. Panel is very suitable for multi-page apps as it can easily share information between multiple pages so that you can build full-featured multi-page apps. Dash supports multi-page applications in a more performant way than the other frameworks, with the ability to alter URLs without refreshing the actual webpage itself — leading to highly reduced page-load times — however, sharing of variables between pages needs to be done explicitly, which can hinder the real world applicability when creating applications where pages need to share lots of information frequently.
The Worst:
Voilà. There is no explicit support and the workarounds aren’t really akin to multi-page applications.

Open Source vs Proprietary

Streamlit: Fully open source at present, however, there is an enterprise version in beta, called ‘Streamlit for Teams’.
Dash:
Both an open source framework, as well as an enterprise version with many additional features.
Voilà:
Fully open source.
Panel:
Fully open source.

The Best: Voilà & Panel
The Worst:
None

Extent of Prerequisite Skills Needed (Excluding Python)

Streamlit: To get the full utility out of Streamlit no other prerequisite skills are needed. HTML, CSS, and JavaScript can bolster your use of the framework — leading to more complex and visually appealing application layouts.
Dash:
You will need a rudimentary knowledge of HTML. CSS knowledge will enable greater control in your application design decisions.
Voilà:
No other skills bar Python are explicitly needed, however, some knowledge of HTML, CSS, and Jinja will be required if you want full design control over the layout and appearance of your dashboard.
Panel:
No skills other than Python are required to get started with Panel. HTML, CSS, and JavaScript knowledge will aid in the development process, especially when it comes to the stylistic choices.

The Best: Streamlit. Coming from a pure Python background, Streamlit will handle the bulk of the design decisions for you, without you needing to learn any HTML or CSS.
The Worst:
Dash, marginally. I only choose Dash here as I feel like you can get by without knowing any HTML or CSS for the other 3 frameworks, but with Dash you will need to understand HTML to correctly lay out your application and to know what components are what.

Ease of Use

Streamlit: Streamlit’s API is minimal, easily manageable, written in pure Python, and can be read in its entirety in a single sitting. It is an incredibly easy to use framework.
Dash:
Easy to use to create basic dashboard applications, but it is slightly more difficult to create complex application layouts.
Voilà:
Voilà in of itself is incredibly easy to use to create a basic dashboard applications, however, it is not always straightforward to control the intricacies regarding the application layout and appearance.
Panel:
Easy to use for straightforward data dashboard applications, but it can be quite tricky once you get past more trivial dashboard interfaces.

The Best: Streamlit. The framework was developed with ease of use high on their priority list, if not at the top. It is remarkably easy to create dashboard applications with Streamlit!
The Worst:
Panel. It took a lot of reading and experimenting to even create the most basic of dashboards with Panel. In saying that, it does become easier after those initial hours are put in — but it is still the most convoluted of the four frameworks.

Design Flexibility

Streamlit: As the focus is primarily on ease of use, it is not entirely flexible in its layout options. If you are skilled in HTML and JavaScript you can create your own Streamlit Components which will provide you with more control over application layout. Overall, the design flexibility is sufficient for basic dashboards, but does not provide much control for advanced dashboards.
Dash:
In my opinion Dash’s main strength is its incredible design flexibility. A lot of this design flexibility can be attributed to the use of HTML and CSS code alongside your Python code however.
Voilà:
Limited design flexibility. It has a handful of useful templates, but outside of these templates the only option is to construct your own nbconvert templates.
Panel:
Great design flexibility. Various templates, inline HTML & CSS, inclusion of external CSS and JavaScript files, and the ability to create your own templates, are reasons why Panel permits great design flexibility.

The Best: Dash. Dash is eons ahead with regard to design flexibility when compared to the others. This is mainly due to the framework’s Pythonic abstractions of HTML and CSS.
The Worst:
Voilà. Most of the styling has to be done either through IPYWidgets directly or through the creation of your own nbconvert templates — using HTML, CSS, & Jinja. This isn’t helped by the fact that the Voilà documentation on creating templates is currently outdated at the time of writing (March 2021) and doesn’t work in its current form.

Jupyter/IPython Notebook Support

Streamlit: None.
Dash:
The main Dash framework does not support working with Jupyter notebooks, but Plotly have recently released ‘JupyterDash for working with Dash in the Jupyter/IPython environment.
Voilà:
Exceptional Jupyter support. Voilà works directly from the Jupyter notebook interface as an extension, as well as with the Jupyter server, and JupyterLab. The framework is a Jupyter sub-project.
Panel:
Brilliant Jupyter support. Panel works almost exactly the same in the Jupyter/IPython notebook environment as with regular Python script files.

The Best: Voilà
The Worst:
Streamlit

Deployment Options

Streamlit: Plentiful. Options include their own Streamlit Sharing platform, MyBinder, AWS, Google Cloud Platform, Google Colab, Azure, Heroku, JupyterHub, Apache, Nginx, deploying as an executable file to Windows, MacOS, Linux, and even Android & IOS, and lastly ContainDS Dashboards with JupyterHub, and PythonAnywhere.
Dash:
Plentiful. Options include Heroku, MyBinder, AWS, Google Cloud Platform, Google Colab, Azure, JupyterHub, Apache, Nginx, ContainDS Dashboards with JupyterHub, and PythonAnywhere.
Voilà:
Plentiful. Options include AWS, MyBinder, Google Cloud Platform, Google Colab, Azure, Heroku, JupyterHub, Apache, Nginx, ContainDS Dashboards with JupyterHub, and PythonAnywhere.
Panel:
Plentiful. Options include AWS, MyBinder, Google Cloud Platform, Google Colab, Azure, Heroku, JupyterHub, Apache, Nginx, and PythonAnywhere.

The Best: All four frameworks have an abundance of options.
The Worst:
None.

Ease of Deployment

Streamlit: Depends on your choice of deployment environment. Deployment to the Sharing platform is as easy as deployment could possibly be. Streamlit provide good, clear documentation on deploying to their own Sharing platform. There is also a ‘Deployment Guide Wiki’ on the Streamlit forum with consolidated deployment steps for various platforms.
Dash:
Depends on your choice of deployment environment. Correctly setting environment dependencies can be slightly more difficult with Dash apps when compared to the other frameworks herein. The Dash deployment documentation only contains steps on how to deploy Dash applications to Heroku Cloud Platform, however, there are many articles on the web clearly demonstrating the appropriate deployment steps for other deployment routes.
Voilà:
Depends on your choice of deployment environment. The Voilà deployment documentation demonstrates steps for deploying to Binder, Heroku, and Google App Engine, alongside deployment steps for Nginx web servers. The docs also contain steps on how to share Voilà applications using ngrok, a tool which can used to share local servers over the internet securely. There are many articles on the web clearly demonstrating the appropriate deployment steps for other deployment options.
Panel:
Depends on your choice of deployment environment. I found the Panel deployment documentation quite vague and ambiguous. In the Panel User Guide’s ‘Deploy & Export section, steps are given on various ways to deploy your application to a server, or to export your application to a static HTML page with interactivity embedded within it. Details regarding server deployment can be found in the Server Deployment’ section of the Panel User Guide, with details for deploying to MyBinder, Heroku, and Microsoft Azure. This page also includes a list of other possible cloud providers which support Panel applications — namely AWS, Google Cloud Platform, and DigitalOcean — although no clear instructions are included for these cloud providers.

The Best: Streamlit & Voilà. Deployment to the Streamlit Sharing platform is as easy as deployment gets. Voilà’s deployment documentation is the best of the four frameworks, with clear, unambiguous instruction throughout.
The Worst:
Dash or Panel. Dash is marginally more difficult to deploy due to the environment set up. Panel’s deployment documentation discuss the breadth of ways in which Panel applications can be deployed, but there is a distinct lack of depth in the explanations.

Authentication Mechanisms

Streamlit: None.
Dash:
Dash explicitly provides users with authentication mechanisms, through the ‘dash-auth’ package which uses HTTP Basic Authentication.
Voilà:
None.
Panel:
Panel provides out of the box authentication mechanisms. It uses the OAuth 2.0 protocol, which in essence outsources authentication to a third party — for example, signing in with GitHub or Google.

The Best: Panel & Dash
The Worst:
Streamlit & Voilà

Ease of Maintenance

Streamlit: As Easy as code maintenance gets. They also maintain a clear and concise changelog for monitoring newly added and recently deprecated features.
Dash:
Relatively easy. Depending on how long it has been since you last programmed with Dash, you may need to refamiliarize yourself with the code structure before being able to continue developing your application. They also maintain a clear and concise changelog for monitoring newly added and recently deprecated features.
Voilà:
The framework does not contain any Voilà-specific code elements, meaning maintenance is simple, as it is merely maintaining Python code.
Panel:
Just how easy your application is to maintain will depend on which API you originally used to create your application, with the more rudimentary APIs such as the Interact API being easier to maintain than others, such as the Callbacks API. They also maintain a clear and concise changelog for monitoring newly added and recently deprecated features.

The Best: Streamlit & Voilà
The Worst:
Dash or Panel

Online Prevalence & Popularity

Streamlit: As of February 2021, Google & Stack Overflow searches for ‘streamlit’ return 241,000 and 485 results, respectively.
Dash:
As of February 2021, Google & Stack Overflow searches for ‘plotly dash’ return 905,000 and 500 results, respectively.
Voilà:
As of February 2021, Google & Stack Overflow searches for ‘voila dashboard’ return 1,009,000 and 75 results, respectively.
Panel:
As of February 2021, Google & Stack Overflow searches for ‘holoviz panel’ return 6,650 and 45 results, respectively.

The Best: Dash
The Worst:
Panel

Level of Support

Streamlit: No support chat or email. Active user support forum. The Streamlit GitHub repository’s Issues section has 940 closed issues and 540 open issues. (February 2021)
Dash:
No support chat or email. Active user support forum. The Dash GitHub repository’s Issues section has 558 closed issues and 392 open issues.
Voilà:
No support chat or email. No specific support forum. Issues are handled on the greater Jupyter community forum. The Voilà GitHub repository’s Issues section has 269 closed issues and 172 open issues.
Panel:
No support chat or email. Relatively active user support forum. The Panel GitHub repository’s Issues section has 664 closed issues and 316 open issues.

The Best: Streamlit & Dash
The Worst:
Voilà

The GitHub Communities

Star History of Streamlit, Dash, Panel, & Voilà. Image Courtesy of Star History.

Note: All numbers provided are as they were in February 2021.

Streamlit: 12.7k Stars, 1.1k Forks, and 80 Contributors.
Dash:
13.8k Stars, 1.4k Forks, and 61 Contributors.
Voilà:
3k Stars, ~290 Forks, and 43 Contributors.
Panel:
~950 Stars, ~150 Forks, and 60 Contributors.

The Best: Dash
The Worst:
Panel

Optimal Use Case

Streamlit: A visually appealing framework which is great to utilise if you have an already existing Python code base which you wish to turn into an interactive dashboard as quickly and painlessly as possible. It is the easiest to use of the four frameworks.
Dash:
Dash is the best choice if you are looking for an enterprise-grade one-framework-fits-all solution, or if you have a basic understanding of web development.
Voilà:
To be used in a scenario where you have a Jupyter/IPython notebook with some data analysis already conducted, and you want to share the data insights with colleagues without the code cells cluttering up the view. Voilà is also a great tool for quickly and reliably reporting data insights across an organisation.
Panel:
Creating dashboard applications which are not restricted to a single GUI. Panel is a good choice when your data is mostly geospatial. As Panel is part of the HoloViz ecosystem it works flawlessly with the GeoViews Python library for handling geospatial data. Panel handles this form of data better than Dash, Streamlit, or Voilà.

Conclusion & Comparison Matrix

In the end, having explored these four Python dashboarding frameworks through a critical lens for nearly half a year, I would say that they all have their merits, and that your choice of framework should not depend on choosing the absolute ‘best, but rather on choosing the framework that best fits your project specifications and what you are trying to achieve.

I’ll leave you with a comparison matrix, which distills everything I have learned over the last handful of months into a single graph.

Comparison Matrix — Dash vs Streamlit vs Voilà vs Panel

Thank you for reading!

I hope you have enjoyed this 5-part series, and as always, if you’ve enjoyed this article please feel free to give it a clap and a share.

How has your experience with these leading Python dashboarding frameworks been? Are there any issues or features you’ve encountered that weren’t touched upon in this article? Let me know!

Although every aspect of this article was thoroughly researched, due to the scope of the content herein and the everchanging nature of these newer dashboarding frameworks, some aspects may be incorrect or have become outdated. I have checked the veracity of every sentence in this article, however, it is still possible I may have made a mistake. If you notice any inaccuracies please comment them below or message me on LinkedIn so that I can rectify them. Thank you!

Follow me on Medium to keep up to date with any future articles.

Find out more about me on my LinkedIn.

And most importantly, best of luck in your Python dashboarding adventures!

Stephen Kilcommins

Gain Access to Expert View — Subscribe to DDI Intel



from Hacker News https://ift.tt/3ghJ0E5

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.