本文整理汇总了Python中bokeh.models.widgets.Button.button_type方法的典型用法代码示例。如果您正苦于以下问题:Python Button.button_type方法的具体用法?Python Button.button_type怎么用?Python Button.button_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bokeh.models.widgets.Button
的用法示例。
在下文中一共展示了Button.button_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Slider
# 需要导入模块: from bokeh.models.widgets import Button [as 别名]
# 或者: from bokeh.models.widgets.Button import button_type [as 别名]
### NOTE: The csv export will not work on Safari
import bokeh
import pandas as pd
from bokeh.plotting import ColumnDataSource
from bokeh.models import CustomJS, HBox, VBox, VBoxForm
from bokeh.models.widgets import Slider, Button, DataTable, TableColumn
from bokeh.io import curdoc, vform
# note this is fake data
df = pd.read_csv('salary_data.csv')
salary_range = Slider(title="Max Salary", start=10000, end=250000, value=150000, step=1000)
button = Button(label="Download")
button.button_type = "success"
source = ColumnDataSource(data=dict())
columns = [TableColumn(field="name", title="Employee Name"),
TableColumn(field="salary", title="Income"),
TableColumn(field="years_experience", title="Experience (years)")]
data_table = DataTable(source=source, columns=columns)
def update(attr, old, new):
curr_df = df[df['salary'] <= salary_range.value].dropna()
source.data = dict(name=curr_df['name'].tolist(),
salary=curr_df['salary'].tolist(),
years_experience=curr_df['years_experience'].tolist())