Skip to content

Commit

Permalink
Added dash-extension support. Also significant tidy up and refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
ascillitoe committed Jul 18, 2021
1 parent 1b7520a commit 2a3289e
Show file tree
Hide file tree
Showing 12 changed files with 698 additions and 771 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# cache dir
tmp/
19 changes: 13 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import dash
import dash_html_components as html
import dash_core_components as dcc
from dash_extensions.enrich import Dash, FileSystemStore
import dash_bootstrap_components as dbc
from whitenoise import WhiteNoise
import os

os.makedirs("tmp/", exist_ok=True)
output_defaults=dict(backend=FileSystemStore(cache_dir="tmp/",threshold=100), session_check=True)

external_stylesheets = [dbc.themes.SPACELAB, 'https://codepen.io/chriddyp/pen/bWLwgP.css']
app = Dash(__name__, suppress_callback_exceptions=True, output_defaults=output_defaults,
external_stylesheets=[dbc.themes.SPACELAB, 'https://codepen.io/chriddyp/pen/bWLwgP.css'],
external_scripts=["https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML" ])
app.title = "Uncertainty Quantification with equadratures"

app=dash.Dash(__name__, external_stylesheets=external_stylesheets,suppress_callback_exceptions=True,meta_tags=[{'name': 'viewport',
'content': 'width=device-width, initial-scale=0.2, maximum-scale=1.2,minimum-scale=0.5'}])
server = app.server
server.secret_key = os.environ.get('secret_key', 'secret')
# To serve static files (e.g. images etc)
server.wsgi_app = WhiteNoise(server.wsgi_app, root='static/')
Loading

0 comments on commit 2a3289e

Please sign in to comment.