MVP version of box charts
This commit is contained in:
@@ -970,8 +970,13 @@ def read_cols_df_sql(ids,columns):
|
||||
connection = engine.raw_connection()
|
||||
df = pd.read_sql_query(query,engine)
|
||||
df = df.fillna(value=0)
|
||||
|
||||
try:
|
||||
df['peakforce'] = df['peakforce']*lbstoN
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
df['averageforce'] = df['averageforce']*lbstoN
|
||||
except KeyError:
|
||||
pass
|
||||
@@ -990,6 +995,10 @@ def read_df_sql(id):
|
||||
df = df.fillna(value=0)
|
||||
try:
|
||||
df['peakforce'] = df['peakforce']*lbstoN
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
df['averageforce'] = df['averageforce']*lbstoN
|
||||
except KeyError:
|
||||
pass
|
||||
@@ -1037,6 +1046,10 @@ def smalldataprep(therows,xparam,yparam1,yparam2):
|
||||
|
||||
try:
|
||||
df['peakforce'] = df['peakforce']*lbstoN
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
df['averageforce'] = df['averageforce']*lbstoN
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
@@ -108,6 +108,14 @@ def interactive_boxchart(datadf,fieldname):
|
||||
months=["%d %B %Y"],
|
||||
years=["%d %B %Y"],
|
||||
)
|
||||
|
||||
if fieldname == 'pace':
|
||||
plot.yaxis[0].formatter = DatetimeTickFormatter(
|
||||
seconds = ["%S"],
|
||||
minutes = ["%M"]
|
||||
)
|
||||
|
||||
|
||||
plot.xaxis.major_label_orientation = pi/4
|
||||
|
||||
script, div = components(plot)
|
||||
|
||||
@@ -433,12 +433,14 @@ class Workout(models.Model):
|
||||
ownerfirst = self.user.user.first_name
|
||||
ownerlast = self.user.user.last_name
|
||||
duration = self.duration
|
||||
workouttype = self.workouttype
|
||||
|
||||
stri = u'{d} {n} {dist}m {duration:%H:%M:%S} {ownerfirst} {ownerlast}'.format(
|
||||
stri = u'{d} {n} {dist}m {duration:%H:%M:%S} {workouttype} {ownerfirst} {ownerlast}'.format(
|
||||
d = date.strftime('%Y-%m-%d'),
|
||||
n = name,
|
||||
dist = distance,
|
||||
duration = duration,
|
||||
workouttype = workouttype,
|
||||
ownerfirst = ownerfirst,
|
||||
ownerlast = ownerlast,
|
||||
)
|
||||
|
||||
@@ -13,7 +13,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_12 alpha">
|
||||
<h3>{{ team.name }} Team Workouts</h3>
|
||||
{% if theuser %}
|
||||
<h3>{{ theuser.first_name }}'s Workouts</h3>
|
||||
{% else %}
|
||||
<h3>{{ user.first_name }}'s Workouts</h3>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_12 alpha">
|
||||
<div class="grid_4 alpha">
|
||||
|
||||
Reference in New Issue
Block a user