Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -79,7 +79,7 @@ def generate_graph(selected_investors, filtered_data):
|
|
79 |
node_sizes.append(2000)
|
80 |
else: # Company size based on valuation
|
81 |
valuation = filtered_data.loc[filtered_data["Company"] == node, "Valuation_Billions"].values
|
82 |
-
node_sizes.append(valuation[0] *
|
83 |
|
84 |
# Node colors
|
85 |
node_colors = []
|
@@ -97,11 +97,19 @@ def generate_graph(selected_investors, filtered_data):
|
|
97 |
with_labels=True,
|
98 |
node_size=node_sizes,
|
99 |
node_color=node_colors,
|
100 |
-
|
|
|
101 |
font_weight="bold",
|
102 |
-
edge_color="
|
103 |
-
width=
|
104 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
plt.title("Venture Funded Companies Visualization", fontsize=20)
|
106 |
plt.axis('off')
|
107 |
|
|
|
79 |
node_sizes.append(2000)
|
80 |
else: # Company size based on valuation
|
81 |
valuation = filtered_data.loc[filtered_data["Company"] == node, "Valuation_Billions"].values
|
82 |
+
node_sizes.append(valuation[0] * 50 if len(valuation) > 0 else 100)
|
83 |
|
84 |
# Node colors
|
85 |
node_colors = []
|
|
|
97 |
with_labels=True,
|
98 |
node_size=node_sizes,
|
99 |
node_color=node_colors,
|
100 |
+
alpha=0.8, # Slight transparency for Tufte-inspired visuals
|
101 |
+
font_size=10,
|
102 |
font_weight="bold",
|
103 |
+
edge_color="#B0BEC5", # Neutral, muted edge color
|
104 |
+
width=0.8 # Thin edges for minimal visual clutter
|
105 |
)
|
106 |
+
|
107 |
+
# Add a legend for node size (valuation)
|
108 |
+
min_size, max_size = 50, 5000 # Example scale
|
109 |
+
for size, label in zip([min_size, max_size], ["$1B", "$100B"]):
|
110 |
+
plt.scatter([], [], s=size, color="#33FF57", label=f"{label} valuation")
|
111 |
+
plt.legend(scatterpoints=1, frameon=False, labelspacing=1.5, loc="lower left", fontsize=12)
|
112 |
+
|
113 |
plt.title("Venture Funded Companies Visualization", fontsize=20)
|
114 |
plt.axis('off')
|
115 |
|