From 54dc8507dbf1469d82cbe9324a75a2dc149fae99 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 9 Nov 2020 10:34:44 +0100 Subject: [PATCH 1/3] migration to bokeh 2.2.3 --- requirements.txt | 26 ++- rowers/interactiveplots.py | 178 +++++++++++--------- rowers/mytypes.py | 2 +- rowers/templates/agegroupchart.html | 2 +- rowers/templates/agegroupcp.html | 2 +- rowers/templates/boxplot.html | 2 +- rowers/templates/cum_flex.html | 8 +- rowers/templates/cumstats.html | 8 +- rowers/templates/disqualification_view.html | 2 +- rowers/templates/fitnessmetric.html | 2 +- rowers/templates/flexchart3otw.html | 4 +- rowers/templates/flexchartstacked.html | 4 +- rowers/templates/forcecurve_single.html | 4 +- rowers/templates/histo.html | 8 +- rowers/templates/histo_single.html | 2 +- rowers/templates/history.html | 8 +- rowers/templates/list_workouts.html | 6 +- rowers/templates/map_view.html | 2 +- rowers/templates/mapcompare.html | 2 +- rowers/templates/multicompare.html | 2 +- rowers/templates/multiflex.html | 2 +- rowers/templates/oterankings.html | 2 +- rowers/templates/otwgeeky.html | 2 +- rowers/templates/otwinteractive.html | 2 +- rowers/templates/otwrankings.html | 2 +- rowers/templates/rankings.html | 2 +- rowers/templates/splitworkout.html | 2 +- rowers/templates/streamedit.html | 2 +- rowers/templates/summary_edit.html | 2 +- rowers/templates/trainingplan_chart.html | 4 +- rowers/templates/user_analysis_select.html | 8 +- rowers/templates/windedit.html | 2 +- rowers/templates/withdraw_view.html | 2 +- rowers/templates/workflow.html | 2 +- rowers/templates/workout_comments.html | 2 +- rowers/templates/workout_form.html | 2 +- rowers/templates/workout_view.html | 2 +- 37 files changed, 171 insertions(+), 145 deletions(-) diff --git a/requirements.txt b/requirements.txt index ec986f8e..9c69965b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ backcall==0.1.0 beautifulsoup4==4.7.1 billiard==3.6.0.0 bleach==3.1.0 -bokeh==1.0.4 +bokeh==2.2.3 boto==2.49.0 boto3==1.14.7 botocore==1.17.7 @@ -23,7 +23,7 @@ cffi==1.14.0 chardet==3.0.4 Click==7.0 cloudpickle==1.2.2 -colorama==0.4.1 +colorama==0.4.4 colorclass==2.2.0 cookies==2.2.1 coreapi==2.3.3 @@ -81,7 +81,7 @@ geoip2==3.0.0 geos==0.2.1 grpcio==1.26.0 grpcio-tools==1.26.0 -holoviews==1.11.3 +holoviews==1.13.5 html5lib==1.0.1 htmlmin==0.1.12 HTMLParser==0.0.2 @@ -141,14 +141,16 @@ openapi-codec==1.3.2 packaging==19.0 pandas==1.0.5 pandocfilters==1.4.2 -param==1.8.2 +panel==0.10.1 +param==1.10.0 parso==0.3.4 pathspec==0.5.9 pbr==5.1.3 pexpect==4.6.0 pickleshare==0.7.5 -Pillow==5.4.1 +Pillow==8.0.1 pip-upgrader==1.4.6 +pkginfo==1.6.0 pluggy==0.9.0 prometheus-client==0.6.0 prompt-toolkit==2.0.9 @@ -157,10 +159,11 @@ psycopg2==2.8.1 ptyprocess==0.6.0 py==1.8.0 pyarrow==0.17.1 -pycairo==1.19.0 +pycairo==1.20.0 pycparser==2.19 +pyct==0.4.8 pygeoip==0.3.2 -Pygments==2.3.1 +Pygments==2.7.1 pyOpenSSL==19.1.0 pyparsing==2.3.1 pyrsistent==0.14.11 @@ -176,17 +179,20 @@ python-dateutil==2.8.0 python-memcached==1.59 python-twitter==3.5 pytz==2020.1 -pyviz-comms==0.7.1 +pyviz-comms==0.7.6 pywin32-ctypes==0.2.0 pywinpty==0.5.5 PyYAML==5.1 pyzmq==18.0.1 qtconsole==4.4.3 ratelim==0.1.6 +readme-renderer==28.0 redis==3.2.1 requests==2.23.0 requests-oauthlib==1.2.0 -rowingdata==3.0.0 +requests-toolbelt==0.9.1 +rfc3986==1.4.0 +rowingdata==3.0.1 rowingphysics==0.5.0 rq==0.13.0 rules==2.1 @@ -214,6 +220,8 @@ toolz==0.10.0 tornado==6.0.1 tqdm==4.31.1 traitlets==4.3.2 +twine==3.2.0 +typing-extensions==3.7.4.3 units==0.7 uritemplate==3.0.0 urllib3==1.25.9 diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index de97b577..cdbab280 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -248,7 +248,7 @@ def interactive_hr_piechart(df,rower,title,totalseconds=0): z.wedge(x=0,y=1, radius=0.4, start_angle=cumsum('angle',include_zero=True), end_angle=cumsum('angle'), - line_color='white',fill_color='color',source=data,legend='zone') + line_color='white',fill_color='color',source=data,legend_label='zone') @@ -314,7 +314,7 @@ def interactive_workouttype_piechart(workouts): p.wedge(x=0, y=1, radius=0.4, start_angle=cumsum('angle', include_zero=True), end_angle=cumsum('angle'), - line_color="white", fill_color='color', source=data,legend='type', ) + line_color="white", fill_color='color', source=data,legend_label='type', ) p.axis.axis_label=None p.axis.visible=False @@ -600,7 +600,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type',toolbar_lo window.location.href = links[index] """) - taptool.callback = callback + taptool.js_on_event('tap',callback) script,div = components(p) @@ -779,7 +779,7 @@ def interactive_activitychart2(workouts,startdate,enddate,stack='type',toolbar_l window.location.href = links[index] """) - taptool.callback = callback + taptool.js_on_event('tap',callback) script,div = components(p) @@ -1451,37 +1451,43 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): sourcemultiline.change.emit(); """) - annotation = TextInput(title="Type your plot notes here", value="", - callback=callback) + annotation = TextInput(title="Type your plot notes here", value="") + annotation.js_on_change('value',callback) callback.args["annotation"] = annotation slider_spm_min = Slider(start=15.0, end=55,value=15.0, step=.1, - title="Min SPM",callback=callback) + title="Min SPM") + slider_spm_min.js_on_change('value',callback) callback.args["minspm"] = slider_spm_min slider_spm_max = Slider(start=15.0, end=55,value=55.0, step=.1, - title="Max SPM",callback=callback) + title="Max SPM") + slider_spm_max.js_on_change('value',callback) callback.args["maxspm"] = slider_spm_max slider_work_min = Slider(start=0, end=1500,value=0, step=10, - title="Min Work per Stroke",callback=callback) + title="Min Work per Stroke") + slider_work_min.js_on_change('value',callback) callback.args["minwork"] = slider_work_min slider_work_max = Slider(start=0, end=1500,value=1500, step=10, - title="Max Work per Stroke",callback=callback) + title="Max Work per Stroke") + slider_work_max.js_on_change('value',callback) callback.args["maxwork"] = slider_work_max distmax = 100+100*int(rowdata['distance'].max()/100.) slider_dist_min = Slider(start=0,end=distmax,value=0,step=50, - title="Min Distance",callback=callback) + title="Min Distance") + slider_dist_min.js_on_change('value',callback) callback.args["mindist"] = slider_dist_min slider_dist_max = Slider(start=0,end=distmax,value=distmax, step=50, - title="Max Distance",callback=callback) + title="Max Distance") + slider_dist_max.js_on_change('value',callback) callback.args["maxdist"] = slider_dist_max layout = layoutrow([layoutcolumn([annotation, @@ -1619,14 +1625,14 @@ def fitnessmetric_chart(fitnessmetrics,user,workoutmode='rower',startdate=None, ) plot.circle('date','power2k',source=source,fill_color='red',size=10, - legend='2k power') + legend_label='2k power') plot.circle('date','power1hr',source=source,fill_color='blue',size=10, - legend='1 hr power') + legend_label='1 hr power') plot.circle('date','power4min',source=source,fill_color='green',size=10, - legend='4 min power') + legend_label='4 min power') plot.line('date','power4min',source=source2,color='green') plot.line('date','power2k',source=source2,color='red') @@ -1792,8 +1798,8 @@ def interactive_histoall(theworkouts,histoparam,includereststrokes, annolabel.text = annotation """) - annotation = TextInput(title="Type your plot notes here", value="", - callback=callback) + annotation = TextInput(title="Type your plot notes here", value="") + annotation.js_on_change('value',callback) callback.args["annotation"] = annotation layout = layoutcolumn([annotation,plot]) @@ -2849,15 +2855,15 @@ def interactive_agegroupcpchart(age,normalized=False): plot.sizing_mode = 'scale_width' plot.line('duration','fitpowerfh',source=source, - legend='Female HW',color='blue') + legend_label='Female HW',color='blue') plot.line('duration','fitpowerfl',source=source, - legend='Female LW',color='red') + legend_label='Female LW',color='red') plot.line('duration','fitpowerml',source=source, - legend='Male LW',color='green') + legend_label='Male LW',color='green') plot.line('duration','fitpowermh',source=source, - legend='Male HW',color='orange') + legend_label='Male HW',color='orange') plot.circle('flduration','flpower',source=source, @@ -2980,7 +2986,7 @@ def interactive_otwcpchart(powerdf,promember=0,rowername="",r=None,cpfit='data', ) plot.circle('Deltaminutes','CP',source=source,fill_color='red',size=15, - legend='Power Data') + legend_label='Power Data') plot.xaxis.axis_label = "Duration (minutes)" plot.yaxis.axis_label = "Power (W)" @@ -3006,10 +3012,10 @@ def interactive_otwcpchart(powerdf,promember=0,rowername="",r=None,cpfit='data', hover.mode = 'mouse' - plot.line('duration','CP',source=sourcecomplex,legend="CP Model", + plot.line('duration','CP',source=sourcecomplex,legend_label="CP Model", color='green') - plot.line('duration','CPmax',source=sourcecomplex,legend="CP Model", + plot.line('duration','CPmax',source=sourcecomplex,legend_label="CP Model", color='red') script, div = components(plot) @@ -3067,7 +3073,7 @@ def interactive_agegroup_plot(df,distance=2000,duration=None, plot = Figure(tools=TOOLS,plot_width=900) plot.sizing_mode='scale_width' plot.circle('age','power',source=source,fill_color='red',size=15, - legend='World Record') + legend_label='World Record') plot.line(age2,expo_vals) plot.xaxis.axis_label = "Age" @@ -3287,7 +3293,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, ) plot.circle('duration','power',source=source,fill_color='red',size=15, - legend='Power') + legend_label='Power') plot.xaxis.axis_label = "Duration (seconds)" plot.yaxis.axis_label = "Power (W)" @@ -3334,7 +3340,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, plot.circle('duration','power',source=source2, fill_color='blue',size=3, - legend = 'Power from segments') + legend_label = 'Power from segments') hover = plot.select(dict(type=HoverTool)) @@ -3352,28 +3358,28 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, plot.legend.orientation = "vertical" - plot.line('duration','power',source=sourcepaul,legend="Paul's Law") - plot.line('duration','power',source=sourcecomplex,legend="CP Model", + plot.line('duration','power',source=sourcepaul,legend_label="Paul's Law") + plot.line('duration','power',source=sourcecomplex,legend_label="CP Model", color='green') if p1wc is not None: plot.line('duration','fitpowerwc',source=sourcecomplex, - legend="World Class", + legend_label="World Class", color='Maroon',line_dash='dotted') plot.line('duration','fitpowerexcellent',source=sourcecomplex, - legend="90% percentile", + legend_label="90% percentile", color='Purple',line_dash='dotted') plot.line('duration','fitpowergood',source=sourcecomplex, - legend="75% percentile", + legend_label="75% percentile", color='Olive',line_dash='dotted') plot.line('duration','fitpowerfair',source=sourcecomplex, - legend="50% percentile", + legend_label="50% percentile", color='Gray',line_dash='dotted') plot.line('duration','fitpoweraverage',source=sourcecomplex, - legend="25% percentile", + legend_label="25% percentile", color='SkyBlue',line_dash='dotted') @@ -3453,8 +3459,8 @@ def interactive_windchart(id=0,promember=0): # toolbar_location="below", toolbar_sticky=False, ) - plot.line('dist','vwind',source=source,legend="Wind Speed (m/s)") - plot.line('dist','tw',source=source,legend="Tail (+)/Head (-) Wind (m/s)",color='black') + plot.line('dist','vwind',source=source,legend_label="Wind Speed (m/s)") + plot.line('dist','tw',source=source,legend_label="Tail (+)/Head (-) Wind (m/s)",color='black') plot.title.text = row.name # plot.title.text_font_size=value("1.0em") plot.title.text_font="1.0em" @@ -3466,7 +3472,7 @@ def interactive_windchart(id=0,promember=0): plot.extra_y_ranges = {"winddirection": Range1d(start=0,end=360)} plot.line('dist','winddirection',source=source, - legend='Wind Direction',color="red", + legend_label='Wind Direction',color="red", y_range_name="winddirection") plot.add_layout(LinearAxis(y_range_name="winddirection",axis_label="Wind Direction (degree)"),'right') @@ -3526,7 +3532,7 @@ def interactive_streamchart(id=0,promember=0): # toolbar_location="below", toolbar_sticky=False, ) - plot.line(dist,vstream,legend="River Stream Velocity (m/s)") + plot.line(dist,vstream,legend_label="River Stream Velocity (m/s)") plot.title.text = row.name plot.title.text_font_size=value("1.0em") plot.xaxis.axis_label = "Distance (m)" @@ -3607,7 +3613,7 @@ def interactive_chart(id=0,promember=0,intervaldata = {}): y_range_name = "watermark", ) - plot.line('time','pace',source=source,legend="Pace",name="pace") + plot.line('time','pace',source=source,legend_label="Pace",name="pace") plot.title.text = row.name plot.title.text_font_size=value("1.0em") plot.sizing_mode = 'scale_width' @@ -3637,7 +3643,7 @@ def interactive_chart(id=0,promember=0,intervaldata = {}): plot.extra_y_ranges["spmax"] = Range1d(start=10,end=45) plot.line('time','spm',source=source,color="red", - y_range_name="spmax", legend="Stroke Rate",name="spm") + y_range_name="spmax", legend_label="Stroke Rate",name="spm") plot.add_layout(LinearAxis(y_range_name="spmax",axis_label="SPM"),'right') plot.legend.location = "bottom_right" @@ -3956,7 +3962,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='', text = "{gvalue:3.0f}".format(gvalue=gvalue), background_fill_alpha=1.0, text_color='black', - text_font_size=value("0.7em")) + text_font_size="0.7em") plot.add_layout(box) plot.add_layout(legendlabel) @@ -3965,7 +3971,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='', y_units='screen', text = 'group legend', text_color='black', - text_font_size=value("0.7em"), + text_font_size="0.7em", angle=90, angle_units='deg') @@ -4216,7 +4222,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, y2label = y1label plot.circle('x1','y1',source=source2,fill_alpha=0.3,line_color=None, - legend=yparamname1, + legend_label=yparamname1, ) plot.xaxis.axis_label = axlabels[xparam] @@ -4240,7 +4246,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, plot.extra_y_ranges["yax2"] = yrange2 plot.circle('x1','y2',color="red",y_range_name="yax2", - legend=yparamname2, + legend_label=yparamname2, source=source2,fill_alpha=0.3,line_color=None) plot.add_layout(LinearAxis(y_range_name="yax2", @@ -4361,21 +4367,25 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, """) slider_spm_min = Slider(start=15.0, end=55,value=15.0, step=.1, - title="Min SPM",callback=callback) + title="Min SPM") + slider_spm_min.js_on_change('value',callback) callback.args["minspm"] = slider_spm_min slider_spm_max = Slider(start=15.0, end=55,value=55.0, step=.1, - title="Max SPM",callback=callback) + title="Max SPM") + slider_spm_max.js_on_change('value',callback) callback.args["maxspm"] = slider_spm_max slider_work_min = Slider(start=0.0, end=1500,value=0.0, step=10, - title="Min Work per Stroke",callback=callback) + title="Min Work per Stroke") + slider_work_min.js_on_change('value',callback) callback.args["minwork"] = slider_work_min slider_work_max = Slider(start=0.0, end=1500,value=1500.0, step=10, - title="Max Work per Stroke",callback=callback) + title="Max Work per Stroke") + slider_work_max.js_on_change('value',callback) callback.args["maxwork"] = slider_work_max try: @@ -4384,12 +4394,14 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, distmax = 1000. slider_dist_min = Slider(start=0,end=distmax,value=0,step=50, - title="Min Distance",callback=callback) + title="Min Distance") + slider_dist_min.js_on_change('value',callback) callback.args["mindist"] = slider_dist_min slider_dist_max = Slider(start=0,end=distmax,value=distmax, step=50, - title="Max Distance",callback=callback) + title="Max Distance") + slider_dist_max.js_on_change('value',callback) callback.args["maxdist"] = slider_dist_max layout = layoutrow([layoutcolumn([slider_spm_min, @@ -5126,12 +5138,12 @@ def interactive_flex_chart2(id,r,promember=0, # average values if yparam1 == 'driveenergy': if xparam == 'spm': - plot.line(xvals,yconstantpower,color="green",legend="Constant Power") + plot.line(xvals,yconstantpower,color="green",legend_label="Constant Power") if plottype=='line': - plot.line('x1','y1',source=source2,legend=yaxlabel) + plot.line('x1','y1',source=source2,legend_label=yaxlabel) elif plottype=='scatter': - plot.scatter('x1','y1',source=source2,legend=yaxlabel,fill_alpha=0.4, + plot.scatter('x1','y1',source=source2,legend_label=yaxlabel,fill_alpha=0.4, line_color=None) plot.title.text = row.name @@ -5200,11 +5212,11 @@ def interactive_flex_chart2(id,r,promember=0, if plottype=='line': plot.line('x1','y2',color="red",y_range_name="yax2", - legend=axlegend, + legend_label=axlegend, source=source2) elif plottype=='scatter': - plot.scatter('x1','y2',source=source2,legend=axlegend, + plot.scatter('x1','y2',source=source2,legend_label=axlegend, fill_alpha=0.4, line_color=None,color="red",y_range_name="yax2") @@ -5362,26 +5374,30 @@ def interactive_flex_chart2(id,r,promember=0, source2.change.emit(); """) - annotation = TextInput(title="Type your plot notes here", value="", - callback=callback) + annotation = TextInput(title="Type your plot notes here", value="") + annotation.js_on_change('value',callback) callback.args["annotation"] = annotation slider_spm_min = Slider(start=15.0, end=55,value=15.0, step=.1, - title="Min SPM",callback=callback) + title="Min SPM") + slider_spm_min.js_on_change('value',callback) callback.args["minspm"] = slider_spm_min slider_spm_max = Slider(start=15.0, end=55,value=55.0, step=.1, - title="Max SPM",callback=callback) + title="Max SPM") + slider_spm_max.js_on_change('value',callback) callback.args["maxspm"] = slider_spm_max slider_work_min = Slider(start=0.0, end=1500,value=0.0, step=10, - title="Min Work per Stroke",callback=callback) + title="Min Work per Stroke") + slider_work_min.js_on_change('value',callback) callback.args["minwork"] = slider_work_min slider_work_max = Slider(start=0.0, end=1500,value=1500.0, step=10, - title="Max Work per Stroke",callback=callback) + title="Max Work per Stroke") + slider_work_max.js_on_change('value',callback) callback.args["maxwork"] = slider_work_max try: @@ -5390,12 +5406,14 @@ def interactive_flex_chart2(id,r,promember=0, distmax = 100 slider_dist_min = Slider(start=0,end=distmax,value=0,step=50, - title="Min Distance",callback=callback) + title="Min Distance") + slider_dist_min.js_on_change('value',callback) callback.args["mindist"] = slider_dist_min slider_dist_max = Slider(start=0,end=distmax,value=distmax, step=50, - title="Max Distance",callback=callback) + title="Max Distance") + slider_dist_max.js_on_change('value',callback) callback.args["maxdist"] = slider_dist_max thesliders = layoutcolumn([ @@ -5754,27 +5772,27 @@ def interactive_bar_chart(id=0,promember=0): plot.extra_y_ranges["hr"] = Range1d(start=100,end=200) plot.quad(left='time',top='hr_ut2',bottom='hr_bottom', right='x_right',source=source,color="gray", - y_range_name="hr", legend=" + diff --git a/rowers/templates/agegroupcp.html b/rowers/templates/agegroupcp.html index 36870c7b..253eff4f 100644 --- a/rowers/templates/agegroupcp.html +++ b/rowers/templates/agegroupcp.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/boxplot.html b/rowers/templates/boxplot.html index eeea25c6..e5574916 100644 --- a/rowers/templates/boxplot.html +++ b/rowers/templates/boxplot.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/cum_flex.html b/rowers/templates/cum_flex.html index 1bf49dfe..c718372e 100644 --- a/rowers/templates/cum_flex.html +++ b/rowers/templates/cum_flex.html @@ -59,12 +59,12 @@
- - + +
- - + +
diff --git a/rowers/templates/cumstats.html b/rowers/templates/cumstats.html index 9e3d214b..7841874a 100644 --- a/rowers/templates/cumstats.html +++ b/rowers/templates/cumstats.html @@ -60,12 +60,12 @@
- - + +
- - + +
diff --git a/rowers/templates/disqualification_view.html b/rowers/templates/disqualification_view.html index f1b696c4..bd1894b7 100644 --- a/rowers/templates/disqualification_view.html +++ b/rowers/templates/disqualification_view.html @@ -98,7 +98,7 @@ {% endif %}
  • - + diff --git a/rowers/templates/fitnessmetric.html b/rowers/templates/fitnessmetric.html index 6958985d..647f49be 100644 --- a/rowers/templates/fitnessmetric.html +++ b/rowers/templates/fitnessmetric.html @@ -48,7 +48,7 @@ }); - + diff --git a/rowers/templates/flexchart3otw.html b/rowers/templates/flexchart3otw.html index e89e394b..d7fdf3af 100644 --- a/rowers/templates/flexchart3otw.html +++ b/rowers/templates/flexchart3otw.html @@ -11,8 +11,8 @@ {{ js_res | safe }} {{ css_res| safe }} - - + + diff --git a/rowers/templates/flexchartstacked.html b/rowers/templates/flexchartstacked.html index f162fc09..11a54331 100644 --- a/rowers/templates/flexchartstacked.html +++ b/rowers/templates/flexchartstacked.html @@ -11,8 +11,8 @@ {{ js_res | safe }} {{ css_res| safe }} - - + + diff --git a/rowers/templates/forcecurve_single.html b/rowers/templates/forcecurve_single.html index 2326aa0a..ed7f9c5a 100644 --- a/rowers/templates/forcecurve_single.html +++ b/rowers/templates/forcecurve_single.html @@ -11,8 +11,8 @@ {{ js_res | safe }} {{ css_res| safe }} - - + + diff --git a/rowers/templates/histo.html b/rowers/templates/histo.html index 4e200c2d..be333c76 100644 --- a/rowers/templates/histo.html +++ b/rowers/templates/histo.html @@ -60,12 +60,12 @@
    - - + +
    - - + +
    diff --git a/rowers/templates/histo_single.html b/rowers/templates/histo_single.html index ddd1ac99..fce8843e 100644 --- a/rowers/templates/histo_single.html +++ b/rowers/templates/histo_single.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/history.html b/rowers/templates/history.html index 54a62246..52e2eabf 100644 --- a/rowers/templates/history.html +++ b/rowers/templates/history.html @@ -6,12 +6,12 @@ {% block main %}
    - - + +
    - - + +
    + + + diff --git a/rowers/templates/map_view.html b/rowers/templates/map_view.html index 7826674e..93d9677c 100644 --- a/rowers/templates/map_view.html +++ b/rowers/templates/map_view.html @@ -12,7 +12,7 @@ {% block main %} - + diff --git a/rowers/templates/mapcompare.html b/rowers/templates/mapcompare.html index 88a1db29..be79b5c3 100644 --- a/rowers/templates/mapcompare.html +++ b/rowers/templates/mapcompare.html @@ -12,7 +12,7 @@ {% block main %} - + diff --git a/rowers/templates/multicompare.html b/rowers/templates/multicompare.html index 5e214ff1..df363159 100644 --- a/rowers/templates/multicompare.html +++ b/rowers/templates/multicompare.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/multiflex.html b/rowers/templates/multiflex.html index 1fbe007b..ea02452c 100644 --- a/rowers/templates/multiflex.html +++ b/rowers/templates/multiflex.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/oterankings.html b/rowers/templates/oterankings.html index 7778bcf2..4fc7d4ac 100644 --- a/rowers/templates/oterankings.html +++ b/rowers/templates/oterankings.html @@ -10,7 +10,7 @@ {% block main %} - + diff --git a/rowers/templates/otwgeeky.html b/rowers/templates/otwgeeky.html index 6c65fe08..403be27d 100644 --- a/rowers/templates/otwgeeky.html +++ b/rowers/templates/otwgeeky.html @@ -138,7 +138,7 @@
    - + diff --git a/rowers/templates/otwinteractive.html b/rowers/templates/otwinteractive.html index 809208b1..ef2d13da 100644 --- a/rowers/templates/otwinteractive.html +++ b/rowers/templates/otwinteractive.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/otwrankings.html b/rowers/templates/otwrankings.html index a627b362..9e5184b8 100644 --- a/rowers/templates/otwrankings.html +++ b/rowers/templates/otwrankings.html @@ -10,7 +10,7 @@ {% block main %} - + diff --git a/rowers/templates/rankings.html b/rowers/templates/rankings.html index 87126f49..cc573e39 100644 --- a/rowers/templates/rankings.html +++ b/rowers/templates/rankings.html @@ -13,7 +13,7 @@ {% block main %} - + diff --git a/rowers/templates/splitworkout.html b/rowers/templates/splitworkout.html index f54a64f4..b07c1a54 100644 --- a/rowers/templates/splitworkout.html +++ b/rowers/templates/splitworkout.html @@ -23,7 +23,7 @@
  • - + diff --git a/rowers/templates/streamedit.html b/rowers/templates/streamedit.html index 301cf033..18306667 100644 --- a/rowers/templates/streamedit.html +++ b/rowers/templates/streamedit.html @@ -31,7 +31,7 @@
  • - + diff --git a/rowers/templates/summary_edit.html b/rowers/templates/summary_edit.html index d4b8edc7..844e3272 100644 --- a/rowers/templates/summary_edit.html +++ b/rowers/templates/summary_edit.html @@ -93,7 +93,7 @@
  • - + diff --git a/rowers/templates/trainingplan_chart.html b/rowers/templates/trainingplan_chart.html index 030658cb..14c62309 100644 --- a/rowers/templates/trainingplan_chart.html +++ b/rowers/templates/trainingplan_chart.html @@ -6,8 +6,8 @@ {% block main %} - - + + diff --git a/rowers/templates/user_analysis_select.html b/rowers/templates/user_analysis_select.html index 4a4f95a7..5d05f318 100644 --- a/rowers/templates/user_analysis_select.html +++ b/rowers/templates/user_analysis_select.html @@ -310,12 +310,12 @@
    - - + +
    - - + +
    + diff --git a/rowers/templates/withdraw_view.html b/rowers/templates/withdraw_view.html index 810826e3..05e890ee 100644 --- a/rowers/templates/withdraw_view.html +++ b/rowers/templates/withdraw_view.html @@ -98,7 +98,7 @@
  • {% endif %}
  • - + diff --git a/rowers/templates/workflow.html b/rowers/templates/workflow.html index 46eeea00..0ed796ce 100644 --- a/rowers/templates/workflow.html +++ b/rowers/templates/workflow.html @@ -16,7 +16,7 @@ {% block meta %} {% leaflet_js %} {% leaflet_css %} - + diff --git a/rowers/templates/workout_comments.html b/rowers/templates/workout_comments.html index a74b4664..e8fd8630 100644 --- a/rowers/templates/workout_comments.html +++ b/rowers/templates/workout_comments.html @@ -86,7 +86,7 @@
  • - + diff --git a/rowers/templates/workout_form.html b/rowers/templates/workout_form.html index 8e466c63..51a5a83b 100644 --- a/rowers/templates/workout_form.html +++ b/rowers/templates/workout_form.html @@ -147,7 +147,7 @@ $('#id_workouttype').change(); {% endif %} {% if mapdiv %}
  • - + diff --git a/rowers/templates/workout_view.html b/rowers/templates/workout_view.html index 942b9534..e240cb70 100644 --- a/rowers/templates/workout_view.html +++ b/rowers/templates/workout_view.html @@ -127,7 +127,7 @@
  • {% endif %}
  • - + From 4b1599fcdf84361afeddba8628fc904b362eca17 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 9 Nov 2020 11:06:03 +0100 Subject: [PATCH 2/3] struggling with plot dimensions --- rowers/interactiveplots.py | 63 ++++++++++++++++++----------------- rowers/views/analysisviews.py | 2 +- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index cdbab280..4f12380f 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -779,7 +779,7 @@ def interactive_activitychart2(workouts,startdate,enddate,stack='type',toolbar_l window.location.href = links[index] """) - taptool.js_on_event('tap',callback) + taptool.js_on_event('tap',callback) script,div = components(p) @@ -1115,7 +1115,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): ) plot = Figure(tools=TOOLS, - toolbar_sticky=False,toolbar_location="above") + toolbar_sticky=False,toolbar_location="above",plot_width=800,plot_height=600) # add watermark watermarkurl = "/static/img/logo7.png" @@ -1386,7 +1386,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): multilines['x'] = [] multilines['y'] = [] - for (i=0; i=minspm && spm1[i]<=maxspm) { if (distance1[i]>=mindist && distance1[i]<=maxdist) { if (driveenergy1[i]>=minwork && driveenergy1[i]<=maxwork) { @@ -1451,40 +1451,40 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): sourcemultiline.change.emit(); """) - annotation = TextInput(title="Type your plot notes here", value="") + annotation = TextInput(width=200, title="Type your plot notes here", value="") annotation.js_on_change('value',callback) callback.args["annotation"] = annotation - slider_spm_min = Slider(start=15.0, end=55,value=15.0, step=.1, + slider_spm_min = Slider(width=200, start=15.0, end=55,value=15.0, step=.1, title="Min SPM") slider_spm_min.js_on_change('value',callback) callback.args["minspm"] = slider_spm_min - slider_spm_max = Slider(start=15.0, end=55,value=55.0, step=.1, + slider_spm_max = Slider(width=200, start=15.0, end=55,value=55.0, step=.1, title="Max SPM") slider_spm_max.js_on_change('value',callback) callback.args["maxspm"] = slider_spm_max - slider_work_min = Slider(start=0, end=1500,value=0, step=10, + slider_work_min = Slider(width=200, start=0, end=1500,value=0, step=10, title="Min Work per Stroke") slider_work_min.js_on_change('value',callback) callback.args["minwork"] = slider_work_min - slider_work_max = Slider(start=0, end=1500,value=1500, step=10, + slider_work_max = Slider(width=200, start=0, end=1500,value=1500, step=10, title="Max Work per Stroke") slider_work_max.js_on_change('value',callback) callback.args["maxwork"] = slider_work_max distmax = 100+100*int(rowdata['distance'].max()/100.) - slider_dist_min = Slider(start=0,end=distmax,value=0,step=50, + slider_dist_min = Slider(width=200, start=0,end=distmax,value=0,step=50, title="Min Distance") slider_dist_min.js_on_change('value',callback) callback.args["mindist"] = slider_dist_min - slider_dist_max = Slider(start=0,end=distmax,value=distmax, + slider_dist_max = Slider(width=200, start=0,end=distmax,value=distmax, step=50, title="Max Distance") slider_dist_max.js_on_change('value',callback) @@ -1798,7 +1798,7 @@ def interactive_histoall(theworkouts,histoparam,includereststrokes, annolabel.text = annotation """) - annotation = TextInput(title="Type your plot notes here", value="") + annotation = TextInput(width=200, title="Type your plot notes here", value="") annotation.js_on_change('value',callback) callback.args["annotation"] = annotation @@ -4321,7 +4321,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, data2['yname2'] = [] data2['spm'] = [] - for (i=0; i=minspm && spm1[i]<=maxspm) { if (distance1[i]>=mindist && distance1[i]<=maxdist) { if (driveenergy1[i]>=minwork && driveenergy1[i]<=maxwork) { @@ -4350,7 +4350,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, ym1 /= data2['x1'].length ym2 /= data2['x1'].length - for (i=0; i=minspm && spm1[i]<=maxspm) { if (distance1[i]>=mindist && distance1[i]<=maxdist) { if (driveenergy1[i]>=minwork && driveenergy1[i]<=maxwork) { @@ -5355,7 +5356,7 @@ def interactive_flex_chart2(id,r,promember=0, ym1 /= data2['x1'].length ym2 /= data2['x1'].length - for (i=0; i Date: Mon, 9 Nov 2020 14:39:26 +0100 Subject: [PATCH 3/3] fixing sizing mode --- rowers/interactiveplots.py | 150 +++++++++++++++++++++++-------------- 1 file changed, 93 insertions(+), 57 deletions(-) diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 4f12380f..26a82fe3 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -351,7 +351,7 @@ def interactive_boxchart(datadf,fieldname,extratitle='', yrange1 = Range1d(start=yaxminima[fieldname],end=yaxmaxima[fieldname]) plot.y_range = yrange1 - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.xaxis.axis_label = 'Date' plot.yaxis.axis_label = axlabels[fieldname] @@ -419,7 +419,7 @@ def interactive_planchart(data,startdate,enddate): p.plot_height=350 p.y_range = yrange1 p.toolbar_location = 'above' - p.sizing_mode = 'scale_width' + p.sizing_mode = 'stretch_both' script,div = components(p) @@ -586,7 +586,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type',toolbar_lo p.plot_height=350 p.toolbar_location = toolbar_location p.y_range.start = 0 - p.sizing_mode = 'scale_width' + p.sizing_mode = 'stretch_both' url = "http://rowsandall.com/rowers/workout/@duration/" taptool = p.select(type=TapTool) @@ -764,7 +764,7 @@ def interactive_activitychart2(workouts,startdate,enddate,stack='type',toolbar_l p.plot_width=550 p.plot_height=350 p.toolbar_location = toolbar_location - p.sizing_mode = 'scale_width' + p.sizing_mode = 'stretch_both' p.y_range.start = 0 url = "http://rowsandall.com/rowers/workout/@duration/" taptool = p.select(type=TapTool) @@ -1116,6 +1116,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): plot = Figure(tools=TOOLS, toolbar_sticky=False,toolbar_location="above",plot_width=800,plot_height=600) + plot.sizing_mode = 'stretch_both' # add watermark watermarkurl = "/static/img/logo7.png" @@ -1131,7 +1132,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): watermarkanchor = 'bottom_right' plot.extra_y_ranges = {"watermark": watermarkrange} plot.extra_x_ranges = {"watermark": watermarkrange} - plot.sizing_mode = 'scale_width' + plot.image_url([watermarkurl],watermarkx,watermarky, watermarkw,watermarkh, @@ -1451,57 +1452,68 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): sourcemultiline.change.emit(); """) - annotation = TextInput(width=200, title="Type your plot notes here", value="") + annotation = TextInput(width=140, title="Type your plot notes here", value="") annotation.js_on_change('value',callback) callback.args["annotation"] = annotation - slider_spm_min = Slider(width=200, start=15.0, end=55,value=15.0, step=.1, + slider_spm_min = Slider(width=140, start=15.0, end=55,value=15.0, step=.1, title="Min SPM") slider_spm_min.js_on_change('value',callback) callback.args["minspm"] = slider_spm_min - slider_spm_max = Slider(width=200, start=15.0, end=55,value=55.0, step=.1, + slider_spm_max = Slider(width=140, start=15.0, end=55,value=55.0, step=.1, title="Max SPM") slider_spm_max.js_on_change('value',callback) callback.args["maxspm"] = slider_spm_max - slider_work_min = Slider(width=200, start=0, end=1500,value=0, step=10, + slider_work_min = Slider(width=140, start=0, end=1500,value=0, step=10, title="Min Work per Stroke") slider_work_min.js_on_change('value',callback) callback.args["minwork"] = slider_work_min - slider_work_max = Slider(width=200, start=0, end=1500,value=1500, step=10, + slider_work_max = Slider(width=140, start=0, end=1500,value=1500, step=10, title="Max Work per Stroke") slider_work_max.js_on_change('value',callback) callback.args["maxwork"] = slider_work_max distmax = 100+100*int(rowdata['distance'].max()/100.) - slider_dist_min = Slider(width=200, start=0,end=distmax,value=0,step=50, + slider_dist_min = Slider(width=140, start=0,end=distmax,value=0,step=50, title="Min Distance") slider_dist_min.js_on_change('value',callback) callback.args["mindist"] = slider_dist_min - slider_dist_max = Slider(width=200, start=0,end=distmax,value=distmax, + slider_dist_max = Slider(width=140, start=0,end=distmax,value=distmax, step=50, title="Max Distance") slider_dist_max.js_on_change('value',callback) callback.args["maxdist"] = slider_dist_max - layout = layoutrow([layoutcolumn([annotation, + annotation.sizing_mode = 'fixed' + slider_spm_min.sizing_mode = 'fixed' + slider_spm_max.sizing_mode = 'fixed' + slider_work_min.sizing_mode = 'fixed' + slider_work_max.sizing_mode = 'fixed' + slider_dist_min.sizing_mode = 'fixed' + slider_dist_max.sizing_mode = 'fixed' + + thesliders = layoutcolumn([annotation, slider_spm_min, slider_spm_max, slider_dist_min, slider_dist_max, slider_work_min, slider_work_max, - ], - ), + ] + ) + thesliders.sizing_mode = 'fixed' + + layout = layoutrow([thesliders, plot]) - layout.sizing_mode = 'scale_width' + layout.sizing_mode = 'stretch_both' script, div = components(layout) js_resources = INLINE.render_js() @@ -1648,7 +1660,7 @@ def fitnessmetric_chart(fitnessmetrics,user,workoutmode='rower',startdate=None, ) plot.xaxis.major_label_orientation = pi/4 - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.y_range = Range1d(0,1.5*max(power4min)) if not startdate: @@ -1780,7 +1792,7 @@ def interactive_histoall(theworkouts,histoparam,includereststrokes, plot.add_layout(LinearAxis(y_range_name="fraction", axis_label="Cumulative % of strokes"),'right') - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' annolabel = Label(x=50,y=450,x_units='screen',y_units='screen', text='', @@ -1798,7 +1810,7 @@ def interactive_histoall(theworkouts,histoparam,includereststrokes, annolabel.text = annotation """) - annotation = TextInput(width=200, title="Type your plot notes here", value="") + annotation = TextInput(width=140, title="Type your plot notes here", value="") annotation.js_on_change('value',callback) callback.args["annotation"] = annotation @@ -2852,7 +2864,7 @@ def interactive_agegroupcpchart(age,normalized=False): plot = Figure(plot_width=900,x_axis_type=x_axis_type, tools=TOOLS) - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.line('duration','fitpowerfh',source=source, legend_label='Female HW',color='blue') @@ -2971,7 +2983,7 @@ def interactive_otwcpchart(powerdf,promember=0,rowername="",r=None,cpfit='data', watermarkh = 35 watermarkanchor = 'bottom_right' plot.extra_y_ranges = {"watermark": watermarkrange} - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' @@ -3071,7 +3083,7 @@ def interactive_agegroup_plot(df,distance=2000,duration=None, TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' plot = Figure(tools=TOOLS,plot_width=900) - plot.sizing_mode='scale_width' + plot.sizing_mode='stretch_both' plot.circle('age','power',source=source,fill_color='red',size=15, legend_label='World Record') @@ -3280,7 +3292,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, watermarkh = 35 watermarkanchor = 'bottom_right' plot.extra_y_ranges = {"watermark": watermarkrange} - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.image_url([watermarkurl],1.8*max(thesecs),watermarky, watermarkw,watermarkh, @@ -3467,7 +3479,7 @@ def interactive_windchart(id=0,promember=0): plot.xaxis.axis_label = "Distance (m)" plot.yaxis.axis_label = "Wind Speed (m/s)" plot.y_range = Range1d(-7,7) - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.extra_y_ranges = {"winddirection": Range1d(start=0,end=360)} @@ -3538,7 +3550,7 @@ def interactive_streamchart(id=0,promember=0): plot.xaxis.axis_label = "Distance (m)" plot.yaxis.axis_label = "River Current (m/s)" plot.y_range = Range1d(-2,2) - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' script, div = components(plot) @@ -3616,7 +3628,7 @@ def interactive_chart(id=0,promember=0,intervaldata = {}): plot.line('time','pace',source=source,legend_label="Pace",name="pace") plot.title.text = row.name plot.title.text_font_size=value("1.0em") - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.xaxis.axis_label = "Time" plot.yaxis.axis_label = "Pace (/500m)" plot.xaxis[0].formatter = DatetimeTickFormatter( @@ -3921,7 +3933,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='', plot.title.text = title plot.title.text_font_size=value("1.0em") - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.image_url([watermarkurl],watermarkx,watermarky, watermarkw,watermarkh, @@ -4170,7 +4182,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, watermarkanchor = 'bottom_right' plot.extra_y_ranges = {"watermark": watermarkrange} plot.extra_x_ranges = {"watermark": watermarkrange} - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.image_url([watermarkurl],watermarkx,watermarky, watermarkw,watermarkh, @@ -4366,24 +4378,24 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, source2.change.emit(); """) - slider_spm_min = Slider(width=200, start=15.0, end=55,value=15.0, step=.1, + slider_spm_min = Slider(width=140, start=15.0, end=55,value=15.0, step=.1, title="Min SPM") slider_spm_min.js_on_change('value',callback) callback.args["minspm"] = slider_spm_min - slider_spm_max = Slider(width=200, start=15.0, end=55,value=55.0, step=.1, + slider_spm_max = Slider(width=140, start=15.0, end=55,value=55.0, step=.1, title="Max SPM") slider_spm_max.js_on_change('value',callback) callback.args["maxspm"] = slider_spm_max - slider_work_min = Slider(width=200, start=0.0, end=1500,value=0.0, step=10, + slider_work_min = Slider(width=140, start=0.0, end=1500,value=0.0, step=10, title="Min Work per Stroke") slider_work_min.js_on_change('value',callback) callback.args["minwork"] = slider_work_min - slider_work_max = Slider(width=200, start=0.0, end=1500,value=1500.0, step=10, + slider_work_max = Slider(width=140, start=0.0, end=1500,value=1500.0, step=10, title="Max Work per Stroke") slider_work_max.js_on_change('value',callback) callback.args["maxwork"] = slider_work_max @@ -4393,28 +4405,39 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, except KeyError: distmax = 1000. - slider_dist_min = Slider(width=200, start=0,end=distmax,value=0,step=50, + slider_dist_min = Slider(width=140, start=0,end=distmax,value=0,step=50, title="Min Distance") slider_dist_min.js_on_change('value',callback) callback.args["mindist"] = slider_dist_min - slider_dist_max = Slider(width=200, start=0,end=distmax,value=distmax, + slider_dist_max = Slider(width=140, start=0,end=distmax,value=distmax, step=50, title="Max Distance") slider_dist_max.js_on_change('value',callback) callback.args["maxdist"] = slider_dist_max - layout = layoutrow([layoutcolumn([slider_spm_min, + slider_spm_min.sizing_mode = 'fixed' + slider_spm_max.sizing_mode = 'fixed' + slider_work_min.sizing_mode = 'fixed' + slider_work_max.sizing_mode = 'fixed' + slider_dist_min.sizing_mode = 'fixed' + slider_dist_max.sizing_mode = 'fixed' + + thesliders = layoutcolumn([slider_spm_min, slider_spm_max, slider_dist_min, slider_dist_max, slider_work_min, slider_work_max, ], - ), + ) + + thesliders.sizing_mode = 'fixed' + + layout = layoutrow([thesliders, plot]) - layout.sizing_mode = 'scale_width' + layout.sizing_mode = 'stretch_both' script, div = components(layout) js_resources = INLINE.render_js() @@ -4583,6 +4606,11 @@ def interactive_flexchart_stacked(id,r,xparam='time', plot2.xaxis.visible=False plot3.xaxis.visible=False + plot1.sizing_mode = 'stretch_both' + plot2.sizing_mode = 'stretch_both' + plot3.sizing_mode = 'stretch_both' + plot4.sizing_mode = 'stretch_both' + linked_crosshair = CrosshairTool(dimensions="height") plot1.add_tools(linked_crosshair) plot2.add_tools(linked_crosshair) @@ -4814,7 +4842,7 @@ def interactive_flexchart_stacked(id,r,xparam='time', plot4, ]) - layout.sizing_mode = 'scale_width' + layout.sizing_mode = 'stretch_both' script, div = components(layout) @@ -5040,7 +5068,7 @@ def interactive_flex_chart2(id,r,promember=0, tools=TOOLS,toolbar_location='above', toolbar_sticky=False,plot_width=800,plot_height=600, ) - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' #plot.width_policy = 'max' @@ -5058,7 +5086,7 @@ def interactive_flex_chart2(id,r,promember=0, watermarkanchor = 'bottom_right' plot.extra_y_ranges = {"watermark": watermarkrange} plot.extra_x_ranges = {"watermark": watermarkrange} - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.image_url([watermarkurl],watermarkx,watermarky, watermarkw,watermarkh, @@ -5150,7 +5178,7 @@ def interactive_flex_chart2(id,r,promember=0, plot.title.text = row.name plot.title.text_font_size=value("1.0em") - plot.sizing_mode = 'stretch_height' + plot.sizing_mode = 'stretch_both' plot.xaxis.axis_label = xaxlabel plot.yaxis.axis_label = yaxlabel @@ -5375,28 +5403,28 @@ def interactive_flex_chart2(id,r,promember=0, source2.change.emit(); """) - annotation = TextInput(width=200, title="Type your plot notes here", value="") + annotation = TextInput(width=140, title="Type your plot notes here", value="") annotation.js_on_change('value',callback) callback.args["annotation"] = annotation - slider_spm_min = Slider(width=200, start=15.0, end=55,value=15.0, step=.1, + slider_spm_min = Slider(width=140, start=15.0, end=55,value=15.0, step=.1, title="Min SPM") slider_spm_min.js_on_change('value',callback) callback.args["minspm"] = slider_spm_min - slider_spm_max = Slider(width=200, start=15.0, end=55,value=55.0, step=.1, + slider_spm_max = Slider(width=140, start=15.0, end=55,value=55.0, step=.1, title="Max SPM") slider_spm_max.js_on_change('value',callback) callback.args["maxspm"] = slider_spm_max - slider_work_min = Slider(width=200, start=0.0, end=1500,value=0.0, step=10, + slider_work_min = Slider(width=140, start=0.0, end=1500,value=0.0, step=10, title="Min Work per Stroke") slider_work_min.js_on_change('value',callback) callback.args["minwork"] = slider_work_min - slider_work_max = Slider(width=200, start=0.0, end=1500,value=1500.0, step=10, + slider_work_max = Slider(width=140, start=0.0, end=1500,value=1500.0, step=10, title="Max Work per Stroke") slider_work_max.js_on_change('value',callback) callback.args["maxwork"] = slider_work_max @@ -5406,17 +5434,25 @@ def interactive_flex_chart2(id,r,promember=0, except (KeyError,ValueError): distmax = 100 - slider_dist_min = Slider(width=200, start=0,end=distmax,value=0,step=50, + slider_dist_min = Slider(width=140, start=0,end=distmax,value=0,step=50, title="Min Distance") slider_dist_min.js_on_change('value',callback) callback.args["mindist"] = slider_dist_min - slider_dist_max = Slider(width=200, start=0,end=distmax,value=distmax, + slider_dist_max = Slider(width=140, start=0,end=distmax,value=distmax, step=50, title="Max Distance") slider_dist_max.js_on_change('value',callback) callback.args["maxdist"] = slider_dist_max + annotation.sizing_mode = 'fixed' + slider_spm_min.sizing_mode = 'fixed' + slider_spm_max.sizing_mode = 'fixed' + slider_work_min.sizing_mode = 'fixed' + slider_work_max.sizing_mode = 'fixed' + slider_dist_min.sizing_mode = 'fixed' + slider_dist_max.sizing_mode = 'fixed' + thesliders = layoutcolumn([ annotation, slider_spm_min, @@ -5427,13 +5463,13 @@ def interactive_flex_chart2(id,r,promember=0, slider_work_max, ]) - thesliders.sizing_mode = 'scale_width' + thesliders.sizing_mode = 'fixed' layout = layoutrow([thesliders, plot]) - # layout.sizing_mode = 'scale_width' - layout.sizing_mode = 'scale_width' + # layout.sizing_mode = 'stretch_both' + layout.sizing_mode = 'stretch_both' script, div = components(layout) js_resources = INLINE.render_js() @@ -5588,14 +5624,14 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0, ) - sizing_mode = 'fixed' # 'scale_width' also looks nice with this example + sizing_mode = 'fixed' # 'stretch_both' also looks nice with this example plot = Figure(x_axis_type=x_axis_type,y_axis_type=y_axis_type, plot_width=200,plot_height=150, ) -# plot.sizing_mode = 'scale_width' +# plot.sizing_mode = 'stretch_both' plot.sizing_mode = 'fixed' plot.toolbar.logo = None plot.toolbar_location = None @@ -5717,7 +5753,7 @@ def interactive_bar_chart(id=0,promember=0): watermarkanchor = 'bottom_right' plot.extra_y_ranges = {"watermark": watermarkrange} plot.extra_x_ranges = {"watermark": watermarkrange} - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.image_url([watermarkurl],0.01,0.99, watermarkw,watermarkh, @@ -5912,7 +5948,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', watermarkanchor = 'bottom_right' plot.extra_y_ranges = {"watermark": watermarkrange} plot.extra_x_ranges = {"watermark": watermarkrange} - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.image_url([watermarkurl],0.05,0.9, @@ -6210,7 +6246,7 @@ def interactive_comparison_chart(id1=0,id2=0,xparam='distance',yparam='spm', watermarkanchor = 'bottom_right' plot.extra_y_ranges = {"watermark": watermarkrange} plot.extra_x_ranges = {"watermark": watermarkrange} - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.image_url([watermarkurl],0.05,watermarky, watermarkw,watermarkh, @@ -6355,7 +6391,7 @@ def interactive_otw_advanced_pace_chart(id=0,promember=0): watermarkanchor = 'bottom_right' plot.extra_y_ranges = {"watermark": watermarkrange} plot.extra_x_ranges = {"watermark": watermarkrange} - plot.sizing_mode = 'scale_width' + plot.sizing_mode = 'stretch_both' plot.image_url([watermarkurl],watermarkx,watermarky, watermarkw,watermarkh,