Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -54,7 +54,7 @@ if query:
|
|
54 |
st.subheader(f"Similar Words to {query}")
|
55 |
|
56 |
# calculate the sizes of the squares in the treemap
|
57 |
-
short_table = table.head(
|
58 |
short_table.index += 1
|
59 |
short_table.index = 1 / short_table.index
|
60 |
sizes = short_table.index.tolist()
|
@@ -63,7 +63,7 @@ if query:
|
|
63 |
color = [cmap[i] for i in range(len(sizes))]
|
64 |
|
65 |
short_table.set_index('Word', inplace=True)
|
66 |
-
squarify.plot(sizes=sizes, label=short_table.index.tolist(), color=color, edgecolor="#EBF5FB", text_kwargs={'fontsize':
|
67 |
# # plot the treemap using matplotlib
|
68 |
plt.axis('off')
|
69 |
fig = plt.gcf()
|
@@ -89,7 +89,7 @@ if query:
|
|
89 |
# time.sleep(2)
|
90 |
st.subheader(f"Similar Genes to {query}")
|
91 |
|
92 |
-
df1 = df1.head(
|
93 |
df1.index = 1/df1.index
|
94 |
sizes = df1.index.tolist()
|
95 |
|
@@ -97,7 +97,7 @@ if query:
|
|
97 |
color2 = [cmap2[i] for i in range(len(sizes))]
|
98 |
|
99 |
df1.set_index('Human Gene', inplace=True)
|
100 |
-
squarify.plot(sizes=sizes, label=df1.index.tolist(), color=color2, edgecolor="#EBF5FB", text_kwargs={'fontsize':
|
101 |
#
|
102 |
# # plot the treemap using matplotlib
|
103 |
|
|
|
54 |
st.subheader(f"Similar Words to {query}")
|
55 |
|
56 |
# calculate the sizes of the squares in the treemap
|
57 |
+
short_table = table.head(10)
|
58 |
short_table.index += 1
|
59 |
short_table.index = 1 / short_table.index
|
60 |
sizes = short_table.index.tolist()
|
|
|
63 |
color = [cmap[i] for i in range(len(sizes))]
|
64 |
|
65 |
short_table.set_index('Word', inplace=True)
|
66 |
+
squarify.plot(sizes=sizes, label=short_table.index.tolist(), color=color, edgecolor="#EBF5FB", text_kwargs={'fontsize': 12})
|
67 |
# # plot the treemap using matplotlib
|
68 |
plt.axis('off')
|
69 |
fig = plt.gcf()
|
|
|
89 |
# time.sleep(2)
|
90 |
st.subheader(f"Similar Genes to {query}")
|
91 |
|
92 |
+
df1 = df1.head(10)
|
93 |
df1.index = 1/df1.index
|
94 |
sizes = df1.index.tolist()
|
95 |
|
|
|
97 |
color2 = [cmap2[i] for i in range(len(sizes))]
|
98 |
|
99 |
df1.set_index('Human Gene', inplace=True)
|
100 |
+
squarify.plot(sizes=sizes, label=df1.index.tolist(), color=color2, edgecolor="#EBF5FB", text_kwargs={'fontsize': 12})
|
101 |
#
|
102 |
# # plot the treemap using matplotlib
|
103 |
|