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