work in progress on cum_flex
This commit is contained in:
@@ -3972,8 +3972,18 @@ def interactive_cum_flex_chart2(theworkouts, promember=0,
|
||||
|
||||
# datadf = dataprep.smalldataprep(theworkouts,xparam,yparam1,yparam2)
|
||||
ids = [int(w.id) for w in theworkouts]
|
||||
columns = [xparam, yparam1, yparam2, 'spm', 'driveenergy', 'distance']
|
||||
datadf = dataprep.getsmallrowdata_db(columns, ids=ids, doclean=True,
|
||||
#columns = [xparam, yparam1, yparam2, 'spm', 'driveenergy', 'distance']
|
||||
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']
|
||||
|
||||
datadf = pd.DataFrame()
|
||||
if promember:
|
||||
datadf = dataprep.getsmallrowdata_db(columns, ids=ids, doclean=True,
|
||||
workstrokesonly=workstrokesonly)
|
||||
else:
|
||||
datadf = dataprep.getsmallrowdata_db(columns, ids=ids, doclean=True,
|
||||
workstrokesonly=workstrokesonly)
|
||||
|
||||
try:
|
||||
@@ -4066,28 +4076,17 @@ def interactive_cum_flex_chart2(theworkouts, promember=0,
|
||||
ytrend = func(x1, popt[0], popt[1])
|
||||
datadf['ytrend'] = ytrend
|
||||
|
||||
data_dict = datadf.to_dict("records")
|
||||
|
||||
metrics_list = [{'name': name, 'rowingmetrics':d } for name, d in metrics.rowingmetrics]
|
||||
|
||||
chart_data = {
|
||||
'title': 'Some Chart',
|
||||
'data': [
|
||||
{
|
||||
'ftime': '03:00.0',
|
||||
'workout': 'a',
|
||||
'spm': 24,
|
||||
'distance':1000
|
||||
},
|
||||
{
|
||||
'ftime': '03:00.0',
|
||||
'workout': 'a',
|
||||
'spm': 24,
|
||||
'distance':1000
|
||||
},
|
||||
{
|
||||
'ftime': '03:00.0',
|
||||
'workout': 'a',
|
||||
'spm': 24,
|
||||
'distance':1000
|
||||
},
|
||||
]
|
||||
'x': xparam,
|
||||
'y1': yparam1,
|
||||
'y2': yparam2,
|
||||
'data': data_dict,
|
||||
'metrics': metrics_list,
|
||||
}
|
||||
|
||||
script, div = get_chart("/dots", chart_data)
|
||||
|
||||
@@ -364,6 +364,7 @@ for key, dict in rowingmetrics:
|
||||
metricsdicts[key] = dict
|
||||
|
||||
|
||||
|
||||
metricsgroups = list(set([d['group'] for n, d in rowingmetrics]))
|
||||
|
||||
dtypes = {}
|
||||
|
||||
Reference in New Issue
Block a user