当我使用Bokeh中的点击工具单击一个字形时,我试图创建一个弹出窗口。我看到工具提示使用@variable装饰器,可以替换它,例如
plot = figure(
x_axis_label ='False Positives',
y_axis_label ='False Negatives',
plot_width=500, plot_height=500,
tools="tap",
tooltips=TOOLTIPS)
其中TOOLTIPS是其中带有@variable的html字符串。
除了做之外还有没有更好的方法来替换html字符串中的@variable
html = html.replace("@x", x);
在customJS的tap回调代码中?