interactive compare chart v1
This commit is contained in:
@@ -95,7 +95,7 @@ def get_chart(end_point, chart_data, debug=False):
|
||||
headers = {'authorization':"Bearer {token}".format(token=settings.ROWSANDALL_CHARTS_TOKEN)}
|
||||
try:
|
||||
response = requests.post(url, json=chart_data, headers=headers)
|
||||
except Error as err:
|
||||
except Exception as err:
|
||||
if debug:
|
||||
print("Chart Server Error")
|
||||
print(err)
|
||||
@@ -5276,8 +5276,14 @@ def interactive_multiple_compare_chart(ids, xparam, yparam, plottype='line',
|
||||
|
||||
columns = [name for name, d in metrics.rowingmetrics]
|
||||
columns_basic = [name for name, d in metrics.rowingmetrics if d['group'] == 'basic']
|
||||
columns = columns + ['spm', 'driveenergy', 'distance']
|
||||
columns_basic = columns_basic + ['spm', 'driveenergy', 'distance']
|
||||
add_columns = [
|
||||
'ftime', 'distance', 'fpace',
|
||||
'power', 'hr', 'spm',
|
||||
'time', 'pace', 'workoutstate',
|
||||
'workoutid'
|
||||
]
|
||||
columns = columns + add_columns
|
||||
columns_basic = columns_basic + add_columns
|
||||
|
||||
compute = False
|
||||
doclean = False
|
||||
@@ -5296,8 +5302,9 @@ def interactive_multiple_compare_chart(ids, xparam, yparam, plottype='line',
|
||||
compute=compute,
|
||||
workstrokesonly=workstrokesonly)
|
||||
|
||||
datadf['workoutid'] = datadf['workoutid'].astype(int)
|
||||
datadf.dropna(axis=1, how='all', inplace=True)
|
||||
datadf.dropna(axis=0, how='any', inplace=True)
|
||||
datadf.dropna(axis=0, how='all', inplace=True)
|
||||
|
||||
nrworkouts = len(ids)
|
||||
|
||||
@@ -5317,8 +5324,9 @@ def interactive_multiple_compare_chart(ids, xparam, yparam, plottype='line',
|
||||
if (xparam == 'time'):
|
||||
datadf[xparam] = datadf[xparam] - datadf[xparam].iloc[0]
|
||||
|
||||
data_dict = datadf.to_dict("records")
|
||||
datadf = datadf.fillna(0)
|
||||
|
||||
data_dict = datadf.to_dict("records")
|
||||
|
||||
metrics_list = [{'name': name, 'rowingmetrics':d } for name, d in metrics.rowingmetrics]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user