Pragya Jatav commited on
Commit
3e08d83
·
1 Parent(s): d374b1a

version changes

Browse files
Files changed (2) hide show
  1. pages/2_Scenario_Planner.py +69 -15
  2. summary_df.pkl +1 -1
pages/2_Scenario_Planner.py CHANGED
@@ -1076,7 +1076,61 @@ if auth_status == True:
1076
  header_df["Prospects"]["Simulated"] = format_numbers_f(float(_scenario.modified_total_sales))
1077
  header_df["Prospects"]["Change"] = format_numbers_f(_scenario.delta_sales)
1078
  header_df["Prospects"]["Percent Change"] = numerize(100*(_scenario.delta_sales/_scenario.actual_total_sales),1)+'%'
1079
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1080
  # header_df.reset_index(inplace=True)
1081
  # # Function to color the index
1082
  # def highlight_index(s):
@@ -1117,20 +1171,20 @@ if auth_status == True:
1117
 
1118
  # st.markdown(styled_df.to_html(escape=False), unsafe_allow_html=True)
1119
 
1120
- st.markdown(header_df.style.set_table_styles
1121
- ([{'selector': 'th',
1122
- 'props': [('background-color', '#D3D3D3'),
1123
- ('font-size', '25px')]},
1124
- {
1125
- 'selector' : 'td:first-child',
1126
- 'props' : [('background-color', '#D3D3D3'),
1127
- ('font-size', '25px')]
1128
- }
1129
- ,
1130
- {'selector': 'tbody td',
1131
- 'props': [('font-size', '20px')]}
1132
-
1133
- ]).to_html(),unsafe_allow_html=True)
1134
 
1135
 
1136
 
 
1076
  header_df["Prospects"]["Simulated"] = format_numbers_f(float(_scenario.modified_total_sales))
1077
  header_df["Prospects"]["Change"] = format_numbers_f(_scenario.delta_sales)
1078
  header_df["Prospects"]["Percent Change"] = numerize(100*(_scenario.delta_sales/_scenario.actual_total_sales),1)+'%'
1079
+
1080
+ st.markdown("""<hr class="spends-heading-seperator">""", unsafe_allow_html=True)
1081
+ _columns = st.columns((1, 1, 1, 1, 1))
1082
+ with _columns[0]:
1083
+ generate_spending_header("Metric")
1084
+ with _columns[1]:
1085
+ generate_spending_header("Actual")
1086
+ with _columns[2]:
1087
+ generate_spending_header("Optimised")
1088
+ with _columns[3]:
1089
+ generate_spending_header("Change")
1090
+ with _columns[4]:
1091
+ generate_spending_header("Change Percent")
1092
+ st.markdown("""<hr class="spends-heading-seperator">""", unsafe_allow_html=True)
1093
+
1094
+ _columns = st.columns((1, 1, 1, 1, 1))
1095
+ with _columns[0]:
1096
+ st.header("Spends")
1097
+ with _columns[1]:
1098
+ st.metric(label="", value=header_df["Spends"]["Actual"])
1099
+ with _columns[2]:
1100
+ st.metric(label="", value=header_df["Spends"]["Simulated"])
1101
+ with _columns[3]:
1102
+ st.metric(label="", value=header_df["Spends"]["Change"])
1103
+ with _columns[4]:
1104
+ st.metric(label="", value=header_df["Spends"]["Percent Change"])
1105
+ # st.metric(
1106
+ # label="Total Sales",
1107
+ # value=header_df["Spends"]["Percent Change"], # Format value with thousands separator
1108
+ # delta=header_df["Spends"]["Percent Change"], # Delta with sign
1109
+ # delta_color="normal" # Inverse color for delta
1110
+ # )
1111
+
1112
+
1113
+ st.markdown(
1114
+ """<hr class="spends-child-seperator">""",
1115
+ unsafe_allow_html=True,
1116
+ )
1117
+ _columns = st.columns((1, 1, 1, 1, 1))
1118
+ with _columns[0]:
1119
+ st.header("Prospects")
1120
+ with _columns[1]:
1121
+ st.metric(label="", value=header_df["Prospects"]["Actual"])
1122
+ with _columns[2]:
1123
+ st.metric(label="", value=header_df["Prospects"]["Simulated"])
1124
+ with _columns[3]:
1125
+ st.metric(label="", value=header_df["Prospects"]["Change"])
1126
+ with _columns[4]:
1127
+ st.metric(label="", value=header_df["Prospects"]["Percent Change"])
1128
+ st.markdown(
1129
+ """<hr class="spends-child-seperator">""",
1130
+ unsafe_allow_html=True,
1131
+ )
1132
+ st.markdown("""<hr class="spends-heading-seperator">""", unsafe_allow_html=True)
1133
+
1134
  # header_df.reset_index(inplace=True)
1135
  # # Function to color the index
1136
  # def highlight_index(s):
 
1171
 
1172
  # st.markdown(styled_df.to_html(escape=False), unsafe_allow_html=True)
1173
 
1174
+ # st.markdown(header_df.style.set_table_styles
1175
+ # ([{'selector': 'th',
1176
+ # 'props': [('background-color', '#D3D3D3'),
1177
+ # ('font-size', '25px')]},
1178
+ # {
1179
+ # 'selector' : 'td:first-child',
1180
+ # 'props' : [('background-color', '#D3D3D3'),
1181
+ # ('font-size', '25px')]
1182
+ # }
1183
+ # ,
1184
+ # {'selector': 'tbody td',
1185
+ # 'props': [('font-size', '20px')]}
1186
+
1187
+ # ]).to_html(),unsafe_allow_html=True)
1188
 
1189
 
1190
 
summary_df.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:10bce0c861df04b0b349bd713006cced672e900b0f7f2cd3cbfcd944db12653d
3
  size 1822
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb3ac5ee9a76864b6e39e867641203d531d627f6406af2d5884ed8fe0691361d
3
  size 1822