ralate2 commited on
Commit
6870269
·
verified ·
1 Parent(s): acf8067

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -33
app.py CHANGED
@@ -62,39 +62,25 @@ df['Original Issue Year'] = df['Original Issue Date'].dt.year
62
  # else:
63
  # st.write("No data available for the 'License Status' plot.")
64
 
65
- # # Visualization 1: Pie chart of licenses by Status with distinct colors and legend
66
- # st.subheader("Licenses by Status")
67
- # category_counts = df['License Status'].value_counts().reset_index()
68
- # category_counts.columns = ['License Status', 'Count']
69
-
70
- # if not category_counts.empty:
71
- # chart1 = alt.Chart(category_counts).mark_arc().encode(
72
- # theta=alt.Theta(field="Count", type="quantitative", title="Number of Licenses"),
73
- # color=alt.Color(field="License Status", type="nominal", legend=alt.Legend(title="License Status"),
74
- # scale=alt.Scale(scheme='category20')), # Distinct color scheme
75
- # tooltip=['License Status', 'Count']
76
- # ).properties(
77
- # width=400,
78
- # height=400,
79
- # title="Licenses by Status"
80
- # )
81
- # st.altair_chart(chart1)
82
- # else:
83
- # st.write("No data available for the 'License Status' plot.")
84
-
85
- # Visualization: Heatmap
86
- st.subheader("Heatmap of License Status by State")
87
- chart_heatmap = alt.Chart(state_status_counts).mark_rect().encode(
88
- x=alt.X('State:N', title='State'),
89
- y=alt.Y('License Status:N', title='License Status'),
90
- color=alt.Color('Count:Q', title='Number of Licenses', scale=alt.Scale(scheme='viridis')),
91
- tooltip=['State', 'License Status', 'Count']
92
- ).properties(
93
- width=600,
94
- height=400,
95
- title="Heatmap of License Status by State"
96
- )
97
- st.altair_chart(chart_heatmap)
98
 
99
 
100
  # Write-up for Visualization 1
 
62
  # else:
63
  # st.write("No data available for the 'License Status' plot.")
64
 
65
+ # Visualization 1: Pie chart of licenses by Status with distinct colors and legend
66
+ st.subheader("Licenses by Status")
67
+ category_counts = df['License Status'].value_counts().reset_index()
68
+ category_counts.columns = ['License Status', 'Count']
69
+
70
+ if not category_counts.empty:
71
+ chart1 = alt.Chart(category_counts).mark_arc().encode(
72
+ theta=alt.Theta(field="Count", type="quantitative", title="Number of Licenses"),
73
+ color=alt.Color(field="License Status", type="nominal", legend=alt.Legend(title="License Status"),
74
+ scale=alt.Scale(scheme='category1')), # Distinct color scheme
75
+ tooltip=['License Status', 'Count']
76
+ ).properties(
77
+ width=400,
78
+ height=400,
79
+ title="Licenses by Status"
80
+ )
81
+ st.altair_chart(chart1)
82
+ else:
83
+ st.write("No data available for the 'License Status' plot.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
 
86
  # Write-up for Visualization 1