Commit 83be64e2 authored by Samuël Weber's avatar Samuël Weber
Browse files

remove app folder

parent f57b090c
import dash
app = dash.Dash(
__name__,
meta_tags=[
{"name": "viewport", "content": "width=device-width, initial-scale=1"}
],
)
server = app.server
app.config.suppress_callback_exceptions = True
This diff is collapsed.
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from app_main import app
layout = dbc.Container(
dbc.Row(
dbc.Col(
[
html.H1("Question and contact"),
dcc.Markdown(
"""
## The SOURCES project
The purpose of this website is data vizualisation of the SOURCES project.
However, if you are interested in re-using part of this database or if you
have other questions, please contact us:
- Olivier Favez: ```olivier.favez@ineris.fr```
- Jean-Luc Jaffrezo: ```jean-luc.jaffrezoz@univ-grenoble-alpes.fr```
## The web app
This app is written in python thanks to [dash](https://dash.plot.ly/), based on
plotly. Many thanks to all the dash developers!
The app in developped and maintained by
- Samuël Weber: ```samuel.weber@univ-grenoble-alpes.fr```
Also, the git repository is available here: [git repo](https://gricad-gitlab.univ-grenoble-alpes.fr/pmall/pm-source).
"""
)
]
)
)
)
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
# from app_main import app
layout = dbc.Container(
dbc.Row([
dbc.Col(
id="about-col",
children=[
html.H1("About"),
dcc.Markdown("""
Blabla
""", dangerously_allow_html=True),
dcc.Link("Start exploring the results", href="/results",
className="btn btn-success mx-auto my-3 w-50 d-block")
]
)
])
)
This diff is collapsed.
This diff is collapsed.
#container-sources {
width: 95%;
}
#map-component {
margin: 20px 0px;
/* height: 200px; */
display: block;
}
.text {
display: block;
}
.helping-text {
text-align: center;
padding-top: 20px;
}
#boxplot-options {
/* display: flex; */
display: block;
width: 100%;
}
.options-items {
display: inline-block;
}
.options-items label {
margin-left: 5px;
}
p {
text-align: justify;
}
.graph_main_page {
margin: 0px;
padding: 0px;
}
.caption p {
text-align: center;
color: darkblue;
}
#nav-logo a {
/* background-color: #DDD; */
margin: 0px 10px;
}
This diff is collapsed.
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State
from app_main import app
from apps import app_contact, app_results, app_deconvolOP
server = app.server
# ========== Layout
app.layout = html.Div([
dbc.Navbar(
[
dbc.NavbarBrand("OP apportionment", href="/", className="ml-2 font-weight-bold"),
dbc.NavbarToggler(id="navbar-toggler"),
dbc.Collapse(
[
dbc.NavLink("Results", href="/results",
className="btn btn-info"),
dbc.NavLink("Question & contact", href="/contact"),
],
navbar=True,
id='navbar-collapse'
),
#
dbc.Row(
[
html.A(
html.Img(
src="/assets/img/logo_IGE.png",
className="logo", height=50
),
href="http://www.ige-grenoble.fr"
),
html.A(
html.Img(
src="/assets/img/logo_INERIS.png",
className="logo", height=50
),
href="https://www.ineris.fr"
),
html.A(
html.Img(
src="/assets/img/logo_LCSQA.png",
className="logo", height=50
),
href="http://www.lcsqa.org"
),
html.A(
html.Img(
src="/assets/img/logo_ADEME.png",
className="logo", height=50
),
href="https://ademe.fr"
),
],
id="nav-logo",
className="ml-auto "
)
],
),
html.Div(id='master-page-content'),
dcc.Location(id='master-url', refresh=False)
])
# =========== Options
app.title = "OP apportionment"
# external_css = [
# dbc.themes.BOOTSTRAP
# ]
#
# for css in external_css:
# app.css.append_css({"external_url": css})
# =========== Serve pages
@app.callback(
Output('master-page-content', 'children'),
[Input('master-url', 'pathname')]
)
def display_page(pathname):
# return app_single.layout
print(pathname)
if pathname is None or pathname == '/':
return app_deconvolOP.layout
elif pathname[:len('/results')] == '/results':
return app_results.layout
elif pathname[:len('/contact')] == '/contact':
return app_contact.layout
else:
return app_deconvolOP.layout
# # return '404'
# add callback for toggling the collapse on small screens
@app.callback(
Output("navbar-collapse", "is_open"),
[Input("navbar-toggler", "n_clicks")],
[State("navbar-collapse", "is_open")],
)
def toggle_navbar_collapse(n, is_open):
if n:
return not is_open
return is_open
# =================================
if __name__ == '__main__':
app.run_server(debug=True)
STATION_ORDER = [
"MRS-5av", "PdB", "AIX", "NIC", "TAL", "NGT", "GRE-fr_2013", "GRE-fr_2017",
"GRE-cb", "VIF", "CHAM", "MNZ", "PAS", "RBX", "STG-cle"
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment