patrickramos commited on
Commit
7763ddf
·
1 Parent(s): f101223

Update app

Browse files
Files changed (2) hide show
  1. demo.py +1 -1
  2. gradio_function.py +3 -1
demo.py CHANGED
@@ -75,9 +75,9 @@ with gr.Blocks(css=css) as demo:
75
  gr.Markdown('## Bugs and other notes')
76
  with gr.Accordion('Click to open', open=False):
77
  gr.Markdown('''
78
- - Whiff% and CSW% has not been verified
79
  - No padding in pie charts leads to hovertext getting cut off near the bottom for some players
80
  - Y axis ticks messy when no velocity distribution is plotted
 
81
  '''
82
  )
83
 
 
75
  gr.Markdown('## Bugs and other notes')
76
  with gr.Accordion('Click to open', open=False):
77
  gr.Markdown('''
 
78
  - No padding in pie charts leads to hovertext getting cut off near the bottom for some players
79
  - Y axis ticks messy when no velocity distribution is plotted
80
+ - Topmost distribution in summary velo distribution plot is clipped
81
  '''
82
  )
83
 
gradio_function.py CHANGED
@@ -120,10 +120,11 @@ def plot_pitch_velo(player=None, velos=None, pitch_type=None, pitch_name=None):
120
  velos = df.set_index(['name', pitch_col]).loc[(player, pitch_val), 'release_speed']
121
 
122
  fig = go.Figure(data=go.Violin(x=velos, side='positive', hoveron='points', points=False, meanline_visible=True, name='Velocity Distribution'))
 
123
  fig.update_layout(
124
  xaxis=dict(
125
  title='Velocity',
126
- range=[125, 170],
127
  scaleratio=2
128
  ),
129
  yaxis=dict(
@@ -254,6 +255,7 @@ def plot_all_pitch_velo(player=None, player_df=None, pitch_counts=None, min_pitc
254
  ))
255
 
256
  fig.update_xaxes(title='Velocity')
 
257
 
258
  return fig
259
 
 
120
  velos = df.set_index(['name', pitch_col]).loc[(player, pitch_val), 'release_speed']
121
 
122
  fig = go.Figure(data=go.Violin(x=velos, side='positive', hoveron='points', points=False, meanline_visible=True, name='Velocity Distribution'))
123
+ median = velos.median()
124
  fig.update_layout(
125
  xaxis=dict(
126
  title='Velocity',
127
+ range=[median-25, median+25],
128
  scaleratio=2
129
  ),
130
  yaxis=dict(
 
255
  ))
256
 
257
  fig.update_xaxes(title='Velocity')
258
+ fig.update_layout(violingap=0, violingroupgap=0)
259
 
260
  return fig
261