dash.Dash

Published by onesixx on

홈페이지: https://plotly.com/

Dash Python User Guide: https://dash.plotly.com/

community : https://community.plotly.com/

club : https://community.plotly.com/tag/dash-club

group : https://community.plotly.com/g

Plotly Open Source Graphing Library : https://plotly.com/python

awesome-dash : https://github.com/ucg8j/awesome-dash#galleries

예시

https://dash-example-index.herokuapp.com/

Dash Enterprise App Gallery : https://dash.gallery/Portal/

https://github.com/plotly/dash-sample-apps

Dash : Web application 빌드하는 데 사용되는 Python 프레임 워크

대시보드를 만드는 데 이상적임 (Flask, Plotly.js 및 React.js로 작성되었으므로)

  • Flask (cf. Django)
  • react.js
  • plotly
!pip install --user plotly
Clean Architecture for AI/ML Applications using Dash and Plotly with Docker

 EDA (exploratory data analysis) :

Dash 의 official documentation : Python framework for building web analytic applications.
Flask, React, and Plotly 

장점

  1. Python으로 모두 처리
  2. “reactive” UI 구현이 쉽다.
    – multiple inputs
    – multiple outputs
    – inputs that depend on other inputs
  3. Dash Apps은 태생적으로 multi-user apps: 즉 multiple users가 독립적인 session으로 app을 본다. s
  4. Flask 를 backend로 사용하고, Gunicorn을 통해 실행하므로,
    많은 수의 worker processes를 제공 할 수 있다.
  5. compoent 렌더링에는 React.js 를 사용하고, React를 통해 Dash 컴포넌트를 생성할수 있는
     plugin system 을 제공한다.
    React 커뮤니티에서 만들어지는 컴포넌트를 (slider, table 컴포넌트)를 가져다 적용할수 있다.
  6. Flask 를 server로 사용하기 때문에, Flask app처럼 Dash를 deploy할 수 있다.
  7. 다소 관대한 MIT 오픈소스 license

단점

  1. Reactive 그래프에서 중간값이 없다.
    Plotly에서 제안된것처럼 hidden div에 “중간데이터”를 추가
  2. 모든 Output에 각각 분리된 function을 작성해야만 한다.
    You have to write a separate function for every Output which forces you to restructure the code
    (sometimes this can be also an advantage)
  3. 2개의 python callback이 같은 element를 업데이트하는 것이 불가능하다.
  4. Input이 없거나 Output이 없는 callback은 만들수 없다.

예제

from dash import Dash, html, dcc
from dash.dependencies import Input, Output
# Run this app with `python app.py` and
# visit http://127.0.0.1:8050/ in your web browser.

from dash import Dash, html

app = dash.Dash(__name__)

app.layout = html.Div(children=[
    html.H3('Dash App'),
])

if __name__ == '__main__':
    app.run_server(debug=True)
Categories: dash

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x