Nazhar commited on
Commit
a5b09d6
·
verified ·
1 Parent(s): 13ed06a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -298,7 +298,7 @@ with news_analysis:
298
  line=dict(dash='solid', color=cs.close_line_color, width=2),
299
  # text=events['Cleaned_Headline'],
300
  # hovertext=events['FeatureSentiment'],
301
- customdata=events['Feature'],
302
  hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',
303
  # hoverlabel=dict(font=dict(color=events
304
  # ['FeatureSentiment'].apply(lambda x: 'red' if x == 'Negative' else 'blue' if x == 'Neutral' else 'green'))), # Customize the line style, color, and width
@@ -325,10 +325,10 @@ with news_analysis:
325
  figure = go.Figure(data=[line_stock], layout=layout)
326
  figure.add_scatter(x=plot_sub_pos['Date'], y=plot_sub_pos['Price'], mode='markers',
327
  marker=dict(symbol='triangle-up', size=10, color=cs.pos_impacts_color), name='Positive Impact',
328
- customdata=set(plot_sub_pos['Feature']), hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>')
329
  figure.add_scatter(x=plot_sub_neg['Date'], y=plot_sub_neg['Price'], mode='markers',
330
  marker=dict(symbol='triangle-down', size=10, color=cs.neg_impacts_color), name='Negative Impact',
331
- customdata=set(plot_sub_neg['Feature']), hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',)
332
  figure.update_layout(
333
  title={
334
  'text': title,
@@ -692,7 +692,7 @@ with final_recs:
692
  line=dict(dash='solid', color=cs.close_line_color, width=2),
693
  # text=events['Cleaned_Headline'],
694
  # hovertext=events['FeatureSentiment'],
695
- customdata=events['Feature'],
696
  hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',
697
  # hoverlabel=dict(font=dict(color=events
698
  # ['FeatureSentiment'].apply(lambda x: 'red' if x == 'Negative' else 'blue' if x == 'Neutral' else 'green'))), # Customize the line style, color, and width
@@ -719,10 +719,10 @@ with final_recs:
719
  figure = go.Figure(data=[line_stock], layout=layout)
720
  figure.add_scatter(x=plot_sub_pos['Date'], y=plot_sub_pos['Price'], mode='markers',
721
  marker=dict(symbol='triangle-up', size=10, color=cs.pos_impacts_color), name='Positive Impact',
722
- customdata=set(plot_sub_pos['Feature']), hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>')
723
  figure.add_scatter(x=plot_sub_neg['Date'], y=plot_sub_neg['Price'], mode='markers',
724
  marker=dict(symbol='triangle-down', size=10, color=cs.neg_impacts_color), name='Negative Impact',
725
- customdata=set(plot_sub_neg['Feature']), hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',)
726
  figure.update_layout(
727
  title={
728
  'text': title,
 
298
  line=dict(dash='solid', color=cs.close_line_color, width=2),
299
  # text=events['Cleaned_Headline'],
300
  # hovertext=events['FeatureSentiment'],
301
+ customdata=str(events['Feature']),
302
  hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',
303
  # hoverlabel=dict(font=dict(color=events
304
  # ['FeatureSentiment'].apply(lambda x: 'red' if x == 'Negative' else 'blue' if x == 'Neutral' else 'green'))), # Customize the line style, color, and width
 
325
  figure = go.Figure(data=[line_stock], layout=layout)
326
  figure.add_scatter(x=plot_sub_pos['Date'], y=plot_sub_pos['Price'], mode='markers',
327
  marker=dict(symbol='triangle-up', size=10, color=cs.pos_impacts_color), name='Positive Impact',
328
+ customdata=str(set(plot_sub_pos['Feature'])), hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>')
329
  figure.add_scatter(x=plot_sub_neg['Date'], y=plot_sub_neg['Price'], mode='markers',
330
  marker=dict(symbol='triangle-down', size=10, color=cs.neg_impacts_color), name='Negative Impact',
331
+ customdata=str(set(plot_sub_neg['Feature'])), hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',)
332
  figure.update_layout(
333
  title={
334
  'text': title,
 
692
  line=dict(dash='solid', color=cs.close_line_color, width=2),
693
  # text=events['Cleaned_Headline'],
694
  # hovertext=events['FeatureSentiment'],
695
+ customdata=str(events['Feature']),
696
  hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',
697
  # hoverlabel=dict(font=dict(color=events
698
  # ['FeatureSentiment'].apply(lambda x: 'red' if x == 'Negative' else 'blue' if x == 'Neutral' else 'green'))), # Customize the line style, color, and width
 
719
  figure = go.Figure(data=[line_stock], layout=layout)
720
  figure.add_scatter(x=plot_sub_pos['Date'], y=plot_sub_pos['Price'], mode='markers',
721
  marker=dict(symbol='triangle-up', size=10, color=cs.pos_impacts_color), name='Positive Impact',
722
+ customdata=str(set(plot_sub_pos['Feature'])), hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>')
723
  figure.add_scatter(x=plot_sub_neg['Date'], y=plot_sub_neg['Price'], mode='markers',
724
  marker=dict(symbol='triangle-down', size=10, color=cs.neg_impacts_color), name='Negative Impact',
725
+ customdata=str(set(plot_sub_neg['Feature'])), hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',)
726
  figure.update_layout(
727
  title={
728
  'text': title,