本文整理匯總了Python中bokeh.models.widgets.Slider.callback方法的典型用法代碼示例。如果您正苦於以下問題:Python Slider.callback方法的具體用法?Python Slider.callback怎麽用?Python Slider.callback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bokeh.models.widgets.Slider
的用法示例。
在下文中一共展示了Slider.callback方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: dict
# 需要導入模塊: from bokeh.models.widgets import Slider [as 別名]
# 或者: from bokeh.models.widgets.Slider import callback [as 別名]
spec = Cratio + np.random.randn(len(Cratio))*sig
planet.data = dict(lam=lam, cratio=Cratio*1e9, spec=spec*1e9, downerr=(spec-sig)*1e9, uperr=(spec+sig)*1e9)
format_button_group.active = None
######################################
# SET UP ALL THE WIDGETS AND CALLBACKS
######################################
source = ColumnDataSource(data=dict(value=[]))
source.on_change('data', update_data)
exptime = Slider(title="Integration Time (hours)", value=20., start=10., end=100.0, step=1.0, callback_policy='mouseup')
exptime.callback = CustomJS(args=dict(source=source), code="""
source.data = { value: [cb_obj.value] }
""")
distance = Slider(title="Distance (parsec)", value=10., start=2., end=50.0, step=1.0, callback_policy='mouseup')
distance.callback = CustomJS(args=dict(source=source), code="""
source.data = { value: [cb_obj.value] }
""")
radius = Slider(title="Planet Radius (R_Earth)", value=1.0, start=0.5, end=3., step=0.1, callback_policy='mouseup')
radius.callback = CustomJS(args=dict(source=source), code="""
source.data = { value: [cb_obj.value] }
""")
semimajor= Slider(title="Semi-major axis of orbit (AU)", value=1.0, start=0.2, end=2., step=0.1, callback_policy='mouseup')
semimajor.callback = CustomJS(args=dict(source=source), code="""
source.data = { value: [cb_obj.value] }
""")
exozodi = Slider(title="Number of Exozodi", value = 1.0, start=1.0, end=10., step=1., callback_policy='mouseup')
exozodi.callback = CustomJS(args=dict(source=source), code="""