Skip to content

Commit 30318ec

Browse files
committed
Minor cleanup.
1 parent a7cddd5 commit 30318ec

File tree

5 files changed

+26
-25
lines changed

5 files changed

+26
-25
lines changed

application/plotlydash/dashboard.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Create a Dash app within a Flask app."""
2-
from pathlib import Path
32
import dash
43
import dash_table
54
import dash_html_components as html
@@ -34,27 +33,27 @@ def create_dashboard(server):
3433
# Create Dash Layout comprised of Data Tables
3534
dash_app.layout = html.Div(
3635
children=[dcc.Graph(
37-
id='histogram-graph',
38-
figure={
39-
'data': [
40-
{
41-
'x': df['complaint_type'],
42-
'text': df['complaint_type'],
43-
'customdata': df['unique_key'],
44-
'name': '311 Calls by region.',
45-
'type': 'histogram'
36+
id='histogram-graph',
37+
figure={
38+
'data': [
39+
{
40+
'x': df['complaint_type'],
41+
'text': df['complaint_type'],
42+
'customdata': df['unique_key'],
43+
'name': '311 Calls by region.',
44+
'type': 'histogram'
45+
}
46+
],
47+
'layout': {
48+
'title': 'NYC 311 Calls category.',
49+
'height': 600,
50+
'padding': 150
4651
}
52+
}),
53+
create_data_table(df)
4754
],
48-
'layout': {
49-
'title': 'NYC 311 Calls category.',
50-
'height': 600,
51-
'padding': 150
52-
}
53-
}
54-
),
55-
create_data_table(df)],
5655
id='dash-container'
57-
)
56+
)
5857

5958
return dash_app.server
6059

application/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Routes for core Flask app."""
1+
"""Core Flask app routes."""
22
from flask import Blueprint, render_template
33
from flask import current_app as app
44

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/less/home.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
.home-template {
22
.container {
33
width: 1000px;
4-
margin: 90px auto;
4+
margin: 50px auto;
55
}
66

77
.card {
88
width: 900px;
99
max-width: 93%;
1010
height: fit-content;
11-
margin: 80px auto 0;
11+
margin: 40px auto 0;
1212
padding: 50px;
1313
background: white;
1414
box-shadow: 0 0 5px rgba(65, 67, 144, 0.15);

application/templates/index.jinja2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<img src="{{ url_for('static', filename='img/logo.png') }}" class="logo" />
66
<h1 class="site-title">{{ title }}</h1>
77
<p class="subtitle">Demo for embedding Plotly Dash within Flask Apps (View source on <a href="https://github.com/toddbirchard/plotlydash-flask-tutorial">Github</a>).</p>
8-
9-
<a href="/dashapp/" class="dash-link">Embdedded Plotly Dash <i class="fas fa-arrow-right"></i></a>
8+
<a href="/dashapp/" class="dash-link">
9+
<span>Embdedded Plotly Dash</span>
10+
<i class="fas fa-arrow-right"></i>
11+
</a>
1012
</div>
1113
{% endblock %}

0 commit comments

Comments
 (0)