Spaces:
Runtime error
Runtime error
Commit
β’
b7a2ed4
1
Parent(s):
b62d049
Update app.py
Browse files
app.py
CHANGED
@@ -113,14 +113,14 @@ def kpi_chart() -> alt.Chart:
|
|
113 |
total_annotators = len(user_ids_annotations)
|
114 |
|
115 |
# Assuming you have a DataFrame with user data, create a sample DataFrame
|
116 |
-
data = pd.DataFrame({"Category": ["Total
|
117 |
|
118 |
# Create Altair chart
|
119 |
chart = (
|
120 |
alt.Chart(data)
|
121 |
.mark_text(fontSize=100, align="center", baseline="middle", color="steelblue")
|
122 |
.encode(text="Value:N")
|
123 |
-
.properties(title="Number of
|
124 |
)
|
125 |
|
126 |
return chart
|
@@ -138,9 +138,9 @@ def obtain_top_5_users(user_ids_annotations: Dict[str, int]) -> pd.DataFrame:
|
|
138 |
"""
|
139 |
|
140 |
dataframe = pd.DataFrame(
|
141 |
-
user_ids_annotations.items(), columns=["Name", "Submitted
|
142 |
)
|
143 |
-
dataframe = dataframe.sort_values(by="Submitted
|
144 |
return dataframe.head(10)
|
145 |
|
146 |
|
|
|
113 |
total_annotators = len(user_ids_annotations)
|
114 |
|
115 |
# Assuming you have a DataFrame with user data, create a sample DataFrame
|
116 |
+
data = pd.DataFrame({"Category": ["Total Contributors"], "Value": [total_annotators]})
|
117 |
|
118 |
# Create Altair chart
|
119 |
chart = (
|
120 |
alt.Chart(data)
|
121 |
.mark_text(fontSize=100, align="center", baseline="middle", color="steelblue")
|
122 |
.encode(text="Value:N")
|
123 |
+
.properties(title="Number of Contributors", width=250, height=200)
|
124 |
)
|
125 |
|
126 |
return chart
|
|
|
138 |
"""
|
139 |
|
140 |
dataframe = pd.DataFrame(
|
141 |
+
user_ids_annotations.items(), columns=["Name", "Submitted Responses"]
|
142 |
)
|
143 |
+
dataframe = dataframe.sort_values(by="Submitted Responses", ascending=False)
|
144 |
return dataframe.head(10)
|
145 |
|
146 |
|