資料參考:https://alysivji.github.io/reactive-dashboards-with-dash.html (frameware,good)
Big Data Analytics with Pandas and SQLite in Python
https://datacarpentry.org/python-ecology-lesson/09-working-with-sql/index.html
https://sqlitebrowser.org/
https://medium.com/a-r-g-o/using-plotlys-dash-to-deliver-public-sector-decision-support-dashboards-ac863fa829fb (another porject)
Dash Application Design: MVC Pattern
Every Dash application could be divided into the following components:
(1)Data Manipulation - Perform operations to read / transform data for display
(2)Dashboard Layout - Visually render data into output representation
(3)Interaction Between Components - Convert user input to commands for data manipulation + render
When designing a Dash application, we should stucture our code into three sections:
1. Data Manipulation (Model)
2. Dashboard Layout (View)
3. Interaction Between Components (Controller)
We created the following template to help us get started:
Historical Match-up Dashboard
In this section, we will create a full-featured Dash application that can be used to view historical soccer data.
We will use the following process to create / modify Dash applications:
- Create/Update Layout - Figure out where components will be placed
- Map Interactions with Other Components - Specify interaction in callback decorators
- Wire in Data Model - Data manipulation to link interaction and render
Data is stored in an SQLite database:
wget https://github.com/alysivji/historical-results-dashboard/blob/master/soccer-stats.db?raw=true soccer-stats.db
Download the Dash application template file from above:
$ export DB_URI=sqlite:///soccer-stats.db $ python app.py * Running on http://0.0.0.0:8050/ (Press CTRL+C to quit) * Restarting with stat
留言列表