Skip to content

Commit 6ef2878

Browse files
committed
local updates.
1 parent 705d291 commit 6ef2878

File tree

20 files changed

+406
-258
lines changed

20 files changed

+406
-258
lines changed

Pipfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[dev-packages]
7-
python-dotenv = "*"
87
lesscpy = "*"
98
cssmin = "*"
109
jsmin = "*"
@@ -19,6 +18,7 @@ Dash_core_components = "*"
1918
Dash_html_components = "*"
2019
Dash-renderer = "*"
2120
Pandas = "*"
21+
python-dotenv = "*"
2222

2323
[requires]
24-
python_version = "3.7"
24+
python_version = "3.8"

Pipfile.lock

Lines changed: 100 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# Plot.ly Dash Flask Tutorial
1+
# Plotly Dash Flask Tutorial
22

33

4-
![Python](https://img.shields.io/badge/Python-3.7-blue.svg?logo=python&longCache=true&logoColor=white&colorB=5e81ac&style=flat-square&colorA=4c566a)
5-
![Flask](https://img.shields.io/badge/Flask-1.0.2-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
6-
![Flask-Assets](https://img.shields.io/badge/Flask--Assets-v0.12-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
7-
![Pandas](https://img.shields.io/badge/Pandas-v0.24.2-blue.svg?longCache=true&logo=python&longCache=true&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
8-
![Dash](https://img.shields.io/badge/Dash-v1.0.2-blue.svg?longCache=true&logo=python&longCache=true&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
9-
![Plotly](https://img.shields.io/badge/Plotly-v3.7.1-blue.svg?longCache=true&logo=python&longCache=true&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
4+
![Python](https://img.shields.io/badge/Python-^3.8-blue.svg?logo=python&longCache=true&logoColor=white&colorB=5e81ac&style=flat-square&colorA=4c566a)
5+
![Flask](https://img.shields.io/badge/Flask-1.1.2-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
6+
![Flask-Assets](https://img.shields.io/badge/Flask--Assets-v2.0-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
7+
![Pandas](https://img.shields.io/badge/Pandas-v1.0.3-blue.svg?longCache=true&logo=python&longCache=true&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
8+
![Dash](https://img.shields.io/badge/Dash-v1.11.0-blue.svg?longCache=true&logo=python&longCache=true&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
9+
![Plotly](https://img.shields.io/badge/Plotly-v4.6.0-blue.svg?longCache=true&logo=python&longCache=true&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
1010
![GitHub Last Commit](https://img.shields.io/github/last-commit/google/skia.svg?style=flat-square&colorA=4c566a&colorB=a3be8c)
1111
[![GitHub Issues](https://img.shields.io/github/issues/toddbirchard/plotlydash-flask-tutorial.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/toddbirchard/plotlydash-flask-tutorial/issues)
1212
[![GitHub Stars](https://img.shields.io/github/stars/toddbirchard/plotlydash-flask-tutorial.svg?style=flat-square&colorB=ebcb8b&colorA=4c566a)](https://github.com/toddbirchard/plotlydash-flask-tutorial/stargazers)
1313
[![GitHub Forks](https://img.shields.io/github/forks/toddbirchard/plotlydash-flask-tutorial.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/toddbirchard/plotlydash-flask-tutorial/network)
1414

1515

16-
Source code for the accompanying tutorial found here: https://hackersandslackers.com/gaining-full-control-over-plotly-dash/
16+
Source code for the accompanying tutorial found here: https://hackersandslackers.com/plotly-dash-with-flask/

application/dash_application/dash_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def get_datasets():
3535
"""Return previews of all CSVs saved in /data directory."""
3636
p = Path('.')
3737
data_filepath = list(p.glob('data/*.csv'))
38-
arr = ['This is an example Plot.ly Dash App.']
38+
arr = []
3939
for index, csv in enumerate(data_filepath):
4040
df = pd.read_csv(data_filepath[index]).head(10)
4141
table_preview = dash_table.DataTable(

application/dash_application/layout.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@
77
{%css%}
88
</head>
99
<body>
10-
<nav>
11-
<a href="/"><i class="fas fa-home"></i> Home</a>
12-
<a href="/dashapp/"><i class="fas fa-chart-line"></i> Embdedded Plotly Dash</a>
13-
</nav>
10+
<header>
11+
<div class="nav-wrapper">
12+
<a href="/" class="logo">
13+
<img src="/static/img/logo.png" class="logo" />
14+
</a>
15+
<nav>
16+
<a href="/dashapp/"><i class="fas fa-chart-line"></i> Embdedded Plotly Dash</a>
17+
</nav>
18+
</div>
19+
</header>
1420
{%app_entry%}
1521
<footer>
1622
{%config%}

application/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@main_bp.route('/')
1212
def home():
1313
"""Landing page."""
14-
return render_template('index.html',
15-
title='Plotly Flask Tutorial.',
14+
return render_template('index.jinja2',
15+
title='Plotly Dash & Flask Tutorial',
1616
template='home-template',
1717
body="This is an example homepage served with Flask.")

application/static/dist/css/styles.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

application/static/img/logo.png

5.79 KB
Loading

application/static/less/global.less

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
body,
22
html {
3-
font-family: 'Lato';
4-
background: #e7ecf7 !important;
5-
padding: 0;
63
height: 100% !important;
4+
margin: 0;
5+
padding: 0;
6+
background: #e7ecf7 !important;
77
background: #edf4f7;
8+
font-family: 'Lato';
89
}
910

1011
.row .col {
Lines changed: 23 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,34 @@
11
header {
2-
background: rgba(26, 35, 55, 1);
2+
position: relative;
33
width: 100%;
4-
height: 70px;
4+
margin-bottom: 50px!important;
5+
padding: 30px 0 !important;
6+
background: white!important;
7+
box-shadow: 0 0 5px #bec6cf;
8+
font-family: 'Lato',sans-serif;
9+
10+
.nav-wrapper {
11+
display: flex;
12+
align-items: center;
13+
justify-content: space-between;
14+
width: 1000px;
15+
max-width: 90%;
16+
margin: auto;
517

6-
.leftNav {
718
nav {
8-
width: 30%;
9-
color: white;
10-
background: none;
11-
padding: 20px 30px;
12-
box-shadow: none !important;
1319
display: flex;
14-
align-items: center;
1520
}
1621

17-
ul {
18-
list-style: none;
19-
width: 100%;
20-
display: flex;
21-
justify-content: space-between;
22-
align-items: center;
23-
24-
li {
25-
display: inline-block;
26-
color: white;
27-
line-height: 1;
28-
height: fit-content;
29-
font-size: 1em !important;
30-
font-weight: 400;
31-
}
32-
33-
.rightNav {
34-
float: right;
35-
36-
.export {
37-
display: block !important;
38-
position: absolute !important;
39-
width: 40px !important;
40-
height: 40px !important;
41-
top: 10px !important;
42-
right: 10px !important;
43-
font-size: 2em !important;
44-
color: white !important;
45-
transition: all 0.3s ease-out;
46-
47-
&:hover {
48-
cursor: pointer;
49-
opacity: 0.7;
50-
}
22+
.logo {
23+
width: 50px;
24+
}
5125

52-
.export-icon {
53-
font-size: 1em;
54-
}
55-
}
56-
}
26+
a {
27+
margin-left: 30px;
28+
color: #70829d;
29+
font-size: 1em;
30+
text-decoration: none;
31+
transition: all 0.3s ease-out;
5732
}
5833
}
5934
}

0 commit comments

Comments
 (0)