Private
Public Access
1
0

removing obsolete code

This commit is contained in:
2024-03-20 21:55:53 +01:00
parent edd5762010
commit 06cfdbc7a9

View File

@@ -3779,158 +3779,6 @@ def interactive_multiflex(datadf, xparam, yparam, groupby, extratitle='',
return script, div
x_axis_type = 'linear'
y_axis_type = 'linear'
if xparam == 'time': # pragma: no cover
x_axis_type = 'datetime'
if yparam == 'pace':
y_axis_type = 'datetime'
datadf.index.names = ['index']
source = ColumnDataSource(
datadf,
)
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap'
if groupby != 'date':
hover = HoverTool(tooltips=[
(groupby, '@groupval{1.1}'),
(xparamname, '@x{1.1}'),
(yparamname, '@y')
])
else: # pragma: no cover
hover = HoverTool(
tooltips=[
(groupby, '@groupval'),
(xparamname, '@x{1.1}'),
(yparamname, '@y'),
])
hover.mode = 'mouse'
TOOLS = [SaveTool(), PanTool(), BoxZoomTool(), WheelZoomTool(),
ResetTool(), TapTool(), hover]
plot = figure(x_axis_type=x_axis_type, y_axis_type=y_axis_type,
tools=TOOLS,
toolbar_location="above",
toolbar_sticky=False, width=920)
# add watermark
watermarkurl = "/static/img/logo7.png"
watermarkrange = Range1d(start=0, end=1)
watermarkalpha = 0.6
watermarkx = 0.99
watermarky = 0.01
watermarkw = 184
watermarkh = 35
watermarkanchor = 'bottom_right'
plot.extra_y_ranges = {"watermark": watermarkrange}
plot.extra_x_ranges = {"watermark": watermarkrange}
plot.title.text = title
plot.title.text_font_size = "1.0em"
#plot.sizing_mode = 'stretch_both'
plot.image_url([watermarkurl], watermarkx, watermarky,
watermarkw, watermarkh,
global_alpha=watermarkalpha,
w_units='screen',
h_units='screen',
anchor=watermarkanchor,
dilate=True,
x_range_name="watermark",
y_range_name="watermark",
)
errorbar(plot, xparam, yparam, source=source,
xerr=ploterrorbars,
yerr=ploterrorbars,
point_kwargs={
'line_color': "#969696",
'size': "groupsize",
'fill_color': "color",
'fill_alpha': 1.0,
},
)
for nr, gvalue, color in colorlegend:
box = BoxAnnotation(bottom=75+20*nr, left=50, top=95+20*nr,
right=70,
bottom_units='screen',
top_units='screen',
left_units='screen',
right_units='screen',
fill_color=color,
fill_alpha=1.0,
line_color=color)
legendlabel = Label(x=71, y=78+20*nr, x_units='screen',
y_units='screen',
text="{gvalue:3.0f}".format(gvalue=gvalue),
background_fill_alpha=1.0,
text_color='black',
text_font_size="0.7em")
plot.add_layout(box)
plot.add_layout(legendlabel)
if colorlegend:
legendlabel = Label(x=322, y=250, x_units='screen',
y_units='screen',
text='group legend',
text_color='black',
text_font_size="0.7em",
angle=90,
angle_units='deg')
if xparam == 'workoutid': # pragma: no cover
plot.xaxis.axis_label = 'Workout'
else:
plot.xaxis.axis_label = axlabels[xparam]
if yparam == 'workoutid': # pragma: no cover
plot.xaxis.axis_label = 'Workout'
else:
plot.yaxis.axis_label = axlabels[yparam]
binlabel = Label(x=50, y=50, x_units='screen',
y_units='screen',
text="Bin size {binsize:3.1f}".format(binsize=binsize),
background_fill_alpha=0.7,
background_fill_color='white',
text_color='black', text_font_size='10pt',
)
slidertext = "SPM: {:.0f}-{:.0f}, WpS: {:.0f}-{:.0f}".format(
spmmin, spmmax, workmin, workmax
)
sliderlabel = Label(x=50, y=20, x_units='screen', y_units='screen',
text=slidertext,
background_fill_alpha=0.7,
background_fill_color='white',
text_color='black', text_font_size='10pt',
)
plot.add_layout(binlabel)
plot.add_layout(sliderlabel)
yrange1 = Range1d(start=yaxmin, end=yaxmax)
plot.y_range = yrange1
xrange1 = Range1d(start=xaxmin, end=xaxmax)
plot.x_range = xrange1
if yparam == 'pace':
plot.yaxis[0].formatter = DatetimeTickFormatter(
seconds=["%S"],
minutes=["%M"]
)
script, div = components(plot)
return [script, div]
def interactive_cum_flex_chart2(theworkouts, promember=0,