cyberosa
commited on
Commit
·
c571577
1
Parent(s):
a4540a6
updated graphs after missing non_Olas group
Browse files- tabs/retention_plots.py +4 -2
- tabs/trader_plots.py +2 -10
tabs/retention_plots.py
CHANGED
@@ -31,7 +31,7 @@ def plot_wow_retention_by_type(wow_retention):
|
|
31 |
yanchor="middle",
|
32 |
y=0.5,
|
33 |
xanchor="left",
|
34 |
-
x=
|
35 |
orientation="v",
|
36 |
),
|
37 |
yaxis=dict(
|
@@ -42,7 +42,9 @@ def plot_wow_retention_by_type(wow_retention):
|
|
42 |
], # Add 10% padding to y-axis
|
43 |
),
|
44 |
xaxis=dict(tickformat="%Y-%m-%d"),
|
45 |
-
margin=dict(r=
|
|
|
|
|
46 |
)
|
47 |
|
48 |
# Add hover template
|
|
|
31 |
yanchor="middle",
|
32 |
y=0.5,
|
33 |
xanchor="left",
|
34 |
+
x=0.99,
|
35 |
orientation="v",
|
36 |
),
|
37 |
yaxis=dict(
|
|
|
42 |
], # Add 10% padding to y-axis
|
43 |
),
|
44 |
xaxis=dict(tickformat="%Y-%m-%d"),
|
45 |
+
margin=dict(r=200), # Adjusted margins
|
46 |
+
width=600, # Set explicit width
|
47 |
+
height=500, # Set explicit height
|
48 |
)
|
49 |
|
50 |
# Add hover template
|
tabs/trader_plots.py
CHANGED
@@ -302,20 +302,12 @@ def plot_total_bet_amount(
|
|
302 |
|
303 |
|
304 |
def plot_active_traders(
|
305 |
-
|
306 |
-
unknown_traders: pd.DataFrame,
|
307 |
market_creator: str = None,
|
308 |
):
|
309 |
"""Function to plot the volume of active traders for the different categories and markets"""
|
310 |
-
traders_data["trader_type"] = traders_data["staking"].apply(
|
311 |
-
lambda x: "non_Olas" if x == "non_Olas" else "Olas"
|
312 |
-
)
|
313 |
-
filtered_traders_data = traders_data
|
314 |
-
if len(unknown_traders) > 0:
|
315 |
-
# merge
|
316 |
-
unknown_traders["trader_type"] = "unknown"
|
317 |
-
filtered_traders_data = pd.concat([traders_data, unknown_traders], axis=0)
|
318 |
|
|
|
319 |
if market_creator is not None:
|
320 |
filtered_traders_data = filtered_traders_data.loc[
|
321 |
filtered_traders_data["market_creator"] == market_creator
|
|
|
302 |
|
303 |
|
304 |
def plot_active_traders(
|
305 |
+
active_traders_data: pd.DataFrame,
|
|
|
306 |
market_creator: str = None,
|
307 |
):
|
308 |
"""Function to plot the volume of active traders for the different categories and markets"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
|
310 |
+
filtered_traders_data = active_traders_data.copy()
|
311 |
if market_creator is not None:
|
312 |
filtered_traders_data = filtered_traders_data.loc[
|
313 |
filtered_traders_data["market_creator"] == market_creator
|