-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
26 lines (21 loc) · 785 Bytes
/
Copy pathapp.py
File metadata and controls
26 lines (21 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import dash
from dash import html, dcc
import pandas as pd # Example import
# ... any other imports
app = dash.Dash(__name__, external_stylesheets=['https://codepen.io/chriddyp/pen/bWLwgP.css']) # Example external stylesheet
server = app.server # Expose the Flask server object for gunicorn
# Sample DataFrame (replace with your data)
df = pd.DataFrame({'x': [1, 2, 3], 'y': [4, 5, 6]})
app.layout = html.Div([
html.H1("My Dash App"),
dcc.Graph(
id='example-graph',
figure={
'data': [{'x': df['x'], 'y': df['y'], 'type': 'bar', 'name': 'SF'}],
'layout': {'title': 'Dash Graph'}
}
)
])
# ... any callbacks or other app logic ...
if __name__ == '__main__':
app.run_server(debug=True) # Set debug=False for production!