-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5399faf
commit eb0afb0
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: dash | ||
on: push | ||
jobs: | ||
mini-app: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- run: | | ||
pip install dash | ||
pip install pandas | ||
- run: python Dash/app.py | ||
timeout-minutes: 1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Dash.plotly | ||
- Python low-code framework | ||
- For building ML & data science web apps. | ||
- Built on top of Plotly.js, React and Flask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from dash import Dash, html, dcc, callback, Output, Input | ||
import plotly.express as px | ||
import pandas as pd | ||
|
||
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminder_unfiltered.csv') | ||
|
||
app = Dash() | ||
|
||
app.layout = [ | ||
html.H1(children='Title of Dash App', style={'textAlign':'center'}), | ||
dcc.Dropdown(df.country.unique(), 'Canada', id='dropdown-selection'), | ||
dcc.Graph(id='graph-content') | ||
] | ||
|
||
@callback( | ||
Output('graph-content', 'figure'), | ||
Input('dropdown-selection', 'value') | ||
) | ||
def update_graph(value): | ||
dff = df[df.country==value] | ||
return px.line(dff, x='year', y='pop') | ||
|
||
if __name__ == '__main__': | ||
app.run(debug=True) |