fixing sizing mode
This commit is contained in:
@@ -351,7 +351,7 @@ def interactive_boxchart(datadf,fieldname,extratitle='',
|
|||||||
|
|
||||||
yrange1 = Range1d(start=yaxminima[fieldname],end=yaxmaxima[fieldname])
|
yrange1 = Range1d(start=yaxminima[fieldname],end=yaxmaxima[fieldname])
|
||||||
plot.y_range = yrange1
|
plot.y_range = yrange1
|
||||||
plot.sizing_mode = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
plot.xaxis.axis_label = 'Date'
|
plot.xaxis.axis_label = 'Date'
|
||||||
plot.yaxis.axis_label = axlabels[fieldname]
|
plot.yaxis.axis_label = axlabels[fieldname]
|
||||||
@@ -419,7 +419,7 @@ def interactive_planchart(data,startdate,enddate):
|
|||||||
p.plot_height=350
|
p.plot_height=350
|
||||||
p.y_range = yrange1
|
p.y_range = yrange1
|
||||||
p.toolbar_location = 'above'
|
p.toolbar_location = 'above'
|
||||||
p.sizing_mode = 'scale_width'
|
p.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
script,div = components(p)
|
script,div = components(p)
|
||||||
|
|
||||||
@@ -586,7 +586,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type',toolbar_lo
|
|||||||
p.plot_height=350
|
p.plot_height=350
|
||||||
p.toolbar_location = toolbar_location
|
p.toolbar_location = toolbar_location
|
||||||
p.y_range.start = 0
|
p.y_range.start = 0
|
||||||
p.sizing_mode = 'scale_width'
|
p.sizing_mode = 'stretch_both'
|
||||||
url = "http://rowsandall.com/rowers/workout/@duration/"
|
url = "http://rowsandall.com/rowers/workout/@duration/"
|
||||||
taptool = p.select(type=TapTool)
|
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_width=550
|
||||||
p.plot_height=350
|
p.plot_height=350
|
||||||
p.toolbar_location = toolbar_location
|
p.toolbar_location = toolbar_location
|
||||||
p.sizing_mode = 'scale_width'
|
p.sizing_mode = 'stretch_both'
|
||||||
p.y_range.start = 0
|
p.y_range.start = 0
|
||||||
url = "http://rowsandall.com/rowers/workout/@duration/"
|
url = "http://rowsandall.com/rowers/workout/@duration/"
|
||||||
taptool = p.select(type=TapTool)
|
taptool = p.select(type=TapTool)
|
||||||
@@ -1116,6 +1116,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
|
|||||||
|
|
||||||
plot = Figure(tools=TOOLS,
|
plot = Figure(tools=TOOLS,
|
||||||
toolbar_sticky=False,toolbar_location="above",plot_width=800,plot_height=600)
|
toolbar_sticky=False,toolbar_location="above",plot_width=800,plot_height=600)
|
||||||
|
plot.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
# add watermark
|
# add watermark
|
||||||
watermarkurl = "/static/img/logo7.png"
|
watermarkurl = "/static/img/logo7.png"
|
||||||
@@ -1131,7 +1132,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
|
|||||||
watermarkanchor = 'bottom_right'
|
watermarkanchor = 'bottom_right'
|
||||||
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 = 'scale_width'
|
|
||||||
|
|
||||||
plot.image_url([watermarkurl],watermarkx,watermarky,
|
plot.image_url([watermarkurl],watermarkx,watermarky,
|
||||||
watermarkw,watermarkh,
|
watermarkw,watermarkh,
|
||||||
@@ -1451,57 +1452,68 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
|
|||||||
sourcemultiline.change.emit();
|
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)
|
annotation.js_on_change('value',callback)
|
||||||
callback.args["annotation"] = annotation
|
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")
|
title="Min SPM")
|
||||||
slider_spm_min.js_on_change('value',callback)
|
slider_spm_min.js_on_change('value',callback)
|
||||||
callback.args["minspm"] = slider_spm_min
|
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")
|
title="Max SPM")
|
||||||
slider_spm_max.js_on_change('value',callback)
|
slider_spm_max.js_on_change('value',callback)
|
||||||
callback.args["maxspm"] = slider_spm_max
|
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")
|
title="Min Work per Stroke")
|
||||||
slider_work_min.js_on_change('value',callback)
|
slider_work_min.js_on_change('value',callback)
|
||||||
callback.args["minwork"] = slider_work_min
|
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")
|
title="Max Work per Stroke")
|
||||||
slider_work_max.js_on_change('value',callback)
|
slider_work_max.js_on_change('value',callback)
|
||||||
callback.args["maxwork"] = slider_work_max
|
callback.args["maxwork"] = slider_work_max
|
||||||
|
|
||||||
distmax = 100+100*int(rowdata['distance'].max()/100.)
|
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")
|
title="Min Distance")
|
||||||
slider_dist_min.js_on_change('value',callback)
|
slider_dist_min.js_on_change('value',callback)
|
||||||
callback.args["mindist"] = slider_dist_min
|
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,
|
step=50,
|
||||||
title="Max Distance")
|
title="Max Distance")
|
||||||
slider_dist_max.js_on_change('value',callback)
|
slider_dist_max.js_on_change('value',callback)
|
||||||
callback.args["maxdist"] = slider_dist_max
|
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_min,
|
||||||
slider_spm_max,
|
slider_spm_max,
|
||||||
slider_dist_min,
|
slider_dist_min,
|
||||||
slider_dist_max,
|
slider_dist_max,
|
||||||
slider_work_min,
|
slider_work_min,
|
||||||
slider_work_max,
|
slider_work_max,
|
||||||
],
|
]
|
||||||
),
|
)
|
||||||
|
thesliders.sizing_mode = 'fixed'
|
||||||
|
|
||||||
|
layout = layoutrow([thesliders,
|
||||||
plot])
|
plot])
|
||||||
|
|
||||||
layout.sizing_mode = 'scale_width'
|
layout.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
script, div = components(layout)
|
script, div = components(layout)
|
||||||
js_resources = INLINE.render_js()
|
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.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))
|
plot.y_range = Range1d(0,1.5*max(power4min))
|
||||||
if not startdate:
|
if not startdate:
|
||||||
@@ -1780,7 +1792,7 @@ def interactive_histoall(theworkouts,histoparam,includereststrokes,
|
|||||||
plot.add_layout(LinearAxis(y_range_name="fraction",
|
plot.add_layout(LinearAxis(y_range_name="fraction",
|
||||||
axis_label="Cumulative % of strokes"),'right')
|
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',
|
annolabel = Label(x=50,y=450,x_units='screen',y_units='screen',
|
||||||
text='',
|
text='',
|
||||||
@@ -1798,7 +1810,7 @@ def interactive_histoall(theworkouts,histoparam,includereststrokes,
|
|||||||
annolabel.text = annotation
|
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)
|
annotation.js_on_change('value',callback)
|
||||||
callback.args["annotation"] = annotation
|
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,
|
plot = Figure(plot_width=900,x_axis_type=x_axis_type,
|
||||||
tools=TOOLS)
|
tools=TOOLS)
|
||||||
plot.sizing_mode = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
plot.line('duration','fitpowerfh',source=source,
|
plot.line('duration','fitpowerfh',source=source,
|
||||||
legend_label='Female HW',color='blue')
|
legend_label='Female HW',color='blue')
|
||||||
@@ -2971,7 +2983,7 @@ def interactive_otwcpchart(powerdf,promember=0,rowername="",r=None,cpfit='data',
|
|||||||
watermarkh = 35
|
watermarkh = 35
|
||||||
watermarkanchor = 'bottom_right'
|
watermarkanchor = 'bottom_right'
|
||||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
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'
|
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||||
|
|
||||||
plot = Figure(tools=TOOLS,plot_width=900)
|
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,
|
plot.circle('age','power',source=source,fill_color='red',size=15,
|
||||||
legend_label='World Record')
|
legend_label='World Record')
|
||||||
|
|
||||||
@@ -3280,7 +3292,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower,
|
|||||||
watermarkh = 35
|
watermarkh = 35
|
||||||
watermarkanchor = 'bottom_right'
|
watermarkanchor = 'bottom_right'
|
||||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
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,
|
plot.image_url([watermarkurl],1.8*max(thesecs),watermarky,
|
||||||
watermarkw,watermarkh,
|
watermarkw,watermarkh,
|
||||||
@@ -3467,7 +3479,7 @@ def interactive_windchart(id=0,promember=0):
|
|||||||
plot.xaxis.axis_label = "Distance (m)"
|
plot.xaxis.axis_label = "Distance (m)"
|
||||||
plot.yaxis.axis_label = "Wind Speed (m/s)"
|
plot.yaxis.axis_label = "Wind Speed (m/s)"
|
||||||
plot.y_range = Range1d(-7,7)
|
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)}
|
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.xaxis.axis_label = "Distance (m)"
|
||||||
plot.yaxis.axis_label = "River Current (m/s)"
|
plot.yaxis.axis_label = "River Current (m/s)"
|
||||||
plot.y_range = Range1d(-2,2)
|
plot.y_range = Range1d(-2,2)
|
||||||
plot.sizing_mode = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
|
|
||||||
script, div = components(plot)
|
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.line('time','pace',source=source,legend_label="Pace",name="pace")
|
||||||
plot.title.text = row.name
|
plot.title.text = row.name
|
||||||
plot.title.text_font_size=value("1.0em")
|
plot.title.text_font_size=value("1.0em")
|
||||||
plot.sizing_mode = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
plot.xaxis.axis_label = "Time"
|
plot.xaxis.axis_label = "Time"
|
||||||
plot.yaxis.axis_label = "Pace (/500m)"
|
plot.yaxis.axis_label = "Pace (/500m)"
|
||||||
plot.xaxis[0].formatter = DatetimeTickFormatter(
|
plot.xaxis[0].formatter = DatetimeTickFormatter(
|
||||||
@@ -3921,7 +3933,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
|||||||
|
|
||||||
plot.title.text = title
|
plot.title.text = title
|
||||||
plot.title.text_font_size=value("1.0em")
|
plot.title.text_font_size=value("1.0em")
|
||||||
plot.sizing_mode = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
plot.image_url([watermarkurl],watermarkx,watermarky,
|
plot.image_url([watermarkurl],watermarkx,watermarky,
|
||||||
watermarkw,watermarkh,
|
watermarkw,watermarkh,
|
||||||
@@ -4170,7 +4182,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
watermarkanchor = 'bottom_right'
|
watermarkanchor = 'bottom_right'
|
||||||
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 = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
plot.image_url([watermarkurl],watermarkx,watermarky,
|
plot.image_url([watermarkurl],watermarkx,watermarky,
|
||||||
watermarkw,watermarkh,
|
watermarkw,watermarkh,
|
||||||
@@ -4366,24 +4378,24 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
source2.change.emit();
|
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")
|
title="Min SPM")
|
||||||
slider_spm_min.js_on_change('value',callback)
|
slider_spm_min.js_on_change('value',callback)
|
||||||
callback.args["minspm"] = slider_spm_min
|
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")
|
title="Max SPM")
|
||||||
slider_spm_max.js_on_change('value',callback)
|
slider_spm_max.js_on_change('value',callback)
|
||||||
callback.args["maxspm"] = slider_spm_max
|
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")
|
title="Min Work per Stroke")
|
||||||
slider_work_min.js_on_change('value',callback)
|
slider_work_min.js_on_change('value',callback)
|
||||||
callback.args["minwork"] = slider_work_min
|
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")
|
title="Max Work per Stroke")
|
||||||
slider_work_max.js_on_change('value',callback)
|
slider_work_max.js_on_change('value',callback)
|
||||||
callback.args["maxwork"] = slider_work_max
|
callback.args["maxwork"] = slider_work_max
|
||||||
@@ -4393,28 +4405,39 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
distmax = 1000.
|
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")
|
title="Min Distance")
|
||||||
slider_dist_min.js_on_change('value',callback)
|
slider_dist_min.js_on_change('value',callback)
|
||||||
callback.args["mindist"] = slider_dist_min
|
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,
|
step=50,
|
||||||
title="Max Distance")
|
title="Max Distance")
|
||||||
slider_dist_max.js_on_change('value',callback)
|
slider_dist_max.js_on_change('value',callback)
|
||||||
callback.args["maxdist"] = slider_dist_max
|
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_spm_max,
|
||||||
slider_dist_min,
|
slider_dist_min,
|
||||||
slider_dist_max,
|
slider_dist_max,
|
||||||
slider_work_min,
|
slider_work_min,
|
||||||
slider_work_max,
|
slider_work_max,
|
||||||
],
|
],
|
||||||
),
|
)
|
||||||
|
|
||||||
|
thesliders.sizing_mode = 'fixed'
|
||||||
|
|
||||||
|
layout = layoutrow([thesliders,
|
||||||
plot])
|
plot])
|
||||||
|
|
||||||
layout.sizing_mode = 'scale_width'
|
layout.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
script, div = components(layout)
|
script, div = components(layout)
|
||||||
js_resources = INLINE.render_js()
|
js_resources = INLINE.render_js()
|
||||||
@@ -4583,6 +4606,11 @@ def interactive_flexchart_stacked(id,r,xparam='time',
|
|||||||
plot2.xaxis.visible=False
|
plot2.xaxis.visible=False
|
||||||
plot3.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")
|
linked_crosshair = CrosshairTool(dimensions="height")
|
||||||
plot1.add_tools(linked_crosshair)
|
plot1.add_tools(linked_crosshair)
|
||||||
plot2.add_tools(linked_crosshair)
|
plot2.add_tools(linked_crosshair)
|
||||||
@@ -4814,7 +4842,7 @@ def interactive_flexchart_stacked(id,r,xparam='time',
|
|||||||
plot4,
|
plot4,
|
||||||
])
|
])
|
||||||
|
|
||||||
layout.sizing_mode = 'scale_width'
|
layout.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
|
|
||||||
script, div = components(layout)
|
script, div = components(layout)
|
||||||
@@ -5040,7 +5068,7 @@ def interactive_flex_chart2(id,r,promember=0,
|
|||||||
tools=TOOLS,toolbar_location='above',
|
tools=TOOLS,toolbar_location='above',
|
||||||
toolbar_sticky=False,plot_width=800,plot_height=600,
|
toolbar_sticky=False,plot_width=800,plot_height=600,
|
||||||
)
|
)
|
||||||
plot.sizing_mode = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
#plot.width_policy = 'max'
|
#plot.width_policy = 'max'
|
||||||
|
|
||||||
|
|
||||||
@@ -5058,7 +5086,7 @@ def interactive_flex_chart2(id,r,promember=0,
|
|||||||
watermarkanchor = 'bottom_right'
|
watermarkanchor = 'bottom_right'
|
||||||
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 = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
plot.image_url([watermarkurl],watermarkx,watermarky,
|
plot.image_url([watermarkurl],watermarkx,watermarky,
|
||||||
watermarkw,watermarkh,
|
watermarkw,watermarkh,
|
||||||
@@ -5150,7 +5178,7 @@ def interactive_flex_chart2(id,r,promember=0,
|
|||||||
plot.title.text = row.name
|
plot.title.text = row.name
|
||||||
plot.title.text_font_size=value("1.0em")
|
plot.title.text_font_size=value("1.0em")
|
||||||
|
|
||||||
plot.sizing_mode = 'stretch_height'
|
plot.sizing_mode = 'stretch_both'
|
||||||
plot.xaxis.axis_label = xaxlabel
|
plot.xaxis.axis_label = xaxlabel
|
||||||
|
|
||||||
plot.yaxis.axis_label = yaxlabel
|
plot.yaxis.axis_label = yaxlabel
|
||||||
@@ -5375,28 +5403,28 @@ def interactive_flex_chart2(id,r,promember=0,
|
|||||||
source2.change.emit();
|
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)
|
annotation.js_on_change('value',callback)
|
||||||
callback.args["annotation"] = annotation
|
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")
|
title="Min SPM")
|
||||||
slider_spm_min.js_on_change('value',callback)
|
slider_spm_min.js_on_change('value',callback)
|
||||||
callback.args["minspm"] = slider_spm_min
|
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")
|
title="Max SPM")
|
||||||
slider_spm_max.js_on_change('value',callback)
|
slider_spm_max.js_on_change('value',callback)
|
||||||
callback.args["maxspm"] = slider_spm_max
|
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")
|
title="Min Work per Stroke")
|
||||||
slider_work_min.js_on_change('value',callback)
|
slider_work_min.js_on_change('value',callback)
|
||||||
callback.args["minwork"] = slider_work_min
|
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")
|
title="Max Work per Stroke")
|
||||||
slider_work_max.js_on_change('value',callback)
|
slider_work_max.js_on_change('value',callback)
|
||||||
callback.args["maxwork"] = slider_work_max
|
callback.args["maxwork"] = slider_work_max
|
||||||
@@ -5406,17 +5434,25 @@ def interactive_flex_chart2(id,r,promember=0,
|
|||||||
except (KeyError,ValueError):
|
except (KeyError,ValueError):
|
||||||
distmax = 100
|
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")
|
title="Min Distance")
|
||||||
slider_dist_min.js_on_change('value',callback)
|
slider_dist_min.js_on_change('value',callback)
|
||||||
callback.args["mindist"] = slider_dist_min
|
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,
|
step=50,
|
||||||
title="Max Distance")
|
title="Max Distance")
|
||||||
slider_dist_max.js_on_change('value',callback)
|
slider_dist_max.js_on_change('value',callback)
|
||||||
callback.args["maxdist"] = slider_dist_max
|
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([
|
thesliders = layoutcolumn([
|
||||||
annotation,
|
annotation,
|
||||||
slider_spm_min,
|
slider_spm_min,
|
||||||
@@ -5427,13 +5463,13 @@ def interactive_flex_chart2(id,r,promember=0,
|
|||||||
slider_work_max,
|
slider_work_max,
|
||||||
])
|
])
|
||||||
|
|
||||||
thesliders.sizing_mode = 'scale_width'
|
thesliders.sizing_mode = 'fixed'
|
||||||
|
|
||||||
layout = layoutrow([thesliders,
|
layout = layoutrow([thesliders,
|
||||||
plot])
|
plot])
|
||||||
|
|
||||||
# layout.sizing_mode = 'scale_width'
|
# layout.sizing_mode = 'stretch_both'
|
||||||
layout.sizing_mode = 'scale_width'
|
layout.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
script, div = components(layout)
|
script, div = components(layout)
|
||||||
js_resources = INLINE.render_js()
|
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 = Figure(x_axis_type=x_axis_type,y_axis_type=y_axis_type,
|
||||||
plot_width=200,plot_height=150,
|
plot_width=200,plot_height=150,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# plot.sizing_mode = 'scale_width'
|
# plot.sizing_mode = 'stretch_both'
|
||||||
plot.sizing_mode = 'fixed'
|
plot.sizing_mode = 'fixed'
|
||||||
plot.toolbar.logo = None
|
plot.toolbar.logo = None
|
||||||
plot.toolbar_location = None
|
plot.toolbar_location = None
|
||||||
@@ -5717,7 +5753,7 @@ def interactive_bar_chart(id=0,promember=0):
|
|||||||
watermarkanchor = 'bottom_right'
|
watermarkanchor = 'bottom_right'
|
||||||
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 = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
plot.image_url([watermarkurl],0.01,0.99,
|
plot.image_url([watermarkurl],0.01,0.99,
|
||||||
watermarkw,watermarkh,
|
watermarkw,watermarkh,
|
||||||
@@ -5912,7 +5948,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
|||||||
watermarkanchor = 'bottom_right'
|
watermarkanchor = 'bottom_right'
|
||||||
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 = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
|
|
||||||
plot.image_url([watermarkurl],0.05,0.9,
|
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'
|
watermarkanchor = 'bottom_right'
|
||||||
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 = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
plot.image_url([watermarkurl],0.05,watermarky,
|
plot.image_url([watermarkurl],0.05,watermarky,
|
||||||
watermarkw,watermarkh,
|
watermarkw,watermarkh,
|
||||||
@@ -6355,7 +6391,7 @@ def interactive_otw_advanced_pace_chart(id=0,promember=0):
|
|||||||
watermarkanchor = 'bottom_right'
|
watermarkanchor = 'bottom_right'
|
||||||
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 = 'scale_width'
|
plot.sizing_mode = 'stretch_both'
|
||||||
|
|
||||||
plot.image_url([watermarkurl],watermarkx,watermarky,
|
plot.image_url([watermarkurl],watermarkx,watermarky,
|
||||||
watermarkw,watermarkh,
|
watermarkw,watermarkh,
|
||||||
|
|||||||
Reference in New Issue
Block a user