Skip to content

Commit 5805414

Browse files
committed
Style and metadata updates.
1 parent 455d79b commit 5805414

File tree

6 files changed

+33
-14
lines changed

6 files changed

+33
-14
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ __pycache__/
1717
.Python
1818
build/
1919
develop-eggs/
20-
dist/
2120
downloads/
2221
eggs/
2322
.eggs/
@@ -132,4 +131,4 @@ dmypy.json
132131
.pyre/
133132

134133
# etc
135-
.idea
134+
.idea

application/plotlydash/dashboard.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def create_dashboard(server):
2020

2121
# Prepare a DataFrame
2222
df = pd.read_csv('data/311-calls.csv', parse_dates=['created_date'])
23+
df['created_date'] = df['created_date'].dt.date
2324
num_complaints = df['complaint_type'].value_counts()
2425
to_remove = num_complaints[num_complaints <= 20].index
2526
df.replace(to_remove, np.nan, inplace=True)
@@ -43,7 +44,7 @@ def create_dashboard(server):
4344
],
4445
'layout': {
4546
'title': 'NYC 311 Calls category.',
46-
'height': 600,
47+
'height': 500,
4748
'padding': 150
4849
}
4950
}),

application/routes.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
@app.route('/')
77
def home():
88
"""Landing page."""
9-
return render_template('index.jinja2',
10-
title='Plotly Dash & Flask Tutorial',
11-
template='home-template',
12-
body="This is a homepage served with Flask.")
9+
return render_template(
10+
'index.jinja2',
11+
title='Plotly Dash Flask Tutorial',
12+
description='Embed Plotly Dash into your Flask applications.',
13+
template='home-template',
14+
body="This is a homepage served with Flask."
15+
)

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ nav {
9696
}
9797

9898
th {
99-
padding: 25px 15px !important;
99+
padding: 25px 12px !important;
100100
border-top: 0 !important;
101101
border-right: 0 !important;
102102
border-bottom: 1px solid #e5e7eb !important;
@@ -143,7 +143,7 @@ nav {
143143
}
144144

145145
td {
146-
padding: 15px !important;
146+
padding: 12px !important;
147147
font-size: .95em;
148148
text-align: left !important;
149149

@@ -200,7 +200,7 @@ table {
200200
}
201201

202202
td {
203-
padding: 15px 10px !important;
203+
padding: 12px 10px !important;
204204
overflow: hidden !important;
205205
border: 0 !important;
206206
font-size: 0.65em !important;
@@ -238,7 +238,7 @@ table {
238238

239239
#histogram-graph {
240240
margin-bottom: 30px;
241-
padding-bottom: 50px;
241+
padding-bottom: 176px !important;
242242
overflow: hidden;
243243
border-radius: 4px;
244244
background: white;

application/templates/layout.jinja2

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,30 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6-
<title>{{title}}</title>
6+
<title>{{ title }}</title>
7+
<meta property="og:site_name" content="{{ title }}"/>
8+
<meta property="og:type" content="website"/>
9+
<meta property="og:title" content="{{ title }} - Hackers and Slackers"/>
10+
<meta property="og:description" content="{{ description }}"/>
11+
<meta property="og:url" content="https://plotlydashflask.hackersandslackers.app/"/>
12+
<meta name="twitter:title" content="{{ title }}"/>
13+
<meta name="twitter:description" content="{{ description }}"/>
14+
<meta name="twitter:url" content="https://plotlydashflask.hackersandslackers.app/"/>
15+
<meta name="twitter:site" content="@hackersslackers"/>
16+
<meta name="twitter:creator" content="@toddrbirchard"/>
17+
<meta name="twitter:card" content="summary_large_image"/>
18+
<meta name="twitter:image"
19+
content=" https://storage.googleapis.com/hackersandslackers-cdn/2018/12/Dash@2x.jpg"/>
20+
<meta property="og:image" content=" https://storage.googleapis.com/hackersandslackers-cdn/2018/12/Dash@2x.jpg"/>
21+
<meta property="og:image:width" content="1000"/>
22+
<meta property="og:image:height" content="523"/>
723
<meta name="HandheldFriendly" content="True" />
824
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
925
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
1026
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/styles.css') }}" />
1127
<link rel="stylesheet" href="https://use.typekit.net/uqq2lcv.css">
12-
<link rel="shortcut icon" href="{{ url_for('static', filename='dist/img/favicon.png') }}" type="image/x-icon" />
1328
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
29+
<link rel="shortcut icon" href="{{ url_for('static', filename='dist/img/favicon.png') }}" type="image/x-icon" />
1430
</head>
1531
<body class="{{template}}">
1632
<div class="container">

0 commit comments

Comments
 (0)