rosacastillo commited on
Commit
44a1003
·
1 Parent(s): 9d73e83

Fixing bug with cropped legend

Browse files
Files changed (2) hide show
  1. app.py +0 -4
  2. tabs/metrics.py +1 -5
app.py CHANGED
@@ -219,8 +219,6 @@ with demo:
219
  trade_details_plot = plot_trade_metrics(
220
  metric_name=default_trade_metric,
221
  trades_df=trades_df,
222
- height=400,
223
- width=1400,
224
  )
225
  with gr.Column(scale=1):
226
  trade_details_text = get_trade_metrics_text()
@@ -229,8 +227,6 @@ with demo:
229
  return plot_trade_metrics(
230
  metric_name=trade_detail,
231
  trades_df=trades_df,
232
- height=400,
233
- width=1400,
234
  )
235
 
236
  trade_details_selector.change(
 
219
  trade_details_plot = plot_trade_metrics(
220
  metric_name=default_trade_metric,
221
  trades_df=trades_df,
 
 
222
  )
223
  with gr.Column(scale=1):
224
  trade_details_text = get_trade_metrics_text()
 
227
  return plot_trade_metrics(
228
  metric_name=trade_detail,
229
  trades_df=trades_df,
 
 
230
  )
231
 
232
  trade_details_selector.change(
tabs/metrics.py CHANGED
@@ -117,9 +117,7 @@ def plot2_trade_details(
117
  )
118
 
119
 
120
- def plot_trade_metrics(
121
- metric_name: str, trades_df: pd.DataFrame, height: int = None, width: int = None
122
- ) -> gr.Plot:
123
  """Plots the trade metrics."""
124
 
125
  if metric_name == "mech calls":
@@ -157,8 +155,6 @@ def plot_trade_metrics(
157
  legend=dict(yanchor="top", y=0.5),
158
  )
159
  fig.update_xaxes(tickformat="%b %d\n%Y")
160
- if height is not None:
161
- fig.update_layout(width=WIDTH, height=HEIGHT)
162
  return gr.Plot(
163
  value=fig,
164
  )
 
117
  )
118
 
119
 
120
+ def plot_trade_metrics(metric_name: str, trades_df: pd.DataFrame) -> gr.Plot:
 
 
121
  """Plots the trade metrics."""
122
 
123
  if metric_name == "mech calls":
 
155
  legend=dict(yanchor="top", y=0.5),
156
  )
157
  fig.update_xaxes(tickformat="%b %d\n%Y")
 
 
158
  return gr.Plot(
159
  value=fig,
160
  )