final watermark
This commit is contained in:
@@ -176,6 +176,21 @@ def interactive_forcecurve(theworkouts,workstrokesonly=False):
|
||||
plot = Figure(tools=TOOLS,
|
||||
toolbar_sticky=False)
|
||||
|
||||
# add watermark
|
||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
||||
plot.extra_x_ranges = {"watermark": watermarkrange}
|
||||
|
||||
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",
|
||||
)
|
||||
|
||||
avf = Span(location=averageforceav,dimension='width',line_color='blue',
|
||||
line_dash=[6,6],line_width=2)
|
||||
|
||||
@@ -415,6 +430,21 @@ def interactive_histoall(theworkouts):
|
||||
toolbar_location="above"
|
||||
)
|
||||
|
||||
# add watermark
|
||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
||||
plot.extra_x_ranges = {"watermark": watermarkrange}
|
||||
|
||||
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",
|
||||
)
|
||||
|
||||
hist,edges = np.histogram(histopwr,bins=150)
|
||||
|
||||
histsum = np.cumsum(hist)
|
||||
@@ -449,7 +479,7 @@ def interactive_histoall(theworkouts):
|
||||
|
||||
hover.mode = 'mouse'
|
||||
|
||||
plot.extra_y_ranges = {"fraction": Range1d(start=0,end=105)}
|
||||
plot.extra_y_ranges["fraction"] = Range1d(start=0,end=105)
|
||||
plot.line('right','histsum',source=source,color="red",
|
||||
y_range_name="fraction")
|
||||
plot.add_layout(LinearAxis(y_range_name="fraction",
|
||||
@@ -612,6 +642,20 @@ def interactive_cpchart(thedistances,thesecs,theavpower,
|
||||
plot_width=900,
|
||||
toolbar_location="above",
|
||||
toolbar_sticky=False)
|
||||
|
||||
# add watermark
|
||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
||||
|
||||
plot.image_url([watermarkurl],1.8*max(thesecs),watermarky,
|
||||
watermarkw,watermarkh,
|
||||
global_alpha=watermarkalpha,
|
||||
w_units='screen',
|
||||
h_units='screen',
|
||||
anchor=watermarkanchor,
|
||||
dilate=True,
|
||||
y_range_name = "watermark",
|
||||
)
|
||||
|
||||
plot.circle('duration','power',source=source,fill_color='red',size=15,
|
||||
legend='Power')
|
||||
plot.xaxis.axis_label = "Duration (seconds)"
|
||||
@@ -682,6 +726,7 @@ def interactive_windchart(id=0,promember=0):
|
||||
|
||||
# create interactive plot
|
||||
plot = Figure(plot_width=400,plot_height=300)
|
||||
|
||||
# get user
|
||||
# u = User.objects.get(id=row.user.id)
|
||||
r = row.user
|
||||
@@ -853,6 +898,21 @@ def interactive_chart(id=0,promember=0):
|
||||
toolbar_sticky=False,
|
||||
tools=TOOLS)
|
||||
|
||||
# add watermark
|
||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
||||
plot.extra_x_ranges = {"watermark": watermarkrange}
|
||||
|
||||
plot.image_url([watermarkurl],0.01,0.99,
|
||||
0.5*watermarkw,0.5*watermarkh,
|
||||
global_alpha=watermarkalpha,
|
||||
w_units='screen',
|
||||
h_units='screen',
|
||||
anchor='top_left',
|
||||
dilate=True,
|
||||
x_range_name = "watermark",
|
||||
y_range_name = "watermark",
|
||||
)
|
||||
|
||||
plot.line('time','pace',source=source,legend="Pace")
|
||||
plot.title.text = row.name
|
||||
plot.title.text_font_size=value("1.0em")
|
||||
@@ -892,7 +952,7 @@ def interactive_chart(id=0,promember=0):
|
||||
|
||||
hover.mode = 'mouse'
|
||||
|
||||
plot.extra_y_ranges = {"hrax": Range1d(start=100,end=200)}
|
||||
plot.extra_y_ranges["hrax"] = Range1d(start=100,end=200)
|
||||
plot.line('time','hr',source=source,color="red",
|
||||
y_range_name="hrax", legend="Heart Rate")
|
||||
plot.add_layout(LinearAxis(y_range_name="hrax",axis_label="HR"),'right')
|
||||
@@ -998,6 +1058,21 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
||||
toolbar_location="above",
|
||||
toolbar_sticky=False)
|
||||
|
||||
# add watermark
|
||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
||||
plot.extra_x_ranges = {"watermark": watermarkrange}
|
||||
|
||||
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",
|
||||
)
|
||||
|
||||
x1means = Span(location=x1mean,dimension='height',line_color='green',
|
||||
line_dash=[6,6], line_width=2)
|
||||
|
||||
@@ -1051,7 +1126,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
||||
|
||||
if yparam2 != 'None':
|
||||
yrange2 = Range1d(start=yaxminima[yparam2],end=yaxmaxima[yparam2])
|
||||
plot.extra_y_ranges = {"yax2": yrange2}
|
||||
plot.extra_y_ranges["yax2"] = yrange2
|
||||
|
||||
plot.circle('x1','y2',color="red",y_range_name="yax2",
|
||||
legend=yparamname2,
|
||||
@@ -1659,6 +1734,22 @@ def interactive_bar_chart(id=0,promember=0):
|
||||
toolbar_sticky=False,
|
||||
plot_width=920,
|
||||
tools=TOOLS)
|
||||
|
||||
# add watermark
|
||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
||||
plot.extra_x_ranges = {"watermark": watermarkrange}
|
||||
|
||||
plot.image_url([watermarkurl],0.01,0.99,
|
||||
watermarkw,watermarkh,
|
||||
global_alpha=watermarkalpha,
|
||||
w_units='screen',
|
||||
h_units='screen',
|
||||
anchor='top_left',
|
||||
dilate=True,
|
||||
x_range_name = "watermark",
|
||||
y_range_name = "watermark",
|
||||
)
|
||||
|
||||
plot.title.text = row.name
|
||||
plot.title.text_font_size=value("1.0em")
|
||||
plot.xaxis.axis_label = "Time"
|
||||
@@ -1699,7 +1790,7 @@ def interactive_bar_chart(id=0,promember=0):
|
||||
|
||||
hover.mode = 'mouse'
|
||||
|
||||
plot.extra_y_ranges = {"hr": Range1d(start=100,end=200)}
|
||||
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="<UT2")
|
||||
@@ -1802,6 +1893,21 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
plot_width=920,
|
||||
toolbar_sticky=False)
|
||||
|
||||
# add watermark
|
||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
||||
plot.extra_x_ranges = {"watermark": watermarkrange}
|
||||
|
||||
plot.image_url([watermarkurl],0.05,0.9,
|
||||
watermarkw,watermarkh,
|
||||
global_alpha=watermarkalpha,
|
||||
w_units='screen',
|
||||
h_units='screen',
|
||||
anchor='top_left',
|
||||
dilate=True,
|
||||
x_range_name = "watermark",
|
||||
y_range_name = "watermark",
|
||||
)
|
||||
|
||||
colors = itertools.cycle(palette)
|
||||
|
||||
cntr = 0
|
||||
@@ -2017,6 +2123,21 @@ def interactive_comparison_chart(id1=0,id2=0,xparam='distance',yparam='spm',
|
||||
plot_width=920,
|
||||
toolbar_sticky=False)
|
||||
|
||||
# add watermark
|
||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
||||
plot.extra_x_ranges = {"watermark": watermarkrange}
|
||||
|
||||
plot.image_url([watermarkurl],0.05,watermarky,
|
||||
watermarkw,watermarkh,
|
||||
global_alpha=watermarkalpha,
|
||||
w_units='screen',
|
||||
h_units='screen',
|
||||
anchor='bottom_left',
|
||||
dilate=True,
|
||||
x_range_name = "watermark",
|
||||
y_range_name = "watermark",
|
||||
)
|
||||
|
||||
TIPS = OrderedDict([
|
||||
('time','@ftime1'),
|
||||
('pace','@fpace1'),
|
||||
@@ -2113,6 +2234,21 @@ def interactive_otw_advanced_pace_chart(id=0,promember=0):
|
||||
plot_width=920,
|
||||
toolbar_sticky=False)
|
||||
|
||||
# add watermark
|
||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
||||
plot.extra_x_ranges = {"watermark": watermarkrange}
|
||||
|
||||
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",
|
||||
)
|
||||
|
||||
plot.title.text = row.name
|
||||
plot.title.text_font_size=value("1.2em")
|
||||
plot.xaxis.axis_label = "Time"
|
||||
|
||||
Reference in New Issue
Block a user