Python Dash by Plotly 与 Jupyter Dashboards 的优缺点是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44967759/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 00:41:37  来源:igfitidea点击:

What are the pros and cons of Dash by Plotly vs Jupyter Dashboards?

pythonjupyter-notebookplotlyjupyterplotly-dash

提问by snth

Dash by Plotlylooks like a great way for a Python developer to create interactive web apps without having to learn Javascript and Front End Web development. Another great project with similar aims and scope is Jupyter Dashboards.

Plotly 的 Dash看起来是 Python 开发人员无需学习 Javascript 和前端 Web 开发即可创建交互式 Web 应用程序的好方法。另一个具有类似目标和范围的伟大项目是Jupyter Dashboards

What are the pros and cons of each?

各自的优缺点是什么?

In particular in a multi-user deployment? I also found the Plotly documentation quite unclear on what exactly is Open Source and whether the data gets uploaded to them or if the plotting can be done offline? There are clearly two modes for the underlying Plotly library but what mode does Dash operate in?

特别是在多用户部署中?我还发现 Plotly 文档对于开源到底是什么以及数据是否上传到他们或者绘图是否可以离线完成非常不清楚?底层的 Plotly 库显然有两种模式,但 Dash 在什么模式下运行?

回答by Chris P

Disclaimer: I wrote Dash :)

免责声明:我写了 Dash :)

I'd recommend just trying both of them. Dash takes about 30 minutes to run through the tutorial.

我建议只尝试这两个。Dash 大约需要 30 分钟来完成本教程

I'd also recommend checking out:

我还建议检查:

  • 达世币公告信。这是对 Dash 的全面介绍,包括示例、架构和有关许可 (MIT) 的讨论。
  • Dash 应用程序库中 Dash 应用程序的实时示例

There are some high-level features of Dash (these are covered in the announcement letterin more detail)

Dash 有一些高级功能(这些在公告信中有更详细的介绍)

  • Dash Apps require very little boilerplate to get started - a simple "hello world" Dash app that dynamically displays a graph based off of a dropdown's value weighs in under 50 lines of code.
  • Dash Apps are generated entirely from Python, even the HTML and JS
  • Dash Apps bind interactive components (dropdowns, graphs, sliders, text inputs) with your own Python code through reactive Dash "callbacks".
  • Dash Apps are "reactive" which means that it's easy to reason about complicated UIs with multiple inputs, multiple outputs, and inputs that depend on other inputs.
  • Dash Apps are inherently multi-user apps as the "state" of the app is entirely in the client: multiple users can view apps and have independent sessions.
  • Since Dash has a traditional stateless backend, it's easy to scale apps to serve hundreds or thousands of users by scaling up the number of worker processes. Requests are sent to whichever worker is available, enabling a small number of workers to service a larger number of sessions.
  • Dash uses React.jsto render components and includes a plugin systemfor creating your own Dash components with React.
  • Dash's Graphcomponent is interactive, allowing Dash app authors to write applications that respond to hovering, clicking, or selecting points on the graph.
  • Dash 应用程序需要很少的样板才能开始 - 一个简单的“hello world”Dash 应用程序,它根据下拉列表的值动态显示图形,不到 50 行代码。
  • Dash 应用程序完全由 Python 生成,甚至是 HTML 和 JS
  • Dash 应用程序通过反应式 Dash“ callbacks”将交互式组件(下拉菜单、图形、滑块、文本输入)与您自己的 Python 代码绑定。
  • Dash 应用程序是“反应式”的,这意味着很容易推理具有多个输入、多个输出和依赖于其他输入的输入的复杂 UI。
  • Dash 应用程序本质上是多用户应用程序,因为应用程序的“状态”完全在客户端:多个用户可以查看应用程序并拥有独立的会话。
  • 由于 Dash 具有传统的无状态后端,因此可以通过扩展工作进程的数量来轻松扩展应用程序以服务成百上千的用户。请求被发送到任何可用的工作器,使少量工作器能够为大量会话提供服务。
  • Dash 使用React.js来渲染组件,并包含一个插件系统,用于使用 React 创建您自己的 Dash 组件。
  • Dash 的Graph组件是交互式的,允许 Dash 应用程序作者编写响应悬停、单击或选择图形上的点的应用程序。

I also found the Plotly documentation quite unclear on what exactly is Open Source and whether the data gets uploaded to them or if the plotting can be done offline?

我还发现 Plotly 文档对于开源到底是什么以及数据是否上传到他们或者绘图是否可以离线完成非常不清楚?

It sounds like this is referring to the plotly.pygraphing library. This is a separate library than Dash. Both libraries use the MIT licensed plotly.jslibrary for creating charts. plotly.jsdoesn't send any data to the plotly server - it's completely client-side.

听起来这是指plotly.py图形库。这是一个与 Dash 不同的库。这两个库都使用 MIT 许可的plotly.js库来创建图表。plotly.js不向 plotly 服务器发送任何数据 - 它完全是客户端。

The plotly.pylibrary includes methods to send the data to your online plotly account for hosting, sharing, and editing the charts but it's completely opt-in. Again, plotly.pyis a separate library than Dash. plotly.pyis for interactive graphing, Dashis for creating interactive applications (which can include charts).

plotly.py库包括将数据发送到您的在线 plotly 帐户以托管、共享和编辑图表的方法,但它完全是可选的。同样,plotly.py是一个单独的库,而不是Dash. plotly.py用于交互式绘图,Dash用于创建交互式应用程序(可以包括图表)。

In particular in a multi-user deployment? There are clearly two modes for the underlying Plotly library but what mode does Dash operate in?

特别是在多用户部署中?底层的 Plotly 库显然有两种模式,但 Dash 在什么模式下运行?

  • Dash is MIT licensed. You can run Dash on your own servers or on your machine.
  • Dash uses a Flask server, so you can deploy Dash apps in the same way that you would deploy Flask apps
  • Plotly licenses Dash Enterprise, a platform that can be installed on your own infrastructure. Dash Enterprise is a "PaaS" that makes it easy to deploy apps on your own servers, SSO/LDAP authentication, additional design capabilities, additional app capabilities, and more.
  • Dash 是 MIT 许可的。您可以在自己的服务器或机器上运行 Dash。
  • Dash 使用 Flask 服务器,因此您可以像部署 Flask 应用程序一样部署 Dash 应用程序
  • Plotly 许可Dash Enterprise,这是一个可以安装在您自己的基础设施上的平台。Dash Enterprise 是一个“PaaS”,可以轻松地在您自己的服务器上部署应用程序、SSO/LDAP 身份验证、附加设计功能、附加应用程序功能等。

回答by Shawn S

Well for one jupyter dashboards are free, ploty dashboards I would assume use the ploty library, where as the jupyter dashboards can use what ever modules/libraries you want. I just finished making a jupyter dashboard today to aggregate information from all of our CI systems. It was incredibly easy and honestly kind of fun. Once you get one or two data sources figured out adding a new one or adding a new widget is easy along with adding control widgets.

好吧,对于一个 jupyter 仪表板是免费的,我假设使用 ploty 仪表板,因为 jupyter 仪表板可以使用你想要的任何模块/库。我今天刚刚完成了一个 jupyter 仪表板,用于聚合来自我们所有 CI 系统的信息。这非常简单,老实说很有趣。一旦您获得一两个数据源,就可以轻松添加新的数据源或添加新的小部件以及添加控制小部件。