Skip to content

Commit

Permalink
Added the option to show the actual data inside the venn diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
edeng23 committed Mar 5, 2023
1 parent 5f2b776 commit d105d8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion venn.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def get_labels(data, fill=["number"]):
input
data: data to get label for
fill: ["number"|"logic"|"percent"]
fill: ["number"|"logic"|"percent"|"data"]
return
labels: a dict of labels for different sets
Expand Down Expand Up @@ -122,6 +122,9 @@ def get_labels(data, fill=["number"]):
data_size = len(s_all)
for k in set_collections:
labels[k] += "(%.1f%%)" % (100.0 * len(set_collections[k]) / data_size)
if "data" in fill:
for k in set_collections:
labels[k] += "\n".join(set_collections[k])

return labels

Expand Down

0 comments on commit d105d8c

Please sign in to comment.