我正在尝试使用Bokeh中的切换按钮来创建一个交互式网站,用户可以单击切换按钮来选择绘制哪些图形.
按钮将从文本文件加载数据(包含两列x和y数据).数据文件有两列,包含由空格分隔的x和y数据.
选择切换按钮后,将绘制相应的数据,当取消选择切换按钮时,将删除绘图.
我目前无法将参数传递给回调事件,是否可能?
from bokeh.io import vform
from bokeh.models import CustomJS, ColumnDataSource
from bokeh.models.widgets import Toggle
from bokeh.plotting import figure, output_file, show
output_file("load_data_buttons.html")
x = [0]
y = x
source = ColumnDataSource(data=dict(x=x, y=y))
plot = figure(plot_width=400, plot_height=400)
plot.line('x', 'y', source=source, line_width=3, line_alpha=0.6)
callback = CustomJS(args=filename,dict(source=source), code="""
var data = source.get('data');
console.log(filename)
x = data['x']
y = data['y']
#load data stored in the file name and assign to x and y
source.trigger('change');
""")
toggle1 = Toggle(label="Load data file 1", type="success",callback=callback("data_file_1.txt")) …Run Code Online (Sandbox Code Playgroud) 我正在使用Elsevier制作的Scopus API. http://dev.elsevier.com/sc_apis.html
我写了一篇简短的python脚本来提取有关论文的信息,例如标题,DOI号和引用该论文的论文的DOI号.
然而,我真正想要的是能够提取我正在从中提取信息的论文中引用的DOI数量的论文.
到目前为止,这是我的代码的重要部分
paper_info_search = requests.get(api_resource + 'query=doi(10.1016/j.fusengdes.2015.04.018)', headers=headers)
Run Code Online (Sandbox Code Playgroud)
这会在纸上提取大量信息(标题,作者等)
citations_of_paper = requests.get(api_resource + 'query=refeid(' + EID + ')', headers=headers)
Run Code Online (Sandbox Code Playgroud)
得到引用该论文的论文清单
有谁知道如何获得本文中出现的参考.