Skip to content

Commit cd7e32f

Browse files
committed
dash v1.0.2
1 parent a4432b4 commit cd7e32f

File tree

8 files changed

+82
-73
lines changed

8 files changed

+82
-73
lines changed

Pipfile

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

66
[dev-packages]
7-
python-dotenv="*"
8-
lesscpy="*"
9-
cssmin="*"
10-
jsmin="*"
7+
python-dotenv = "*"
8+
lesscpy = "*"
9+
cssmin = "*"
10+
jsmin = "*"
1111

1212
[packages]
13-
flask="*"
14-
flask_assets="*"
15-
pathlib="*"
16-
dash="*"
17-
dash_core_components="*"
18-
dash_html_components="*"
19-
dash-renderer="*"
20-
pandas="*"
13+
Flask = "*"
14+
Flask_assets = "*"
15+
Pathlib = "*"
16+
Dash = "*"
17+
Dash_core_components = "*"
18+
Dash_html_components = "*"
19+
Dash-renderer = "*"
20+
Pandas = "*"
2121

2222
[requires]
2323
python_version = "3.7"

Pipfile.lock

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
![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)
66
![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)
77
![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-v0.40.0-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)
99
![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)
1010
![Psycopg2-Binary](https://img.shields.io/badge/Psycopg2--Binary-v2.7.7-red.svg?longCache=true&style=flat-square&logo=PostgreSQL&logoColor=white&colorA=4c566a&colorB=bf616a)
1111
![Flask-SQLAlchemy](https://img.shields.io/badge/Flask--SQLAlchemy-2.3.2-red.svg?longCache=true&style=flat-square&logo=scala&logoColor=white&colorA=4c566a&colorB=bf616a)

application/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ def create_app():
1818
from .dash_application import dash_example
1919
app = dash_example.Add_Dash(app)
2020

21+
# Compile assets
22+
from .assets import compile_assets
23+
compile_assets(app)
24+
2125
return app

application/assets.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from flask_assets import Environment, Bundle
2+
3+
4+
def compile_assets(app):
5+
"""Configure authorization asset bundles."""
6+
assets = Environment(app)
7+
Environment.auto_build = True
8+
Environment.debug = False
9+
less_bundle = Bundle('less/*.less',
10+
filters='less,cssmin',
11+
output='dist/css/styles.css',
12+
extra={'rel': 'stylesheet/less'})
13+
js_bundle = Bundle('js/*.js',
14+
filters='jsmin',
15+
output='dist/js/main.js')
16+
assets.register('less_all', less_bundle)
17+
assets.register('js_all', js_bundle)
18+
if app.config['FLASK_ENV'] == 'development':
19+
less_bundle.build(force=True)
20+
js_bundle.build()

application/dash_application/dash_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Create a Dash app within a Flask app."""
2-
import glob
32
from pathlib import Path
43
from dash import Dash
54
import dash_table
@@ -43,7 +42,8 @@ def get_datasets():
4342
id='table_' + str(index),
4443
columns=[{"name": i, "id": i} for i in df.columns],
4544
data=df.to_dict("rows"),
46-
sorting=True,
45+
sort_action="native",
46+
sort_mode='single'
4747
)
4848
arr.append(table_preview)
4949
return arr

application/routes.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
11
"""Routes for core Flask app."""
22
from flask import Blueprint, render_template
3-
from flask_assets import Environment, Bundle
43
from flask import current_app as app
54

5+
66
main_bp = Blueprint('main_bp', __name__,
77
template_folder='templates',
88
static_folder='static')
9-
assets = Environment(app)
10-
Environment.auto_build = True
11-
Environment.debug = False
12-
less_bundle = Bundle('less/*.less',
13-
filters='less,cssmin',
14-
output='dist/css/styles.css',
15-
extra={'rel': 'stylesheet/less'})
16-
js_bundle = Bundle('js/*.js',
17-
filters='jsmin',
18-
output='dist/js/main.js')
19-
assets.register('less_all', less_bundle)
20-
assets.register('js_all', js_bundle)
21-
if app.config['FLASK_ENV'] == 'development':
22-
less_bundle.build(force=True)
23-
js_bundle.build()
249

2510

2611
@main_bp.route('/')

requirements.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ attrs==19.1.0
22
certifi==2019.3.9
33
chardet==3.0.4
44
Click==7.0
5+
cssmin==0.2.0
56
dash==1.0.2
67
dash-core-components==1.0.0
78
dash-html-components==1.0.0
@@ -15,18 +16,22 @@ idna==2.8
1516
ipython-genutils==0.2.0
1617
itsdangerous==1.1.0
1718
Jinja2==2.10.1
19+
jsmin==2.2.2
1820
jsonschema==3.0.1
1921
jupyter-core==4.4.0
22+
lesscpy==0.13.0
2023
MarkupSafe==1.1.1
2124
nbformat==4.4.0
22-
numpy==1.16.4
25+
numpy==1.17.0
2326
pandas==0.25.0
2427
pathlib==1.0.1
2528
plotly==4.0.0
29+
ply==3.11
2630
pyrsistent==0.15.2
2731
python-dateutil==2.8.0
28-
pytz==2019.1
29-
PyYAML==5.1.1
32+
python-dotenv==0.10.3
33+
pytz==2019.2
34+
PyYAML==5.1.2
3035
requests==2.21.0
3136
retrying==1.3.3
3237
six==1.12.0

0 commit comments

Comments
 (0)