Spaces:
Sleeping
Sleeping
Update index.py
Browse files
index.py
CHANGED
@@ -57,7 +57,7 @@ df_neg = counts[[x in ['negative'] for x in counts.FinBERT_label]]
|
|
57 |
|
58 |
|
59 |
|
60 |
-
app.layout = dbc.Container([
|
61 |
dbc.Row([ # row 1
|
62 |
dbc.Col([html.H1('Evolução temporal de sentimento em títulos de notícias')],
|
63 |
className="text-center mt-3 mb-1")]),
|
@@ -371,7 +371,28 @@ def update_output(selected_topic, selected_domain, start_date, end_date):
|
|
371 |
# )
|
372 |
# def update_headlines_table(selected_topic, selected_domain, start_date, end_date):
|
373 |
# # Filtering data...
|
374 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
|
376 |
if __name__ == '__main__':
|
377 |
app.run_server(debug=True)
|
|
|
57 |
|
58 |
|
59 |
|
60 |
+
# app.layout = dbc.Container([
|
61 |
dbc.Row([ # row 1
|
62 |
dbc.Col([html.H1('Evolução temporal de sentimento em títulos de notícias')],
|
63 |
className="text-center mt-3 mb-1")]),
|
|
|
371 |
# )
|
372 |
# def update_headlines_table(selected_topic, selected_domain, start_date, end_date):
|
373 |
# # Filtering data...
|
374 |
+
|
375 |
+
app.layout = html.Div(
|
376 |
+
[
|
377 |
+
dbc.Tabs(
|
378 |
+
[
|
379 |
+
dbc.Tab(label="Tab 1", tab_id="tab-1"),
|
380 |
+
dbc.Tab(label="Tab 2", tab_id="tab-2"),
|
381 |
+
],
|
382 |
+
id="tabs",
|
383 |
+
active_tab="tab-1",
|
384 |
+
),
|
385 |
+
html.Div(id="content"),
|
386 |
+
]
|
387 |
+
)
|
388 |
+
|
389 |
+
@app.callback(Output("content", "children"), [Input("tabs", "active_tab")])
|
390 |
+
def switch_tab(at):
|
391 |
+
if at == "tab-1":
|
392 |
+
return tab1_content
|
393 |
+
elif at == "tab-2":
|
394 |
+
return tab2_content
|
395 |
+
return html.P("This shouldn't ever be displayed...")
|
396 |
|
397 |
if __name__ == '__main__':
|
398 |
app.run_server(debug=True)
|