amirali1985 commited on
Commit
e54556a
·
1 Parent(s): 3d6fc0d

More small fixes.

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -170,15 +170,12 @@ def compute_summary(entries: List[Dict[str, Any]]):
170
  return labels, props, counts, total
171
 
172
  def summary_plot(entries: List[Dict[str, Any]]):
173
- labels, props, _, _ = compute_summary(entries)
174
- fig, ax = plt.subplots()
175
- ax.bar(labels, props)
176
- ax.set_ylim(0, 1)
177
- ax.set_ylabel("Proportion")
178
- ax.set_title("Proportion of Selected Traits (under current Name filter)")
179
- ax.tick_params(axis='x', rotation=20)
180
- fig.tight_layout()
181
- return fig
182
 
183
  # ---------- Rendering ----------
184
 
 
170
  return labels, props, counts, total
171
 
172
  def summary_plot(entries: List[Dict[str, Any]]):
173
+ # Returns Markdown with proportions per trait under the current Name filter
174
+ labels, props, counts, total = compute_summary(entries)
175
+ lines = ["## 📊 Summary (Name filter)", f"**Total:** {total}"]
176
+ for label, p in zip(labels, props):
177
+ lines.append(f"- {label}: {p:.2f}")
178
+ return "\n".join(lines)
 
 
 
179
 
180
  # ---------- Rendering ----------
181