fixed bug with disappearing div
This commit is contained in:
@@ -319,7 +319,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
|||||||
|
|
||||||
p.legend.location = "top_left"
|
p.legend.location = "top_left"
|
||||||
p.legend.background_fill_alpha = 0.7
|
p.legend.background_fill_alpha = 0.7
|
||||||
# p.sizing_mode = 'scale_width'
|
#p.sizing_mode = 'scale_width'
|
||||||
p.sizing_mode = 'stretch_both'
|
p.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
p.yaxis.axis_label = 'Minutes'
|
p.yaxis.axis_label = 'Minutes'
|
||||||
@@ -3738,6 +3738,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
|||||||
datadf.dropna(axis=1,how='all',inplace=True)
|
datadf.dropna(axis=1,how='all',inplace=True)
|
||||||
datadf.dropna(axis=0,how='any',inplace=True)
|
datadf.dropna(axis=0,how='any',inplace=True)
|
||||||
|
|
||||||
|
|
||||||
nrworkouts = len(ids)
|
nrworkouts = len(ids)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -3800,13 +3801,14 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
|||||||
plot = Figure(x_axis_type=x_axis_type,y_axis_type=y_axis_type,
|
plot = Figure(x_axis_type=x_axis_type,y_axis_type=y_axis_type,
|
||||||
tools=TOOLS,
|
tools=TOOLS,
|
||||||
toolbar_location="above",
|
toolbar_location="above",
|
||||||
plot_width=920,
|
plot_width=920,plot_height=500,
|
||||||
toolbar_sticky=False)
|
toolbar_sticky=False)
|
||||||
|
|
||||||
# add watermark
|
# add watermark
|
||||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
plot.extra_y_ranges = {"watermark": watermarkrange}
|
||||||
plot.extra_x_ranges = {"watermark": watermarkrange}
|
plot.extra_x_ranges = {"watermark": watermarkrange}
|
||||||
plot.sizing_mode = 'stretch_both'
|
plot.sizing_mode = 'scale_width'
|
||||||
|
|
||||||
|
|
||||||
plot.image_url([watermarkurl],0.05,0.9,
|
plot.image_url([watermarkurl],0.05,0.9,
|
||||||
watermarkw,watermarkh,
|
watermarkw,watermarkh,
|
||||||
@@ -3826,6 +3828,8 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
|||||||
|
|
||||||
for id,color in itertools.izip(ids,colors):
|
for id,color in itertools.izip(ids,colors):
|
||||||
group = datadf[datadf['workoutid']==int(id)].copy()
|
group = datadf[datadf['workoutid']==int(id)].copy()
|
||||||
|
|
||||||
|
|
||||||
group.sort_values(by='time',ascending=True,inplace=True)
|
group.sort_values(by='time',ascending=True,inplace=True)
|
||||||
try:
|
try:
|
||||||
group['x'] = group[xparam]
|
group['x'] = group[xparam]
|
||||||
@@ -3837,6 +3841,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
group['y'] = 0.0*group['x']
|
group['y'] = 0.0*group['x']
|
||||||
|
|
||||||
|
|
||||||
ymean = group['y'].mean()
|
ymean = group['y'].mean()
|
||||||
ylabel = Label(x=100,y=60+nrworkouts*20-20*cntr,
|
ylabel = Label(x=100,y=60+nrworkouts*20-20*cntr,
|
||||||
x_units='screen',y_units='screen',
|
x_units='screen',y_units='screen',
|
||||||
@@ -3909,8 +3914,6 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
|||||||
|
|
||||||
script, div = components(plot)
|
script, div = components(plot)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return [script,div,message,errormessage]
|
return [script,div,message,errormessage]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,12 +14,14 @@
|
|||||||
{{ interactiveplot |safe }}
|
{{ interactiveplot |safe }}
|
||||||
|
|
||||||
<h1>Interactive Comparison</h1>
|
<h1>Interactive Comparison</h1>
|
||||||
|
|
||||||
|
|
||||||
<ul class="main-content">
|
<ul class="main-content">
|
||||||
<li class="grid_4">
|
<li class="grid_4">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{{ the_div|safe }}
|
{{ the_div|safe }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li class="grid_4">
|
<li class="grid_4">
|
||||||
<form enctype="multipart/form-data" action="/rowers/multi-compare" method="post">
|
<form enctype="multipart/form-data" action="/rowers/multi-compare" method="post">
|
||||||
|
|||||||
Reference in New Issue
Block a user