Subhajit Chakraborty commited on
Commit
43b8a79
·
1 Parent(s): a49b078

update app.py(4)

Browse files
Files changed (1) hide show
  1. src/app.py +42 -35
src/app.py CHANGED
@@ -65,42 +65,49 @@ if st.session_state.page == "Dashboard":
65
  st.header("Welcome!!")
66
  st.text("Here you will find all about your leads.")
67
  if st.session_state.data_enhancement == True:
 
 
 
 
68
 
69
- fig_ind, fig_coun, fig_btype, fig_rev = chart_data.create_chart("data/all_cleaned_companies.json")
70
- col1, col2, col3 = st.columns(3)
71
-
72
- with col1:
73
- st.subheader("Industry-wise Distribution")
74
- st.plotly_chart(fig_ind, use_container_width=True)
75
-
76
- with col2:
77
- st.subheader("Country-wise Distribution")
78
- st.plotly_chart(fig_coun, use_container_width=True)
79
-
80
- with col3:
81
- st.subheader("Business type-wise Distribution")
82
- st.plotly_chart(fig_btype, use_container_width=True)
83
-
84
- st.subheader("Revenue-based Distribution")
85
- st.plotly_chart(fig_rev, use_container_width=True)
86
- df_display = chart_data.df_creator_from_json_and_process("data/all_cleaned_companies.json").sort_values(by="score", ascending=False).rename(columns={
87
- "company_name": "Company Name",
88
- "key_industry": "Industry Type",
89
- "industry_type": "Speciality",
90
- "street": "Street",
91
- "city": "City",
92
- "state": "State",
93
- "country": "Country",
94
- "phone": "Phone",
95
- "email": "Email",
96
- "company_size": "Number of Employees",
97
- "approx_revenue": "Revenue",
98
- "business_type": "Business Type",
99
- "website_url": "Website",
100
- "country": "Country"
101
- })
102
- st.subheader("All Company Details")
103
- st.dataframe(df_display)
 
 
 
104
 
105
 
106
  if st.session_state.page == "Enrich Companies":
 
65
  st.header("Welcome!!")
66
  st.text("Here you will find all about your leads.")
67
  if st.session_state.data_enhancement == True:
68
+ main_lead_info_file = "data/all_cleaned_companies.json"
69
+ if os.path.isdir(main_lead_info_file):
70
+ fig_ind, fig_coun, fig_btype, fig_rev = chart_data.create_chart("data/all_cleaned_companies.json")
71
+ col1, col2, col3 = st.columns(3)
72
 
73
+ with col1:
74
+ st.subheader("Industry-wise Distribution")
75
+ st.plotly_chart(fig_ind, use_container_width=True)
76
+
77
+ with col2:
78
+ st.subheader("Country-wise Distribution")
79
+ st.plotly_chart(fig_coun, use_container_width=True)
80
+
81
+ with col3:
82
+ st.subheader("Business type-wise Distribution")
83
+ st.plotly_chart(fig_btype, use_container_width=True)
84
+
85
+ st.subheader("Revenue-based Distribution")
86
+ st.plotly_chart(fig_rev, use_container_width=True)
87
+ else:
88
+ st.subheader("Do Data Enhancement first in order to view the diagramatic details!!")
89
+ if os.path.isdir(main_lead_info_file):
90
+ df_display = chart_data.df_creator_from_json_and_process("data/all_cleaned_companies.json").sort_values(by="score", ascending=False).rename(columns={
91
+ "company_name": "Company Name",
92
+ "key_industry": "Industry Type",
93
+ "industry_type": "Speciality",
94
+ "street": "Street",
95
+ "city": "City",
96
+ "state": "State",
97
+ "country": "Country",
98
+ "phone": "Phone",
99
+ "email": "Email",
100
+ "company_size": "Number of Employees",
101
+ "approx_revenue": "Revenue",
102
+ "business_type": "Business Type",
103
+ "website_url": "Website",
104
+ "country": "Country"
105
+ })
106
+ st.subheader("All Company Details")
107
+ st.dataframe(df_display)
108
+ else:
109
+ # st.subheader("All Company Details")
110
+ st.write("_There are no leads yet.Go to Data Enrichment to create leads!!_")
111
 
112
 
113
  if st.session_state.page == "Enrich Companies":